From patchwork Mon Mar 21 11:50:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787114 X-Patchwork-Delegate: geert@linux-m68k.org 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 67BDAC43217 for ; Mon, 21 Mar 2022 11:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346862AbiCULwm (ORCPT ); Mon, 21 Mar 2022 07:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236268AbiCULwk (ORCPT ); Mon, 21 Mar 2022 07:52:40 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2073C1557FF for ; Mon, 21 Mar 2022 04:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=XONJQws0G0Qd59 eaonfUHwUQhTZBr7Wfsr5JDj17GTA=; b=G0t2rTisIsPREuGN/cwg4ekOnRu/mS oE+vDdrHFZw0E+QQuJ9plH5bfLEEVocYZwFYYy23ND4bQF6mbJYHSwd2BP7MhtXZ tneEVvEQsNkr3gBTPXAJrfVEuPR7TbTJMklyPP8jB+M4ZrHsECx1yqwA7MK6XPbV fvF6q+RTst8oc= Received: (qmail 860209 invoked from network); 21 Mar 2022 12:51:06 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:06 +0100 X-UD-Smtp-Session: l3s3148p1@zJ2NHLnaAqcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson Subject: [RFC PATCH 01/10] mmc: core: improve API to make clear mmc_hw_reset is for cards Date: Mon, 21 Mar 2022 12:50:47 +0100 Message-Id: <20220321115059.21803-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org To make it unambiguous that mmc_hw_reset() is for cards and not for controllers, we a) add 'card' to the function name and b) make the function argument mmc_card instead of mmc_host. A fallback is provided until all users are converted. Signed-off-by: Wolfram Sang --- drivers/mmc/core/block.c | 2 +- drivers/mmc/core/core.c | 18 +++++++++++++----- drivers/mmc/core/mmc_test.c | 3 +-- include/linux/mmc/core.h | 1 + 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 4e67c1403cc9..74674a4650b0 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -993,7 +993,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host, return -EEXIST; md->reset_done |= type; - err = mmc_hw_reset(host); + err = mmc_card_hw_reset(host->card); /* Ensure we switch back to the correct partition */ if (err) { struct mmc_blk_data *main_md = diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 368f10405e13..71e75196bc53 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1984,7 +1984,8 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) } EXPORT_SYMBOL(mmc_set_blocklen); -static void mmc_hw_reset_for_init(struct mmc_host *host) +/* we can't use mmc_card as a parameter, it is not populated yet */ +static void mmc_card_hw_reset_for_init(struct mmc_host *host) { mmc_pwrseq_reset(host); @@ -1994,8 +1995,8 @@ static void mmc_hw_reset_for_init(struct mmc_host *host) } /** - * mmc_hw_reset - reset the card in hardware - * @host: MMC host to which the card is attached + * mmc_card_hw_reset - reset the card in hardware + * @card: card to be reset * * Hard reset the card. This function is only for upper layers, like the * block layer or card drivers. You cannot use it in host drivers (struct @@ -2003,8 +2004,9 @@ static void mmc_hw_reset_for_init(struct mmc_host *host) * * Return: 0 on success, -errno on failure */ -int mmc_hw_reset(struct mmc_host *host) +int mmc_card_hw_reset(struct mmc_card *card) { + struct mmc_host *host = card->host; int ret; ret = host->bus_ops->hw_reset(host); @@ -2014,6 +2016,12 @@ int mmc_hw_reset(struct mmc_host *host) return ret; } +EXPORT_SYMBOL(mmc_card_hw_reset); + +int mmc_hw_reset(struct mmc_host *host) +{ + return mmc_card_hw_reset(host->card); +} EXPORT_SYMBOL(mmc_hw_reset); int mmc_sw_reset(struct mmc_host *host) @@ -2045,7 +2053,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) * Some eMMCs (with VCCQ always on) may not be reset after power up, so * do a hardware reset if possible. */ - mmc_hw_reset_for_init(host); + mmc_card_hw_reset_for_init(host); /* * sdio_reset sends CMD52 to reset card. Since we do not know diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index e6a2fd2c6d5c..bfcae8f79cbd 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -2325,10 +2325,9 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test) static int mmc_test_reset(struct mmc_test_card *test) { struct mmc_card *card = test->card; - struct mmc_host *host = card->host; int err; - err = mmc_hw_reset(host); + err = mmc_card_hw_reset(card); if (!err) { /* * Reset will re-enable the card's command queue, but tests diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 71101d1ec825..25a7cf69d919 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -176,6 +176,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries); int mmc_hw_reset(struct mmc_host *host); +int mmc_card_hw_reset(struct mmc_card *card); int mmc_sw_reset(struct mmc_host *host); void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card); From patchwork Mon Mar 21 11:50:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787115 X-Patchwork-Delegate: geert@linux-m68k.org 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 8A072C43219 for ; Mon, 21 Mar 2022 11:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344272AbiCULwm (ORCPT ); Mon, 21 Mar 2022 07:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346867AbiCULwk (ORCPT ); Mon, 21 Mar 2022 07:52:40 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 968351567B4 for ; Mon, 21 Mar 2022 04:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=YTuuwVU35z7nZX Id+G+XxJLrCfLxFx7vvmpo3qJBvUM=; b=TWpQUKY0ISuVpQjnBadom1NUtIZhft PduBXJWbTxsFmktScZMsyUbYBWq1TYpEUiAauquJGxRGNHFA8RPLUxRbDC/bFPbQ BVpySXXgstR/iiuKRQ8tPNQ5Kr88FXzHfp6pjUfWXfEBTyFqGl2IOIEJNiQ8zqZC CHepWQj2XIdK8= Received: (qmail 860252 invoked from network); 21 Mar 2022 12:51:07 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:07 +0100 X-UD-Smtp-Session: l3s3148p1@zoKWHLnaBKcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Kalle Valo , "David S. Miller" , Jakub Kicinski , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 02/10] ath10k: sdio: update to new MMC API for resetting cards Date: Mon, 21 Mar 2022 12:50:48 +0100 Message-Id: <20220321115059.21803-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org No functional change, only the name and the argument type change to avoid confusion between resetting a card and a host controller. Signed-off-by: Wolfram Sang --- RFC, please do not apply yet. drivers/net/wireless/ath/ath10k/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 63e1c2d783c5..b6c9eb0ab9c8 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -1633,7 +1633,7 @@ static void ath10k_sdio_hif_power_down(struct ath10k *ar) return; } - ret = mmc_hw_reset(ar_sdio->func->card->host); + ret = mmc_card_hw_reset(ar_sdio->func->card); if (ret) ath10k_warn(ar, "unable to reset sdio: %d\n", ret); From patchwork Mon Mar 21 11:50:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787117 X-Patchwork-Delegate: geert@linux-m68k.org 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 85D55C4167D for ; Mon, 21 Mar 2022 11:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346867AbiCULwn (ORCPT ); Mon, 21 Mar 2022 07:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346878AbiCULwl (ORCPT ); Mon, 21 Mar 2022 07:52:41 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B351D15856E for ; Mon, 21 Mar 2022 04:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=2kPVtjZgbfZNm8 bnLKE/3dfwjc3G5UY5/Mx40qSbFhk=; b=pok2xq+8PHwewlgGiN04y3TnrC8PrW mSd8P4A0cl8Pwr9eTaIH5IWX6b1vCPNZpwoogRISMVIxwSK2PGic+DoAA1cV/Hnq C74dPFtZN/0/t5sBnNYM8L3TeoIpATMu8mwgbO0ku9trN/kquLTsZX6nUhOwsc4c Bubq+Wa/hCWgo= Received: (qmail 860299 invoked from network); 21 Mar 2022 12:51:07 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:07 +0100 X-UD-Smtp-Session: l3s3148p1@JQigHLnaBqcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org Subject: [RFC PATCH 03/10] brcmfmac: sdio: update to new MMC API for resetting cards Date: Mon, 21 Mar 2022 12:50:49 +0100 Message-Id: <20220321115059.21803-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org No functional change, only the name and the argument type change to avoid confusion between resetting a card and a host controller. Signed-off-by: Wolfram Sang Acked-by: Arend van Spriel --- RFC, please do not apply yet. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 8effeb7a7269..df5b36217a0d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4165,7 +4165,7 @@ static int brcmf_sdio_bus_reset(struct device *dev) /* reset the adapter */ sdio_claim_host(sdiodev->func1); - mmc_hw_reset(sdiodev->func1->card->host); + mmc_card_hw_reset(sdiodev->func1->card); sdio_release_host(sdiodev->func1); brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN); From patchwork Mon Mar 21 11:50:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787116 X-Patchwork-Delegate: geert@linux-m68k.org 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 F2BC7C3525B for ; Mon, 21 Mar 2022 11:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346894AbiCULwn (ORCPT ); Mon, 21 Mar 2022 07:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346895AbiCULwm (ORCPT ); Mon, 21 Mar 2022 07:52:42 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039041557FF for ; Mon, 21 Mar 2022 04:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=3/MweonOnAZzh0 9fhx+1gPXXRGWjBJLCioPiGXAo618=; b=nFKi4GC/C+rUCjAYG4bFTffa8e/2Ix htMeS+n4hfsDkaQI4dtnpKID6i1jFjEAKBXG5a3MIZeiwb5TAwSvAzniHqXBlOqJ Ck0vMIXpZmgSbZMz2bB9Kb9TXQT5uLka9BJOJvRl/4grj6U5xYMipTffCIkjaKZd tpgZRSId7PGDY= Received: (qmail 860337 invoked from network); 21 Mar 2022 12:51:08 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:08 +0100 X-UD-Smtp-Session: l3s3148p1@NoWpHLnaCKcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 04/10] mwifiex: sdio: update to new MMC API for resetting cards Date: Mon, 21 Mar 2022 12:50:50 +0100 Message-Id: <20220321115059.21803-5-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org No functional change, only the name and the argument type change to avoid confusion between resetting a card and a host controller. Signed-off-by: Wolfram Sang --- RFC, please do not apply yet. drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index bde9e4bbfffe..8c3730c7d93e 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -2639,7 +2639,7 @@ static void mwifiex_sdio_card_reset_work(struct mwifiex_adapter *adapter) /* Run a HW reset of the SDIO interface. */ sdio_claim_host(func); - ret = mmc_hw_reset(func->card->host); + ret = mmc_card_hw_reset(func->card); sdio_release_host(func); switch (ret) { From patchwork Mon Mar 21 11:50:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787122 X-Patchwork-Delegate: geert@linux-m68k.org 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 6CF20C4707A for ; Mon, 21 Mar 2022 11:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346945AbiCULxU (ORCPT ); Mon, 21 Mar 2022 07:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346916AbiCULwt (ORCPT ); Mon, 21 Mar 2022 07:52:49 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D84ECC5A for ; Mon, 21 Mar 2022 04:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=WqN5GinpQ6GaOH m+NbWUDUynB6s3adKS8MwbgKgGEGw=; b=urhrVmn82vKxahoXY7wN8ma9p08gyC ymgZc+ozWpv435AAaT8AxVIN5PS0H78AhUDebx2xPHrkB27d8Gb2kU/YO6GANqNE A82vlgtD1s7Gu49coOaNO4gClr+m51VolaT0HLgW1ZwB8okxfPZWHGUhtkfpI3yB fgvkNDVtLPzHE= Received: (qmail 860372 invoked from network); 21 Mar 2022 12:51:09 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:09 +0100 X-UD-Smtp-Session: l3s3148p1@qMWyHLnaCqcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 05/10] wlcore: sdio: update to new MMC API for resetting cards Date: Mon, 21 Mar 2022 12:50:51 +0100 Message-Id: <20220321115059.21803-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org No functional change, only the name and the argument type change to avoid confusion between resetting a card and a host controller. Signed-off-by: Wolfram Sang --- RFC, please do not apply yet. drivers/net/wireless/ti/wlcore/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c index 72fc41ac83c0..62246a98bbc9 100644 --- a/drivers/net/wireless/ti/wlcore/sdio.c +++ b/drivers/net/wireless/ti/wlcore/sdio.c @@ -146,7 +146,7 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue) * To guarantee that the SDIO card is power cycled, as required to make * the FW programming to succeed, let's do a brute force HW reset. */ - mmc_hw_reset(card->host); + mmc_card_hw_reset(card); sdio_enable_func(func); sdio_release_host(func); From patchwork Mon Mar 21 11:50:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787118 X-Patchwork-Delegate: geert@linux-m68k.org 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 86C10C4332F for ; Mon, 21 Mar 2022 11:51:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346903AbiCULxQ (ORCPT ); Mon, 21 Mar 2022 07:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346936AbiCULwu (ORCPT ); Mon, 21 Mar 2022 07:52:50 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E970E15856E for ; Mon, 21 Mar 2022 04:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=yXa+PC2KmL1IZD J2XME9ff+HOtr6XglrIc3LVEsRp0Q=; b=1fkXXOo7cufzqodsI99ct7VYaxGoKP YJE3uQyyTP2bD0yLLjSmqgfj/YYoZbWum0ff+InpsqReZvam+WS6Evt52eXKgy2y cRAeM9CJLt0m9FEZuQojWDQfNmsvKOw3CrITOYFXzi2NfrX0XUpKT9Ho8vA3qUKF yZB7tplc5/ZJY= Received: (qmail 860402 invoked from network); 21 Mar 2022 12:51:09 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:09 +0100 X-UD-Smtp-Session: l3s3148p1@Lw29HLnaDKcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson Subject: [RFC PATCH 06/10] mmc: core: remove fallback for mmc_hw_reset() Date: Mon, 21 Mar 2022 12:50:52 +0100 Message-Id: <20220321115059.21803-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org All users have been converted, the fallback can go now. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 6 ------ include/linux/mmc/core.h | 1 - 2 files changed, 7 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 71e75196bc53..7a2985dde0e6 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2018,12 +2018,6 @@ int mmc_card_hw_reset(struct mmc_card *card) } EXPORT_SYMBOL(mmc_card_hw_reset); -int mmc_hw_reset(struct mmc_host *host) -{ - return mmc_card_hw_reset(host->card); -} -EXPORT_SYMBOL(mmc_hw_reset); - int mmc_sw_reset(struct mmc_host *host) { int ret; diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 25a7cf69d919..7759502c8c67 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -175,7 +175,6 @@ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq); int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries); -int mmc_hw_reset(struct mmc_host *host); int mmc_card_hw_reset(struct mmc_card *card); int mmc_sw_reset(struct mmc_host *host); void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card); From patchwork Mon Mar 21 11:50:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787123 X-Patchwork-Delegate: geert@linux-m68k.org 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 26D6DC433EF for ; Mon, 21 Mar 2022 11:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234788AbiCULxw (ORCPT ); Mon, 21 Mar 2022 07:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346937AbiCULwu (ORCPT ); Mon, 21 Mar 2022 07:52:50 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5D0315AAC0 for ; Mon, 21 Mar 2022 04:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=xWPaZrnm9z27Va /XtIjY8NA3lcLy58v4RnWPMq+zt4U=; b=RsJ7rkJKhSPu2AqcPTthRCoW/h9xbw /5Sk3LmIuYLtSgiwxLaHm5fgS3LtqmGnLKkUUjz296SlzmzzQYr/VgbA4UxMoNmC rGf20OVbsuSd0SDDpDKHdKEkwYMUfaN6I9CvDudJwCynssYgUwAJa6pw8HY6DvyJ 1t/mCspig/a90= Received: (qmail 860435 invoked from network); 21 Mar 2022 12:51:10 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:10 +0100 X-UD-Smtp-Session: l3s3148p1@U77HHLnaDqcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson Subject: [RFC PATCH 07/10] mmc: core: improve API to make clear that mmc_sw_reset is for cards Date: Mon, 21 Mar 2022 12:50:53 +0100 Message-Id: <20220321115059.21803-8-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org To make it unambiguous that mmc_sw_reset() is for cards and not for controllers, we a) add 'card' to the function name and b) make the function argument mmc_card instead of mmc_host. There is no fallback because there are currently no users. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 5 +++-- include/linux/mmc/core.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 7a2985dde0e6..3498b341acaf 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2018,8 +2018,9 @@ int mmc_card_hw_reset(struct mmc_card *card) } EXPORT_SYMBOL(mmc_card_hw_reset); -int mmc_sw_reset(struct mmc_host *host) +int mmc_card_sw_reset(struct mmc_card *card) { + struct mmc_host *host = card->host; int ret; if (!host->bus_ops->sw_reset) @@ -2032,7 +2033,7 @@ int mmc_sw_reset(struct mmc_host *host) return ret; } -EXPORT_SYMBOL(mmc_sw_reset); +EXPORT_SYMBOL(mmc_card_sw_reset); static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) { diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 7759502c8c67..c2616b61c191 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -176,7 +176,7 @@ int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries); int mmc_card_hw_reset(struct mmc_card *card); -int mmc_sw_reset(struct mmc_host *host); +int mmc_card_sw_reset(struct mmc_card *card); void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card); #endif /* LINUX_MMC_CORE_H */ From patchwork Mon Mar 21 11:50:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787120 X-Patchwork-Delegate: geert@linux-m68k.org 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 BD82FC4167E for ; Mon, 21 Mar 2022 11:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346960AbiCULxS (ORCPT ); Mon, 21 Mar 2022 07:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346957AbiCULwv (ORCPT ); Mon, 21 Mar 2022 07:52:51 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29B915854A for ; Mon, 21 Mar 2022 04:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=k2S5I6Iv385ASD dHgH6U1H/WEVCqefhmjYtrjjjQKg4=; b=sNpb5cWGveFIaKOfuGIP4pi08hDAtm E8nvrHHNabLwIA9zl6t9aD1IQJ7nStBIjG4R4yBOg+QHKvbeKZm12SpUfdo6As1b hii3yaaQAHXE6Zt8Xm/DNSgaPuflVz6qK+p+cbaMOe3nryFqBZfO4BF7zDvba/xn aOnaQu1xp2SpQ= Received: (qmail 860460 invoked from network); 21 Mar 2022 12:51:11 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:11 +0100 X-UD-Smtp-Session: l3s3148p1@Bt/YHLnaEKcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson Subject: [RFC PATCH 08/10] mmc: core: improve API to make clear hw_reset from bus_ops is for cards Date: Mon, 21 Mar 2022 12:50:54 +0100 Message-Id: <20220321115059.21803-9-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org To make it unambiguous that bus_ops->hw_reset() is for cards and not for controllers, we a) add 'card' to the function name and b) make the function argument mmc_card instead of mmc_host. All users are converted, too. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 4 ++-- drivers/mmc/core/core.h | 2 +- drivers/mmc/core/mmc.c | 6 +++--- drivers/mmc/core/sd.c | 8 ++++---- drivers/mmc/core/sdio.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3498b341acaf..1d874b064202 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -969,7 +969,7 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width) } /* - * Set initial state after a power cycle or a hw_reset. + * Set initial state after a power cycle or a card_hw_reset. */ void mmc_set_initial_state(struct mmc_host *host) { @@ -2009,7 +2009,7 @@ int mmc_card_hw_reset(struct mmc_card *card) struct mmc_host *host = card->host; int ret; - ret = host->bus_ops->hw_reset(host); + ret = host->bus_ops->card_hw_reset(card); if (ret < 0) pr_warn("%s: tried to HW reset card, got error %d\n", mmc_hostname(host), ret); diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index f5f3f623ea49..c54270a6d457 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -27,7 +27,7 @@ struct mmc_bus_ops { int (*runtime_resume)(struct mmc_host *); int (*alive)(struct mmc_host *); int (*shutdown)(struct mmc_host *); - int (*hw_reset)(struct mmc_host *); + int (*card_hw_reset)(struct mmc_card *); int (*sw_reset)(struct mmc_host *); bool (*cache_enabled)(struct mmc_host *); int (*flush_cache)(struct mmc_host *); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index e7ea45386c22..1857f398298b 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2215,9 +2215,9 @@ static int mmc_can_reset(struct mmc_card *card) return 1; } -static int _mmc_hw_reset(struct mmc_host *host) +static int _mmc_card_hw_reset(struct mmc_card *card) { - struct mmc_card *card = host->card; + struct mmc_host *host = card->host; /* * In the case of recovery, we can't expect flushing the cache to work @@ -2249,7 +2249,7 @@ static const struct mmc_bus_ops mmc_ops = { .runtime_resume = mmc_runtime_resume, .alive = mmc_alive, .shutdown = mmc_shutdown, - .hw_reset = _mmc_hw_reset, + .card_hw_reset = _mmc_card_hw_reset, .cache_enabled = _mmc_cache_enabled, .flush_cache = _mmc_flush_cache, }; diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 68df6b2f49cc..c4a08ee8cdcc 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1784,10 +1784,10 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) return 0; } -static int mmc_sd_hw_reset(struct mmc_host *host) +static int mmc_sd_card_hw_reset(struct mmc_card *card) { - mmc_power_cycle(host, host->card->ocr); - return mmc_sd_init_card(host, host->card->ocr, host->card); + mmc_power_cycle(card->host, card->ocr); + return mmc_sd_init_card(card->host, card->ocr, card); } static const struct mmc_bus_ops mmc_sd_ops = { @@ -1799,7 +1799,7 @@ static const struct mmc_bus_ops mmc_sd_ops = { .resume = mmc_sd_resume, .alive = mmc_sd_alive, .shutdown = mmc_sd_suspend, - .hw_reset = mmc_sd_hw_reset, + .card_hw_reset = mmc_sd_card_hw_reset, .cache_enabled = sd_cache_enabled, .flush_cache = sd_flush_cache, }; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 25799accf8a0..30242faf703e 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1128,9 +1128,9 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host) * Returns 0 if the HW reset was executed synchronously, returns 1 if the HW * reset was asynchronously scheduled, else a negative error code. */ -static int mmc_sdio_hw_reset(struct mmc_host *host) +static int mmc_sdio_card_hw_reset(struct mmc_card *card) { - struct mmc_card *card = host->card; + struct mmc_host *host = card->host; /* * In case the card is shared among multiple func drivers, reset the @@ -1175,7 +1175,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = { .runtime_suspend = mmc_sdio_runtime_suspend, .runtime_resume = mmc_sdio_runtime_resume, .alive = mmc_sdio_alive, - .hw_reset = mmc_sdio_hw_reset, + .card_hw_reset = mmc_sdio_card_hw_reset, .sw_reset = mmc_sdio_sw_reset, }; From patchwork Mon Mar 21 11:50:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787119 X-Patchwork-Delegate: geert@linux-m68k.org 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 3162AC4167B for ; Mon, 21 Mar 2022 11:51:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346958AbiCULxR (ORCPT ); Mon, 21 Mar 2022 07:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346963AbiCULwv (ORCPT ); Mon, 21 Mar 2022 07:52:51 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B8B415B062 for ; Mon, 21 Mar 2022 04:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=yNuiRrYSmsAtp9 N39Y/ajnCG1ZPP72tGEy39+XJpozQ=; b=J/fmceZcw+8diprk/fGBq+ncKvorZH +q7HdxM1ulcDHWnQSXEuSEi4iXY6gNfYz1L/yg2qbEAcRpfJT8gzZI3ghVYP4/54 iU9zKrbDLednesjmdkDlgsZAGrpIhN5NKQQLccwM7NapMVbFgJ0fdzNFcQVUO1pa 3hWNw5f8AbxD8= Received: (qmail 860482 invoked from network); 21 Mar 2022 12:51:12 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:12 +0100 X-UD-Smtp-Session: l3s3148p1@BDvjHLnaEqcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson Subject: [RFC PATCH 09/10] mmc: core: improve API to make clear sw_reset from bus_ops is for cards Date: Mon, 21 Mar 2022 12:50:55 +0100 Message-Id: <20220321115059.21803-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org To make it unambiguous that bus_ops->sw_reset() is for cards and not for controllers, we a) add 'card' to the function name and b) make the function argument mmc_card instead of mmc_host. All users are converted, too. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 4 ++-- drivers/mmc/core/core.h | 2 +- drivers/mmc/core/sdio.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 1d874b064202..7e48570007f9 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2023,10 +2023,10 @@ int mmc_card_sw_reset(struct mmc_card *card) struct mmc_host *host = card->host; int ret; - if (!host->bus_ops->sw_reset) + if (!host->bus_ops->card_sw_reset) return -EOPNOTSUPP; - ret = host->bus_ops->sw_reset(host); + ret = host->bus_ops->card_sw_reset(card); if (ret) pr_warn("%s: tried to SW reset card, got error %d\n", mmc_hostname(host), ret); diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index c54270a6d457..27e8435ae779 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -28,7 +28,7 @@ struct mmc_bus_ops { int (*alive)(struct mmc_host *); int (*shutdown)(struct mmc_host *); int (*card_hw_reset)(struct mmc_card *); - int (*sw_reset)(struct mmc_host *); + int (*card_sw_reset)(struct mmc_card *); bool (*cache_enabled)(struct mmc_host *); int (*flush_cache)(struct mmc_host *); }; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 30242faf703e..e6460285b46b 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1154,8 +1154,10 @@ static int mmc_sdio_card_hw_reset(struct mmc_card *card) return mmc_sdio_reinit_card(host); } -static int mmc_sdio_sw_reset(struct mmc_host *host) +static int mmc_sdio_card_sw_reset(struct mmc_card *card) { + struct mmc_host *host = card->host; + mmc_set_clock(host, host->f_init); sdio_reset(host); mmc_go_idle(host); @@ -1176,7 +1178,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = { .runtime_resume = mmc_sdio_runtime_resume, .alive = mmc_sdio_alive, .card_hw_reset = mmc_sdio_card_hw_reset, - .sw_reset = mmc_sdio_sw_reset, + .card_sw_reset = mmc_sdio_card_sw_reset, }; From patchwork Mon Mar 21 11:50:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12787121 X-Patchwork-Delegate: geert@linux-m68k.org 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 405F3C433F5 for ; Mon, 21 Mar 2022 11:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346943AbiCULxT (ORCPT ); Mon, 21 Mar 2022 07:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346964AbiCULwv (ORCPT ); Mon, 21 Mar 2022 07:52:51 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B67615B068 for ; Mon, 21 Mar 2022 04:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=vgh5Qz7xpYNiUd NyatSDwqGUyPjgf/Bm/A5158qFWOI=; b=vY6NGv7en2Z3dynFbL7wGT+tMxsrxl ywAkLtcy7gYgI6AG4z3XCxcpLy7j7dewtEAUQg76MWAUlSshPl3M3fgVxrcV2yi8 KriuFDWUIOJnme7pJqiTDTBOnUho4O+0FB0SMQ9yZXnGlG6knp9gnv/bnC1Yayd6 GEQec/uZaFuDQ= Received: (qmail 860539 invoked from network); 21 Mar 2022 12:51:13 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 21 Mar 2022 12:51:13 +0100 X-UD-Smtp-Session: l3s3148p1@1Bn0HLnaFKcgAQnoAFxnAN8BywfgXJ9V From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , Ulf Hansson , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Jaehoon Chung , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chaotian Jing , Matthias Brugger , Adrian Hunter , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Kunihiko Hayashi , Masami Hiramatsu , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [RFC PATCH 10/10] mmc: improve API to make clear hw_reset callback is for cards Date: Mon, 21 Mar 2022 12:50:56 +0100 Message-Id: <20220321115059.21803-11-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> References: <20220321115059.21803-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org To make it unambiguous that the hw_reset callback is for cards and not for controllers, we add 'card' to the callback name and convert all users in one go. We keep the argument as mmc_host, though, because the callback is used very early when mmc_card is not yet populated. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 4 ++-- drivers/mmc/core/mmc.c | 4 ++-- drivers/mmc/host/bcm2835.c | 2 +- drivers/mmc/host/dw_mmc.c | 2 +- drivers/mmc/host/meson-mx-sdhc-mmc.c | 2 +- drivers/mmc/host/mtk-sd.c | 2 +- drivers/mmc/host/sdhci.c | 2 +- drivers/mmc/host/sunxi-mmc.c | 2 +- drivers/mmc/host/uniphier-sd.c | 2 +- include/linux/mmc/host.h | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 7e48570007f9..9b8455c6e0c3 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1989,9 +1989,9 @@ static void mmc_card_hw_reset_for_init(struct mmc_host *host) { mmc_pwrseq_reset(host); - if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) + if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->card_hw_reset) return; - host->ops->hw_reset(host); + host->ops->card_hw_reset(host); } /** diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 1857f398298b..9ea837e2c1ab 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2225,11 +2225,11 @@ static int _mmc_card_hw_reset(struct mmc_card *card) */ _mmc_flush_cache(host); - if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset && + if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset && mmc_can_reset(card)) { /* If the card accept RST_n signal, send it. */ mmc_set_clock(host, host->f_init); - host->ops->hw_reset(host); + host->ops->card_hw_reset(host); /* Set initial state and call mmc_set_ios */ mmc_set_initial_state(host); } else { diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 463b707d9e99..641ab4f42125 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -1259,7 +1259,7 @@ static void bcm2835_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) static const struct mmc_host_ops bcm2835_ops = { .request = bcm2835_request, .set_ios = bcm2835_set_ios, - .hw_reset = bcm2835_reset, + .card_hw_reset = bcm2835_reset, }; static int bcm2835_add_host(struct bcm2835_host *host) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 06dc56cbada8..581614196a84 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1812,7 +1812,7 @@ static const struct mmc_host_ops dw_mci_ops = { .set_ios = dw_mci_set_ios, .get_ro = dw_mci_get_ro, .get_cd = dw_mci_get_cd, - .hw_reset = dw_mci_hw_reset, + .card_hw_reset = dw_mci_hw_reset, .enable_sdio_irq = dw_mci_enable_sdio_irq, .ack_sdio_irq = dw_mci_ack_sdio_irq, .execute_tuning = dw_mci_execute_tuning, diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c index 28aa78aa08f3..e92e63cb5641 100644 --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c @@ -511,7 +511,7 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode) } static const struct mmc_host_ops meson_mx_sdhc_ops = { - .hw_reset = meson_mx_sdhc_hw_reset, + .card_hw_reset = meson_mx_sdhc_hw_reset, .request = meson_mx_sdhc_request, .set_ios = meson_mx_sdhc_set_ios, .card_busy = meson_mx_sdhc_card_busy, diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index e61b0b98065a..195dc897188b 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2458,7 +2458,7 @@ static const struct mmc_host_ops mt_msdc_ops = { .execute_tuning = msdc_execute_tuning, .prepare_hs400_tuning = msdc_prepare_hs400_tuning, .execute_hs400_tuning = msdc_execute_hs400_tuning, - .hw_reset = msdc_hw_reset, + .card_hw_reset = msdc_hw_reset, }; static const struct cqhci_host_ops msdc_cmdq_ops = { diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 07c6da1f2f0f..22152029e14c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2999,7 +2999,7 @@ static const struct mmc_host_ops sdhci_ops = { .set_ios = sdhci_set_ios, .get_cd = sdhci_get_cd, .get_ro = sdhci_get_ro, - .hw_reset = sdhci_hw_reset, + .card_hw_reset = sdhci_hw_reset, .enable_sdio_irq = sdhci_enable_sdio_irq, .ack_sdio_irq = sdhci_ack_sdio_irq, .start_signal_voltage_switch = sdhci_start_signal_voltage_switch, diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index c62afd212692..0e8fbf4957d8 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1115,7 +1115,7 @@ static const struct mmc_host_ops sunxi_mmc_ops = { .get_cd = mmc_gpio_get_cd, .enable_sdio_irq = sunxi_mmc_enable_sdio_irq, .start_signal_voltage_switch = sunxi_mmc_volt_switch, - .hw_reset = sunxi_mmc_hw_reset, + .card_hw_reset = sunxi_mmc_hw_reset, .card_busy = sunxi_mmc_card_busy, }; diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index ccbf9885a52b..3a8defdcca77 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -597,7 +597,7 @@ static int uniphier_sd_probe(struct platform_device *pdev) ret = PTR_ERR(priv->rst_hw); goto free_host; } - host->ops.hw_reset = uniphier_sd_hw_reset; + host->ops.card_hw_reset = uniphier_sd_hw_reset; } if (host->mmc->caps & MMC_CAP_UHS) { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 7afb57cab00b..c193c50ccd78 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -181,7 +181,7 @@ struct mmc_host_ops { unsigned int max_dtr, int host_drv, int card_drv, int *drv_type); /* Reset the eMMC card via RST_n */ - void (*hw_reset)(struct mmc_host *host); + void (*card_hw_reset)(struct mmc_host *host); void (*card_event)(struct mmc_host *host); /*