lkml.org 
[lkml]   [2017]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 00/18] mtd: nand: denali: Denali NAND IP patch bomb
On Tue, 13 Jun 2017 17:17:41 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Hi Boris,
>
>
> 2017-06-13 16:02 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>:
>
> >
> > BTW, I also implemented ->read/write_buf_word() since the core may one
> > day call these functions, and the default implementations used by the
> > core when these hooks are NULL are not appropriate in your case.
> >
>
> BTW, why doesn't the default hook in the core do like this?
>
>
> static uint8_t nand_read_byte(struct mtd_info *mtd)
> {
> struct nand_chip *chip = mtd_to_nand(mtd);
> uint8_t byte;
>
> chip->read_buf(chip, &byte, 1);
> return byte;
> }
>
>
> ->read_byte() is a special case of ->read_buf() with length==1,
> so this should work.

Not sure it works for all implementation. ->read_byte() is expected
to return the lower 8 bits when interacting with a 16-bits bus. If we do
what you suggest, and ->read_buf() appears to be caching data in an
intermediate buffer if the amount of data is not aligned on 2 bytes,
you might retrieve data you don't care about when ->read_byte() is
called several times.

\
 
 \ /
  Last update: 2017-06-13 10:31    [W:0.050 / U:1.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site