archive mirror
 help / color / mirror / Atom feed
	Madhuparna Bhowmik <>
Subject: [PATCH v2] drivers: mmc: host: via-sdmmc: Fix data race bug
Date: Sat, 22 Aug 2020 11:45:28 +0530	[thread overview]
Message-ID: <> (raw)

From: Madhuparna Bhowmik <>

via_save_pcictrlreg() should be called with host->lock held
as it writes to pm_pcictrl_reg, otherwise there can be a race
condition between via_sd_suspend() and via_sdc_card_detect().
The same pattern is used in the function via_reset_pcictrl()
as well, where via_save_pcictrlreg() is called with host->lock

Found by Linux Driver Verification project (

Signed-off-by: Madhuparna Bhowmik <>
v2: Rebase v5.9-rc1

 drivers/mmc/host/via-sdmmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c
index 49dab9f42b6d..9b755ea0fa03 100644
--- a/drivers/mmc/host/via-sdmmc.c
+++ b/drivers/mmc/host/via-sdmmc.c
@@ -1257,11 +1257,14 @@ static void __maybe_unused via_init_sdc_pm(struct via_crdr_mmc_host *host)
 static int __maybe_unused via_sd_suspend(struct device *dev)
 	struct via_crdr_mmc_host *host;
+	unsigned long flags;
 	host = dev_get_drvdata(dev);
+	spin_lock_irqsave(&host->lock, flags);
+	spin_unlock_irqrestore(&host->lock, flags);

             reply	other threads:[~2020-08-22  6:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22  6:15 madhuparnabhowmik10 [this message]
2020-08-24  9:51 ` [PATCH v2] drivers: mmc: host: via-sdmmc: Fix data race bug 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).