[PATCH v3 11/11] mtd: fsl-quadspi: fix __iomem annotations, accessors

Brian Norris computersforpeace at gmail.com
Fri Apr 11 23:13:33 PDT 2014


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()?

  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.

Brian



More information about the linux-mtd mailing list