[PATCH v2 1/1] mtd: nand: raw: atmel: Add error handling when rb-gpios missing

Eugen Hristev eugen.hristev at collabora.com
Thu Sep 28 08:22:23 CEST 2023


On 9/23/23 19:50, Michael Nazzareno Trimarchi wrote:
> On Fri, Sep 22, 2023 at 11:40 AM Eugen Hristev
> <eugen.hristev at collabora.com> wrote:
>>
>> On 9/22/23 12:08, Alexander Dahl wrote:
>>> Adapt behaviour to Linux kernel driver.
>>>
>>> The return value of gpio_request_by_name_nodev() was not checked before,
>>> and thus in case 'rb-gpios' was missing in DT, rb.type was set to
>>> ATMEL_NAND_GPIO_RB nevertheless, leading to output like this for
>>> example (on sam9x60-curiosity with the line removed from dts):
>>>
>>>       NAND:  Could not find valid ONFI parameter page; aborting
>>>       device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
>>>       Macronix NAND 512MiB 3,3V 8-bit
>>>       512 MiB, SLC, erase size: 256 KiB, page size: 4096, OOB size: 64
>>>       atmel-nand-controller nand-controller: NAND scan failed: -22
>>>       Failed to probe nand driver (err = -22)
>>>       Failed to initialize NAND controller. (error -22)
>>>       0 MiB
>>>
>>> Note: not having that gpio assigned in dts is possible, the driver does
>>> not override nand_chip->dev_ready() then and a generic solution is used.
>>>
>>> Fixes: 6a8dfd57220d ("nand: atmel: Add DM based NAND driver")
>>> Signed-off-by: Alexander Dahl <ada at thorsis.com>
>>> ---
>>
>> Reviewed-by: Eugen Hristev <eugen.hristev at collabora.com>
>>
>>>
>>> Notes:
>>>       v1 -> v2:
>>>
>>>       - Only issue error message if error is not ENOENT.  If the node just is
>>>         missing, move on without error message.
>>>
>>>    drivers/mtd/nand/raw/atmel/nand-controller.c | 11 +++++++----
>>>    1 file changed, 7 insertions(+), 4 deletions(-)
>>>
>>
> Acked-by: Michael Trimarchi <michael at amarulasolutions.com>
> 


Applied to u-boot-at91/master, thanks !


More information about the U-Boot mailing list