[PATCH v3 11/11] mtd: fsl-quadspi: fix __iomem annotations, accessors
Huang Shijie
shijie8 at gmail.com
Sat Apr 12 06:49:43 PDT 2014
On Fri, Apr 11, 2014 at 11:13:33PM -0700, Brian Norris wrote:
> On Sat, Apr 12, 2014 at 12:57:03PM +0800, Huang Shijie wrote:
> > On Fri, Apr 11, 2014 at 12:00:06PM -0700, Brian Norris wrote:
> > > @@ -730,7 +730,7 @@ static int fsl_qspi_read(struct spi_nor *nor, loff_t from,
> > > return ret;
> > >
> > > /* Read out the data directly from the AHB buffer.*/
> > > - memcpy(buf, q->ahb_base + q->chip_base_addr + from, len);
> > > + memcpy_fromio(buf, q->ahb_base + q->chip_base_addr + from, len);
> > ARM does some optimazation to the memcpy, please see arch/arm/lib/memcpy.S.
> >
> > But the memcpy_fromio does not do optimazation, please see _memcpy_fromio.
>
> Ah, yes. I noticed this actually, but didn't think much about it.
>
> > Someone ever sent a patch to fix the issue, but Russell did not merge it.
>
> That's unfortunate.
>
> > please see:
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/003860.html
> >
> > So we'd better do not change to use memcpy_fromio.
>
> How about the last recommendation of that thread, readsl()?
>
[1] firstly, I think it is not an IO read actually.
We read the data from the AHB memory address in fact, a miss will make the
controller to trigger a QUAD read to the NOR flash.
[2] secondly, the memcpy can work by the unit of 8 bytes (or more?),
while the readsl can work by the unit of 4 bytes at most.
So use memcpy here is better then using the readsl.
> http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/003984.html
>
> It has your optimization, and it has the type-checking we'd like.
>
> > BTW: i am okay with other patches about the spi-nor.
>
> Thanks. I'll probably merge the first 10 soon and see about respinning
> this one eventually.
Please merge the first 10 patches as soon as possible. :)
thanks
Huang Shijie
More information about the linux-mtd
mailing list