Re: [PATCH v15 2/7] power: add power sequence library

2017-06-18 Thread Peter Chen
On Thu, Jun 15, 2017 at 06:06:04PM +0800, Peter Chen wrote: > On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > > On 15 June 2017 at 11:11, Peter Chen wrote: > > > On Thu, Jun 15, 2017 at 10:11:45AM +0200, Ulf Hansson wrote: > > >> > Yes, you

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > On 15 June 2017 at 11:11, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Thu, Jun 15, 2017 at 10:11:45AM +0200, Ulf Hansson wrote: > >> > Yes, you are right. This is the limitation for this po

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Thu, Jun 15, 2017 at 11:35:20AM +0200, Ulf Hansson wrote: > On 15 June 2017 at 11:11, Peter Chen wrote: > > On Thu, Jun 15, 2017 at 10:11:45AM +0200, Ulf Hansson wrote: > >> > Yes, you are right. This is the limitation for this power sequence > >> > library, t

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
ail, won't it? > > > > Yes, you are right, thanks for pointing that, I will add mutex_lock for > > of_pwrseq_on. > > Another option is to entirely skip to two step approach. > > In other words, make the library to cope with multiple users via the > same registered library instance. > No, the pwrseq instance stores dtb information (clock, gpio, etc), it needs to be per device. -- Best Regards, Peter Chen

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
ail, won't it? > > > > Yes, you are right, thanks for pointing that, I will add mutex_lock for > > of_pwrseq_on. > > Another option is to entirely skip to two step approach. > > In other words, make the library to cope with multiple users via the > same registered library instance. > No, the pwrseq instance stores dtb information (clock, gpio, etc), it needs to be per device. -- Best Regards, Peter Chen

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Wed, Jun 14, 2017 at 10:53:29AM +0200, Ulf Hansson wrote: > On 14 June 2017 at 03:53, Peter Chen <hzpeterc...@gmail.com> wrote: > > On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote: > >> [...] > >> > >> > + > >> > +/** > &g

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-15 Thread Peter Chen
On Wed, Jun 14, 2017 at 10:53:29AM +0200, Ulf Hansson wrote: > On 14 June 2017 at 03:53, Peter Chen wrote: > > On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote: > >> [...] > >> > >> > + > >> > +/** > >> >

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-13 Thread Peter Chen
ances needs to be registered an > early boot level, to be safe. To me, that seems like poor design > choice. > > Otherwise I think this looks okay to me. > -- Best Regards, Peter Chen

Re: [PATCH v15 2/7] power: add power sequence library

2017-06-13 Thread Peter Chen
ances needs to be registered an > early boot level, to be safe. To me, that seems like poor design > choice. > > Otherwise I think this looks okay to me. > -- Best Regards, Peter Chen

[PATCH v15 2/7] power: add power sequence library

2017-06-12 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen <peter.c...@nxp.com> Tested-by: Maciej S. Szmigi

[PATCH v15 4/7] usb: core: add power sequence handling for USB devices

2017-06-12 Thread Peter Chen
-off-by: Peter Chen <peter.c...@nxp.com> Tested-by Joshua Clayton <stillcompil...@gmail.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Reviewed-by: Vaibhav Hiremath <hvaibhav.li...@gmail.com> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- drivers/

[PATCH v15 2/7] power: add power sequence library

2017-06-12 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen Tested-by: Maciej S. Szmigiero Tested-by Joshua Clayton Reviewed

[PATCH v15 4/7] usb: core: add power sequence handling for USB devices

2017-06-12 Thread Peter Chen
-off-by: Peter Chen Tested-by Joshua Clayton Tested-by: Maciej S. Szmigiero Reviewed-by: Vaibhav Hiremath Acked-by: Alan Stern --- drivers/usb/Kconfig| 1 + drivers/usb/core/hub.c | 49 + drivers/usb/core/hub.h | 1 + 3 files changed, 47

[PATCH v15 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-06-12 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

[PATCH v15 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-06-12 Thread Peter Chen
From: Joshua Clayton Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx6qdl.dtsi | 6

[PATCH v15 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-06-12 Thread Peter Chen
layton <stillcompil...@gmail.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> --- arch/arm/boot/dts/imx6q-evi.dts | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts index fd222

[PATCH v15 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-06-12 Thread Peter Chen
From: Joshua Clayton Previously the onboard hub was made to work by treating its reset gpio as a regulator enable. Get rid of that kludge now that pwseq has added reset gpio support Move pin muxing the hub reset pin into the usbh1 group Signed-off-by: Joshua Clayton Signed-off-by: Peter Chen

[PATCH v15 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-06-12 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen <peter.c...@nxp.

[PATCH v15 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-06-12 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen Signed-off

[PATCH v15 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-06-12 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Philipp Zabel <p.za...@pengutronix.de> Acked-by: Rob Herring <r...@kernel.org> --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++

[PATCH v15 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-06-12 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentatio

[PATCH v15 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-06-12 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/usb-device.txt b

[PATCH v15 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-06-12 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen Acked-by: Philipp Zabel Acked-by: Rob Herring --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v15 0/7] power: add power sequence library

2017-06-12 Thread Peter Chen
msg142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence lib

[PATCH v15 0/7] power: add power sequence library

2017-06-12 Thread Peter Chen
msg142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence lib

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-11 Thread Peter Chen
> >Can you confirm that ULPI phys works with IMX6? > >It seems that IMX53 and IMX6 use the same chipidea controller and should have >the >same behaviour. So I wonder if the issue I encounter can be a SOC issue. > Fabien, all imx6 series uses UTMI PHYs, so I am afraid I can't verify it. Peter

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-11 Thread Peter Chen
> >Can you confirm that ULPI phys works with IMX6? > >It seems that IMX53 and IMX6 use the same chipidea controller and should have >the >same behaviour. So I wonder if the issue I encounter can be a SOC issue. > Fabien, all imx6 series uses UTMI PHYs, so I am afraid I can't verify it. Peter

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-09 Thread Peter Chen
> >I have a look at your patches >(http://www.spinics.net/lists/linux-usb/msg157134.html) >and I wonder if power sequence is applicable only on hub node? No, power sequence can be used for any devices which needs to carry out power on before probe. > hub are probed too >late (after

RE: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-09 Thread Peter Chen
> >I have a look at your patches >(http://www.spinics.net/lists/linux-usb/msg157134.html) >and I wonder if power sequence is applicable only on hub node? No, power sequence can be used for any devices which needs to carry out power on before probe. > hub are probed too >late (after

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-06 Thread Peter Chen
On Tue, Jun 06, 2017 at 07:36:10PM +0200, Fabien Lahoudere wrote: > Hi Peter, > > On Tue, 2017-06-06 at 09:55 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > > > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: >

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-06 Thread Peter Chen
On Tue, Jun 06, 2017 at 07:36:10PM +0200, Fabien Lahoudere wrote: > Hi Peter, > > On Tue, 2017-06-06 at 09:55 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > > > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: >

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 10:57:00AM +0200, Fabien Lahoudere wrote: > > > On Fri, 2017-06-02 at 15:00 -0700, Stephen Boyd wrote: > > > > On

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 11:52:26AM +0200, Fabien Lahoudere wrote: > On Mon, 2017-06-05 at 17:43 +0800, Peter Chen wrote: > > On Mon, Jun 05, 2017 at 10:57:00AM +0200, Fabien Lahoudere wrote: > > > On Fri, 2017-06-02 at 15:00 -0700, Stephen Boyd wrote: > > > > On

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 10:16:34AM -0400, Alan Stern wrote: > On Mon, 5 Jun 2017, Peter Chen wrote: > > > On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > > > Some hard-wired USB devices need to do power sequence to let the > > > device work normally, t

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Mon, Jun 05, 2017 at 10:16:34AM -0400, Alan Stern wrote: > On Mon, 5 Jun 2017, Peter Chen wrote: > > > On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > > > Some hard-wired USB devices need to do power sequence to let the > > > device work normally, t

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
y_init(struct ci_hdrc *ci) >   return ret; >   hw_phymode_configure(ci); >   break; > - case USBPHY_INTERFACE_MODE_ULPI: >   case USBPHY_INTERFACE_MODE_SERIAL: >   hw_phymode_configure(ci); >   ret = _ci_usb_phy_init(ci); > --  Currently, the hw_phymode_configure is called twice for ULPI PHY, the two execution are between _ci_usb_phy_init, would you test which one causes hang? If the second causes hang, you can make a patch for hw_phymode_configure that if the required PORTSC_PTS is the same the value in register, do noop. -- Best Regards, Peter Chen

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-06-05 Thread Peter Chen
y_init(struct ci_hdrc *ci) >   return ret; >   hw_phymode_configure(ci); >   break; > - case USBPHY_INTERFACE_MODE_ULPI: >   case USBPHY_INTERFACE_MODE_SERIAL: >   hw_phymode_configure(ci); >   ret = _ci_usb_phy_init(ci); > --  Currently, the hw_phymode_configure is called twice for ULPI PHY, the two execution are between _ci_usb_phy_init, would you test which one causes hang? If the second causes hang, you can make a patch for hw_phymode_configure that if the required PORTSC_PTS is the same the value in register, do noop. -- Best Regards, Peter Chen

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > Some hard-wired USB devices need to do power sequence to let the > device work normally, the typical power sequence like: enable USB > PHY clock, toggle reset pin, etc. But current Linux USB driver > lacks of such code to d

Re: [PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:49:00AM +0800, Peter Chen wrote: > Some hard-wired USB devices need to do power sequence to let the > device work normally, the typical power sequence like: enable USB > PHY clock, toggle reset pin, etc. But current Linux USB driver > lacks of such code to d

Re: [PATCH v14 2/7] power: add power sequence library

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:48:58AM +0800, Peter Chen wrote: > We have an well-known problem that the device needs to do some power > sequence before it can be recognized by related host, the typical > example like hard-wired mmc devices and usb devices. > > This power s

Re: [PATCH v14 2/7] power: add power sequence library

2017-06-05 Thread Peter Chen
On Thu, May 18, 2017 at 08:48:58AM +0800, Peter Chen wrote: > We have an well-known problem that the device needs to do some power > sequence before it can be recognized by related host, the typical > example like hard-wired mmc devices and usb devices. > > This power s

Re: [PATCH 5/7] USB: of: fix root-hub device-tree node handling

2017-06-04 Thread Peter Chen
et_of_node_from_dev(>dev, bus->sysdev); > dev_set_name(>dev, "usb%d", bus->busnum); > root_hub = 1; > } else { > -- > 2.13.0 I am OK with it, but I suggest adding it for new rc1 since it is based on the 1st patch which is a bug-fix. If this one is really needed for stable tree in future, you can cherry-pick it. -- Best Regards, Peter Chen

Re: [PATCH 5/7] USB: of: fix root-hub device-tree node handling

2017-06-04 Thread Peter Chen
(>dev, bus->sysdev); > dev_set_name(>dev, "usb%d", bus->busnum); > root_hub = 1; > } else { > -- > 2.13.0 I am OK with it, but I suggest adding it for new rc1 since it is based on the 1st patch which is a bug-fix. If this one is really needed for stable tree in future, you can cherry-pick it. -- Best Regards, Peter Chen

Re: [PATCH 1/7] USB: core: fix device node leak

2017-06-04 Thread Peter Chen
; Fixes: 69bec7259853 ("USB: core: let USB device know device node") > Cc: stable <sta...@vger.kernel.org> # v4.6 > Cc: Peter Chen <peter.c...@nxp.com> > Signed-off-by: Johan Hovold <jo...@kernel.org> > --- > drivers/usb/core/usb.c | 2 ++ > 1 file

Re: [PATCH 1/7] USB: core: fix device node leak

2017-06-04 Thread Peter Chen
; Fixes: 69bec7259853 ("USB: core: let USB device know device node") > Cc: stable# v4.6 > Cc: Peter Chen > Signed-off-by: Johan Hovold > --- > drivers/usb/core/usb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/core/usb.c b/dr

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
u trigger this issue? Do you mind sending another patch to fix the same issue for ci_role_show at core.c? -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
= s->private; > > - seq_printf(s, "%s\n", ci_role(ci)->name); > + if (ci->role != CI_ROLE_END) > + seq_printf(s, "%s\n", ci_role(ci)->name); > > return 0; > } By the way, how can you trigger this issue? Do you mind sending another patch to fix the same issue for ci_role_show at core.c? -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
> { > struct ci_hdrc *ci = s->private; > > - seq_printf(s, "%s\n", ci_role(ci)->name); > + if (ci->role != CI_ROLE_END) > + seq_printf(s, "%s\n", ci_role(ci)->name); > > return 0; > } I will queue it, and cc stable -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: debug: check before accessing ci_role

2017-05-18 Thread Peter Chen
= s->private; > > - seq_printf(s, "%s\n", ci_role(ci)->name); > + if (ci->role != CI_ROLE_END) > + seq_printf(s, "%s\n", ci_role(ci)->name); > > return 0; > } I will queue it, and cc stable -- Best Regards, Peter Chen

[PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-05-17 Thread Peter Chen
-off-by: Peter Chen <peter.c...@nxp.com> Tested-by Joshua Clayton <stillcompil...@gmail.com> Tested-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> Reviewed-by: Vaibhav Hiremath <hvaibhav.li...@gmail.com> --- drivers/usb/Kconfig| 1 + dri

[PATCH v14 4/7] usb: core: add power sequence handling for USB devices

2017-05-17 Thread Peter Chen
-off-by: Peter Chen Tested-by Joshua Clayton Tested-by: Maciej S. Szmigiero Reviewed-by: Vaibhav Hiremath --- drivers/usb/Kconfig| 1 + drivers/usb/core/hub.c | 49 + drivers/usb/core/hub.h | 1 + 3 files changed, 47 insertions(+), 4 deletions

[PATCH v14 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-05-17 Thread Peter Chen
layton <stillcompil...@gmail.com> Signed-off-by: Peter Chen <peter.c...@nxp.com> --- arch/arm/boot/dts/imx6q-evi.dts | 25 +++-- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts index fd222

[PATCH v14 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-05-17 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen <peter.c...@nxp.

[PATCH v14 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line

2017-05-17 Thread Peter Chen
From: Joshua Clayton Previously the onboard hub was made to work by treating its reset gpio as a regulator enable. Get rid of that kludge now that pwseq has added reset gpio support Move pin muxing the hub reset pin into the usbh1 group Signed-off-by: Joshua Clayton Signed-off-by: Peter Chen

[PATCH v14 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2017-05-17 Thread Peter Chen
The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node under USB controller, and power sequence properties are under it. Besides, using gpio pinctrl setting for USB2415's reset pin. Signed-off-by: Peter Chen Signed-off

[PATCH v14 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-05-17 Thread Peter Chen
From: Joshua Clayton <stillcompil...@gmail.com> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton <stillcompil...@gmail.com> Signed-o

[PATCH v14 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-05-17 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Philipp Zabel <p.za...@pengutronix.de> Acked-by: Rob Herring <r...@kernel.org> --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++

[PATCH v14 5/7] ARM: dts: imx6qdl: Enable usb node children with

2017-05-17 Thread Peter Chen
From: Joshua Clayton Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may be addressed with a attribute Signed-off-by: Joshua Clayton Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx6qdl.dtsi | 6

[PATCH v14 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2017-05-17 Thread Peter Chen
Add binding doc for generic power sequence library. Signed-off-by: Peter Chen Acked-by: Philipp Zabel Acked-by: Rob Herring --- .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v14 2/7] power: add power sequence library

2017-05-17 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen <peter.c...@nxp.com> Tested-by: Maciej S. Szmigi

[PATCH v14 2/7] power: add power sequence library

2017-05-17 Thread Peter Chen
instead (eg, USB hub driver). For new power sequence library, it can add its compatible string to pwrseq_of_match_table, then the pwrseq core will match it with DT's, and choose this library at runtime. Signed-off-by: Peter Chen Tested-by: Maciej S. Szmigiero Tested-by Joshua Clayton Reviewed

[PATCH v14 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-05-17 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen <peter.c...@nxp.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentatio

[PATCH v14 3/7] binding-doc: usb: usb-device: add optional properties for power sequence

2017-05-17 Thread Peter Chen
Add optional properties for power sequence. Signed-off-by: Peter Chen Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/usb-device.txt | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/usb-device.txt b

[PATCH v14 0/7] power: add power sequence library

2017-05-17 Thread Peter Chen
142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power

[PATCH v14 0/7] power: add power sequence library

2017-05-17 Thread Peter Chen
142815.html [4] http://www.spinics.net/lists/linux-usb/msg152375.html Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (5): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power

Re: [PATCH v13 00/12] power: add power sequence library

2017-05-16 Thread Peter Chen
On Tue, May 16, 2017 at 07:28:55PM +0200, Krzysztof Kozlowski wrote: > On Wed, Feb 15, 2017 at 09:38:09AM +0800, Peter Chen wrote: > > On Tue, Feb 14, 2017 at 12:21:48PM +0200, Roger Quadros wrote: > > > Peter, > > > > > > On 11/02/17 03:

Re: [PATCH v13 00/12] power: add power sequence library

2017-05-16 Thread Peter Chen
On Tue, May 16, 2017 at 07:28:55PM +0200, Krzysztof Kozlowski wrote: > On Wed, Feb 15, 2017 at 09:38:09AM +0800, Peter Chen wrote: > > On Tue, Feb 14, 2017 at 12:21:48PM +0200, Roger Quadros wrote: > > > Peter, > > > > > > On 11/02/17 03:

Re: [PATCH] usb: chipidea: imx: Do not access CLKONOFF on i.MX51

2017-05-08 Thread Peter Chen
,7 @@ static const struct of_device_id usbmisc_imx_dt_ids[] = { > }, > { > .compatible = "fsl,imx51-usbmisc", > - .data = _usbmisc_ops, > + .data = _usbmisc_ops, > }, > { > .compatible = "fsl,imx53-usbmisc", Thanks for fixing it. I prefer using is_imx53_usbmisc stands for if it is imx53 usbmisc at usbmisc_imx53_init to fix it, you can prefer to: drivers/usb/phy/phy-mxs-usb.c. -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: imx: Do not access CLKONOFF on i.MX51

2017-05-08 Thread Peter Chen
}, > { > .compatible = "fsl,imx51-usbmisc", > - .data = _usbmisc_ops, > + .data = _usbmisc_ops, > }, > { > .compatible = "fsl,imx53-usbmisc", Thanks for fixing it. I prefer using is_imx53_usbmisc stands for if it is imx53 usbmisc at usbmisc_imx53_init to fix it, you can prefer to: drivers/usb/phy/phy-mxs-usb.c. -- Best Regards, Peter Chen

RE: [PATCH] ARM: dts: imx6sx-sdb: Remove cpufreq OPP override

2017-04-26 Thread Peter Chen
> >The board file for imx6sx-dbg overrides cpufreq operating points to use higher >voltages. This is done because the board has a shared rail for VDD_ARM_IN and >VDD_SOC_IN and when using LDO bypass the shared voltage needs to be a value >suitable for both ARM and SOC. > >This was introduced in:

RE: [PATCH] ARM: dts: imx6sx-sdb: Remove cpufreq OPP override

2017-04-26 Thread Peter Chen
> >The board file for imx6sx-dbg overrides cpufreq operating points to use higher >voltages. This is done because the board has a shared rail for VDD_ARM_IN and >VDD_SOC_IN and when using LDO bypass the shared voltage needs to be a value >suitable for both ARM and SOC. > >This was introduced in:

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-26 Thread Peter Chen
On Wed, Apr 26, 2017 at 04:25:26PM +0800, Jisheng Zhang wrote: > On Tue, 25 Apr 2017 17:21:59 +0200 > Stefan Wahren <stefan.wah...@i2se.com> wrote: > > > Am 25.04.2017 um 11:20 schrieb Peter Chen: > > > > > >>>> diff --git a/drivers

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-26 Thread Peter Chen
On Wed, Apr 26, 2017 at 04:25:26PM +0800, Jisheng Zhang wrote: > On Tue, 25 Apr 2017 17:21:59 +0200 > Stefan Wahren wrote: > > > Am 25.04.2017 um 11:20 schrieb Peter Chen: > > > > > >>>> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/

Re: [PATCH] usb: chipidea: properly handle host or gadget initialization failure

2017-04-26 Thread Peter Chen
ret); - goto stop; + goto deinit_gadget; } } @@ -1075,7 +1075,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) remove_debug: dbg_remove_files(ci); stop: - if (ci->is_otg) + if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) ci_hdrc_otg_destroy(ci); deinit_gadget: ci_hdrc_gadget_destroy(ci); -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: properly handle host or gadget initialization failure

2017-04-26 Thread Peter Chen
goto deinit_gadget; } } @@ -1075,7 +1075,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) remove_debug: dbg_remove_files(ci); stop: - if (ci->is_otg) + if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) ci_hdrc_otg_destroy(ci); deinit_gadget: ci_hdrc_gadget_destroy(ci); -- Best Regards, Peter Chen

RE: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
>> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c >> > index f88e9157fad0..60a786c87c06 100644 >> > --- a/drivers/usb/chipidea/udc.c >> > +++ b/drivers/usb/chipidea/udc.c >> > @@ -1984,6 +1984,7 @@ static void udc_id_switch_for_host(struct >> > ci_hdrc *ci) int

RE: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
>> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c >> > index f88e9157fad0..60a786c87c06 100644 >> > --- a/drivers/usb/chipidea/udc.c >> > +++ b/drivers/usb/chipidea/udc.c >> > @@ -1984,6 +1984,7 @@ static void udc_id_switch_for_host(struct >> > ci_hdrc *ci) int

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
gt;roles[CI_ROLE_GADGET] = rdrv; > > - return udc_start(ci); > + ret = udc_start(ci); > + if (!ret) > + ci->roles[CI_ROLE_GADGET] = rdrv; > + > + return ret; > } > -- Thanks for fixing it. In fact, we'd better return failure if ret && ret != -ENXIO at probe, it stands for initialization for host or gadget has failed. -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
rdrv; > > - return udc_start(ci); > + ret = udc_start(ci); > + if (!ret) > + ci->roles[CI_ROLE_GADGET] = rdrv; > + > + return ret; > } > -- Thanks for fixing it. In fact, we'd better return failure if ret && ret != -ENXIO at probe, it stands for initialization for host or gadget has failed. -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-25 Thread Peter Chen
On Mon, Apr 24, 2017 at 01:25:21PM +, Bernhard Walle wrote: > Hi, > > > Peter Chen <peter.c...@nxp.com> hat am 24. April 2017 um 05:51 geschrieben: > > > > > The current code logic is: > > - When the resume is received from host, the ci->dirver->r

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-25 Thread Peter Chen
On Mon, Apr 24, 2017 at 01:25:21PM +, Bernhard Walle wrote: > Hi, > > > Peter Chen hat am 24. April 2017 um 05:51 geschrieben: > > > > > The current code logic is: > > - When the resume is received from host, the ci->dirver->resume is > >

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-23 Thread Peter Chen
sume doesn't need to be called. There is a patch to fix clear suspended even the ci->driver->resume is NULL at v4.12-rc1. usb: chipidea: udc: update gadget state after bus resume -- Best Regards, Peter Chen

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-23 Thread Peter Chen
sume doesn't need to be called. There is a patch to fix clear suspended even the ci->driver->resume is NULL at v4.12-rc1. usb: chipidea: udc: update gadget state after bus resume -- Best Regards, Peter Chen

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-04-20 Thread Peter Chen
itialization path. > > A new compatible string "smsc,usb3315" is used to decide which > initialization path to use. > Hi Peter, This is an ULPI PHY, so it is not suitable using generic USB PHY. Taking a look of drivers/phy/phy-qcom-usb-hs.c, you may have some clues.

Re: [RFC] usb-phy-generic: Add support to SMSC USB3315

2017-04-20 Thread Peter Chen
itialization path. > > A new compatible string "smsc,usb3315" is used to decide which > initialization path to use. > Hi Peter, This is an ULPI PHY, so it is not suitable using generic USB PHY. Taking a look of drivers/phy/phy-qcom-usb-hs.c, you may have some clues. Pete

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-17 Thread Peter Chen
adget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -139,10 +139,8 @@ int usb_ep_disable(struct usb_ep *ep) > goto out; > > ret = ep->ops->disable(ep); > - if (ret) { > - ret = ret; > + if (ret) > goto out; >

Re: [PATCH] usb: gadget: remove redundant self assignment

2017-04-17 Thread Peter Chen
b/drivers/usb/gadget/udc/core.c > @@ -139,10 +139,8 @@ int usb_ep_disable(struct usb_ep *ep) > goto out; > > ret = ep->ops->disable(ep); > - if (ret) { > - ret = ret; > + if (ret) > goto out; > - } > > ep->enabled = false; > Reviewed-by: Peter Chen -- Best Regards, Peter Chen

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-14 Thread Peter Chen
isconnected. > > > > You don't need to use above two methods together, I suggest using the > > 2nd method since OTG FSM is hard to maintain due to no mandatory use > > case for it. > > > > -- > > > > Best Regards, > > Peter Chen > > T

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-14 Thread Peter Chen
isconnected. > > > > You don't need to use above two methods together, I suggest using the > > 2nd method since OTG FSM is hard to maintain due to no mandatory use > > case for it. > > > > -- > > > > Best Regards, > > Peter Chen > > T

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-12 Thread Peter Chen
, and using sysfs entries under /sys/bus/platform/devices/ci_hdrc.0/inputs but you may need to patch code to keep vbus always on for A-device, it is not compliance with OTG spec. - Using role interface under debugfs (I move it under sysfs for v4.12). But you need to patch the code and let the A-device switch back to host after iAP is disconnected. You don't need to use above two methods together, I suggest using the 2nd method since OTG FSM is hard to maintain due to no mandatory use case for it. -- Best Regards, Peter Chen

Re: [PATCH] chipidea: Fix issue in reconnecing gadget without insmod/rmmod

2017-04-12 Thread Peter Chen
der /sys/bus/platform/devices/ci_hdrc.0/inputs but you may need to patch code to keep vbus always on for A-device, it is not compliance with OTG spec. - Using role interface under debugfs (I move it under sysfs for v4.12). But you need to patch the code and let the A-device switch back to host after iAP is disconnected. You don't need to use above two methods together, I suggest using the 2nd method since OTG FSM is hard to maintain due to no mandatory use case for it. -- Best Regards, Peter Chen

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Peter Chen
On Wed, Mar 08, 2017 at 06:44:47AM -0800, Guenter Roeck wrote: > On 03/07/2017 10:50 PM, Peter Chen wrote: > > > >>>>You mean type-C trigger an ACPI event, and this ACPI event can notify > >>>>related USB controller driver doing role switch? > >&

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Peter Chen
On Wed, Mar 08, 2017 at 06:44:47AM -0800, Guenter Roeck wrote: > On 03/07/2017 10:50 PM, Peter Chen wrote: > > > >>>>You mean type-C trigger an ACPI event, and this ACPI event can notify > >>>>related USB controller driver doing role switch? > >&

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
>>> You mean type-C trigger an ACPI event, and this ACPI event can notify >>> related USB controller driver doing role switch? >> >> No (firmware programs the dual-role hw/registers), but never mind. >> That could be the case. >> >>> If it is correct, there is a notifier between type-C and USB

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
>>> You mean type-C trigger an ACPI event, and this ACPI event can notify >>> related USB controller driver doing role switch? >> >> No (firmware programs the dual-role hw/registers), but never mind. >> That could be the case. >> >>> If it is correct, there is a notifier between type-C and USB

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
> >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: >> > > What interface you use when you receive this event to handle >> > > dual-role switch? I am wonder if a common dual-role class is >> > > needed, then we can have a common user uti

RE: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Peter Chen
> >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: >> > > What interface you use when you receive this event to handle >> > > dual-role switch? I am wonder if a common dual-role class is >> > > needed, then we can have a common user uti

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 06:36:50AM -0800, Guenter Roeck wrote: > On 03/02/2017 08:52 PM, Peter Chen wrote: > >On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > >>On 03/02/2017 07:35 PM, Peter Chen wrote: > >>>On Tue, Feb 21, 2017 at 05:24:04P

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 06:36:50AM -0800, Guenter Roeck wrote: > On 03/02/2017 08:52 PM, Peter Chen wrote: > >On Thu, Mar 02, 2017 at 08:29:07PM -0800, Guenter Roeck wrote: > >>On 03/02/2017 07:35 PM, Peter Chen wrote: > >>>On Tue, Feb 21, 2017 at 05:24:04P

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-05 Thread Peter Chen
On Fri, Mar 03, 2017 at 04:31:33PM +0200, Heikki Krogerus wrote: > Hi Peter, > > On Fri, Mar 03, 2017 at 11:35:29AM +0800, Peter Chen wrote: > > On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > > > +/* --- */ &g

<    1   2   3   4   5   6   7   8   9   10   >