[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250506095118.2239459-5-o.rempel@pengutronix.de>
Date: Tue, 6 May 2025 11:51:18 +0200
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
kernel@...gutronix.de,
linux-kernel@...r.kernel.org,
linux-mmc@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mark Brown <broonie@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Søren Andersen <san@...v.dk>,
Christian Loehle <christian.loehle@....com>,
Adrian Hunter <adrian.hunter@...el.com>,
Avri Altman <Avri.Altman@...disk.com>
Subject: [PATCH v5 4/4] mmc: block: abort requests and suppress errors after undervoltage shutdown
Extend the existing card removal checks in mmc_blk_mq_complete_rq() and
mmc_mq_queue_rq() to also account for the undervoltage state. If the host
has entered undervoltage shutdown, mark requests as quiet and abort them
early to prevent unnecessary retries and error logging. This ensures no
further operations are attempted on the card after an emergency stop.
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
drivers/mmc/core/block.c | 2 +-
drivers/mmc/core/queue.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 585c2b274d98..2f07610d3c35 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2129,7 +2129,7 @@ static void mmc_blk_mq_complete_rq(struct mmc_queue *mq, struct request *req)
} else if (mqrq->retries++ < MMC_MAX_RETRIES) {
blk_mq_requeue_request(req, true);
} else {
- if (mmc_card_removed(mq->card))
+ if (mmc_card_removed(mq->card) || mq->card->host->undervoltage)
req->rq_flags |= RQF_QUIET;
blk_mq_end_request(req, BLK_STS_IOERR);
}
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 284856c8f655..1dd71ea6927d 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -239,7 +239,7 @@ static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
bool get_card, cqe_retune_ok;
blk_status_t ret;
- if (mmc_card_removed(mq->card)) {
+ if (mmc_card_removed(mq->card) || mq->card->host->undervoltage) {
req->rq_flags |= RQF_QUIET;
return BLK_STS_IOERR;
}
--
2.39.5
Powered by blists - more mailing lists