[PATCH] mtd: rawnand: propagate timing-mode recovery failures
Miquel Raynal
miquel.raynal at bootlin.com
Wed Nov 18 02:28:05 PST 2026
On 03/11/2026 at 23:13:18 -07, James Hilliard <james.hilliard1 at gmail.com> wrote:
> When GET_FEATURES succeeds but the chip does not acknowledge the requested
> timing mode, nand_setup_interface() falls back to mode 0. Both the
> controller-interface reset and the NAND RESET command can fail, but their
> return values are discarded. The function then returns the successful
> GET_FEATURES status even though the fallback did not complete.
>
> Check the controller reset before issuing RESET and propagate either
> recovery error when there was no earlier error. Preserve an earlier
> GET_FEATURES failure and keep returning success when a timing mismatch
> is recovered by a successful mode-0 fallback.
You are carrying a return value in an error path of an error path. If
the reset actually fails, the very next attempt will fail and probe will
be aborted anyway. So while the fix is not inherently wrong, the title
and commit log overstate the problem.
My proposal:
mtd: rawnand: propagate mode-0 fallback failures
When a chip does not acknowledge the requested timing mode,
nand_setup_interface() falls back to mode 0 by resetting the controller
interface and issuing a NAND RESET. Either step can fail; returning
success will likely lead to any later attempt at talking to the chip to
fail.
Make sure the error path propagates those failures in the mode-0
fallback case.
Thanks,
Miquèl
More information about the linux-mtd
mailing list