diff mbox series

[1/3] mmc: mmci: De-assert reset on probe

Message ID 20210619225118.1862634-1-linus.walleij@linaro.org
State New
Headers show
Series [1/3] mmc: mmci: De-assert reset on probe | expand

Commit Message

Linus Walleij June 19, 2021, 10:51 p.m. UTC
If we find a reset handle when probing the MMCI block,
make sure the reset is de-asserted. It could happen that
a hardware has reset asserted at boot.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Yann Gautier <yann.gautier@foss.st.com>
Cc: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/mmc/host/mmci.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.31.1

Comments

Ulf Hansson June 30, 2021, 10:18 a.m. UTC | #1
On Sun, 20 Jun 2021 at 00:53, Linus Walleij <linus.walleij@linaro.org> wrote:
>

> If we find a reset handle when probing the MMCI block,

> make sure the reset is de-asserted. It could happen that

> a hardware has reset asserted at boot.

>

> Cc: Russell King <linux@armlinux.org.uk>

> Cc: Yann Gautier <yann.gautier@foss.st.com>

> Cc: Ludovic Barre <ludovic.barre@st.com>

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

> ---

>  drivers/mmc/host/mmci.c | 4 ++++

>  1 file changed, 4 insertions(+)

>

> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c

> index 984d35055156..af2ed6013ef9 100644

> --- a/drivers/mmc/host/mmci.c

> +++ b/drivers/mmc/host/mmci.c

> @@ -2125,6 +2125,10 @@ static int mmci_probe(struct amba_device *dev,

>         if (IS_ERR(host->rst)) {

>                 ret = PTR_ERR(host->rst);

>                 goto clk_disable;

> +       } else {


You can skip this "else", as reset_control_deassert() copes with a
NULL pointer being passed to it.

> +               ret = reset_control_deassert(host->rst);

> +               if (ret)

> +                       dev_err(mmc_dev(mmc), "failed to de-assert reset\n");

>         }

>

>         /* Get regulators and the supported OCR mask */

> --

> 2.31.1

>


Kind regards
Uffe
diff mbox series

Patch

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 984d35055156..af2ed6013ef9 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -2125,6 +2125,10 @@  static int mmci_probe(struct amba_device *dev,
 	if (IS_ERR(host->rst)) {
 		ret = PTR_ERR(host->rst);
 		goto clk_disable;
+	} else {
+		ret = reset_control_deassert(host->rst);
+		if (ret)
+			dev_err(mmc_dev(mmc), "failed to de-assert reset\n");
 	}
 
 	/* Get regulators and the supported OCR mask */