All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Matthijs van Duin <matthijsvanduin@gmail.com>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Sebastian Reichel" <sre@ring0.de>,
	linux-omap <linux-omap@vger.kernel.org>,
	"Aaro Koskinen" <aaro.koskinen@iki.fi>,
	"Pavel Machek" <pavel@ucw.cz>,
	lkml <linux-kernel@vger.kernel.org>, "Nishanth Menon" <nm@ti.com>
Subject: Re: runtime check for omap-aes bus access permission (was: Re: 3.13-rc3 (commit 7ce93f3) breaks Nokia N900 DT boot)
Date: Fri, 29 May 2015 08:50:31 -0700	[thread overview]
Message-ID: <20150529155030.GO30984@atomide.com> (raw)
In-Reply-To: <CAALWOA82=QmTpCeiceOFQOjqXKdSBjB3Z+jL-mi0vYF=QaL4sA@mail.gmail.com>

* Matthijs van Duin <matthijsvanduin@gmail.com> [150528 18:37]:
> On 29 May 2015 at 02:58, Matthijs van Duin <matthijsvanduin@gmail.com> wrote:
> > It is only guaranteed to happen immediately (before the next
> > instruction is executed) if the error occurs before the posting-point
> > of the write. However, in that case the error is reported in-band to
> > the cpu, resulting in a (synchronous) bus error which takes precedence
> > over the out-of-band error irq (if any is signalled).
> 
> OK, all this was actually assuming linux uses device-type mappings for
> device mappings, which was also the impression I got from
> build_mem_type_table() in arch/arm/mm/mmu.c (although it's a bit of a
> maze). A quick test however seems to imply otherwise:
> 
> ~# ./bogus-dev-write
> Bus error
> 
> So... linux actually uses strongly-ordered mappings? I really didn't
> expect that, given the performance implications (especially on a
> strictly in-order cpu like the Cortex-A8 which will really just sit
> there picking its nose until the write completes) and I think I recall
> having seen an OCP barrier being used somewhere in driver code...

I believe some TI kernels use strongly-ordered mappings, mainline
kernel does not. Which kernel version are you using?
 
> Well, in that case everything I said is technically still true, except
> the posting point is the peripheral itself. That also means the
> interconnect error reporting mechanism is not really useful for
> probing since you'll get a bus error before any error irq is
> delivered.

Hmm if that's the case then yes we can't use the error irq. However,
what I've seen so far is that we only get the bus error if the
l3_* drivers are configured. I guess some more testing is needed.
 
> So I'd say you're back at having to trap that bus error using the
> exception handling mechanism, which I still suspect shouldn't be hard
> to do.

And in that case it makes sense to do that in the bootloader to
avoid adding any custom early boot code to Linux kernel.
 
> Or perhaps you could probe the device using a DMA access and combine
> that with the interconnect error reporting irq... ;-)

Heh too many dependencies :)

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: runtime check for omap-aes bus access permission (was: Re: 3.13-rc3 (commit 7ce93f3) breaks Nokia N900 DT boot)
Date: Fri, 29 May 2015 08:50:31 -0700	[thread overview]
Message-ID: <20150529155030.GO30984@atomide.com> (raw)
In-Reply-To: <CAALWOA82=QmTpCeiceOFQOjqXKdSBjB3Z+jL-mi0vYF=QaL4sA@mail.gmail.com>

* Matthijs van Duin <matthijsvanduin@gmail.com> [150528 18:37]:
> On 29 May 2015 at 02:58, Matthijs van Duin <matthijsvanduin@gmail.com> wrote:
> > It is only guaranteed to happen immediately (before the next
> > instruction is executed) if the error occurs before the posting-point
> > of the write. However, in that case the error is reported in-band to
> > the cpu, resulting in a (synchronous) bus error which takes precedence
> > over the out-of-band error irq (if any is signalled).
> 
> OK, all this was actually assuming linux uses device-type mappings for
> device mappings, which was also the impression I got from
> build_mem_type_table() in arch/arm/mm/mmu.c (although it's a bit of a
> maze). A quick test however seems to imply otherwise:
> 
> ~# ./bogus-dev-write
> Bus error
> 
> So... linux actually uses strongly-ordered mappings? I really didn't
> expect that, given the performance implications (especially on a
> strictly in-order cpu like the Cortex-A8 which will really just sit
> there picking its nose until the write completes) and I think I recall
> having seen an OCP barrier being used somewhere in driver code...

I believe some TI kernels use strongly-ordered mappings, mainline
kernel does not. Which kernel version are you using?
 
> Well, in that case everything I said is technically still true, except
> the posting point is the peripheral itself. That also means the
> interconnect error reporting mechanism is not really useful for
> probing since you'll get a bus error before any error irq is
> delivered.

Hmm if that's the case then yes we can't use the error irq. However,
what I've seen so far is that we only get the bus error if the
l3_* drivers are configured. I guess some more testing is needed.
 
> So I'd say you're back at having to trap that bus error using the
> exception handling mechanism, which I still suspect shouldn't be hard
> to do.

And in that case it makes sense to do that in the bootloader to
avoid adding any custom early boot code to Linux kernel.
 
> Or perhaps you could probe the device using a DMA access and combine
> that with the interconnect error reporting irq... ;-)

Heh too many dependencies :)

Tony

  reply	other threads:[~2015-05-29 15:50 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 21:36 3.13-rc3 (commit 7ce93f3) breaks Nokia N900 DT boot Sebastian Reichel
2013-12-06 22:27 ` Tony Lindgren
2013-12-07  0:00   ` Sebastian Reichel
2013-12-07  0:38     ` Tony Lindgren
2013-12-07  8:18     ` Pali Rohár
2013-12-07 13:48       ` Sebastian Reichel
2013-12-07 13:57         ` Pali Rohár
2013-12-07 16:51           ` Tony Lindgren
2013-12-07 17:53             ` Tony Lindgren
2013-12-07 18:49             ` runtime check for omap-aes bus access permission (was: Re: 3.13-rc3 (commit 7ce93f3) breaks Nokia N900 DT boot) Sebastian Reichel
2013-12-07 21:11               ` Tony Lindgren
2013-12-07 23:03                 ` Sebastian Reichel
2013-12-07 23:22                   ` Tony Lindgren
2014-09-08 23:45                     ` Pali Rohár
2014-11-25 21:08                     ` Pali Rohár
2014-11-25 21:31                       ` Pali Rohár
2014-11-26 17:54                         ` Tony Lindgren
2015-01-17  9:18                           ` Pali Rohár
2015-01-17 17:04                             ` Tony Lindgren
2015-01-17 17:29                               ` Pali Rohár
2015-01-17 17:41                                 ` Tony Lindgren
2015-01-31 11:34                                   ` Pali Rohár
2015-01-31 15:13                                     ` Matthijs van Duin
2015-01-31 19:06                                       ` Pali Rohár
2015-02-11 12:39                                       ` Pali Rohár
2015-02-11 15:22                                         ` Matthijs van Duin
2015-02-11 20:28                                           ` Pali Rohár
2015-02-11 20:33                                             ` Tony Lindgren
2015-02-11 20:40                                             ` Nishanth Menon
2015-02-11 20:40                                               ` Nishanth Menon
2015-02-18 21:14                                               ` Pali Rohár
2015-02-18 21:14                                                 ` Pali Rohár
2015-05-28  7:37                                               ` Pali Rohár
2015-05-28  7:37                                                 ` Pali Rohár
2015-05-28  7:37                                                 ` Pali Rohár
2015-05-28 16:01                                                 ` Tony Lindgren
2015-05-28 16:01                                                   ` Tony Lindgren
2015-05-28 16:01                                                   ` Tony Lindgren
2015-05-28 20:26                                                   ` Matthijs van Duin
2015-05-28 20:26                                                     ` Matthijs van Duin
2015-05-28 22:24                                                     ` Tony Lindgren
2015-05-28 22:24                                                       ` Tony Lindgren
2015-05-28 22:27                                                       ` Pali Rohár
2015-05-28 22:27                                                         ` Pali Rohár
2015-05-29  0:15                                                         ` Tony Lindgren
2015-05-29  0:15                                                           ` Tony Lindgren
2015-05-29  0:15                                                           ` Tony Lindgren
2015-05-29  0:58                                                       ` Matthijs van Duin
2015-05-29  0:58                                                         ` Matthijs van Duin
2015-05-29  1:35                                                         ` Matthijs van Duin
2015-05-29  1:35                                                           ` Matthijs van Duin
2015-05-29 15:50                                                           ` Tony Lindgren [this message]
2015-05-29 15:50                                                             ` Tony Lindgren
2015-05-29 18:16                                                             ` Tony Lindgren
2015-05-29 18:16                                                               ` Tony Lindgren
2015-05-30 15:22                                                             ` Matthijs van Duin
2015-05-30 15:22                                                               ` Matthijs van Duin
2015-06-01 17:58                                                               ` Tony Lindgren
2015-06-01 17:58                                                                 ` Tony Lindgren
2015-06-01 20:32                                                                 ` Matthijs van Duin
2015-06-01 20:32                                                                   ` Matthijs van Duin
2015-06-01 20:52                                                                   ` Tony Lindgren
2015-06-01 20:52                                                                     ` Tony Lindgren
2015-06-02  4:21                                                                     ` Matthijs van Duin
2015-06-02  4:21                                                                       ` Matthijs van Duin
2015-02-19 18:20                                           ` Pali Rohár
2015-02-19 18:20                                             ` Pali Rohár
2015-02-19 20:25                                             ` Matthijs van Duin
2015-02-19 20:25                                               ` Matthijs van Duin
2015-02-19 21:10                                             ` Aaro Koskinen
2015-02-19 21:10                                               ` Aaro Koskinen
2015-01-24 10:40                     ` Pali Rohár
2015-01-31 14:38                       ` Matthijs van Duin
2015-01-31 19:09                         ` Pali Rohár
2015-02-01  1:36                           ` Matthijs van Duin
2015-02-01  8:56                             ` Pali Rohár
2015-02-11 20:43                               ` Pavel Machek
2015-02-11 21:14                                 ` Pali Rohár
2015-02-09 11:55     ` 3.13-rc3 (commit 7ce93f3) breaks Nokia N900 DT boot Pali Rohár
2013-12-08 14:13   ` Aaro Koskinen
2013-12-08 16:40     ` Tony Lindgren
2013-12-08 17:10       ` Sebastian Reichel
2013-12-08 17:43         ` Tony Lindgren
2013-12-08 17:59           ` Aaro Koskinen
2013-12-08 18:09           ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150529155030.GO30984@atomide.com \
    --to=tony@atomide.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthijsvanduin@gmail.com \
    --cc=nm@ti.com \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=sre@ring0.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.