* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
@ 2017-12-18 3:57 Chen-Yu Tsai
2017-12-18 11:05 ` Philipp Zabel
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chen-Yu Tsai @ 2017-12-18 3:57 UTC (permalink / raw)
To: linux-arm-kernel
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: <stable@vger.kernel.org> # 4.14.x
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
drivers/clk/sunxi/clk-sun9i-mmc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c
index a1a634253d6f..f00d8758ba24 100644
--- a/drivers/clk/sunxi/clk-sun9i-mmc.c
+++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
@@ -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)
--
2.15.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
2017-12-18 3:57 [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls Chen-Yu Tsai
@ 2017-12-18 11:05 ` Philipp Zabel
2017-12-18 11:59 ` Maxime Ripard
2017-12-18 21:07 ` Stephen Boyd
2 siblings, 0 replies; 6+ messages in thread
From: Philipp Zabel @ 2017-12-18 11:05 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2017-12-18 at 11:57 +0800, Chen-Yu Tsai wrote:
> 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: <stable@vger.kernel.org> # 4.14.x
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
2017-12-18 3:57 [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls Chen-Yu Tsai
2017-12-18 11:05 ` Philipp Zabel
@ 2017-12-18 11:59 ` Maxime Ripard
2017-12-18 21:07 ` Stephen Boyd
2 siblings, 0 replies; 6+ messages in thread
From: Maxime Ripard @ 2017-12-18 11:59 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 18, 2017 at 11:57:51AM +0800, Chen-Yu Tsai wrote:
> 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: <stable@vger.kernel.org> # 4.14.x
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks!
Maxime
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
2017-12-18 3:57 [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls Chen-Yu Tsai
2017-12-18 11:05 ` Philipp Zabel
2017-12-18 11:59 ` Maxime Ripard
@ 2017-12-18 21:07 ` Stephen Boyd
2017-12-19 8:32 ` Maxime Ripard
2 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2017-12-18 21:07 UTC (permalink / raw)
To: linux-arm-kernel
On 12/18, Chen-Yu Tsai wrote:
> 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: <stable@vger.kernel.org> # 4.14.x
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
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.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
2017-12-18 21:07 ` Stephen Boyd
@ 2017-12-19 8:32 ` Maxime Ripard
2017-12-19 19:51 ` Michael Turquette
0 siblings, 1 reply; 6+ messages in thread
From: Maxime Ripard @ 2017-12-19 8:32 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 18, 2017 at 01:07:09PM -0800, Stephen Boyd wrote:
> On 12/18, Chen-Yu Tsai wrote:
> > 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: <stable@vger.kernel.org> # 4.14.x
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
>
> 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
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls
2017-12-19 8:32 ` Maxime Ripard
@ 2017-12-19 19:51 ` Michael Turquette
0 siblings, 0 replies; 6+ messages in thread
From: Michael Turquette @ 2017-12-19 19:51 UTC (permalink / raw)
To: linux-arm-kernel
Quoting Maxime Ripard (2017-12-19 00:32:28)
> On Mon, Dec 18, 2017 at 01:07:09PM -0800, Stephen Boyd wrote:
> > On 12/18, Chen-Yu Tsai wrote:
> > > 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: <stable@vger.kernel.org> # 4.14.x
> > > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > > ---
> >
> > 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
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-12-19 19:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 3:57 [PATCH] clk: sunxi: sun9i-mmc: Implement reset callback for reset controls Chen-Yu Tsai
2017-12-18 11:05 ` Philipp Zabel
2017-12-18 11:59 ` Maxime Ripard
2017-12-18 21:07 ` Stephen Boyd
2017-12-19 8:32 ` Maxime Ripard
2017-12-19 19:51 ` Michael Turquette
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).