Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp41079lqe; Tue, 26 Mar 2024 19:46:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYZRV4xzmftQ7r0ZVOI6a+ogsUuBPOKcVMvM2nQsE9nU2aILW43AdWwBdCKui484K5mFH+NbMC3CohdvCimAecck8LUUxl371pdHcIDg== X-Google-Smtp-Source: AGHT+IFMY4hF3hLttWbIfHS2Zs4BPrHGi+oIhXC1BCwWC4H8bbfbxiUhppbXcAE3fVxunXfJNi3k X-Received: by 2002:a05:6512:310d:b0:513:5e6b:a191 with SMTP id n13-20020a056512310d00b005135e6ba191mr2198585lfb.50.1711507587801; Tue, 26 Mar 2024 19:46:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711507587; cv=pass; d=google.com; s=arc-20160816; b=J8BMXpO6Tnr73DV/yQuArg1MLBlQUmZxmhfv4n2M0tKoJrjwb/TJBkv3aIZh+luKkz exagw/2Xpmz7ennB7kF1JClE1KxUt+zavDG/ZJxiVOlagnpWydihfMNJTibicviErnLU GqwLJfTWupkVBXfy4b8J2T42dyWFxZGwYKgRhm179EBF+gRG3Sv40mH0yE15EUpRC9hx kaqJzta+K1YDQK862+eRREGRCqGxPmkpDlEewpRKsPPln1MneUOE2c2ydLAwohL4kAQ0 tYiUoHV+WbqdpBq1RDba+1+4StjhhWElD5MxMu6nwHBByaseAAwNhu5WbzUqlJ4t1CHI KY2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from; bh=1ieCrpsH5jRCcniRVbXMZCs0uLoIxzU1CNq/wDzW89o=; fh=S1aTSSMs0zzbSUH0F9i0rWkoQYOqx0YH9DSo1GoqBGY=; b=yhG+uJwHw+5N8OQUpkjcQZFubbH0glkemU1meV3MtAnDDJ6BfTPSaM0QLxnEbwudwb G6rajKZvLVIQSEZi8hYc5RWO791knZY2LZ0yhcvYeAwfhA+bIeGGEH33TCMvYXfFa4x2 VYZTOYS0g8fJ5ij8HDzCKB8L9h6NIOITeuY9XzJUQvNfJedwWibdCWodZtqb352V7eSN gmTVOQyW3MyesWMzNVpB79C3dGHwWhUqttJU1PUVAbqCVebHAH+G23cIreOGtRk0aEyB bLNYbi8MlRSZdGcdlHJUSENUezgfWFz3IZHqkstEuA60hIAheu3vJoeG6uv4DLG5eF36 sx9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-120243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120243-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n13-20020a05640205cd00b00568c171cc3fsi4163547edx.19.2024.03.26.19.46.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 19:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-120243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120243-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 83CCD1F30FF0 for ; Wed, 27 Mar 2024 02:46:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14EE921A0B; Wed, 27 Mar 2024 02:46:20 +0000 (UTC) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB1C117BA6; Wed, 27 Mar 2024 02:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507579; cv=none; b=rBuFRLkP9Vkjaf3tXkHdlw9nBCjBGPRcl2loHtEGLU0ihYPbbRMMmABYlxZYCybf0WCS75q529j/HNcVbVkI3zjD9F013FXqBuxA1N1+WEOX+hYk6JuuTfP1LrOVcuH+pfrvGPyV7HaxoUktKEmWpVesdBlHZc8ujaPhjMqojKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711507579; c=relaxed/simple; bh=azgjSy85/wUZ8NadfZuqevl4MalJBeHpf6RNHzPsmSo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=K3VQrN8yev9YcbePnndTlbyj9tB9bevfslrkICq7TdATxR6HNXd799D0IpLAVnNf/p58iT8qV+pOnNOvGoaD2xsCEiZPR+2Kg81P+GyHyB4rJ9hvBKJsisivrpY3ObfHseGK01nSn+QRA8ZK2F63httDUV+WPAmNpA0JPSAogBM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 42R2jqAP3307072, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 42R2jqAP3307072 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 Mar 2024 10:45:52 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 27 Mar 2024 10:45:52 +0800 Received: from localhost (172.22.81.102) by RTEXMBS01.realtek.com.tw (172.21.6.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 27 Mar 2024 10:45:52 +0800 From: Ricky Wu To: , , , , , , Subject: [PATCH] mmc: core: resume not check card exist before powerup Date: Wed, 27 Mar 2024 10:45:45 +0800 Message-ID: <20240327024545.138351-1-ricky_wu@realtek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS01.realtek.com.tw (172.21.6.94) X-KSE-ServerInfo: RTEXMBS01.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback _mmc_sd_resume add get_cd before call powerup, make sure the card exist Signed-off-by: Ricky Wu --- 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