public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: d-gole@ti.com,daniel@makrotopia.org,frieder.schrempf@kontron.de,frieder@fris.de,gregkh@linuxfoundation.org,linux-mtd@lists.infradead.org,miquel.raynal@bootlin.com,richard@nod.at,sashal@kernel.org,vigneshr@ti.com
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "mtd: spinand: macronix: use scratch buffer for DMA operation" has been added to the 6.1-stable tree
Date: Sat, 21 Mar 2026 15:43:43 +0100	[thread overview]
Message-ID: <2026032143-magnetize-curator-f33d@gregkh> (raw)
In-Reply-To: <20260310171544.1568499-1-frieder@fris.de>


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

    mtd: spinand: macronix: use scratch buffer for DMA operation

to the 6.1-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:
     mtd-spinand-macronix-use-scratch-buffer-for-dma-operation.patch
and it can be found in the queue-6.1 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 stable+bounces-224526-greg=kroah.com@vger.kernel.org Tue Mar 10 18:16:43 2026
From: Frieder Schrempf <frieder@fris.de>
Date: Tue, 10 Mar 2026 18:15:44 +0100
Subject: mtd: spinand: macronix: use scratch buffer for DMA operation
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>
Cc: Daniel Golle <daniel@makrotopia.org>, Dhruva Gole <d-gole@ti.com>, Frieder Schrempf <frieder.schrempf@kontron.de>
Message-ID: <20260310171544.1568499-1-frieder@fris.de>

From: Daniel Golle <daniel@makrotopia.org>

[ Upstream commit ebed787a0becb9354f0a23620a5130cccd6c730c ]

The mx35lf1ge4ab_get_eccsr() function uses an SPI DMA operation to
read the eccsr, hence the buffer should not be on stack. Since commit
380583227c0c7f ("spi: spi-mem: Add extra sanity checks on the op param")
the kernel emmits a warning and blocks such operations.

Use the scratch buffer to get eccsr instead of trying to directly read
into a stack-allocated variable.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/Y8i85zM0u4XdM46z@makrotopia.org
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mtd/nand/spi/macronix.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -83,9 +83,10 @@ static int mx35lf1ge4ab_ecc_get_status(s
 		 * in order to avoid forcing the wear-leveling layer to move
 		 * data around if it's not necessary.
 		 */
-		if (mx35lf1ge4ab_get_eccsr(spinand, &eccsr))
+		if (mx35lf1ge4ab_get_eccsr(spinand, spinand->scratchbuf))
 			return nanddev_get_ecc_conf(nand)->strength;
 
+		eccsr = *spinand->scratchbuf;
 		if (WARN_ON(eccsr > nanddev_get_ecc_conf(nand)->strength ||
 			    !eccsr))
 			return nanddev_get_ecc_conf(nand)->strength;


Patches currently in stable-queue which might be from frieder@fris.de are

queue-6.1/regulator-pca9450-make-irq-optional.patch
queue-6.1/mtd-spinand-macronix-use-scratch-buffer-for-dma-operation.patch

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

      reply	other threads:[~2026-03-21 14:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 17:15 [PATCH 6.1.y] mtd: spinand: macronix: use scratch buffer for DMA operation Frieder Schrempf
2026-03-21 14:43 ` gregkh [this message]

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=2026032143-magnetize-curator-f33d@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=d-gole@ti.com \
    --cc=daniel@makrotopia.org \
    --cc=frieder.schrempf@kontron.de \
    --cc=frieder@fris.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=sashal@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox