[PATCH v4 0/6] power: add power sequence library

2016-08-01 Thread Peter Chen
refix and clock-names for properties at dt binding - Should use structure not but its pointer for kzalloc - Since chipidea core has no of_node, let core's of_node equals glue layer's at core's probe Peter Chen (6): binding-doc: power: pwrseq-generic: add binding doc for gener

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

2016-08-01 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

Re: [v3,2/6] power: add power sequence library

2016-08-01 Thread Peter Chen
s flags; > >+int reset_gpio, ret = 0; > >+ > >+pwrseq_gen->clk = of_clk_get_by_name(np, NULL); > This only gets the first of potentially multiple clocks, is that intended? Matthias, I have added multiple input clocks support at v4 patch set, and you are at cc list

[PATCH v4 5/6] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node

2016-08-01 Thread Peter Chen
From: Peter Chen At device tree, we have no device node for chipidea core, the glue layer's node is the parent node for host and udc device. But in related driver, the parent device is chipidea core. So, in order to let the common driver get parent's node, we let the core's dev

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

2016-08-01 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. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx6qdl-udoo.dtsi | 26 +--

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

2016-08-01 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

Re: [PATCH 3/3] usb: gadget: u_ether: fix dereference after null check coverify warning

2016-08-02 Thread Peter Chen
On Fri, Jul 01, 2016 at 03:33:30PM +0800, Peter Chen wrote: > skb is checked for null pointer at above code, so skb might be null. > eem_wrap uses it without checking null pointer, fix it by adding null > pointer check. > > Signed-off-by: Peter Chen > --- > drivers/usb/gadg

Re: [PATCH v4 2/6] power: add power sequence library

2016-08-03 Thread Peter Chen
On Wed, Aug 03, 2016 at 03:16:58PM -0700, Matthias Kaehlcke wrote: > El Tue, Aug 02, 2016 at 11:30:48AM +0800 Peter Chen ha dit: > > > diff --git a/drivers/power/pwrseq/core.c b/drivers/power/pwrseq/core.c > > > > ... > > > > +static DEFINE_MUTEX(pwrse

Re: [PATCH v2 08/22] usb: chipidea: Remove locking in ci_udc_start()

2016-08-06 Thread Peter Chen
On Fri, Aug 05, 2016 at 02:53:56PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2016-07-08 02:45:28) > > On Thu, Jul 07, 2016 at 03:20:59PM -0700, Stephen Boyd wrote: > > > We don't call hw_device_reset() with the ci->lock held, so it > > > doesn'

Re: [PATCH v2 06/22] usb: chipidea: Add platform flag for wrapper phy management

2016-08-06 Thread Peter Chen
On Fri, Aug 05, 2016 at 02:46:00PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2016-07-08 02:25:35) > > On Thu, Jul 07, 2016 at 03:20:57PM -0700, Stephen Boyd wrote: > > > The ULPI phy on qcom platforms needs to be initialized and > > > powered on after a USB res

Re: [PATCH v2 04/22] usb: chipidea: Only read/write OTGSC from one place

2016-08-06 Thread Peter Chen
On Fri, Aug 05, 2016 at 02:41:37PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2016-07-08 02:14:57) > > On Thu, Jul 07, 2016 at 03:20:55PM -0700, Stephen Boyd wrote: > > > diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c > > > index 03b674

Re: [PATCH v4 0/6] power: add power sequence library

2016-08-07 Thread Peter Chen
On Sat, Aug 06, 2016 at 02:00:08PM +0200, Oscar wrote: > El 2016-08-02 05:30, Peter Chen escribió: > >Hi all, > > > >This is a follow-up for my last power sequence framework patch set > >[1]. > >According to Rob Herring and Ulf Hansson's comments[2], I use

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

2016-08-08 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 v5 0/6] power: add power sequence library

2016-08-08 Thread Peter Chen
let core's of_node equals glue layer's at core's probe Peter Chen (6): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power: add power sequence library binding-doc: usb: usb-device: add optional properties for power sequen

[PATCH v5 4/6] usb: core: add power sequence handling for USB devices

2016-08-08 Thread Peter Chen
s root hub). At hub_disconnect, it will do power off sequence which is at powered on list. Signed-off-by: Peter Chen Tested-by Joshua Clayton --- drivers/usb/core/Makefile | 1 + drivers/usb/core/hub.c| 12 -- drivers/usb/core/hub.h| 12 ++ drivers/usb/core/pwrs

[PATCH v5 2/6] power: add power sequence library

2016-08-08 Thread Peter Chen
and clocks currently, and can cover regulator and pinctrl in future. The host driver calls pwrseq_alloc_generic to create an generic pwrseq instance. Signed-off-by: Peter Chen Tested-by Joshua Clayton --- MAINTAINERS | 9 ++ drivers/power/Kconfig | 1

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

2016-08-08 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 v5 5/6] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node

2016-08-08 Thread Peter Chen
From: Peter Chen At device tree, we have no device node for chipidea core, the glue layer's node is the parent node for host and udc device. But in related driver, the parent device is chipidea core. So, in order to let the common driver get parent's node, we let the core's dev

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

2016-08-08 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. Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx6qdl-udoo.dtsi | 26 +--

RE: [PATCH v2 08/22] usb: chipidea: Remove locking in ci_udc_start()

2016-08-08 Thread Peter Chen
>Quoting Peter Chen (2016-08-06 00:54:35) >> On Fri, Aug 05, 2016 at 02:53:56PM -0700, Stephen Boyd wrote: >> > Quoting Peter Chen (2016-07-08 02:45:28) >> > > On Thu, Jul 07, 2016 at 03:20:59PM -0700, Stephen Boyd wrote: >> > > > We don't ca

Re: [RESEND PATCH] usb: hub: change CLEAR_FEATURE to SET_FEATURE

2016-08-08 Thread Peter Chen
On Tue, Aug 9, 2016 at 11:31 AM, Yonglong Wu wrote: > From: Yonglong Wu > > According to USB30 specification, the Function Remote Wakeup field can be > modified by the SetFeature() requests. SetFeature() is recommended to use. > > Signed-off-by: Yonglong Wu > --- > drivers/usb/core/hub.c |2

Re: [RESEND PATCH] usb: hub: change CLEAR_FEATURE to SET_FEATURE

2016-08-09 Thread Peter Chen
On Tue, Aug 9, 2016 at 4:25 PM, Greg Kroah-Hartman wrote: > On Tue, Aug 09, 2016 at 04:07:56PM +0800, yonglong.wu wrote: >> Hi, >> On Tue, 2016-08-09 at 14:29 +0800, Peter Chen wrote: >> >> On Tue, Aug 9, 2016 at 11:31 AM, Yonglong Wu >>

RE: [PATCH v2 06/22] usb: chipidea: Add platform flag for wrapper phy management

2016-08-09 Thread Peter Chen
>> On Fri, Aug 05, 2016 at 02:46:00PM -0700, Stephen Boyd wrote: >> > Quoting Peter Chen (2016-07-08 02:25:35) >> > > >> > > How you handle the code for PHY getting at probe? >> > > >> > >> > Which probe? Glue layer probe? In

Re: [PATCH 2/2] usb: Kconfig: move ulpi bus to common

2016-08-09 Thread Peter Chen
On Tue, Aug 09, 2016 at 04:06:31PM +0200, Greg KH wrote: > On Fri, Jul 08, 2016 at 04:15:23PM +0800, Peter Chen wrote: > > The ULPI bus is not only for host, but for device mode too, so move > > it out from host's Kconfig. > > > > Cc: Heikki Krogeru

Re: [PATCH 1/2] usb: Kconfig: move common things under usb/common

2016-08-09 Thread Peter Chen
On Tue, Aug 09, 2016 at 04:06:22PM +0200, Greg KH wrote: > On Fri, Jul 08, 2016 at 04:15:22PM +0800, Peter Chen wrote: > > It can simplify root Kconfig > > Why does it matter? > When I try to move ulpi Kconfig from usb host out, I need to find some place to put it, it is ok t

Re: [PATCH V2] usb: chipidea: udc: Use direction flags consequently

2016-08-09 Thread Peter Chen
if (dir == USB_DIR_IN) /* TX */ > num += ci->hw_ep_max / 2; > > spin_unlock(&ci->lock); > -- I have already queued it at local tree for testing, and make the similar changes: commit c95b4427b7328b2618ca70fea65de

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

2016-08-09 Thread Peter Chen
On Tue, Aug 09, 2016 at 04:33:35PM -0700, Joshua Clayton wrote: > Hi Peter, > > On 08/08/2016 01:52 AM, Peter Chen wrote: > > The current dts describes USB HUB's property at USB controller's > > entry, it is improper. The USB HUB should be the child node >

