From nobody Sun Feb 8 04:11:49 2026 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13CF3244675 for ; Mon, 29 Dec 2025 20:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767041273; cv=none; b=smFakMHP+P+/S0z19TFHbQjyenpliKGNnFWOOf8eoY3eXrEewkYdTL5GhXMftDX/rfGkUkF73qiW1F8xaREJ+TlYfCnq6Ow+/xgHe9KAoGKjyxlWJVE2GZaVhfOZF33iuEmByB292zEwUZO1iCJAq2VCDn/8m6xQdsklRlp99xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767041273; c=relaxed/simple; bh=FTTWZTgWJb2pmnADYFOVZQ9XSRXJHwk/7xVUONMUFXQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=C9hc4tN0CdZ/sCglWAAubO/wvJO6Nis1EeXWtI6PsAXkgqZJRe6vfQ///oZEHEOeKmhccemCUl/TNf9kYD2aDCuGC3oHm6eiIYTaT5ypJcv/pNTr8X4VNm/dZJ+2DEC5/Ehum+7pbcyjY5cg8qFcKbnp5JAS2M8J6m+eQGxMPLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=i8kxsaVw; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="i8kxsaVw" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767041259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KEPZBRpnGB1efOd5bNDXDdGViOmX7rmQaGCX0yMPoLM=; b=i8kxsaVw8077mTTEOwc8hlN6GEMB6Lw1QRZ24MrX2rKZDJMp7T0S6p0ctKc7KcAw9uwooX 92LOtmBkiVJlx5jk7JOVITPnblyG4+SyxmFdIV/hlhYfxrAfAdu9s5SO3tjS+TiBQ0mj2O HBOl5ii8tnZsmxYp+AyV44UMYUGx4cg= From: Matthew Schwartz To: ulf.hansson@linaro.org, ricky_wu@realtek.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Matthew Schwartz Subject: [PATCH] mmc: rtsx_pci_sdmmc: implement sdmmc_card_busy function Date: Mon, 29 Dec 2025 12:45:26 -0800 Message-ID: <20251229204526.2850803-1-matthew.schwartz@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" rtsx_pci_sdmmc does not have an sdmmc_card_busy function, so any voltage switches cause a kernel warning, "mmc0: cannot verify signal voltage switch." Copy the sdmmc_card_busy function from rtsx_pci_usb to rtsx_pci_sdmmc to fix this. Fixes: ff984e57d36e ("mmc: Add realtek pcie sdmmc host driver") Signed-off-by: Matthew Schwartz --- drivers/mmc/host/rtsx_pci_sdmmc.c | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_= sdmmc.c index dc2587ff8519..4db3328f46df 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -1306,6 +1306,46 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc= , struct mmc_ios *ios) return err; } =20 +static int sdmmc_card_busy(struct mmc_host *mmc) +{ + struct realtek_pci_sdmmc *host =3D mmc_priv(mmc); + struct rtsx_pcr *pcr =3D host->pcr; + int err; + u8 stat; + u8 mask =3D SD_DAT3_STATUS | SD_DAT2_STATUS | SD_DAT1_STATUS + | SD_DAT0_STATUS; + + mutex_lock(&pcr->pcr_mutex); + + rtsx_pci_start_run(pcr); + + err =3D rtsx_pci_write_register(pcr, SD_BUS_STAT, + SD_CLK_TOGGLE_EN | SD_CLK_FORCE_STOP, + SD_CLK_TOGGLE_EN); + if (err) + goto out; + + mdelay(1); + + err =3D rtsx_pci_read_register(pcr, SD_BUS_STAT, &stat); + if (err) + goto out; + + err =3D rtsx_pci_write_register(pcr, SD_BUS_STAT, + SD_CLK_TOGGLE_EN | SD_CLK_FORCE_STOP, 0); +out: + mutex_unlock(&pcr->pcr_mutex); + + if (err) + return err; + + /* check if any pin between dat[0:3] is low */ + if ((stat & mask) !=3D mask) + return 1; + else + return 0; +} + static int sdmmc_execute_tuning(struct mmc_host *mmc, u32 opcode) { struct realtek_pci_sdmmc *host =3D mmc_priv(mmc); @@ -1418,6 +1458,7 @@ static const struct mmc_host_ops realtek_pci_sdmmc_op= s =3D { .get_ro =3D sdmmc_get_ro, .get_cd =3D sdmmc_get_cd, .start_signal_voltage_switch =3D sdmmc_switch_voltage, + .card_busy =3D sdmmc_card_busy, .execute_tuning =3D sdmmc_execute_tuning, .init_sd_express =3D sdmmc_init_sd_express, }; --=20 2.52.0