2016-10-31 02:49:50

by Jaehoon Chung

[permalink] [raw]
Subject: [PATCH 0/2] mmc: dw_mmc: fix the wrong operation for reset controller

This patch adds the "reset-names" as reset controller for dwmmc controller.
Linaro guys had reported the issue about booting stuck.

Some SoCs are enabled the CONFIG_RESET_CONTROLLER.
then dwmmc controller are waiting for getting reset controller.
But if doesn't define "resets" property in device-tree, it should be stuck.

If use the reset-names as reset controller for dwmmc controller,
it's more stable than now.
This commit is related with the below commit.

Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")

Jaehoon Chung (2):
Documentation: synopsys-dw-mshc: add binding for reset-names
mmc: dw_mmc: add the "reset" as name of reset controller

Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 +++++
drivers/mmc/host/dw_mmc.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)

--
2.10.1


2016-10-31 02:49:52

by Jaehoon Chung

[permalink] [raw]
Subject: [PATCH 1/2] Documentation: synopsys-dw-mshc: add binding for reset-names

Add reset-names property for binding dw-mmc controller.
It might be used together with "reset" property.
- Note: It must be "reset" as name.

Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")

Signed-off-by: Jaehoon Chung <[email protected]>
---
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
index 4e00e85..bfa461a 100644
--- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
@@ -43,6 +43,9 @@ Optional properties:
reset signal present internally in some host controller IC designs.
See Documentation/devicetree/bindings/reset/reset.txt for details.

+* reset-names: request name for using "resets" property. Must be "reset".
+ (It will be used together with "resets" property.)
+
* clocks: from common clock binding: handle to biu and ciu clocks for the
bus interface unit clock and the card interface unit clock.

@@ -103,6 +106,8 @@ board specific portions as listed below.
interrupts = <0 75 0>;
#address-cells = <1>;
#size-cells = <0>;
+ resets = <&rst 20>;
+ reset-names = "reset";
};

[board specific internal DMA resources]
--
2.10.1

2016-10-31 02:51:49

by Jaehoon Chung

[permalink] [raw]
Subject: [PATCH 2/2] mmc: dw_mmc: add the "reset" as name of reset controller

Add the "reset" as name of reset controller.
This is for preventing the wrong operation. Even if some SoC has reset
controller, doesn't define "resets" in device-tree.
Then it might be waiting for reset controller and it should be stuck.

Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")

Signed-off-by: Jaehoon Chung <[email protected]>
---
drivers/mmc/host/dw_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 1c9ee36..a16c537 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2940,7 +2940,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
return ERR_PTR(-ENOMEM);

/* find reset controller when exist */
- pdata->rstc = devm_reset_control_get_optional(dev, NULL);
+ pdata->rstc = devm_reset_control_get_optional(dev, "reset");
if (IS_ERR(pdata->rstc)) {
if (PTR_ERR(pdata->rstc) == -EPROBE_DEFER)
return ERR_PTR(-EPROBE_DEFER);
--
2.10.1

2016-11-01 21:56:03

by John Stultz

[permalink] [raw]
Subject: Re: [PATCH 0/2] mmc: dw_mmc: fix the wrong operation for reset controller

On Sun, Oct 30, 2016 at 7:49 PM, Jaehoon Chung <[email protected]> wrote:
> This patch adds the "reset-names" as reset controller for dwmmc controller.
> Linaro guys had reported the issue about booting stuck.
>
> Some SoCs are enabled the CONFIG_RESET_CONTROLLER.
> then dwmmc controller are waiting for getting reset controller.
> But if doesn't define "resets" property in device-tree, it should be stuck.
>
> If use the reset-names as reset controller for dwmmc controller,
> it's more stable than now.
> This commit is related with the below commit.
>
> Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")

So I wasn't hit by the issue, as I don't tend to boot from SD on my
hikey, but I did run these patches and I'm not seeing any issues with
my Android environment.

So for what its worth:
Acked-by: John Stultz <[email protected]>

thanks
-john

2016-11-03 05:19:20

by Jaehoon Chung

[permalink] [raw]
Subject: Re: [PATCH 0/2] mmc: dw_mmc: fix the wrong operation for reset controller

Hi,

On 11/02/2016 06:56 AM, John Stultz wrote:
> On Sun, Oct 30, 2016 at 7:49 PM, Jaehoon Chung <[email protected]> wrote:
>> This patch adds the "reset-names" as reset controller for dwmmc controller.
>> Linaro guys had reported the issue about booting stuck.
>>
>> Some SoCs are enabled the CONFIG_RESET_CONTROLLER.
>> then dwmmc controller are waiting for getting reset controller.
>> But if doesn't define "resets" property in device-tree, it should be stuck.
>>
>> If use the reset-names as reset controller for dwmmc controller,
>> it's more stable than now.
>> This commit is related with the below commit.
>>
>> Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")
>
> So I wasn't hit by the issue, as I don't tend to boot from SD on my
> hikey, but I did run these patches and I'm not seeing any issues with
> my Android environment.
>
> So for what its worth:
> Acked-by: John Stultz <[email protected]>

Applied on my repository (fixes branch).

Best Regards,
Jaehoon Chung

>
> thanks
> -john
>
>
>

2016-11-09 18:24:29

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 1/2] Documentation: synopsys-dw-mshc: add binding for reset-names

On Mon, Oct 31, 2016 at 11:49:41AM +0900, Jaehoon Chung wrote:
> Add reset-names property for binding dw-mmc controller.
> It might be used together with "reset" property.
> - Note: It must be "reset" as name.
>
> Fixes: d6786fefe816 ("mmc: dw_mmc: add reset support to dwmmc host controller")
>
> Signed-off-by: Jaehoon Chung <[email protected]>
> ---
> Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> index 4e00e85..bfa461a 100644
> --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
> @@ -43,6 +43,9 @@ Optional properties:
> reset signal present internally in some host controller IC designs.
> See Documentation/devicetree/bindings/reset/reset.txt for details.
>
> +* reset-names: request name for using "resets" property. Must be "reset".
> + (It will be used together with "resets" property.)

There is no point in having names for a single reset. This should be
fixed in the kernel only if this causes a problem.

Rob