Re: [PATCH v5 5/6] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node

2016-08-09 Thread Peter Chen
On Tue, Aug 09, 2016 at 05:15:36PM -0700, Stephen Boyd wrote: > Quoting Peter Chen (2016-08-08 01:52:10) > > From: Peter Chen > > > > At device tree, we have no device node for chipidea core, > > the glue layer's node is the parent node for host and udc > &

Re: [PATCH] usb: core: Add runtime resume checking

2016-08-10 Thread Peter Chen
ev); > >> + if (udev->state == USB_STATE_SUSPENDED && w != > >> udev->do_remote_wakeup) { > >> + ret = pm_runtime_resume(&udev->dev); > >> + if (ret == -ESHUTDOWN) > >> + pm_runtime_set_s

Re: [PATCH v5 5/6] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node

2016-08-10 Thread Peter Chen
On Wed, Aug 10, 2016 at 09:00:15AM +, Jun Li wrote: > Hi, Peter > > > -Original Message- > > From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- > > ow...@vger.kernel.org] On Behalf Of Peter Chen > > Sent: Wednesday, August 10, 2016 11:12 AM >

Re: [PATCH] usb: core: Add runtime resume checking

2016-08-10 Thread Peter Chen
On Wed, Aug 10, 2016 at 02:43:50PM +0800, Baolin Wang wrote: > Hi Peter, > > On 10 August 2016 at 14:18, Peter Chen wrote: > > On Wed, Aug 10, 2016 at 10:33:31AM +0800, Baolin Wang wrote: > >> Hi Greg, > >> > >> On 9 August 2016 at 18:26, Greg KH wrote:

Re: [PATCH] usb: core: Add runtime resume checking

2016-08-11 Thread Peter Chen
; > > > If the wakeup setting needs to be changed when the system suspend > > begins, then you have to power-on the controller to make that change. > > > > Given a choice between using a little power or behaving incorrectly, > > you should choose to use the power. > > OK. But that is a real problem. It will pm_runtime_resume() falied > (issued in choose_wakeup()), cause usb controller has powered-off and > xHCI controller has suspended and we have no method to notify the user > to power-on USB controller. Any good suggestion to solve this, Alan > and Peter? Thanks. > Maybe you can show us the call stack why pm_runtime_resume has failed at your environment. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v2] usb: core: Add runtime resume checking in choose_wakeup()

2016-08-11 Thread Peter Chen
ow it won't, it just resume usb device not xHCI controller. I > suppose mainline kernel does not sopport this now. > Why? It works ok at my environment. The controller is the ancestor of the USB device, if the USB device would like to be woken up, the controller will be woken up fir

Re: [PATCH V2] usb: chipidea: udc: Use direction flags consequently

2016-08-11 Thread Peter Chen
Sat Jul 9 14:16:40 2016 + > > > >usb: chipidea: udc: Use direction flags consequently > > > >This driver make assumptions about the value of the direction flags. > >So better use them in comparisons to improve the readability. > > > >Sign

Re: [PATCH 3/3] usb: gadget: u_ether: fix dereference after null check coverify warning

2016-08-11 Thread Peter Chen
On Wed, Aug 10, 2016 at 02:20:18PM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > > On Fri, Jul 01, 2016 at 03:33:30PM +0800, Peter Chen wrote: > >> skb is checked for null pointer at above code, so skb might be null. > >> eem_wrap uses it with

[PATCH v2 1/4] usb: gadget: composite: fix dereference after null check coverify warning

2016-08-11 Thread Peter Chen
cdev->config is checked for null pointer at above code, so cdev->config might be null, fix it by adding null pointer check. Signed-off-by: Peter Chen --- drivers/usb/gadget/composite.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/

[PATCH v2 0/4] usb: gadget: fix several coverity warnings

2016-08-11 Thread Peter Chen
pointer for socket buffer before using it. Peter Chen (4): usb: gadget: composite: fix dereference after null check coverify warning usb: gadget: u_ether: fix dereference after null check coverify warning usb: gadget: function: f_eem: socket buffer may be NULL usb: gadget: function

[PATCH v2 4/4] usb: gadget: function: f_rndis: socket buffer may be NULL

2016-08-11 Thread Peter Chen
In eth_start_xmit, the socket buffer may be NULL. So, add NULL pointer check at .wrap API. Signed-off-by: Peter Chen --- drivers/usb/gadget/function/f_rndis.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c

