Message ID | 20190625100412.11815-1-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ARM: imx25: provide a fixed regulator for usb phys | expand |
Hello! On 25.06.2019 13:04, Uwe Kleine-König wrote: > The usb phys are internal to the SoC and so it their 5V supply. With s/it/is/? > this regulator added explicitly the following (harmless) boot messages > go away: > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > Hello, > > note I'm an USB noob, so please consider carefully before applying :-) > I also put the regulator near the usbphy node instead of in alphabetic > order. Not sure what is sensible/usual here, too. > > Best regards > Uwe > > arch/arm/boot/dts/imx25.dtsi | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi > --- a/arch/arm/boot/dts/imx25.dtsi > +++ b/arch/arm/boot/dts/imx25.dtsi > @@ -614,6 +614,11 @@ > }; > }; > > + reg_usb: regulator_usbphy { Hyphens are preferred to underscores in the prop names. > + compatible = "regulator-fixed"; > + regulator-name = "usb-phy supply"; > + }; > + [...] MBR, Sergei
> Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > The usb phys are internal to the SoC and so it their 5V supply. With this regulator > added explicitly the following (harmless) boot messages go away: > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not > found, using dummy regulator > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not > found, using dummy regulator > To eliminate the warning message, I suggest doing below changes, as vcc supply is not mandatory. diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, } } - nop->vcc = devm_regulator_get(dev, "vcc"); + nop->vcc = devm_regulator_get_optional(dev, "vcc"); if (IS_ERR(nop->vcc)) { dev_dbg(dev, "Error getting vcc regulator: %ld\n", PTR_ERR(nop->vcc)); Peter > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > Hello, > > note I'm an USB noob, so please consider carefully before applying :-) I also put the > regulator near the usbphy node instead of in alphabetic order. Not sure what is > sensible/usual here, too. > > Best regards > Uwe > > arch/arm/boot/dts/imx25.dtsi | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi > --- a/arch/arm/boot/dts/imx25.dtsi > +++ b/arch/arm/boot/dts/imx25.dtsi > @@ -614,6 +614,11 @@ > }; > }; > > + reg_usb: regulator_usbphy { > + compatible = "regulator-fixed"; > + regulator-name = "usb-phy supply"; > + }; > + > usbphy { > compatible = "simple-bus"; > #address-cells = <1>; > @@ -623,12 +630,14 @@ > reg = <0>; > compatible = "usb-nop-xceiv"; > #phy-cells = <0>; > + vcc-supply = <®_usb>; > }; > > usbphy1: usb-phy@1 { > reg = <1>; > compatible = "usb-nop-xceiv"; > #phy-cells = <0>; > + vcc-supply = <®_usb>; > }; > }; > }; > -- > 2.20.1
On 19-06-26 02:40, Peter Chen wrote: > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > The usb phys are internal to the SoC and so it their 5V supply. With this regulator > > added explicitly the following (harmless) boot messages go away: > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not > > found, using dummy regulator > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not > > found, using dummy regulator > > > > To eliminate the warning message, I suggest doing below changes, as vcc > supply is not mandatory. > > diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c > index a53b89be5324..01a5ff1a0515 100644 > --- a/drivers/usb/phy/phy-generic.c > +++ b/drivers/usb/phy/phy-generic.c > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, > } > } > > - nop->vcc = devm_regulator_get(dev, "vcc"); > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's approach. Regards, Marco > if (IS_ERR(nop->vcc)) { > dev_dbg(dev, "Error getting vcc regulator: %ld\n", > PTR_ERR(nop->vcc)); > > Peter > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > --- > > Hello, > > > > note I'm an USB noob, so please consider carefully before applying :-) I also put the > > regulator near the usbphy node instead of in alphabetic order. Not sure what is > > sensible/usual here, too. > > > > Best regards > > Uwe > > > > arch/arm/boot/dts/imx25.dtsi | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi > > --- a/arch/arm/boot/dts/imx25.dtsi > > +++ b/arch/arm/boot/dts/imx25.dtsi > > @@ -614,6 +614,11 @@ > > }; > > }; > > > > + reg_usb: regulator_usbphy { > > + compatible = "regulator-fixed"; > > + regulator-name = "usb-phy supply"; > > + }; > > + > > usbphy { > > compatible = "simple-bus"; > > #address-cells = <1>; > > @@ -623,12 +630,14 @@ > > reg = <0>; > > compatible = "usb-nop-xceiv"; > > #phy-cells = <0>; > > + vcc-supply = <®_usb>; > > }; > > > > usbphy1: usb-phy@1 { > > reg = <1>; > > compatible = "usb-nop-xceiv"; > > #phy-cells = <0>; > > + vcc-supply = <®_usb>; > > }; > > }; > > }; > > -- > > 2.20.1 >
> On 19-06-26 02:40, Peter Chen wrote: > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > this regulator added explicitly the following (harmless) boot messages go away: > > > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not > > > found, using dummy regulator > > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not > > > found, using dummy regulator > > > > > > > To eliminate the warning message, I suggest doing below changes, as > > vcc supply is not mandatory. > > > > diff --git a/drivers/usb/phy/phy-generic.c > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 > > 100644 > > --- a/drivers/usb/phy/phy-generic.c > > +++ b/drivers/usb/phy/phy-generic.c > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct > usb_phy_generic *nop, > > } > > } > > > > - nop->vcc = devm_regulator_get(dev, "vcc"); > > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's > approach. > Add Felipe. Some USB PHY's power are from the core system's power (eg, DDR), and some are fixed at the board and no switch for it. So, it is transparent for software at some cases. Peter > Regards, > Marco > > > if (IS_ERR(nop->vcc)) { > > dev_dbg(dev, "Error getting vcc regulator: %ld\n", > > PTR_ERR(nop->vcc)); > > > > Peter > > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > > --- > > > Hello, > > > > > > note I'm an USB noob, so please consider carefully before applying > > > :-) I also put the regulator near the usbphy node instead of in > > > alphabetic order. Not sure what is sensible/usual here, too. > > > > > > Best regards > > > Uwe > > > > > > arch/arm/boot/dts/imx25.dtsi | 9 +++++++++ > > > 1 file changed, 9 insertions(+) > > > > > > diff --git a/arch/arm/boot/dts/imx25.dtsi > > > b/arch/arm/boot/dts/imx25.dtsi > > > --- a/arch/arm/boot/dts/imx25.dtsi > > > +++ b/arch/arm/boot/dts/imx25.dtsi > > > @@ -614,6 +614,11 @@ > > > }; > > > }; > > > > > > + reg_usb: regulator_usbphy { > > > + compatible = "regulator-fixed"; > > > + regulator-name = "usb-phy supply"; > > > + }; > > > + > > > usbphy { > > > compatible = "simple-bus"; > > > #address-cells = <1>; > > > @@ -623,12 +630,14 @@ > > > reg = <0>; > > > compatible = "usb-nop-xceiv"; > > > #phy-cells = <0>; > > > + vcc-supply = <®_usb>; > > > }; > > > > > > usbphy1: usb-phy@1 { > > > reg = <1>; > > > compatible = "usb-nop-xceiv"; > > > #phy-cells = <0>; > > > + vcc-supply = <®_usb>; > > > }; > > > }; > > > }; > > > -- > > > 2.20.1 > > > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pengutro > nix.de%2F&data=02%7C01%7Cpeter.chen%40nxp.com%7Cd1a839827b3a49 > 0624f508d6f9fab73f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63 > 6971252538657445&sdata=kfTeGJ99AfS74BqdRAOLVJm52jIFIdNmZXXYPX > SzAcA%3D&reserved=0 | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Hello, On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote: > > > On 19-06-26 02:40, Peter Chen wrote: > > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > > this regulator added explicitly the following (harmless) boot messages go away: > > > > > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator > > > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator > > > > > > > > > > To eliminate the warning message, I suggest doing below changes, as > > > vcc supply is not mandatory. > > > > > > diff --git a/drivers/usb/phy/phy-generic.c > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 > > > 100644 > > > --- a/drivers/usb/phy/phy-generic.c > > > +++ b/drivers/usb/phy/phy-generic.c > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, > > > } > > > } > > > > > > - nop->vcc = devm_regulator_get(dev, "vcc"); > > > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); > > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's > > approach. > > > > Add Felipe. > > Some USB PHY's power are from the core system's power (eg, DDR), and some are > fixed at the board and no switch for it. So, it is transparent for software at some cases. It's not clear to me how to proceed. There are two opposing opinions and I don't know enough about USB on mx25 to judge myself. Felipe? Best regards Uwe
On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote: > Hello, > > On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote: > > > > > On 19-06-26 02:40, Peter Chen wrote: > > > > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > > > this regulator added explicitly the following (harmless) boot messages go away: > > > > > > > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator > > > > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator > > > > > > > > > > > > > To eliminate the warning message, I suggest doing below changes, as > > > > vcc supply is not mandatory. > > > > > > > > diff --git a/drivers/usb/phy/phy-generic.c > > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 > > > > 100644 > > > > --- a/drivers/usb/phy/phy-generic.c > > > > +++ b/drivers/usb/phy/phy-generic.c > > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, > > > > } > > > > } > > > > > > > > - nop->vcc = devm_regulator_get(dev, "vcc"); > > > > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); > > > > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's > > > approach. > > > > > > > Add Felipe. > > > > Some USB PHY's power are from the core system's power (eg, DDR), and some are > > fixed at the board and no switch for it. So, it is transparent for software at some cases. > > It's not clear to me how to proceed. There are two opposing opinions and > I don't know enough about USB on mx25 to judge myself. > > Felipe? This thread is still open in my inbox. Felipe, how can I lure you into giving your opinion? My original suggestion can be seen at https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/, Peter's alternative is still in the quotes above. Which is the right/better one? Best regards and thanks, Uwe
Hello, On Mon, Sep 23, 2019 at 12:28:25PM +0200, Uwe Kleine-König wrote: > On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote: > > On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote: > > > > > > > On 19-06-26 02:40, Peter Chen wrote: > > > > > > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > > > > this regulator added explicitly the following (harmless) boot messages go away: > > > > > > > > > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator > > > > > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator > > > > > > > > > > > > > > > > To eliminate the warning message, I suggest doing below changes, as > > > > > vcc supply is not mandatory. > > > > > > > > > > diff --git a/drivers/usb/phy/phy-generic.c > > > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 > > > > > 100644 > > > > > --- a/drivers/usb/phy/phy-generic.c > > > > > +++ b/drivers/usb/phy/phy-generic.c > > > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, > > > > > } > > > > > } > > > > > > > > > > - nop->vcc = devm_regulator_get(dev, "vcc"); > > > > > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); > > > > > > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's > > > > approach. > > > > > > > > > > Add Felipe. > > > > > > Some USB PHY's power are from the core system's power (eg, DDR), and some are > > > fixed at the board and no switch for it. So, it is transparent for software at some cases. > > > > It's not clear to me how to proceed. There are two opposing opinions and > > I don't know enough about USB on mx25 to judge myself. > > > > Felipe? > > This thread is still open in my inbox. Felipe, how can I lure you into > giving your opinion? > > My original suggestion can be seen at > https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/, > Peter's alternative is still in the quotes above. Which is the > right/better one? The stuff said above is still true. I'd like to put this issue on file with "fixed in mainline", but currently this seems to be a stalemate. because nobody cares enough :-| Best regards Uwe
On Fri, Nov 15, 2019 at 10:07:57AM +0100, Uwe Kleine-König wrote: > Hello, > > On Mon, Sep 23, 2019 at 12:28:25PM +0200, Uwe Kleine-König wrote: > > On Wed, Jul 24, 2019 at 03:09:39PM +0200, Uwe Kleine-König wrote: > > > On Thu, Jun 27, 2019 at 03:15:10AM +0000, Peter Chen wrote: > > > > > > > > > On 19-06-26 02:40, Peter Chen wrote: > > > > > > > > > > > > > Subject: [PATCH] ARM: imx25: provide a fixed regulator for usb phys > > > > > > > > > > > > > > The usb phys are internal to the SoC and so it their 5V supply. With > > > > > > > this regulator added explicitly the following (harmless) boot messages go away: > > > > > > > > > > > > > > usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator > > > > > > > usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator > > > > > > > > > > > > > > > > > > > To eliminate the warning message, I suggest doing below changes, as > > > > > > vcc supply is not mandatory. > > > > > > > > > > > > diff --git a/drivers/usb/phy/phy-generic.c > > > > > > b/drivers/usb/phy/phy-generic.c index a53b89be5324..01a5ff1a0515 > > > > > > 100644 > > > > > > --- a/drivers/usb/phy/phy-generic.c > > > > > > +++ b/drivers/usb/phy/phy-generic.c > > > > > > @@ -275,7 +275,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, > > > > > > } > > > > > > } > > > > > > > > > > > > - nop->vcc = devm_regulator_get(dev, "vcc"); > > > > > > + nop->vcc = devm_regulator_get_optional(dev, "vcc"); > > > > > > > > > > Is the regulator optional? IMHO this shouldn't be the fix. I think the right fix is Uwe's > > > > > approach. > > > > > > > > > > > > > Add Felipe. > > > > > > > > Some USB PHY's power are from the core system's power (eg, DDR), and some are > > > > fixed at the board and no switch for it. So, it is transparent for software at some cases. > > > > > > It's not clear to me how to proceed. There are two opposing opinions and > > > I don't know enough about USB on mx25 to judge myself. > > > > > > Felipe? > > > > This thread is still open in my inbox. Felipe, how can I lure you into > > giving your opinion? > > > > My original suggestion can be seen at > > https://lore.kernel.org/linux-usb/20190625100412.11815-1-u.kleine-koenig@pengutronix.de/, > > Peter's alternative is still in the quotes above. Which is the > > right/better one? > > The stuff said above is still true. I'd like to put this issue on file > with "fixed in mainline", but currently this seems to be a stalemate. > because nobody cares enough :-| This topic is on stall since two years now and I still have the patch in the patch stack for my mx25 boards. In my eyes my patch is the right one, because no matter how, the usb phys need some powering, so devm_regulator_get_optional() doesn't seem to be the right approach. Would resending the patch help? Best regards Uwe
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi --- a/arch/arm/boot/dts/imx25.dtsi +++ b/arch/arm/boot/dts/imx25.dtsi @@ -614,6 +614,11 @@ }; }; + reg_usb: regulator_usbphy { + compatible = "regulator-fixed"; + regulator-name = "usb-phy supply"; + }; + usbphy { compatible = "simple-bus"; #address-cells = <1>; @@ -623,12 +630,14 @@ reg = <0>; compatible = "usb-nop-xceiv"; #phy-cells = <0>; + vcc-supply = <®_usb>; }; usbphy1: usb-phy@1 { reg = <1>; compatible = "usb-nop-xceiv"; #phy-cells = <0>; + vcc-supply = <®_usb>; }; }; };
The usb phys are internal to the SoC and so it their 5V supply. With this regulator added explicitly the following (harmless) boot messages go away: usb_phy_generic usbphy:usb-phy@0: usbphy:usb-phy@0 supply vcc not found, using dummy regulator usb_phy_generic usbphy:usb-phy@1: usbphy:usb-phy@1 supply vcc not found, using dummy regulator Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- Hello, note I'm an USB noob, so please consider carefully before applying :-) I also put the regulator near the usbphy node instead of in alphabetic order. Not sure what is sensible/usual here, too. Best regards Uwe arch/arm/boot/dts/imx25.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)