From: Vinod Koul <vinod.koul@intel.com>
To: Herve Codina <herve.codina@celad.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
Bo Shen <voice.shen@atmel.com>,
Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
Mark Brown <broonie@linaro.org>, HuangShijie <shijie8@gmail.com>,
Jingoo Han <jg1.han@samsung.com>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Josh Wu <josh.wu@atmel.com>,
BartlomiejZolnierkiewicz <b.zolnierkie@samsung.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
EzequielGarcia <ezequiel.garcia@free-electrons.com>,
Michael Opdenacker <michael.opdenacker@free-electrons.com>,
Andrew Morton <akpm@linux-foundation.org>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bitcopy
Date: Tue, 21 Oct 2014 16:05:40 +0530 [thread overview]
Message-ID: <20141021103540.GJ28745@intel.com> (raw)
In-Reply-To: <54463356.400@celad.com>
On Tue, Oct 21, 2014 at 12:20:06PM +0200, Herve Codina wrote:
> Hi,
Please don't top post
>
> I didn't go deeper in atmel_nand.c code to see other accesses but old
> copy use writel_relaxed which is a macro to __raw_writel((__force u32)
> cpu_to_le32(v),c)
>
> __iowrite32_copy use directly __raw_writel(*src++, dst++)
>
> So we skip cpu_to_le32. Is it ok for all system using atmel_nand ?
Also would be a good question if we need barriers as __iowrite32_copy()
doesn't guarantee any ordering.
--
~Vinod
>
> Best regards,
> Herve Codina
>
>
> Le 21/10/2014 12:03, Josh Wu a écrit :
> > Hi, Vinod
> >
> > On 10/21/2014 12:06 AM, Vinod Koul wrote:
> >> The driver was also using own method to do 32bit copy, turns out
> >> we have a kernel API so use that instead
> >>
> >> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> >
> > Thanks for the patch.
> > Acked-by: Josh Wu <josh.wu@atmel.com>
> >
> > BTW, is there any similar kernel API that is for the read from io?
> >
> > Best Regards,
> > Josh Wu
> >
> >> ---
> >> drivers/mtd/nand/atmel_nand.c | 10 +++-------
> >> 1 files changed, 3 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> >> index e321c56..b03e80d 100644
> >> --- a/drivers/mtd/nand/atmel_nand.c
> >> +++ b/drivers/mtd/nand/atmel_nand.c
> >> @@ -265,14 +265,10 @@ static void memcpy32_fromio(void *trg, const void __iomem *src, size_t size)
> >> *t++ = readl_relaxed(s++);
> >> }
> >>
> >> -static void memcpy32_toio(void __iomem *trg, const void *src, int size)
> >> +static inline void memcpy32_toio(void __iomem *trg, const void *src, int size)
> >> {
> >> - int i;
> >> - u32 __iomem *t = trg;
> >> - const u32 *s = src;
> >> -
> >> - for (i = 0; i < (size >> 2); i++)
> >> - writel_relaxed(*s++, t++);
> >> + /* __iowrite32_copy use 32bit size values so divide by 4 */
> >> + __iowrite32_copy(trg, src, size/4);
> >> }
> >>
> >> /*
> >
--
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Herve Codina <herve.codina@celad.com>
Cc: Josh Wu <josh.wu@atmel.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Jingoo Han <jg1.han@samsung.com>,
EzequielGarcia <ezequiel.garcia@free-electrons.com>,
Mark Brown <broonie@linaro.org>,
Nicolas Ferre <nicolas.ferre@atmel.com>,
BartlomiejZolnierkiewicz <b.zolnierkie@samsung.com>,
Bo Shen <voice.shen@atmel.com>,
Fabio Estevam <fabio.estevam@freescale.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
Josh Triplett <josh@joshtriplett.org>,
Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
HuangShijie <shijie8@gmail.com>,
Michael Opdenacker <michael.opdenacker@free-electrons.com>
Subject: Re: [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bitcopy
Date: Tue, 21 Oct 2014 16:05:40 +0530 [thread overview]
Message-ID: <20141021103540.GJ28745@intel.com> (raw)
In-Reply-To: <54463356.400@celad.com>
On Tue, Oct 21, 2014 at 12:20:06PM +0200, Herve Codina wrote:
> Hi,
Please don't top post
>
> I didn't go deeper in atmel_nand.c code to see other accesses but old
> copy use writel_relaxed which is a macro to __raw_writel((__force u32)
> cpu_to_le32(v),c)
>
> __iowrite32_copy use directly __raw_writel(*src++, dst++)
>
> So we skip cpu_to_le32. Is it ok for all system using atmel_nand ?
Also would be a good question if we need barriers as __iowrite32_copy()
doesn't guarantee any ordering.
--
~Vinod
>
> Best regards,
> Herve Codina
>
>
> Le 21/10/2014 12:03, Josh Wu a écrit :
> > Hi, Vinod
> >
> > On 10/21/2014 12:06 AM, Vinod Koul wrote:
> >> The driver was also using own method to do 32bit copy, turns out
> >> we have a kernel API so use that instead
> >>
> >> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> >
> > Thanks for the patch.
> > Acked-by: Josh Wu <josh.wu@atmel.com>
> >
> > BTW, is there any similar kernel API that is for the read from io?
> >
> > Best Regards,
> > Josh Wu
> >
> >> ---
> >> drivers/mtd/nand/atmel_nand.c | 10 +++-------
> >> 1 files changed, 3 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> >> index e321c56..b03e80d 100644
> >> --- a/drivers/mtd/nand/atmel_nand.c
> >> +++ b/drivers/mtd/nand/atmel_nand.c
> >> @@ -265,14 +265,10 @@ static void memcpy32_fromio(void *trg, const void __iomem *src, size_t size)
> >> *t++ = readl_relaxed(s++);
> >> }
> >>
> >> -static void memcpy32_toio(void __iomem *trg, const void *src, int size)
> >> +static inline void memcpy32_toio(void __iomem *trg, const void *src, int size)
> >> {
> >> - int i;
> >> - u32 __iomem *t = trg;
> >> - const u32 *s = src;
> >> -
> >> - for (i = 0; i < (size >> 2); i++)
> >> - writel_relaxed(*s++, t++);
> >> + /* __iowrite32_copy use 32bit size values so divide by 4 */
> >> + __iowrite32_copy(trg, src, size/4);
> >> }
> >>
> >> /*
> >
--
next prev parent reply other threads:[~2014-10-21 11:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 16:06 [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bit copy Vinod Koul
2014-10-20 16:06 ` Vinod Koul
2014-10-20 16:06 ` [PATCH 2/2] mtd: mxc_nand: " Vinod Koul
2014-10-20 16:06 ` Vinod Koul
2014-11-05 22:29 ` Brian Norris
2014-11-05 22:29 ` Brian Norris
2014-10-21 10:03 ` [PATCH 1/2] mtd: atmel_nand: " Josh Wu
2014-10-21 10:03 ` Josh Wu
2014-10-21 10:20 ` [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bitcopy Herve Codina
2014-10-21 10:20 ` Herve Codina
2014-10-21 10:35 ` Vinod Koul [this message]
2014-10-21 10:35 ` Vinod Koul
2014-10-22 7:35 ` Josh Wu
2014-10-22 7:35 ` Josh Wu
2014-10-21 10:33 ` [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bit copy Vinod Koul
2014-10-21 10:33 ` Vinod Koul
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=20141021103540.GJ28745@intel.com \
--to=vinod.koul@intel.com \
--cc=akpm@linux-foundation.org \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@linaro.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=fabio.estevam@freescale.com \
--cc=herve.codina@celad.com \
--cc=jg1.han@samsung.com \
--cc=josh.wu@atmel.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=m.grzeschik@pengutronix.de \
--cc=michael.opdenacker@free-electrons.com \
--cc=nicolas.ferre@atmel.com \
--cc=shijie8@gmail.com \
--cc=voice.shen@atmel.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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.