diff mbox series

[PATCHv3,1/2] ARM64: dts: meson-gxbb-odroidc2: Fix usb phy reset warning

Message ID 20190129102521.4141-2-linux.amoon@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series Odroid c2 usb fixs | expand

Commit Message

Anand Moon Jan. 29, 2019, 10:25 a.m. UTC
Add missing vin-supply node 5.0V regulator setting to power
to usb ports, changes help fix the usb reset warning.

[  795.380156] usb 1-1.2: reset high-speed USB device number 3 using dwc2
[  798.356073] usb 1-1.2: reset high-speed USB device number 3 using dwc2
[  801.331999] usb 1-1.2: reset high-speed USB device number 3 using dwc2
[  804.307919] usb 1-1.2: reset high-speed USB device number 3 using dwc2
[  807.283844] usb 1-1.2: reset high-speed USB device number 3 using dwc2

Fixes: 5a0803bd5ae (ARM64: dts: meson-gxbb-odroidc2: Enable USB Nodes)
Tested-by: Kevin Hilman <khilman@baylibre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
changes from prevoius

 regulator                      use open bypass  opmode voltage current     min     max
---------------------------------------------------------------------------------------
 regulator-dummy                  5    4      0 unknown     0mV     0mA     0mV     0mV
    c9100000.usb                  1                                 0mA     0mV     0mV
    c9100000.usb                  1                                 0mA     0mV     0mV
    c9000000.usb                  1                                 0mA     0mV     0mV
    c9000000.usb                  1                                 0mA     0mV     0mV
 P5V0                             1    1      0 unknown  5000mV     0mA  5000mV  5000mV
    USB_OTG_PWR                   4    2      0 unknown  5000mV     0mA  5000mV  5000mV
       phy-c0000020.phy.1         2                                 0mA     0mV     0mV
       phy-c0000000.phy.0         2                                 0mA     0mV     0mV
--
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Martin Blumenstingl Feb. 4, 2019, 1:58 p.m. UTC | #1
Hi Anand,