[PATCH v2 3/4] usb: gadget: function: f_eem: socket buffer may be NULL

2016-08-11 Thread Peter Chen
In eth_start_xmit, the socket buffer may be NULL. So, add NULL pointer check at .wrap API. Signed-off-by: Peter Chen --- drivers/usb/gadget/function/f_eem.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget

[PATCH v2 2/4] usb: gadget: u_ether: fix dereference after null check coverify warning

2016-08-11 Thread Peter Chen
dev->port_usb is checked for null pointer at above code, so dev->port_usb might be null, fix it by adding null pointer check. Signed-off-by: Peter Chen --- drivers/usb/gadget/function/u_ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/fu

Re: [PATCH] usb: core: Add runtime resume checking

2016-08-11 Thread Peter Chen
On Thu, Aug 11, 2016 at 04:07:21PM +0800, Baolin Wang wrote: > Hi Peter, > > On 11 August 2016 at 14:54, Peter Chen wrote: > > On Thu, Aug 11, 2016 at 11:08:52AM +0800, Baolin Wang wrote: > >> Hi Alan, > >> > >> On 10 August 2016 at 22:25, Alan Stern

Re: [PATCH] usb: core: Add runtime resume checking

2016-08-11 Thread Peter Chen
e failed. > >> > > > > What host controller driver you are using? Assume you are using > > xhci-plat.c. The problem for you is this driver does not implement > > Yes. I use xhci-plat.c. > > > runtime pm operations, so the flag HCD_FLAG_HW_ACCESSIBLE is not set. >

Re: [PATCHES] ARM: dts: update udoo and evi hubs to use pwrseq

2016-08-11 Thread Peter Chen
> and remove those lines from imx6qdl-udoo.dtsi in patch 2 (formerly patch 6) > Finally I make the change in imx6q-evi.dts and hope is can be slipped into > the series with the others. > Thanks, I will send them at next revision -- Best Regards, Peter Chen -- To unsubscribe

Re: [PATCH 3/3] ARM: dts: imx6q-evi: Fix onboard hub reset line

2016-08-11 Thread Peter Chen
h? > MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0 > - >; > - }; > - > - pinctrl_usbh1_hubreset: usbh1hubresetgrp { > - fsl,pins = < > MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x1b0b0 > >; > }; This changes remind me that I need to change the same thing for udoo board. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usb: chipidea: udc: don't touch DP when controller is in host mode

2016-08-12 Thread Peter Chen
return 0; > > pm_runtime_get_sync(&ci->gadget.dev); > -- Would you show me how to reproduce it? I can't reproduce it. According to your description, the ci->vbus_active is false, then the pullup operation will NOT do real pull up. -- Best Regards, Pe

RE: [lkp] [usb] ad05399d68: BUG: unable to handle kernel NULL pointer dereference at 0000000000000012

2016-08-15 Thread Peter Chen
and said it is a false report. see below. Would you please double confirm it? On Wed, Jul 13, 2016 at 01:55:26AM +, Peter Chen wrote: > > >>-Original Message- >>From: lkp-requ...@eclists.intel.com >>[mailto:lkp-requ...@eclists.intel.com] On Behalf Of kernel test

Re: [PATCH] usb: chipidea: udc: don't touch DP when controller is in host mode

2016-08-15 Thread Peter Chen
On Fri, Aug 12, 2016 at 09:18:59AM +, Jun Li wrote: > Hi, > > -Original Message- > > From: Peter Chen [mailto:hzpeterc...@gmail.com] > > Sent: Friday, August 12, 2016 4:48 PM > > To: Jun Li > > Cc: Peter Chen ; linux-usb@vger.kernel.org > >

[PATCH v6 0/8] power: add power sequence library

2016-08-15 Thread Peter Chen
of_node, let core's of_node equals glue layer's at core's probe Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (6): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence

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

2016-08-15 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 v6 3/8] binding-doc: usb: usb-device: add optional properties for power sequence

2016-08-15 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 v6 5/8] usb: chipidea: let chipidea core device of_node equal's glue layer device of_node

2016-08-15 Thread Peter Chen
From: Peter Chen At device tree, we have no device node for chipidea core, the glue layer's node is the parent node for host and udc device. But in related driver, the parent device is chipidea core. So, in order to let the common driver get parent's node, we let the core's dev

