Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2] mtd: rawnand: rockchip: ensure NVDDR timings are rejected
       [not found] <20240518124404.472eb60b@xps-13>
@ 2024-05-19  3:13 ` Val Packett
  2024-05-27 12:14   ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Val Packett @ 2024-05-19  3:13 UTC (permalink / raw)
  Cc: Val Packett, stable, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, Heiko Stuebner, Stephen Rothwell, linux-mtd,
	linux-arm-kernel, linux-rockchip, linux-kernel

.setup_interface first gets called with a "target" value of
NAND_DATA_IFACE_CHECK_ONLY, in which case an error is expected
if the controller driver does not support the timing mode (NVDDR).

Fixes: a9ecc8c814e9 ("mtd: rawnand: Choose the best timings, NV-DDR included")
Signed-off-by: Val Packett <val@packett.cool>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/rockchip-nand-controller.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/rockchip-nand-controller.c b/drivers/mtd/nand/raw/rockchip-nand-controller.c
index 7baaef69d..555804476 100644
--- a/drivers/mtd/nand/raw/rockchip-nand-controller.c
+++ b/drivers/mtd/nand/raw/rockchip-nand-controller.c
@@ -420,13 +420,13 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target,
 	u32 rate, tc2rw, trwpw, trw2c;
 	u32 temp;
 
-	if (target < 0)
-		return 0;
-
 	timings = nand_get_sdr_timings(conf);
 	if (IS_ERR(timings))
 		return -EOPNOTSUPP;
 
+	if (target < 0)
+		return 0;
+
 	if (IS_ERR(nfc->nfc_clk))
 		rate = clk_get_rate(nfc->ahb_clk);
 	else
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mtd: rawnand: rockchip: ensure NVDDR timings are rejected
  2024-05-19  3:13 ` [PATCH v2] mtd: rawnand: rockchip: ensure NVDDR timings are rejected Val Packett
@ 2024-05-27 12:14   ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2024-05-27 12:14 UTC (permalink / raw)
  To: Val Packett
  Cc: Miquel Raynal, stable, Richard Weinberger, Vignesh Raghavendra,
	Heiko Stuebner, Stephen Rothwell, linux-mtd, linux-arm-kernel,
	linux-rockchip, linux-kernel

On Sun, 2024-05-19 at 03:13:39 UTC, Val Packett wrote:
> .setup_interface first gets called with a "target" value of
> NAND_DATA_IFACE_CHECK_ONLY, in which case an error is expected
> if the controller driver does not support the timing mode (NVDDR).
> 
> Fixes: a9ecc8c814e9 ("mtd: rawnand: Choose the best timings, NV-DDR included")
> Signed-off-by: Val Packett <val@packett.cool>
> Cc: stable@vger.kernel.org

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-27 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240518124404.472eb60b@xps-13>
2024-05-19  3:13 ` [PATCH v2] mtd: rawnand: rockchip: ensure NVDDR timings are rejected Val Packett
2024-05-27 12:14   ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox