[PATCH - V2] Add NAND lock/unlock routines

Vimal Singh vimal.newwork at gmail.com
Mon Mar 1 23:55:08 EST 2010


On Fri, Feb 26, 2010 at 6:17 PM, David Woodhouse <dwmw2 at infradead.org> wrote:
> On Wed, 2010-01-13 at 14:55 +0530, Vimal Singh wrote:
>>
>> >> @@ -2999,8 +3211,8 @@ int nand_scan_tail(struct mtd_info *mtd)
>> >>       mtd->read_oob = nand_read_oob;
>> >>       mtd->write_oob = nand_write_oob;
>> >>       mtd->sync = nand_sync;
>> >> -     mtd->lock = NULL;
>> >> -     mtd->unlock = NULL;
>> >> +     mtd->lock = nand_lock;
>> >> +     mtd->unlock = nand_unlock;
>> >
>> > What makes you believe it is safe to assign these call-backs here?
>> >
>> > AFAICS, this means it will be done for all flashes. Do all of them
>> > support lock/unlock? I did not investigate this, but I think that
>> > probably not.
>>
>> OK. In that case I'll rather not do it here and do it in my specific
>> driver.
>
> Hm, I'm not sure that's the best approach. It's a function of the NAND
> chip, not the controller. We should detect the presence of the feature
> from the chip ID, if at all possible.
>
> I'm happy with your first two patches as part of a three-patch set
> though. Thanks.
>
Thanks David. I'll see the datasheet if chip ID has this information.

-- 
Regards,
Vimal Singh



More information about the linux-mtd mailing list