Re: [PATCH] [MTD] [NAND] GPIO NAND flash driver

Mike Frysinger
2008-10-08T06:20:15Z

On Wed, Oct 8, 2008 at 02:01, Mike Rapoport wrote:
> +/* gpio_nand_dosync()
> + *
> + * needed due to bus-reordering within the PXA itself (see section on
> + * I/O ordering in PXA manual (section 2.3, p35)
> + */
> +static void gpio_nand_dosync(struct gpiomtd *gpiomtd)
> +{
> + unsigned long tmp;
> +
> + if (gpiomtd->io_sync) {
> + /*
> + * this should generate the read, followed by
> + * something that depends on the read
> + */
> + tmp = readl(gpiomtd->io_sync);
> + asm volatile("mov %1, %0\n" : "=r" (tmp) : "r" (tmp));
> + }
> +}

there isnt much point in attempting to write a generic solution if
you're just going to turn around and stick straight assembly in the
middle of it. why not use a real arch-generic method like a memory
barrier.
-mike