From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388662; b=GoJn6FNmChMrKymEo6p3lXZvICw6OZIJ8Ke64fk2ODdlm6g/jxW3vaO/5YQcW12gbVkh UmKvNiSPP8oa5hjJtF+/GnFcwuHlfYLPeGdIyvLrzbhbmo4c1B3tCb3l+ei7C7DhNp/gY wo8R/yMN+l0TlWymhNrq9ro2xVLJ9/icbfKPTzOMjf+53BfDuKXmEgbcKCtu4IqAbw6no yPFD50LqvtMQy3PDK20qTyEEtW59UwQFLKj5TNCZIUe21GYcIsbNzr2qNW7kKpII5fAu5 uiY8Oi7t0EUsNXncNgvVbsPsewmVG8gAFzZisAQ80ywU9/7+YVdg/oI3+tsxE+ZgwQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388662; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=/e2V1v20F9/iHgUxEllvuOpMKYixov4xuTZRrU5NfWE=; b=QQUKNtaA6xTrTdk0dOSm3BjJ8K9jsPx9ZGnwcSPklScufXzVdwQUGRo4ewwnOPtj+p5H RG9kL4LEMoMXtmDEximT7vAT9Bx3EGpXx+M3SM6vGGr5cYgozd5nf6va4XvTYBsY0EoVW n7A4K8czLpnke2p/d3+qALweihNgJsUWGFD16dNgftQoDbQZ40aHii1yQ3w6GOFw4icdk 8ci0KUypzQiQQ64WR5vU68b+LWL6XeoU9gZLDpZgtBHVx1RV38Li4esDD787gxZi/ggZh ztze8LMcO/wHDdrOrSxT86pRwAuVrL9GuYCxCgTZMULp3u/WuiYiVFc/9URrUv2UIWw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="Qm/lBj2E"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BFB6606A330; Fri, 4 Dec 2026 12:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Qm/lBj2E Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190CF1F00A0D; Fri, 4 Dec 2026 12:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388662; bh=/e2V1v20F9/iHgUxEllvuOpMKYixov4xuTZRrU5NfWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Qm/lBj2EA4PIcn6slxCJSytCddAIp4Hui9rZXZs9X047+FuuCUf+Lb4hqI9v8xB9m SSI+5w0QibHa0Qf3rv4g8ygsCkZHlpoeiqGNheqqY9P6/GCWJ3v7DnxzU5f5CeDaCS y9m7ti9BDu7um3Tts4gJXAQ3+2JXpTdtwoPp5xi8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Adrian Hunter , Ian Ray , Haibo Chen , Ulf Hansson , Sasha Levin Subject: [PATCH 6.1 0704/1059] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Date: Fri, 4 Dec 2026 19:03:55 +0900 Message-ID: <20261204100702.213444280@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Ray [ Upstream commit d35d93c2902592a84347a15deac4d67a323694c9 ] Since commit 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type"), the eMMC driver strength is passed directly to mmc_set_driver_type(), which propagates the value through ios.drv_type all the way to sdhci_set_ios(). For value 4, SDHCI correctly warns: mmc2: invalid driver type, default to driver type B The host driver type has no effect on this controller: esdhc_writew_le() never programs the driver-type field of SDHCI_HOST_CONTROL2. Hook set_ios() and force drv_type to the always-valid Type B, so that SDHCI never sees an unsupported value. Tested on i.MX8MP (usdhc3, eMMC in HS400) with `fixed-emmc-driver-type = <4>`: the warning is gone and the HS_TIMING register contains 0x43 as expected. Fixes: 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type") Link: https://lore.kernel.org/all/20260926122908.866-1-ian.ray@gehealthcare.com/ Cc: stable@vger.kernel.org Suggested-by: Adrian Hunter Signed-off-by: Ian Ray Acked-by: Adrian Hunter Reviewed-by: Haibo Chen Signed-off-by: Ulf Hansson [ sashal: Hunks were placed by hand with different context: the new set_ios function goes before esdhc_reset_tuning() (no usdhc_init_card() here), and the probe hook goes after the usdhc execute_tuning setup. ] Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 3c7b32c0d3f3f..39d0799c563ec 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1198,6 +1198,20 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host) "warning! HS400 strobe DLL status REF/SLV not lock in 50us, STROBE DLL status is %x!\n", v); } +static void sdhci_esdhc_imx_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) +{ + /* + * This controller has no driver-type control: esdhc_writew_le() + * discards the driver-type field when writing SDHCI_HOST_CONTROL2. + * The programmed value is therefore irrelevant, but SDHCI rejects + * non-SD values such as 4 (eMMC 40 ohm, from fixed-emmc-driver-type). + * Force an always-valid Type B. + */ + ios->drv_type = MMC_SET_DRIVER_TYPE_B; + + sdhci_set_ios(mmc, ios); +} + static void esdhc_reset_tuning(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -1674,6 +1688,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->mmc_host_ops.execute_tuning = usdhc_execute_tuning; } + /* No SDHCI driver type control */ + host->mmc_host_ops.set_ios = sdhci_esdhc_imx_set_ios; + if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) sdhci_esdhc_ops.platform_execute_tuning = esdhc_executing_tuning; -- 2.53.0