From nobody Fri Sep 19 00:49:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F12C433FE for ; Wed, 30 Nov 2022 12:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234444AbiK3MPc (ORCPT ); Wed, 30 Nov 2022 07:15:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiK3MPa (ORCPT ); Wed, 30 Nov 2022 07:15:30 -0500 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35752B600; Wed, 30 Nov 2022 04:15:27 -0800 (PST) Received: from SHSend.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by SHSQR01.spreadtrum.com with ESMTPS id 2AUCDen7047066 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Wed, 30 Nov 2022 20:13:40 +0800 (CST) (envelope-from Wenchao.Chen@unisoc.com) Received: from xm13705pcu.spreadtrum.com (10.13.3.189) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 30 Nov 2022 20:13:38 +0800 From: Wenchao Chen To: , , , , CC: , , , , Subject: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Date: Wed, 30 Nov 2022 20:13:28 +0800 Message-ID: <20221130121328.25553-1-wenchao.chen@unisoc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.13.3.189] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 2AUCDen7047066 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After switching the voltage, no reset data and command will cause CMD2 timeout. Fixes: 29ca763fc26f ("mmc: sdhci-sprd: Add pin control support for voltage = switch") Signed-off-by: Wenchao Chen Acked-by: Adrian Hunter Reviewed-by: Baolin Wang --- Changelog: v1 -> v2: There is no need to wait for the state of the pin to stabilize. --- drivers/mmc/host/sdhci-sprd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index b92a408f138d..bec3f9e3cd3f 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *m= mc, struct mmc_ios *ios) } =20 if (IS_ERR(sprd_host->pinctrl)) - return 0; + goto reset; =20 switch (ios->signal_voltage) { case MMC_SIGNAL_VOLTAGE_180: @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *m= mc, struct mmc_ios *ios) =20 /* Wait for 300 ~ 500 us for pin state stable */ usleep_range(300, 500); + +reset: sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); =20 return 0; --=20 2.17.1