[PATCH v6 2/8] power: add power sequence library

2016-08-15 Thread Peter Chen
and clocks currently, and can cover regulator and pinctrl in future. The host driver calls pwrseq_alloc_generic to create an generic pwrseq instance. Signed-off-by: Peter Chen Tested-by Joshua Clayton Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke --- MAINTAINERS

[PATCH v6 4/8] usb: core: add power sequence handling for USB devices

2016-08-15 Thread Peter Chen
s root hub). At hub_disconnect, it will do power off sequence which is at powered on list. Signed-off-by: Peter Chen Tested-by Joshua Clayton --- drivers/usb/core/Makefile | 1 + drivers/usb/core/hub.c| 12 -- drivers/usb/core/hub.h| 12 ++ drivers/usb/core/pwrs

[PATCH v6 6/8] ARM: dts: imx6qdl: Enable usb node children with

2016-08-15 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 v6 7/8] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property

2016-08-15 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

[PATCH v6 8/8] ARM: dts: imx6q-evi: Fix onboard hub reset line

2016-08-15 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

Re: [PATCH 2/2] usb: Kconfig: move ulpi bus to common

2016-08-15 Thread Peter Chen
On Mon, Aug 15, 2016 at 04:07:14PM +0300, Heikki Krogerus wrote: > Hi, > > On Fri, Jul 08, 2016 at 04:15:23PM +0800, Peter Chen wrote: > > The ULPI bus is not only for host, but for device mode too, so move > > it out from host's Kconfig. > > > > Cc: Hei

Re: [PATCH] USB: core: of: Check device_node before parsing in usb_of_get_child_node()

2016-08-15 Thread Peter Chen
eproduce it, would you please show me your dump when null pointer dereference occurs? From what I find the __of_get_next_child checks null pointer for parent node. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [lkp] [usb] ad05399d68: BUG: unable to handle kernel NULL pointer dereference at 0000000000000012

2016-08-15 Thread Peter Chen
On Mon, Aug 15, 2016 at 10:49:55PM +0800, Ye Xiaolong wrote: > On 08/15, Peter Chen wrote: > > > >> > >> > >>FYI, we noticed the following commit: > >> > >>https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next > &g

Re: [PATCH] usb: chipidea: host: disable io watchdog

2016-08-15 Thread Peter Chen
; ret = ehci_setup(hcd); > if (ret) > return ret; > > + ehci->need_io_watchdog = 0; > + > ci_platform_configure(ci); > > return ret; > -- > 2.8.1 > I will test it -- Best Regards, Peter Chen -- To unsubscribe fr

Re: [PATCH v2 3/3] usb: gadget: add f_uac1 variant based on new u_audio api

2016-08-15 Thread Peter Chen
his driver requires a real Audio codec to be present > on the device. > > +config USB_CONFIGFS_F_UAC1_NEWAPI > + bool "Audio Class 1.0 (new API)" > + depends on USB_CONFIGFS > + depends on SND > + select USB_LIBCOMPOSITE > + select SND_PCM > + select USB_U_AUDIO > + select USB_F_UAC1_NEWAPI > + help > + This Audio function implements 1 AudioControl interface, > + 1 AudioStreaming Interface each for USB-OUT and USB-IN. %s/1/one -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v2 0/3] USB Audio Gadget refactoring

2016-08-16 Thread Peter Chen
dlsolo:~# root@imx6qdlsolo:~# Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo Playing WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo underrun!!! (at least 36.634 ms long) underrun!!! (at least 36.117 ms long) underrun!!! (at least 4

Re: [PATCH 2/2] usb: Kconfig: move ulpi bus to common

2016-08-16 Thread Peter Chen
On Mon, Aug 15, 2016 at 04:07:14PM +0300, Heikki Krogerus wrote: > Hi, > > On Fri, Jul 08, 2016 at 04:15:23PM +0800, Peter Chen wrote: > > The ULPI bus is not only for host, but for device mode too, so move > > it out from host's Kconfig. > > > > Cc: Hei

[PATCH 1/1] usb: Kconfig: move ulpi bus support out of host

2016-08-16 Thread Peter Chen
The ULPI bus is not only for host, but for device mode too, so move it out from host's Kconfig. Cc: Heikki Krogerus Signed-off-by: Peter Chen --- drivers/usb/Kconfig | 20 drivers/usb/core/Kconfig | 20 2 files changed, 20 insertions(+

