All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	 Boris Brezillon <bbrezillon@kernel.org>,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: propagate timing-mode recovery failures
Date: Wed, 18 Nov 2026 11:28:05 +0100	[thread overview]
Message-ID: <874idejux6.fsf@bootlin.com> (raw)
In-Reply-To: <20261103-submit-rawnand-timing-recovery-v1-v1-1-1cc33723e052@gmail.com> (James Hilliard's message of "Tue, 03 Nov 2026 23:13:18 -0700")

On 03/11/2026 at 23:13:18 -07, James Hilliard <james.hilliard1@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

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	 Boris Brezillon <bbrezillon@kernel.org>,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: propagate timing-mode recovery failures
Date: Wed, 18 Nov 2026 11:28:05 +0100	[thread overview]
Message-ID: <874idejux6.fsf@bootlin.com> (raw)
In-Reply-To: <20261103-submit-rawnand-timing-recovery-v1-v1-1-1cc33723e052@gmail.com> (James Hilliard's message of "Tue, 03 Nov 2026 23:13:18 -0700")

On 03/11/2026 at 23:13:18 -07, James Hilliard <james.hilliard1@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

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2026-11-18 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  6:13 [PATCH] mtd: rawnand: propagate timing-mode recovery failures James Hilliard
2026-11-04  6:13 ` James Hilliard
2026-11-18 10:28 ` Miquel Raynal [this message]
2026-11-18 10:28   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874idejux6.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.