linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards
@ 2022-04-08  8:00 Wolfram Sang
  2022-04-08  8:00 ` [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-04-08  8:00 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Wolfram Sang, ath10k,
	bcm-kernel-feedback-list, brcm80211-dev-list.pdl, linux-amlogic,
	linux-arm-kernel, linux-kernel, linux-mediatek, linux-rpi-kernel,
	linux-sunxi, linux-wireless, netdev, SHA-cyfmac-dev-list

As discussed in 2020 [1], Ulf and I agreed that it would be easier to
understand the {h|s}w_reset mechanisms if it was clear that they are for
cards. This series implements that by changing the parameter to mmc_card
where apropriate. Also, the callback into host drivers has been renamed
to 'card_hw_reset' to make it obvious what exactly the driver is
expected to reset.

I tested it with my Renesas boards, so far no regressions. Buildbots are
currently checking the series.

This series is based on mmc/next as of yesterday. A branch is here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/mmc/reset-api-v2

Looking forward to comments. Happy hacking,

   Wolfram

[1] https://lore.kernel.org/all/20200916090121.2350-1-wsa+renesas@sang-engineering.com/

Wolfram Sang (3):
  mmc: core: improve API to make clear mmc_hw_reset is for cards
  mmc: core: improve API to make clear that mmc_sw_reset is for cards
  mmc: improve API to make clear hw_reset callback is for cards

 drivers/mmc/core/block.c                             |  2 +-
 drivers/mmc/core/core.c                              | 12 +++++++-----
 drivers/mmc/core/mmc.c                               |  4 ++--
 drivers/mmc/core/mmc_test.c                          |  3 +--
 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 +-
 drivers/net/wireless/ath/ath10k/sdio.c               |  2 +-
 .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  |  2 +-
 drivers/net/wireless/marvell/mwifiex/sdio.c          |  2 +-
 drivers/net/wireless/ti/wlcore/sdio.c                |  2 +-
 include/linux/mmc/core.h                             |  4 ++--
 include/linux/mmc/host.h                             |  2 +-
 17 files changed, 25 insertions(+), 24 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset is for cards
  2022-04-08  8:00 [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
@ 2022-04-08  8:00 ` Wolfram Sang
  2022-04-08  8:14   ` Kalle Valo
  2022-04-08  8:00 ` [PATCH 2/3] mmc: core: improve API to make clear that mmc_sw_reset " Wolfram Sang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2022-04-08  8:00 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Wolfram Sang, Ulf Hansson, Kalle Valo,
	David S. Miller, Jakub Kicinski, Paolo Abeni, Arend van Spriel,
	Franky Lin, Hante Meuleman, Amitkumar Karwar, Ganapathi Bhat,
	Sharvari Harisangam, Xinming Hu, linux-kernel, ath10k,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list

To make it unambiguous that mmc_hw_reset() is for cards and not for
controllers, we make the function argument mmc_card instead of mmc_host.
Also, all users are converted.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Ulf prefers one cross-subsystem patch to have all users converted. So,
we are looking for ACKs from the maintainers of the wireless drivers.
Thank you!

Changes since RFC:
* don't rename the function but only change the argument type
* remove fallback and convert all users in one go
* remove comment as suggested by Ulf

 drivers/mmc/core/block.c                                | 2 +-
 drivers/mmc/core/core.c                                 | 5 +++--
 drivers/mmc/core/mmc_test.c                             | 3 +--
 drivers/net/wireless/ath/ath10k/sdio.c                  | 2 +-
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
 drivers/net/wireless/marvell/mwifiex/sdio.c             | 2 +-
 drivers/net/wireless/ti/wlcore/sdio.c                   | 2 +-
 include/linux/mmc/core.h                                | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 9c009e820de4..b35e7a95798b 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -995,7 +995,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_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 61abae221623..6f2561469a8f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1998,7 +1998,7 @@ 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
+ * @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
@@ -2006,8 +2006,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_hw_reset(struct mmc_card *card)
 {
+	struct mmc_host *host = card->host;
 	int ret;
 
 	ret = host->bus_ops->hw_reset(host);
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index e6a2fd2c6d5c..8d9bceeff986 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_hw_reset(card);
 	if (!err) {
 		/*
 		 * Reset will re-enable the card's command queue, but tests
diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 63e1c2d783c5..73693c66cef1 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_hw_reset(ar_sdio->func->card);
 	if (ret)
 		ath10k_warn(ar, "unable to reset sdio: %d\n", ret);
 
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index ba3c159111d3..55285cad527f 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_hw_reset(sdiodev->func1->card);
 	sdio_release_host(sdiodev->func1);
 
 	brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index bde9e4bbfffe..4f3238d2a171 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_hw_reset(func->card);
 	sdio_release_host(func);
 
 	switch (ret) {
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 72fc41ac83c0..9140b0163474 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_hw_reset(card);
 
 	sdio_enable_func(func);
 	sdio_release_host(func);
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 71101d1ec825..de5c64bbdb72 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -175,7 +175,7 @@ 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_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);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] mmc: core: improve API to make clear that mmc_sw_reset is for cards
  2022-04-08  8:00 [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
  2022-04-08  8:00 ` [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
@ 2022-04-08  8:00 ` Wolfram Sang
  2022-04-08  8:00 ` [PATCH 3/3] mmc: improve API to make clear hw_reset callback " Wolfram Sang
  2022-04-08  9:05 ` [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset " Ulf Hansson
  3 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-04-08  8:00 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang, Ulf Hansson, linux-kernel

To make it unambiguous that mmc_sw_reset() is for cards and not for
controllers, we make the function argument mmc_card instead of mmc_host.
There are no users to convert currently.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Change since RFC:
* don't rename the function but only change the argument type

 drivers/mmc/core/core.c  | 3 ++-
 include/linux/mmc/core.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 6f2561469a8f..57c64c0583ac 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2020,8 +2020,9 @@ int mmc_hw_reset(struct mmc_card *card)
 }
 EXPORT_SYMBOL(mmc_hw_reset);
 
-int mmc_sw_reset(struct mmc_host *host)
+int mmc_sw_reset(struct mmc_card *card)
 {
+	struct mmc_host *host = card->host;
 	int ret;
 
 	if (!host->bus_ops->sw_reset)
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index de5c64bbdb72..6efec0b9820c 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_hw_reset(struct mmc_card *card);
-int mmc_sw_reset(struct mmc_host *host);
+int mmc_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 */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] mmc: improve API to make clear hw_reset callback is for cards
  2022-04-08  8:00 [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
  2022-04-08  8:00 ` [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
  2022-04-08  8:00 ` [PATCH 2/3] mmc: core: improve API to make clear that mmc_sw_reset " Wolfram Sang
@ 2022-04-08  8:00 ` Wolfram Sang
  2022-04-08  9:05 ` [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset " Ulf Hansson
  3 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-04-08  8:00 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Wolfram Sang, Ulf Hansson, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list,
	Nicolas Saenz Julienne, Jaehoon Chung, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Chaotian Jing,
	Matthias Brugger, Adrian Hunter, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Kunihiko Hayashi, Masami Hiramatsu, linux-kernel,
	linux-rpi-kernel, linux-arm-kernel, linux-amlogic,
	linux-mediatek, linux-sunxi

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 <wsa+renesas@sang-engineering.com>
---

Ulf: I really think the callback rename makes sense here to make it
obvious for driver authors that the card should be reset. Because we got
it wrong and at least bcm2835 has it also wrong, maybe meson as well.

 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 57c64c0583ac..8cc2b746414b 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1991,9 +1991,9 @@ static void mmc_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 1f22f1d2e9b8..9ab915b5737a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -2238,11 +2238,11 @@ static int _mmc_hw_reset(struct mmc_host *host)
 	 */
 	_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);
 
 	/*
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset is for cards
  2022-04-08  8:00 ` [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
@ 2022-04-08  8:14   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2022-04-08  8:14 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, linux-renesas-soc, Ulf Hansson, David S. Miller,
	Jakub Kicinski, Paolo Abeni, Arend van Spriel, Franky Lin,
	Hante Meuleman, Amitkumar Karwar, Ganapathi Bhat,
	Sharvari Harisangam, Xinming Hu, linux-kernel, ath10k,
	linux-wireless, netdev, brcm80211-dev-list.pdl,
	SHA-cyfmac-dev-list

Wolfram Sang <wsa+renesas@sang-engineering.com> writes:

> To make it unambiguous that mmc_hw_reset() is for cards and not for
> controllers, we make the function argument mmc_card instead of mmc_host.
> Also, all users are converted.
>
> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Ulf prefers one cross-subsystem patch to have all users converted. So,
> we are looking for ACKs from the maintainers of the wireless drivers.
> Thank you!
>
> Changes since RFC:
> * don't rename the function but only change the argument type
> * remove fallback and convert all users in one go
> * remove comment as suggested by Ulf
>
>  drivers/mmc/core/block.c                                | 2 +-
>  drivers/mmc/core/core.c                                 | 5 +++--
>  drivers/mmc/core/mmc_test.c                             | 3 +--
>  drivers/net/wireless/ath/ath10k/sdio.c                  | 2 +-
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
>  drivers/net/wireless/marvell/mwifiex/sdio.c             | 2 +-
>  drivers/net/wireless/ti/wlcore/sdio.c                   | 2 +-

For wireless:

Acked-by: Kalle Valo <kvalo@kernel.org>

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards
  2022-04-08  8:00 [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
                   ` (2 preceding siblings ...)
  2022-04-08  8:00 ` [PATCH 3/3] mmc: improve API to make clear hw_reset callback " Wolfram Sang
@ 2022-04-08  9:05 ` Ulf Hansson
  3 siblings, 0 replies; 6+ messages in thread
From: Ulf Hansson @ 2022-04-08  9:05 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, linux-renesas-soc, ath10k, bcm-kernel-feedback-list,
	brcm80211-dev-list.pdl, linux-amlogic, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-rpi-kernel, linux-sunxi,
	linux-wireless, netdev, SHA-cyfmac-dev-list

On Fri, 8 Apr 2022 at 10:01, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> As discussed in 2020 [1], Ulf and I agreed that it would be easier to
> understand the {h|s}w_reset mechanisms if it was clear that they are for
> cards. This series implements that by changing the parameter to mmc_card
> where apropriate. Also, the callback into host drivers has been renamed
> to 'card_hw_reset' to make it obvious what exactly the driver is
> expected to reset.
>
> I tested it with my Renesas boards, so far no regressions. Buildbots are
> currently checking the series.
>
> This series is based on mmc/next as of yesterday. A branch is here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/mmc/reset-api-v2
>
> Looking forward to comments. Happy hacking,
>
>    Wolfram
>
> [1] https://lore.kernel.org/all/20200916090121.2350-1-wsa+renesas@sang-engineering.com/
>
> Wolfram Sang (3):
>   mmc: core: improve API to make clear mmc_hw_reset is for cards
>   mmc: core: improve API to make clear that mmc_sw_reset is for cards
>   mmc: improve API to make clear hw_reset callback is for cards
>
>  drivers/mmc/core/block.c                             |  2 +-
>  drivers/mmc/core/core.c                              | 12 +++++++-----
>  drivers/mmc/core/mmc.c                               |  4 ++--
>  drivers/mmc/core/mmc_test.c                          |  3 +--
>  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 +-
>  drivers/net/wireless/ath/ath10k/sdio.c               |  2 +-
>  .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  |  2 +-
>  drivers/net/wireless/marvell/mwifiex/sdio.c          |  2 +-
>  drivers/net/wireless/ti/wlcore/sdio.c                |  2 +-
>  include/linux/mmc/core.h                             |  4 ++--
>  include/linux/mmc/host.h                             |  2 +-
>  17 files changed, 25 insertions(+), 24 deletions(-)
>

Patch 1 applied for fixes and the two others for next, thanks!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-08  9:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08  8:00 [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
2022-04-08  8:00 ` [PATCH 1/3] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
2022-04-08  8:14   ` Kalle Valo
2022-04-08  8:00 ` [PATCH 2/3] mmc: core: improve API to make clear that mmc_sw_reset " Wolfram Sang
2022-04-08  8:00 ` [PATCH 3/3] mmc: improve API to make clear hw_reset callback " Wolfram Sang
2022-04-08  9:05 ` [PATCH 0/3] mmc: improve API to make clear {h|s}w_reset " Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).