[PATCH] [MTD] [NAND] GPIO NAND flash driver
Mike Frysinger
vapier.adi at gmail.com
Wed Oct 8 13:41:45 EDT 2008
On Wed, Oct 8, 2008 at 04:28, Mike Rapoport wrote:
> Mike Frysinger wrote:
>> On Wed, Oct 8, 2008 at 03:28, Russell King - ARM Linux wrote:
>>> On Wed, Oct 08, 2008 at 02:20:13AM -0400, Mike Frysinger wrote:
>>>> 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.
>>> Linux memory barriers don't cater for what's required here. What's
>>> required is what's there - a read from a separate region with a
>>> dependency on that read. Linux has no such barrier.
>>
>> thanks, this kind of comment in the source would be useful ... but
>> what is also needed is '#ifdef __arm__'
>
> If '#ifdef' is preferable than 'depend on ARM' I can send an updated patch.
i'd remove the "depend on ARM" and add "#ifdef __arm__" into the .c
file. unless i missed something, there's nothing else arm specific in
there.
-mike
More information about the linux-mtd
mailing list