Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Ricky Wu <ricky_wu@realtek.com>
To: <ulf.hansson@linaro.org>, <ricky_wu@realtek.com>,
	<wenchao.chen@unisoc.com>, <ricardo@marliere.net>,
	<marex@denx.de>, <linux-mmc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] mmc: core: resume not check card exist before powerup
Date: Wed, 27 Mar 2024 10:45:45 +0800	[thread overview]
Message-ID: <20240327024545.138351-1-ricky_wu@realtek.com> (raw)

_mmc_sd_resume
add get_cd before call powerup, make sure the card exist

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 drivers/mmc/core/sd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 1c8148cdda50..35e036672cfb 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1750,6 +1750,9 @@ static int _mmc_sd_resume(struct mmc_host *host)
 	if (!mmc_card_suspended(host->card))
 		goto out;
 
+	if (host->ops->get_cd && !host->ops->get_cd(host))
+		goto out;
+
 	mmc_power_up(host, host->card->ocr);
 	err = mmc_sd_init_card(host, host->card->ocr, host->card);
 	mmc_card_clr_suspended(host->card);
-- 
2.25.1


             reply	other threads:[~2024-03-27  2:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  2:45 Ricky Wu [this message]
2024-03-28 12:38 ` [PATCH] mmc: core: resume not check card exist before powerup Ulf Hansson
2024-03-29  9:03   ` Ricky WU
2024-04-19  6:53   ` Ricky WU
2024-04-25 16:59     ` Ulf Hansson
2024-04-29  6:56       ` Ricky WU

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=20240327024545.138351-1-ricky_wu@realtek.com \
    --to=ricky_wu@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=ricardo@marliere.net \
    --cc=ulf.hansson@linaro.org \
    --cc=wenchao.chen@unisoc.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