nand_flash_detect_onfi error

Brian Norris computersforpeace at gmail.com
Tue Nov 3 12:57:51 PST 2015


On Tue, Nov 3, 2015 at 12:54 PM, Boris Brezillon
<boris.brezillon at free-electrons.com> wrote:
> On Tue, 3 Nov 2015 12:45:11 -0800
> Brian Norris <computersforpeace at gmail.com> wrote:
>
>> On Tue, Nov 03, 2015 at 09:25:46PM +0100, Boris Brezillon wrote:
>> > On Tue, 3 Nov 2015 13:56:16 -0300
>> > Ezequiel Garcia <ezequiel at vanguardiasur.com.ar> wrote:
>> > > On 3 November 2015 at 13:27, Renaud Barbier <renaud.barbier at ge.com> wrote:
>> > > > chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
>> > > > for (i = 0; i < 3; i++) {
>> > > >         for (j = 0; j < sizeof(*p); j++)
>> > > >                 ((uint8_t *)p)[j] = chip->read_byte(mtd);
>> > > >         if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
>> > > >                         le16_to_cpu(p->crc)) {
>> > > >                 break;
>> > > >         }
>> > > > }
>> > > >
>> ...
>> > BTW, I wonder why ->read_byte() is used instead of ->read_buf() here.
>>
>> commit bd9c6e99b58255b9de1982711ac9487c9a2f18be
>> Author: Brian Norris <computersforpeace at gmail.com>
>> Date:   Fri Nov 29 22:04:28 2013 -0800
>>
>>     mtd: nand: don't use read_buf for 8-bit ONFI transfers
>
> Makes sense. Thanks for pointing this out.

Perhaps it was worth a code comment. It can be confusing.



More information about the linux-mtd mailing list