Re: [PATCH v2 0/3] USB Audio Gadget refactoring

2016-08-16 Thread Peter Chen
On Tue, Aug 16, 2016 at 11:32:55AM +0200, Clemens Ladisch wrote: > Peter Chen wrote: > > I find UAC2 (UAC1 is ok) support is not well with the latest mainline > > kernel w/o your patch set. The windows7 can't install the driver > > successfully > > Windows does n

Re: [PATCH] usb: phy: mxs: Add DT bindings to configure TX settings

2016-08-16 Thread Peter Chen
hy->tx_reg_set |= GM_USBPHY_TX_TXCAL45DP(val); > + } > + > + if (!of_property_read_u32(np, "fsl,tx-d-cal", &val) && > + val >= MXS_PHY_TX_D_CAL_MIN && val <= MXS_PHY_TX_D_CAL_MAX) { > + /* Scale to a 4-bit value. Round up the value

Re: [Umap2][10/11][1a0a:0102] USB host stops communicating

2016-08-17 Thread Peter Chen
ve mode as described in Section 7.1.20 [USB2.0] and drives an SE0 until the controller is reset. So, it is expected that the host stops enumerating. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord.

Re: [PATCH v5 2/2] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2016-08-17 Thread Peter Chen
MODULE_LICENSE("GPL v2"); > > +MODULE_DESCRIPTION("WhiskeyCove PMIC USB Type-C PHY driver"); > > you need to add: > > MODULE_ALIAS("platform:bxt_wcove_usbc"); > > otherwise this won't probe() automagically. > What do you mean, Felipe? If

[GIT PULL] usb: chipidea fixes for v4.8

2016-08-18 Thread Peter Chen
| 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usb: chipidea: support generic phy in PM code path

2016-08-21 Thread Peter Chen
unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v6 2/8] power: add power sequence library

2016-08-22 Thread Peter Chen
On Mon, Aug 15, 2016 at 05:13:12PM +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 sequenc

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

2016-08-22 Thread Peter Chen
On Mon, Aug 15, 2016 at 05:13:14PM +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] usb: chipidea: support generic phy in PM code path

2016-08-22 Thread Peter Chen
On Mon, Aug 22, 2016 at 02:39:21PM +0800, Jisheng Zhang wrote: > Hi Peter, > > On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote: > > > On Fri, Aug 19, 2016 at 08:10:13PM +0800, Jisheng Zhang wrote: > > > Support generic phy in PM code path: call phy_powe

Re: [PATCH v6 2/8] power: add power sequence library

2016-08-22 Thread Peter Chen
On Mon, Aug 22, 2016 at 12:23:31PM +0200, Sebastian Reichel wrote: > Hi Peter, > > On Mon, Aug 22, 2016 at 02:51:58PM +0800, Peter Chen wrote: > > On Mon, Aug 15, 2016 at 05:13:12PM +0800, Peter Chen wrote: > > > We have an well-known problem that the device needs to do s

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

2016-08-22 Thread Peter Chen
. > I will add #ifdef CONFIG_OF for related code. And put the content at hub_pwrseq_on at hub_probe directly, how about below? hub_probe() { ... if (hub_configure(hub, endpoint) >= 0) { #ifdef CONFIG_OF for_each_child_of_node(parent->of_node, np) { ret = ge

Re: usb: chipidea: hdc: kernel panic during shutdown

2016-08-23 Thread Peter Chen
ow changes: diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 96ae695..61237a9 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -103,7 +103,7 @@ static const struct ehci_driver_overrides ehci_ci_overrides = { static irqreturn_t host_irq(struct

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-08-24 Thread Peter Chen
q. > Could this be the cause of this error? UEI is an error interrupt, and software have not handled it, so it will not affect ci->status. > Should we only call isr_tr_complete_handler if UI && !UEI ? > > Or would adding a check for ci->status == NULL in isr_setup-status_phase &

Re: [PATCH v6 0/8] power: add power sequence library

2016-08-24 Thread Peter Chen
On Tue, Aug 23, 2016 at 04:02:48PM +0530, Vaibhav Hiremath wrote: > > > On Monday 15 August 2016 02:43 PM, Peter Chen wrote: > >Hi all, > > > >This is a follow-up for my last power sequence framework patch set [1]. > >According to Rob Herring and Ulf Hanss

Re: usb: chipidea: hdc: kernel panic during shutdown

2016-08-25 Thread Peter Chen
dd Li Jun to CC] > > > > > > > Alan Stern hat am 24. August 2016 um 15:45 > > > > geschrieben: > > > > > > > > > > > > On Wed, 24 Aug 2016, Peter Chen wrote: > > > > > > > > > On Tue, Aug 23, 2016 at

Re: usb: chipidea: hdc: kernel panic during shutdown

2016-08-25 Thread Peter Chen
On Thu, Aug 25, 2016 at 08:27:03AM +0200, Stefan Wahren wrote: > Am 25.08.2016 um 08:44 schrieb Peter Chen: > > On Thu, Aug 25, 2016 at 07:06:12AM +0200, Stefan Wahren wrote: > >> Hi Alan, > >> > >> i tried the following patch: > >> --- a/drivers/usb/ch

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-08-26 Thread Peter Chen
On Fri, Aug 26, 2016 at 01:47:40AM +0200, Clemens Gruber wrote: > On Wed, Aug 24, 2016 at 04:11:02PM +0800, Peter Chen wrote: > > UEI is an error interrupt, and software have not handled it, so it will > > not affect ci->status. > > > > > Should we only call isr_

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-08-26 Thread Peter Chen
On Fri, Aug 26, 2016 at 01:47:40AM +0200, Clemens Gruber wrote: > On Wed, Aug 24, 2016 at 04:11:02PM +0800, Peter Chen wrote: > > UEI is an error interrupt, and software have not handled it, so it will > > not affect ci->status. > > > > > Should we only call isr_

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-08-28 Thread Peter Chen
On Sun, Aug 28, 2016 at 08:15:02PM +0200, Clemens Gruber wrote: > On Sat, Aug 27, 2016 at 01:21:52AM +0800, Peter Chen wrote: > > The gadget triggers UI interrupt due to host sends packet. > > > > I really can't understand that, why host does not send bus reset >

Re: [PATCH v6 0/8] power: add power sequence library

2016-08-28 Thread Peter Chen
On Wed, Aug 24, 2016 at 04:53:35PM +0800, Peter Chen wrote: > On Tue, Aug 23, 2016 at 04:02:48PM +0530, Vaibhav Hiremath wrote: > > > > > > On Monday 15 August 2016 02:43 PM, Peter Chen wrote: > > >Hi all, > > > > > >This is a follow-up f

Re: [PATCH v6 0/8] power: add power sequence library

2016-08-31 Thread Peter Chen
On Wed, Aug 31, 2016 at 01:46:30PM +0530, Vaibhav Hiremath wrote: > > > On Monday 29 August 2016 04:40 PM, Peter Chen wrote: > >On Wed, Aug 24, 2016 at 04:53:35PM +0800, Peter Chen wrote: > >>On Tue, Aug 23, 2016 at 04:02:48PM +0530, Vaibhav Hiremath wrote: > >>&

Re: [PATCH v6 1/8] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library

2016-09-01 Thread Peter Chen
On Thu, Sep 01, 2016 at 01:33:22PM +0530, Vaibhav Hiremath wrote: > > > On Monday 15 August 2016 02:43 PM, Peter Chen wrote: > >Add binding doc for generic power sequence library. > > > >Signed-off-by: Peter Chen > >Acked-by: Philipp Zabel > >Acked-by

Re: [PATCH v6 0/8] power: add power sequence library

2016-09-01 Thread Peter Chen
On Wed, Aug 31, 2016 at 10:28:20PM +0530, Vaibhav Hiremath wrote: > > > On Wednesday 31 August 2016 03:22 PM, Peter Chen wrote: > >On Wed, Aug 31, 2016 at 01:46:30PM +0530, Vaibhav Hiremath wrote: > >> > >>On Monday 29 August 2016 04:40 PM, Peter Chen wrote: &

Re: [PATCH v6 2/8] power: add power sequence library

2016-09-01 Thread Peter Chen
t;+void (*free)(struct pwrseq *p); > >+}; > >+ > >+#if IS_ENABLED(CONFIG_POWER_SEQUENCE) > >+int pwrseq_get(struct device_node *np, struct pwrseq *p); > >+int pwrseq_on(struct device_node *np, struct pwrseq *p); > >+void pwrseq_off(struct pwrseq *p); >

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

2016-09-01 Thread Peter Chen
On Thu, Sep 01, 2016 at 01:32:49PM +0530, Vaibhav Hiremath wrote: > > > On Monday 15 August 2016 02:43 PM, 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 > >

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-09-01 Thread Peter Chen
On Tue, Aug 30, 2016 at 07:20:45PM +0200, Clemens Gruber wrote: > On Mon, Aug 29, 2016 at 06:24:03PM +0800, Peter Chen wrote: > > Would you please measure the voltage of vbus within 1s at below two > > conditions: > > > > - Just connect cable > > - Just discon

Re: [PATCH 1/1] subsystem:usb

2016-09-01 Thread Peter Chen
dev_info(&interface->dev, "LEGO USB Tower firmware version is %d.%d " > "build %d\n", get_version_reply.major, > get_version_reply.minor, > le16_to_cpu(get_version_reply.build_no)); > > - > +

Re: [PATCH v3 04/22] usb: chipidea: Only read/write OTGSC from one place

2016-09-01 Thread Peter Chen
it_reg() function to the only place it's used and > simplify it for polling the OTGSC register. Then we can make > certain we only use the hw_read_otgsc() API to read OTGSC, which > will make sure we properly handle extcon events. > > Cc: Peter Chen > Cc: Greg Kroah-

Re: [PATCH v3 09/22] usb: chipidea: Add support for ULPI PHY bus

2016-09-01 Thread Peter Chen
ort logic in each phy driver. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Cc: Heikki Krogerus > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/Kconfig | 7 +++ > drivers/usb/chipidea/Makefile | 1 + > drivers/usb/chipidea/ci.h | 21

Re: [PATCH v3 10/22] usb: chipidea: Consolidate extcon notifiers

2016-09-01 Thread Peter Chen
ome lines. This also makes it so that > the id cable state is true when the id pin is pulled low. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Cc: "Ivan T. Ivanov" > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/core.c | 41 ++

Re: [PATCH v3 18/22] usb: chipidea: msm: Add reset controller for PHY POR bit

2016-09-01 Thread Peter Chen
time during initialization. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/Kconfig | 1 + > drivers/usb/chipidea/ci_hdrc_msm.c | 50 > -- > 2 files changed, 49 insertions(+), 2

Re: [PATCH v3 10/22] usb: chipidea: Consolidate extcon notifiers

2016-09-04 Thread Peter Chen
On Fri, Sep 02, 2016 at 06:03:06PM -0700, Stephen Boyd wrote: > On Thu, Sep 1, 2016 at 8:17 PM, Peter Chen wrote: > > On Wed, Aug 31, 2016 at 05:40:24PM -0700, Stephen Boyd wrote: > >> > >> > >> if (cable->state) >

Re: usb: chipidea: hdc: kernel panic during shutdown

2016-09-04 Thread Peter Chen
On Fri, Sep 02, 2016 at 08:20:35PM +0200, Stefan Wahren wrote: > Hi Peter, > > > Stefan Wahren hat am 25. August 2016 um 19:17 > > geschrieben: > > > > > > Hi, > > > > > Peter Chen hat am 25. August 2016 um 11:16 > > > geschrieben:

Re: chipidea: udc: kernel panic in isr_setup_status_phase

2016-09-04 Thread Peter Chen
On Fri, Sep 02, 2016 at 06:42:43PM +0200, Clemens Gruber wrote: > On Fri, Sep 02, 2016 at 09:55:52AM +0800, Peter Chen wrote: > > Do you have other 5V to USB_H1_VBUS? USB PHY needs 5V input voltage > > as the source for USB LDO (3.0v), either from OTG or Host 1. I suspect >

Re: [PATCH] usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phase

2016-09-05 Thread Peter Chen
your USB hardware design. > + */ > + if (WARN_ON_ONCE(!ci->status)) > + return -EPIPE; > + > hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in; > ci->status->context = ci; > ci->status->complete = isr_setup_status_c

RE: [PATCH] usb: gadget: prevent potenial null pointer dereference on skb->len

2016-09-05 Thread Peter Chen
ff *eem_wrap(struct gether *port, struct >sk_buff *skb) > struct sk_buff *skb2 = NULL; > struct usb_ep *in = port->in_ep; > int headroom, tailroom, padlen = 0; >- u16 len = skb->len; >+ u16 len; > > if (!skb) > return NULL; Sorry, my careless, Thanks for fixing it. Acked-by: Peter Chen Peter

<    3   4   5   6   7   8   9   10   11   12   >