On Tue, Jan 29, 2019 at 11:25 AM Anand Moon <linux.amoon@gmail.com> wrote:
>
> Add missing vin-supply node 5.0V regulator setting to power
> to usb ports, changes help fix the usb reset warning.
>
> [  795.380156] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> [  798.356073] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> [  801.331999] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> [  804.307919] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> [  807.283844] usb 1-1.2: reset high-speed USB device number 3 using dwc2
>
> Fixes: 5a0803bd5ae (ARM64: dts: meson-gxbb-odroidc2: Enable USB Nodes)
> Tested-by: Kevin Hilman <khilman@baylibre.com>
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Cc: Jerome Brunet <jbrunet@baylibre.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> changes from prevoius
>
>  regulator                      use open bypass  opmode voltage current     min     max
> ---------------------------------------------------------------------------------------
>  regulator-dummy                  5    4      0 unknown     0mV     0mA     0mV     0mV
>     c9100000.usb                  1                                 0mA     0mV     0mV
>     c9100000.usb                  1                                 0mA     0mV     0mV
>     c9000000.usb                  1                                 0mA     0mV     0mV
>     c9000000.usb                  1                                 0mA     0mV     0mV
>  P5V0                             1    1      0 unknown  5000mV     0mA  5000mV  5000mV
>     USB_OTG_PWR                   4    2      0 unknown  5000mV     0mA  5000mV  5000mV
>        phy-c0000020.phy.1         2                                 0mA     0mV     0mV
>        phy-c0000000.phy.0         2                                 0mA     0mV     0mV
> --
> ---
>  arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> index 2e1cd5e3a246..da729ed00408 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> @@ -28,6 +28,13 @@
>                 reg = <0x0 0x0 0x0 0x80000000>;
>         };
>
> +       p5v0: regulator-p5v0 {
> +               compatible = "regulator-fixed";
> +               regulator-name = "P5V0";
> +               regulator-min-microvolt = <5000000>;
> +               regulator-max-microvolt = <5000000>;
> +       };
> +
>         usb_otg_pwr: regulator-usb-pwrs {
>                 compatible = "regulator-fixed";
>
> @@ -36,6 +43,8 @@
>                 regulator-min-microvolt = <5000000>;
>                 regulator-max-microvolt = <5000000>;
>
> +               vin-supply = <&p5v0>;
did you find out why this patch fixes the USB_OTG_PWR regulator?
based on just reading the patch I can't find an explanation myself

have you tested without this patch to rule out that you hit some bug
in the regulator framework back when you wrote the patch?
(I don't have an Odroid-C2 so I can't test this myself).


Regards
Martin
Anand Moon Feb. 4, 2019, 8:04 p.m. UTC | #2
Hi Martin,

Thanks for your review comments.

On Mon, 4 Feb 2019 at 19:29, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand,
>
> On Tue, Jan 29, 2019 at 11:25 AM Anand Moon <linux.amoon@gmail.com> wrote:
> >
> > Add missing vin-supply node 5.0V regulator setting to power
> > to usb ports, changes help fix the usb reset warning.
> >
> > [  795.380156] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> > [  798.356073] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> > [  801.331999] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> > [  804.307919] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> > [  807.283844] usb 1-1.2: reset high-speed USB device number 3 using dwc2
> >
> > Fixes: 5a0803bd5ae (ARM64: dts: meson-gxbb-odroidc2: Enable USB Nodes)
> > Tested-by: Kevin Hilman <khilman@baylibre.com>
> > Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > Cc: Jerome Brunet <jbrunet@baylibre.com>
> > Cc: Neil Armstrong <narmstrong@baylibre.com>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> > changes from prevoius
> >
> >  regulator                      use open bypass  opmode voltage current     min     max
> > ---------------------------------------------------------------------------------------
> >  regulator-dummy                  5    4      0 unknown     0mV     0mA     0mV     0mV
> >     c9100000.usb                  1                                 0mA     0mV     0mV
> >     c9100000.usb                  1                                 0mA     0mV     0mV
> >     c9000000.usb                  1                                 0mA     0mV     0mV
> >     c9000000.usb                  1                                 0mA     0mV     0mV
> >  P5V0                             1    1      0 unknown  5000mV     0mA  5000mV  5000mV
> >     USB_OTG_PWR                   4    2      0 unknown  5000mV     0mA  5000mV  5000mV
> >        phy-c0000020.phy.1         2                                 0mA     0mV     0mV
> >        phy-c0000000.phy.0         2                                 0mA     0mV     0mV
> > --
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> > index 2e1cd5e3a246..da729ed00408 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> > +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
> > @@ -28,6 +28,13 @@
> >                 reg = <0x0 0x0 0x0 0x80000000>;
> >         };
> >
> > +       p5v0: regulator-p5v0 {
> > +               compatible = "regulator-fixed";
> > +               regulator-name = "P5V0";
> > +               regulator-min-microvolt = <5000000>;
> > +               regulator-max-microvolt = <5000000>;
> > +       };
> > +
> >         usb_otg_pwr: regulator-usb-pwrs {
> >                 compatible = "regulator-fixed";
> >
> > @@ -36,6 +43,8 @@
> >                 regulator-min-microvolt = <5000000>;
> >                 regulator-max-microvolt = <5000000>;
> >
> > +               vin-supply = <&p5v0>;
> did you find out why this patch fixes the USB_OTG_PWR regulator?
> based on just reading the patch I can't find an explanation myself
>

As per the device tree binding we need this setting to enable power input source
[0] Documentation/devicetree/bindings/regulator/fixed-regulator.txt

*I have observed few more place where this setting is missing*

> have you tested without this patch to rule out that you hit some bug
> in the regulator framework back when you wrote the patch?
> (I don't have an Odroid-C2 so I can't test this myself).
>

Yes I have tested this patch.Some device like usb camera and usb hard drive
when connected to usb port will generate warning message.
which shows us that not enough power is being set to the port.

>
> Regards
> Martin

Best Regards



-Anand
Martin Blumenstingl Feb. 4, 2019, 8:49 p.m. UTC | #3
Hi Anand,

On Mon, Feb 4, 2019 at 9:04 PM Anand Moon <linux.amoon@gmail.com> wrote:
[...]
> > > @@ -36,6 +43,8 @@
> > >                 regulator-min-microvolt = <5000000>;
> > >                 regulator-max-microvolt = <5000000>;
> > >
> > > +               vin-supply = <&p5v0>;
> > did you find out why this patch fixes the USB_OTG_PWR regulator?
> > based on just reading the patch I can't find an explanation myself
> >
>
> As per the device tree binding we need this setting to enable power input source
> [0] Documentation/devicetree/bindings/regulator/fixed-regulator.txt
>
> *I have observed few more place where this setting is missing*
OK, I understand that we should describe the hierarchy of the regulators

> > have you tested without this patch to rule out that you hit some bug
> > in the regulator framework back when you wrote the patch?
> > (I don't have an Odroid-C2 so I can't test this myself).
> >
>
> Yes I have tested this patch.Some device like usb camera and usb hard drive
> when connected to usb port will generate warning message.
> which shows us that not enough power is being set to the port.
I don't understand why adding "p5v0" as parent of "usb_otg_pwr"
changes the output of "usb_otg_pwr":
- "p5v0" is a fixed regulator which cannot be controlled at all (apart
from removing power from it)
- "usb_otg_pwr" does not have any current limits set inside the .dts
- "usb_otg_pwr" has the same fixed voltage as the new "p5v0" regulator

what are your steps-to-reproduce for your original issue ("reset
high-speed USB device number 3 using dwc2")?


Regards
Martin
Anand Moon Feb. 5, 2019, 7:53 p.m. UTC | #4
hi Martin,

On Tue, 5 Feb 2019 at 02:19, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand,
>
> On Mon, Feb 4, 2019 at 9:04 PM Anand Moon <linux.amoon@gmail.com> wrote:
> [...]
> > > > @@ -36,6 +43,8 @@
> > > >                 regulator-min-microvolt = <5000000>;
> > > >                 regulator-max-microvolt = <5000000>;
> > > >
> > > > +               vin-supply = <&p5v0>;
> > > did you find out why this patch fixes the USB_OTG_PWR regulator?
> > > based on just reading the patch I can't find an explanation myself
> > >
> >
> > As per the device tree binding we need this setting to enable power input source
> > [0] Documentation/devicetree/bindings/regulator/fixed-regulator.txt
> >
> > *I have observed few more place where this setting is missing*
> OK, I understand that we should describe the hierarchy of the regulators
>
> > > have you tested without this patch to rule out that you hit some bug
> > > in the regulator framework back when you wrote the patch?
> > > (I don't have an Odroid-C2 so I can't test this myself).
> > >
> >
> > Yes I have tested this patch.Some device like usb camera and usb hard drive
> > when connected to usb port will generate warning message.
> > which shows us that not enough power is being set to the port.
> I don't understand why adding "p5v0" as parent of "usb_otg_pwr"
> changes the output of "usb_otg_pwr":
> - "p5v0" is a fixed regulator which cannot be controlled at all (apart
> from removing power from it)
> - "usb_otg_pwr" does not have any current limits set inside the .dts
> - "usb_otg_pwr" has the same fixed voltage as the new "p5v0" regulator
>
> what are your steps-to-reproduce for your original issue ("reset
> high-speed USB device number 3 using dwc2")?
>

I have tried to reproduce this but some how I cannot get the logs
I might have enable some more debug options to reproduce but currently
it's lost.
because of over flashing of the operating system on sdcards.

But definitely this fix the power issue needed to get usb-storage
device to work on Odroid c1/c2 boards.

>
> Regards
> Martin

Best Regards

-Anand
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index 2e1cd5e3a246..da729ed00408 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -28,6 +28,13 @@ 
 		reg = <0x0 0x0 0x0 0x80000000>;
 	};
 
+	p5v0: regulator-p5v0 {
+		compatible = "regulator-fixed";
+		regulator-name = "P5V0";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	};
+
 	usb_otg_pwr: regulator-usb-pwrs {
 		compatible = "regulator-fixed";
 
@@ -36,6 +43,8 @@ 
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 
+		vin-supply = <&p5v0>;
+
 		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};