From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Chao Fu <B44548-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Jingchang Lu
<jingchang.lu-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 1/2] spi:fsl-dspi:add support of DSPI IP in big endian
Date: Fri, 10 Jan 2014 12:53:59 +0000 [thread overview]
Message-ID: <20140110125359.GB15937@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140110124014.GI29039-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On Fri, Jan 10, 2014 at 12:40:14PM +0000, Mark Brown wrote:
> On Fri, Jan 10, 2014 at 08:11:33AM +0000, Chao Fu wrote:
>
> > [Chao Fu] Our CPUs are working on only ARM architecture. But DSPI have two endianness
> > In different series CPU, so we use __raw_read that do not take of endianness.
> > We need observe ARM io methods make sure avoid instructions executing reorder .
> > ARM IO methods :
> > #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; })
> > #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; })
> > #define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
> >
> > #define writeb(v,c) ({ __iowmb(); writeb_relaxed(v,c); })
> > #define writew(v,c) ({ __iowmb(); writew_relaxed(v,c); })
> > #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); })
> >
> > So add barrier here. Could you give some suggestions? Many thanks!
>
> OK that makes sense, please add comments explaining that this is due to
> the endinaness translation. Given that people are starting to use big
> endian more it might be sensible to have these factored out into generic
> code but that can wait.
Accesses to device memory are guaranteed by the architecture to be in
program order when they're within the same 1K block of memory. Larger
blocks are permissible, and depends on the SoC. (The ARM ARM is a little
unclear on this statement, and I believe the statement is/has been fixed.)
The barriers above are not about ensuring correct program order (we have
that anyway), they're about ensuring the visibility externally given the
ARM ARM mess-up, and _primerily_ ensuring proper order between DMA
coherent memory and a DMA agent being enabled, or the DMA agent status
being read vs DMA coherent memory.
--
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-01-10 12:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 6:14 [PATCH v2 1/2] spi:fsl-dspi:add support of DSPI IP in big endian Chao Fu
[not found] ` <1389161655-21856-1-git-send-email-b44548-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-01-08 6:14 ` [PATCH v2 2/2] spi:dspi:Remove some coding sytle not in standard Chao Fu
[not found] ` <1389161655-21856-2-git-send-email-b44548-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-01-09 17:53 ` Mark Brown
2014-01-09 17:52 ` [PATCH v2 1/2] spi:fsl-dspi:add support of DSPI IP in big endian Mark Brown
[not found] ` <20140109175208.GK12858-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-10 8:11 ` Chao Fu
[not found] ` <e9c8019df2cf4d76ae2b77c5d1420050-AZ66ij2kwaYw6E1ICcNxleO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-01-10 12:40 ` Mark Brown
[not found] ` <20140110124014.GI29039-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-10 12:53 ` Russell King - ARM Linux [this message]
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=20140110125359.GB15937@n2100.arm.linux.org.uk \
--to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
--cc=B44548-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=jingchang.lu-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).