From: Scott Wood <scottwood@freescale.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "'Kevin Hao'" <haokexin@gmail.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Chenhui Zhao <chenhui.zhao@freescale.com>,
"Jason.Jin@freescale.com" <Jason.Jin@freescale.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040
Date: Fri, 21 Mar 2014 16:16:33 -0500 [thread overview]
Message-ID: <1395436593.12479.379.camel@snotra.buserror.net> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D0F6E40C4@AcuExch.aculab.com>
On Fri, 2014-03-21 at 09:21 +0000, David Laight wrote:
> From: Scott Wood [mailto:scottwood@freescale.com]
> > On Thu, 2014-03-20 at 11:59 +0000, David Laight wrote:
> > > I tried to work out what the 'twi, isync' instructions were for (in in_le32()).
> > > The best I could come up with was to ensure a synchronous bus-fault.
> > > But bus faults are probably only expected during device probing - not
> > > normal operation, and the instructions will have a significant cost.
> > >
> > > Additionally in_le32() and out_le32() both start with a 'sync' instruction.
> > > In many cases that isn't needed either - an explicit iosync() can be
> > > used after groups of instructions.
> >
> > The idea is that it's better to be maximally safe by default, and let
> > performance critical sections be optimized using raw accessors and
> > explicit synchronization if needed, than to have hard-to-debug bugs due
> > to missing/wrong sync. A lot of I/O is slow enough that the performance
> > impact doesn't really matter, but the brain-time cost of getting the
> > sync right is still there.
>
> Hmmm....
>
> That might be an excuse for the 'sync', but not the twi and isync.
That might be true if I/O is always cache inhibited and guarded, in
which case I think we can rely on that to ensure that the load has
completed before we do things like wrtee or rfi. In any case, I'd want
to hear Ben's explanation.
> I was setting up a dma request (for the ppc 83xx PCIe bridge) and
> was doing back to back little-endian writes into memory.
> I had difficulty finding and including header files containing
> the definitions for byteswapped accesses I needed.
> arch/powerpc/include/asm/swab.h contains some - but I couldn't
> work out how to get it included (apart from giving the full path).
>
> In any case you need to understand when synchronisation is
> required - otherwise you will get it wrong.
> Especially since non-byteswapped accesses are done by direct
> access.
Yes, it's bad that rawness combines the lack of byteswapping with the
lack of synchronization. Ideally the raw accessors would also come in
big and little endian form, plus a native endian form if it's really
needed.
-Scott
next prev parent reply other threads:[~2014-03-21 21:16 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 4:57 [PATCH 1/9] powerpc/fsl: add PVR definition for E500MC and E5500 Chenhui Zhao
2014-03-07 4:57 ` [PATCH 2/9] powerpc/cache: add cache flush operation for various e500 Chenhui Zhao
2014-03-07 4:57 ` [PATCH 3/9] powerpc/rcpm: add RCPM driver Chenhui Zhao
2014-03-11 23:42 ` Scott Wood
2014-03-12 3:59 ` Chenhui Zhao
2014-03-14 22:34 ` Scott Wood
2014-03-07 4:58 ` [PATCH 4/9] powerpc/85xx: support CPU hotplug for e500mc and e5500 Chenhui Zhao
2014-03-11 23:48 ` Scott Wood
2014-03-12 4:34 ` Chenhui Zhao
2014-03-07 4:58 ` [PATCH 5/9] powerpc/85xx: disable irq by hardware when suspend for 64-bit Chenhui Zhao
2014-03-11 23:51 ` Scott Wood
2014-03-12 7:46 ` Chenhui Zhao
2014-03-14 22:41 ` Scott Wood
2014-03-17 9:37 ` Chenhui Zhao
2014-03-07 4:58 ` [PATCH 6/9] powerpc/85xx: support sleep feature on QorIQ SoCs with RCPM Chenhui Zhao
2014-03-12 0:00 ` Scott Wood
2014-03-12 8:08 ` Chenhui Zhao
2014-03-14 22:46 ` Scott Wood
2014-03-07 4:58 ` [PATCH 7/9] fsl: add EPU FSM configuration for deep sleep Chenhui Zhao
2014-03-12 0:08 ` Scott Wood
2014-03-12 8:34 ` Chenhui Zhao
2014-03-14 22:51 ` Scott Wood
2014-03-17 10:27 ` Chenhui Zhao
2014-03-18 23:21 ` Scott Wood
2014-03-19 0:08 ` Chenhui Zhao
2014-03-07 4:58 ` [PATCH 8/9] powerpc/85xx: add save/restore functions for core registers Chenhui Zhao
2014-03-12 0:45 ` Scott Wood
2014-03-12 9:42 ` Chenhui Zhao
2014-03-14 23:01 ` Scott Wood
2014-03-17 10:50 ` Chenhui Zhao
2014-03-07 4:58 ` [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040 Chenhui Zhao
2014-03-12 1:10 ` Scott Wood
2014-03-12 5:57 ` Kevin Hao
2014-03-12 17:43 ` Scott Wood
2014-03-13 7:46 ` Kevin Hao
2014-03-14 22:26 ` Scott Wood
2014-03-16 4:58 ` Kevin Hao
2014-03-18 23:18 ` Scott Wood
2014-03-20 11:47 ` Kevin Hao
2014-03-20 11:59 ` David Laight
2014-03-20 22:07 ` Scott Wood
2014-03-21 9:21 ` David Laight
2014-03-21 21:16 ` Scott Wood [this message]
2014-03-20 22:17 ` Scott Wood
2014-03-12 10:40 ` Chenhui Zhao
2014-03-14 23:18 ` Scott Wood
2014-03-17 11:19 ` Chenhui Zhao
2014-03-18 22:42 ` Scott Wood
2014-03-19 0:56 ` Chenhui Zhao
2014-03-20 23:33 ` Scott Wood
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=1395436593.12479.379.camel@snotra.buserror.net \
--to=scottwood@freescale.com \
--cc=David.Laight@ACULAB.COM \
--cc=Jason.Jin@freescale.com \
--cc=chenhui.zhao@freescale.com \
--cc=haokexin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome