]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 May 2026 11:49:28 +0000 (13:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 May 2026 11:49:28 +0000 (13:49 +0200)
added patches:
mmc-block-use-single-block-write-in-retry.patch
tpm-tpm_tis-add-error-logging-for-data-transfer.patch

queue-5.10/mmc-block-use-single-block-write-in-retry.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/tpm-tpm_tis-add-error-logging-for-data-transfer.patch [new file with mode: 0644]

diff --git a/queue-5.10/mmc-block-use-single-block-write-in-retry.patch b/queue-5.10/mmc-block-use-single-block-write-in-retry.patch
new file mode 100644 (file)
index 0000000..bc172c3
--- /dev/null
@@ -0,0 +1,92 @@
+From c7c6d4f5103864f73ee3a78bfd6da241f84197dd Mon Sep 17 00:00:00 2001
+From: Bin Liu <b-liu@ti.com>
+Date: Wed, 25 Mar 2026 08:49:47 -0500
+Subject: mmc: block: use single block write in retry
+
+From: Bin Liu <b-liu@ti.com>
+
+commit c7c6d4f5103864f73ee3a78bfd6da241f84197dd upstream.
+
+Due to errata i2493[0], multi-block write would still fail in retries.
+
+With i2493, the MMC interface has the potential of write failures when
+issuing multi-block writes operating in HS200 mode with excessive IO
+supply noise.
+
+While the errata provides guidance in hardware design and layout to
+minimize the IO supply noise, in theory the write failure cannot be
+resolved in hardware. The software solution to ensure the data integrity
+is to add minimum 5us delay between block writes. Single-block write is
+the practical way to introduce the delay.
+
+This patch reuses recovery_mode flag, and switches to single-block
+write in retry when multi-block write fails. It covers both CQE and
+non-CQE cases.
+
+[0] https://www.ti.com/lit/pdf/sprz582
+Cc: stable@vger.kernel.org
+Suggested-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Bin Liu <b-liu@ti.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/core/block.c |   12 ++++++++++--
+ drivers/mmc/core/queue.h |    3 +++
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+--- a/drivers/mmc/core/block.c
++++ b/drivers/mmc/core/block.c
+@@ -1316,6 +1316,9 @@ static void mmc_blk_data_prep(struct mmc
+                   rq_data_dir(req) == WRITE &&
+                   (md->flags & MMC_BLK_REL_WR);
++      if (mqrq->flags & MQRQ_XFER_SINGLE_BLOCK)
++              recovery_mode = 1;
++
+       memset(brq, 0, sizeof(struct mmc_blk_request));
+       brq->mrq.data = &brq->data;
+@@ -1453,10 +1456,13 @@ static void mmc_blk_cqe_complete_rq(stru
+               err = 0;
+       if (err) {
+-              if (mqrq->retries++ < MMC_CQE_RETRIES)
++              if (mqrq->retries++ < MMC_CQE_RETRIES) {
++                      if (rq_data_dir(req) == WRITE)
++                              mqrq->flags |= MQRQ_XFER_SINGLE_BLOCK;
+                       blk_mq_requeue_request(req, true);
+-              else
++              } else {
+                       blk_mq_end_request(req, BLK_STS_IOERR);
++              }
+       } else if (mrq->data) {
+               if (blk_update_request(req, BLK_STS_OK, mrq->data->bytes_xfered))
+                       blk_mq_requeue_request(req, true);
+@@ -1941,6 +1947,8 @@ static void mmc_blk_mq_complete_rq(struc
+       } else if (!blk_rq_bytes(req)) {
+               __blk_mq_end_request(req, BLK_STS_IOERR);
+       } else if (mqrq->retries++ < MMC_MAX_RETRIES) {
++              if (rq_data_dir(req) == WRITE)
++                      mqrq->flags |= MQRQ_XFER_SINGLE_BLOCK;
+               blk_mq_requeue_request(req, true);
+       } else {
+               if (mmc_card_removed(mq->card))
+--- a/drivers/mmc/core/queue.h
++++ b/drivers/mmc/core/queue.h
+@@ -61,6 +61,8 @@ enum mmc_drv_op {
+       MMC_DRV_OP_GET_EXT_CSD,
+ };
++#define       MQRQ_XFER_SINGLE_BLOCK          BIT(0)
++
+ struct mmc_queue_req {
+       struct mmc_blk_request  brq;
+       struct scatterlist      *sg;
+@@ -69,6 +71,7 @@ struct mmc_queue_req {
+       void                    *drv_op_data;
+       unsigned int            ioc_count;
+       int                     retries;
++      u32                     flags;
+ };
+ struct mmc_queue {
index 5f3982bfd04cfbc373e46cbfa63e1e419e8d4096..8fd932b794d34348e928454897691f524adcbae9 100644 (file)
@@ -172,3 +172,5 @@ net-rds-fix-mr-cleanup-on-copy-error.patch
 net-smc-avoid-early-lgr-access-in-smc_clc_wait_msg.patch
 rdma-rxe-validate-pad-and-icrc-before-payload_size-in-rxe_rcv.patch
 tpm-avoid-wunused-but-set-variable.patch
+mmc-block-use-single-block-write-in-retry.patch
+tpm-tpm_tis-add-error-logging-for-data-transfer.patch
diff --git a/queue-5.10/tpm-tpm_tis-add-error-logging-for-data-transfer.patch b/queue-5.10/tpm-tpm_tis-add-error-logging-for-data-transfer.patch
new file mode 100644 (file)
index 0000000..17d56e4
--- /dev/null
@@ -0,0 +1,42 @@
+From 0471921e2d1043dcc6de5cffb49dd37709521abe Mon Sep 17 00:00:00 2001
+From: Jacqueline Wong <jacqwong@google.com>
+Date: Wed, 15 Apr 2026 16:00:05 +0000
+Subject: tpm: tpm_tis: add error logging for data transfer
+
+From: Jacqueline Wong <jacqwong@google.com>
+
+commit 0471921e2d1043dcc6de5cffb49dd37709521abe upstream.
+
+Add logging to more easily determine reason for transmit failure
+
+Cc: stable@vger.kernel.org # v6.6+
+Fixes: 280db21e153d8 ("tpm_tis: Resend command to recover from data transfer errors")
+Signed-off-by: Jacqueline Wong <jacqwong@google.com>
+Signed-off-by: Jordan Hand <jhand@google.com>
+Link: https://lore.kernel.org/r/20260415160006.2275325-2-jacqwong@google.com
+Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/tpm/tpm_tis_core.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/char/tpm/tpm_tis_core.c
++++ b/drivers/char/tpm/tpm_tis_core.c
+@@ -410,6 +410,8 @@ static int tpm_tis_send_data(struct tpm_
+               status = tpm_tis_status(chip);
+               if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
+                       rc = -EIO;
++                      dev_err(&chip->dev, "TPM_STS_DATA_EXPECT should be set. sts = 0x%08x\n",
++                              status);
+                       goto out_err;
+               }
+       }
+@@ -427,6 +429,8 @@ static int tpm_tis_send_data(struct tpm_
+       status = tpm_tis_status(chip);
+       if (!itpm && (status & TPM_STS_DATA_EXPECT) != 0) {
+               rc = -EIO;
++              dev_err(&chip->dev, "TPM_STS_DATA_EXPECT should be unset. sts = 0x%08x\n",
++                      status);
+               goto out_err;
+       }