Skip to contentSkip to conversation

clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

PATCH New Chen-Yu Tsai 5 participants 6 messages Dec 18, 2017 – Dec 19, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x
---
 drivers/clk/sunxi/clk-sun9i-mmc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/clk/sunxi/clk-sun9i-mmc.c +12 -0
index a1a634253d6f..f00d8758ba24 100644
@@ -16,6 +16,7 @@
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -83,9 +84,20 @@ static int sun9i_mmc_reset_deassert(struct reset_controller_dev *rcdev,
 	return 0;
 }
 
+static int sun9i_mmc_reset_reset(struct reset_controller_dev *rcdev,
+				 unsigned long id)
+{
+	sun9i_mmc_reset_assert(rcdev, id);
+	udelay(10);
+	sun9i_mmc_reset_deassert(rcdev, id);
+
+	return 0;
+}
+
 static const struct reset_control_ops sun9i_mmc_reset_ops = {
 	.assert		= sun9i_mmc_reset_assert,
 	.deassert	= sun9i_mmc_reset_deassert,
+	.reset		= sun9i_mmc_reset_reset,
 };
 
 static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
Signature · 1 line
2.15.0
#1 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

Quoted 11 lines · Chen-Yu Tsai

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x

regards
Philipp

#2 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

In reply to Chen-Yu Tsai
Quoted 11 lines · Chen-Yu Tsai

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171218/5ca01503/attachment.sig>
#3 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

In reply to Chen-Yu Tsai
Quoted 5 lines · Chen-Yu Tsai

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

Quoted 7 lines

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x

---

Did you want us to pick this up into clk-fixes? It seems to be causing MMC to not work for some time? That sounds annoying enough.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#4 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

Quoted 9 lines · Stephen Boyd
Quoted 8 lines · Chen-Yu Tsai

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Quoted 8 lines
Quoted 4 lines
Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x

---

Did you want us to pick this up into clk-fixes? It seems to be causing MMC to not work for some time? That sounds annoying enough.

That would be great, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171219/86f9bd6a/attachment.sig>
#5 lore raw

PATCH 1/1 clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

Quoting Maxime Ripard (2017-12-19 00:32:28)

Quoted 15 lines · Stephen Boyd
Quoted 14 lines · Chen-Yu Tsai
Quoted 12 lines

Our MMC host driver now issues a reset, instead of just deasserting the reset control, since commit c34eda69ad4c ("mmc: sunxi: Reset the device at probe time"). The sun9i-mmc clock driver does not support this, and will fail, which results in MMC not probing.

This patch implements the reset callback by asserting the reset control, then deasserting it after a small delay.

Fixes 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
Cc <[email protected]> # 4.14.x

---

Quoted 5 lines
Quoted 3 lines

Did you want us to pick this up into clk-fixes? It seems to be causing MMC to not work for some time? That sounds annoying enough.

That would be great, thanks!

Applied to clk-fixes.

Regards,
Mike

Quoted 6 lines

Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com