All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: gregkh@linuxfoundation.org,han.xu@nxp.com,linux-mtd@lists.infradead.org,max.krummenacher@toradex.com,max.oss.09@gmail.com,patches@lists.linux.dev,richard@nod.at,s.hauer@pengutronix.de,tharvey@gateworks.com,tomasz.mon@camlingroup.com
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""" has been added to the 5.4-stable tree
Date: Wed, 21 Feb 2024 12:10:52 +0100	[thread overview]
Message-ID: <2024022152-scoop-onstage-df6a@gregkh> (raw)
In-Reply-To: <20240207174911.870822-2-max.oss.09@gmail.com>


This is a note to let you know that I've just added the patch titled

    Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-revert-mtd-rawnand-gpmi-fix-setting-busy-timeout-setting.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From max.oss.09@gmail.com  Wed Feb 21 12:00:21 2024
From: max.oss.09@gmail.com
Date: Wed,  7 Feb 2024 18:49:11 +0100
Subject: Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""
To: stable@vger.kernel.org
Cc: gregkh@linuxfoundation.org, patches@lists.linux.dev, s.hauer@pengutronix.de, han.xu@nxp.com, tomasz.mon@camlingroup.com, richard@nod.at, tharvey@gateworks.com, linux-mtd@lists.infradead.org, Max Krummenacher <max.krummenacher@toradex.com>
Message-ID: <20240207174911.870822-2-max.oss.09@gmail.com>

From: Max Krummenacher <max.krummenacher@toradex.com>

This reverts commit 15a3adfe75937c9e4e0e48f0ed40dd39a0e526e2.

The backport of [1] relies on having [2] also backported. Having only
one of the two results in a bogus hw->timing1 setting.

If only [2] is backportet the 16 bit register value likely underflows
resulting in a busy_wait_timeout of 0.
Or if only [1] is applied the value likely overflows with chances of
having last 16 LSBs all 0 which would then result in a
busy_wait_timeout of 0 too.

Both cases may lead to NAND data corruption, e.g. on a Colibri iMX7
setup this has been seen.

[1] commit 0fddf9ad06fd ("mtd: rawnand: gpmi: Set WAIT_FOR_READY timeout based on program/erase times")
[2] commit 06781a5026350 ("mtd: rawnand: gpmi: Fix setting busy timeout setting")

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -684,7 +684,7 @@ static void gpmi_nfc_compute_timings(str
 	hw->timing0 = BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) |
 		      BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) |
 		      BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles);
-	hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096);
+	hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(DIV_ROUND_UP(busy_timeout_cycles, 4096));
 
 	/*
 	 * Derive NFC ideal delay from {3}:


Patches currently in stable-queue which might be from max.oss.09@gmail.com are

queue-5.4/revert-revert-mtd-rawnand-gpmi-fix-setting-busy-timeout-setting.patch

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

WARNING: multiple messages have this Message-ID (diff)
From: <gregkh@linuxfoundation.org>
To: gregkh@linuxfoundation.org,han.xu@nxp.com,linux-mtd@lists.infradead.org,max.krummenacher@toradex.com,max.oss.09@gmail.com,patches@lists.linux.dev,richard@nod.at,s.hauer@pengutronix.de,tharvey@gateworks.com,tomasz.mon@camlingroup.com
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""" has been added to the 5.4-stable tree
Date: Wed, 21 Feb 2024 12:10:52 +0100	[thread overview]
Message-ID: <2024022152-scoop-onstage-df6a@gregkh> (raw)
In-Reply-To: <20240207174911.870822-2-max.oss.09@gmail.com>


This is a note to let you know that I've just added the patch titled

    Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-revert-mtd-rawnand-gpmi-fix-setting-busy-timeout-setting.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From max.oss.09@gmail.com  Wed Feb 21 12:00:21 2024
From: max.oss.09@gmail.com
Date: Wed,  7 Feb 2024 18:49:11 +0100
Subject: Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""
To: stable@vger.kernel.org
Cc: gregkh@linuxfoundation.org, patches@lists.linux.dev, s.hauer@pengutronix.de, han.xu@nxp.com, tomasz.mon@camlingroup.com, richard@nod.at, tharvey@gateworks.com, linux-mtd@lists.infradead.org, Max Krummenacher <max.krummenacher@toradex.com>
Message-ID: <20240207174911.870822-2-max.oss.09@gmail.com>

From: Max Krummenacher <max.krummenacher@toradex.com>

This reverts commit 15a3adfe75937c9e4e0e48f0ed40dd39a0e526e2.

The backport of [1] relies on having [2] also backported. Having only
one of the two results in a bogus hw->timing1 setting.

If only [2] is backportet the 16 bit register value likely underflows
resulting in a busy_wait_timeout of 0.
Or if only [1] is applied the value likely overflows with chances of
having last 16 LSBs all 0 which would then result in a
busy_wait_timeout of 0 too.

Both cases may lead to NAND data corruption, e.g. on a Colibri iMX7
setup this has been seen.

[1] commit 0fddf9ad06fd ("mtd: rawnand: gpmi: Set WAIT_FOR_READY timeout based on program/erase times")
[2] commit 06781a5026350 ("mtd: rawnand: gpmi: Fix setting busy timeout setting")

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -684,7 +684,7 @@ static void gpmi_nfc_compute_timings(str
 	hw->timing0 = BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) |
 		      BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) |
 		      BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles);
-	hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096);
+	hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(DIV_ROUND_UP(busy_timeout_cycles, 4096));
 
 	/*
 	 * Derive NFC ideal delay from {3}:


Patches currently in stable-queue which might be from max.oss.09@gmail.com are

queue-5.4/revert-revert-mtd-rawnand-gpmi-fix-setting-busy-timeout-setting.patch

  reply	other threads:[~2024-02-21 11:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 17:49 [regression 5.4.y][RFC][PATCH 0/1] mtd: rawnand: gpmi: busy_timeout_cycles max.oss.09
2024-02-07 17:49 ` max.oss.09
2024-02-07 17:49 ` [regression 5.4.y][RFC][PATCH mtd: rawnand: gpmi: busy_timeout_cycles 1/1] Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting"" max.oss.09
2024-02-07 17:49   ` max.oss.09
2024-02-21 11:10   ` gregkh [this message]
2024-02-21 11:10     ` Patch "Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""" has been added to the 5.4-stable tree gregkh
2024-02-21 11:00 ` [regression 5.4.y][RFC][PATCH 0/1] mtd: rawnand: gpmi: busy_timeout_cycles Greg KH
2024-02-21 11:00   ` Greg KH

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=2024022152-scoop-onstage-df6a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=han.xu@nxp.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=max.krummenacher@toradex.com \
    --cc=max.oss.09@gmail.com \
    --cc=patches@lists.linux.dev \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=stable-commits@vger.kernel.org \
    --cc=tharvey@gateworks.com \
    --cc=tomasz.mon@camlingroup.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.