[PATCH V5 06/10] MIPS: lantiq: add NOR flash support

Artem Bityutskiy dedekind1 at gmail.com
Mon Apr 4 10:07:25 EDT 2011


On Mon, 2011-04-04 at 15:36 +0200, John Crispin wrote:
> >> +ltq_copy_from(struct map_info *map, void *to,
> >> +	unsigned long from, ssize_t len)
> >> +{
> >> +	unsigned char *f = (unsigned char *) (map->virt + from);
> >> +	unsigned char *t = (unsigned char *) to;
> >> +	unsigned long flags;
> >> +
> >> +	spin_lock_irqsave(&ebu_lock, flags);
> >> +	while (len--)
> >> +		*t++ = *f++;
> >> +	spin_unlock_irqrestore(&ebu_lock, flags);
> >>     
> > Can you use memcpy here instead?
> >
> >   
> as we are copying to/from iomem, we cannot use memcpy as the
> pre-fetching breaks the copy process. the normal alternative is to use
> memcpy_to/fromio, however on MIPS this breaks down to a normal memcpy.

Would be nice to have this comment in the code to make life of those who
reads it a bit easier.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list