From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Ricky Wu <ricky_wu@realtek.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] mmc: rtsx_usb_sdmmc: Fix error-path in sd_set_power_mode()
Date: Tue, 10 Jun 2025 13:16:23 +0200 [thread overview]
Message-ID: <20250610111633.504366-2-ulf.hansson@linaro.org> (raw)
In-Reply-To: <20250610111633.504366-1-ulf.hansson@linaro.org>
In the error path of sd_set_power_mode() we don't update host->power_mode,
which could lead to an imbalance of the runtime PM usage count. Fix this by
always updating host->power_mode.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/rtsx_usb_sdmmc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index d229c2b83ea9..8c35cb85a9c0 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -1029,9 +1029,7 @@ static int sd_set_power_mode(struct rtsx_usb_sdmmc *host,
err = sd_power_on(host);
}
- if (!err)
- host->power_mode = power_mode;
-
+ host->power_mode = power_mode;
return err;
}
--
2.43.0
next prev parent reply other threads:[~2025-06-10 11:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 11:16 [PATCH 0/4] mmc: rtsx_usb_sdmmc: Improve sd_set_power_mode() Ulf Hansson
2025-06-10 11:16 ` Ulf Hansson [this message]
2025-06-10 11:16 ` [PATCH 2/4] mmc: rtsx_usb_sdmmc: Print debug-messages at power-on/off errors Ulf Hansson
2025-06-10 11:16 ` [PATCH 3/4] mmc: rtsx_usb_sdmmc: Convert sd_set_power_mode() into void Ulf Hansson
2025-06-10 11:16 ` [PATCH 4/4] mmc: rtsx_usb_sdmmc: Re-work the code in sd_set_power_mode() Ulf Hansson
2025-06-10 11:40 ` [PATCH 0/4] mmc: rtsx_usb_sdmmc: Improve sd_set_power_mode() Avri Altman
2025-06-17 13:56 ` Ulf Hansson
2025-06-18 2:48 ` Ricky WU
2025-06-19 2:27 ` Ricky WU
2025-06-19 11:20 ` Ulf Hansson
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=20250610111633.504366-2-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ricky_wu@realtek.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.