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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 (ÐÑÑÑÐ ÐÐÑÑÑÐÐÐ)




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux