Re: [PATCH v7 1/7] regulator: fixed: add support for ACPI interface

2016-05-03 Thread Lu Baolu
Hi, On 05/03/2016 07:49 PM, Mark Brown wrote: > On Tue, May 03, 2016 at 09:43:58AM +0800, Lu Baolu wrote: >> On 05/02/2016 07:00 PM, Mark Brown wrote: >>> On Fri, Apr 29, 2016 at 02:26:32PM +0800, Lu Baolu wrote: >>>> + gpiod = gpiod_get(dev, "vbus_en"

[PATCH v8 4/7] usb: mux: add driver for Intel drcfg controlled port mux

2016-05-04 Thread Lu Baolu
Several Intel PCHs and SOCs have an internal mux that is used to share one USB port between device controller and host controller. The mux is handled through the Dual Role Configuration Register. Signed-off-by: Heikki Krogerus Signed-off-by: Lu Baolu Signed-off-by: Wu Hao Reviewed-by: Felipe

[PATCH v8 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-04 Thread Lu Baolu
Add a maintainer entry for Intel USB dual role mux drivers and add myself as a maintainer. Signed-off-by: Lu Baolu --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1d5b4be..6ab9e02 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v8 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-05-04 Thread Lu Baolu
mux switch. Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi --- drivers/usb/host/pci-quirks.c| 45 ++-- drivers/usb/host/xhci-ext-caps.h | 2 ++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb

[PATCH v8 3/7] usb: mux: add driver for Intel gpio controlled port mux

2016-05-04 Thread Lu Baolu
-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi --- drivers/usb/mux/Kconfig | 11 +++ drivers/usb/mux/Makefile | 1 + drivers/usb/mux/portmux-intel-gpio.c | 149 +++ 3 files changed, 161 insertions(+) create mode

[PATCH v8 1/7] regulator: fixed: add support for ACPI interface

2016-05-04 Thread Lu Baolu
Add support to retrieve fixed voltage configure information through ACPI interface. This is needed for Intel Bay Trail devices, where a GPIO is used to control the USB vbus. Signed-off-by: Lu Baolu --- drivers/regulator/fixed.c | 46 ++ 1 file changed

[PATCH v8 2/7] usb: mux: add generic code for dual role port mux

2016-05-04 Thread Lu Baolu
control the port mux from user space. Some other archs (e.g. Renesas R-Car gen2 SoCs) need an external mux to swap usb roles as well. This code could be leveraged for those archs as well. Signed-off-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi Reviewed-by: Chanwoo Choi

[PATCH v8 5/7] mfd: intel_vuport: Add Intel virtual USB port MFD Driver

2016-05-04 Thread Lu Baolu
owner per platform_no_drv_owner.cocci] Suggested-by: David Cohen Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi --- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/intel-vuport.c | 89 ++ 3 files change

[PATCH v8 0/7] usb: add support for Intel dual role port mux

2016-05-04 Thread Lu Baolu
series includes a driver for GPIO USB mux. (3) Drivers for USB port mux controlled through memory mapped registers and the logic to create the mux device. This type of dual role port mux could be found in Cherry Trail and Broxton devices. Lu Baolu (7): regulator: fixed: add support for

Re: [PATCH v8 1/7] regulator: fixed: add support for ACPI interface

2016-05-15 Thread Lu Baolu
Hi, On 05/13/2016 07:17 PM, Mark Brown wrote: > On Thu, May 05, 2016 at 01:32:57PM +0800, Lu Baolu wrote: > >> +gpiod = gpiod_get(dev, "gpio", GPIOD_ASIS); >> +if (IS_ERR(gpiod)) >> +return ERR_PTR(-ENODEV); >> +config->

Re: [PATCH v8 2/7] usb: mux: add generic code for dual role port mux

2016-05-25 Thread Lu Baolu
faces. struct portmux_dev *portmux_register(struct portmux_desc *desc); void portmux_unregister(struct portmux_dev *pdev); I will add below ones. struct portmux_dev *portmux_lookup_by_name(char *name); int portmux_switch(struct portmux_dev *pdev, enum port_role); The normal usage mode is 1) the mux device is registered as soon as a mux is detected with portmux_register(); 2) In components like USB PHY or changer drivers, the mux could be retrieved with portmux_lookup_by_name() and controlled via portmux_switch(). Is this helpful? Best regards, Lu Baolu -- 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 v8 2/7] usb: mux: add generic code for dual role port mux

2016-05-27 Thread Lu Baolu
x could >> > be retrieved with portmux_lookup_by_name() and controlled via >> > portmux_switch(). >> > >> > Is this helpful? > It works for me, and we can improve it later if needed. Okay, thanks. Best regards, Lu Baolu -- 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

[PATCH v9 0/7] usb: add support for Intel dual role port mux

2016-05-29 Thread Lu Baolu
mux could be found in Cherry Trail and Broxton devices. All patches have been verified to work on Intel's BayTrail, CherryTrail, and Broxton P platforms. Lu Baolu (7): regulator: fixed: add support for ACPI interface usb: mux: add generic code for dual role port mux usb: mux: add d

[PATCH v9 2/7] usb: mux: add generic code for dual role port mux

2016-05-29 Thread Lu Baolu
users are able to control the port role from user space. Some other archs (e.g. Renesas R-Car gen2 SoCs) need an external mux to swap usb roles as well. This code could also be leveraged for those archs. Signed-off-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi

[PATCH v9 5/7] mfd: intel_vuport: Add Intel virtual USB port MFD Driver

2016-05-29 Thread Lu Baolu
owner per platform_no_drv_owner.cocci] Suggested-by: David Cohen Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi Acked-by: Lee Jones --- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/intel-vuport.c | 86 ++ 3

[PATCH v9 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-05-29 Thread Lu Baolu
mux switch. Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi --- drivers/usb/host/pci-quirks.c| 42 +++- drivers/usb/host/xhci-ext-caps.h | 2 ++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb

[PATCH v9 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-29 Thread Lu Baolu
Add a maintainer entry for Intel USB dual role mux drivers and add myself as a maintainer. Signed-off-by: Lu Baolu --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ed1229e..edaeebe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v9 4/7] usb: mux: add driver for Intel drcfg controlled port mux

2016-05-29 Thread Lu Baolu
Several Intel PCHs and SOCs have an internal mux that is used to share one USB port between device controller and host controller. The mux is handled through the Dual Role Configuration Register. Signed-off-by: Heikki Krogerus Signed-off-by: Lu Baolu Signed-off-by: Wu Hao Reviewed-by: Felipe

[PATCH v9 3/7] usb: mux: add driver for Intel gpio controlled port mux

2016-05-29 Thread Lu Baolu
Chanwoo Choi] Signed-off-by: David Cohen Signed-off-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi Reviewed-by: Chanwoo Choi --- drivers/usb/mux/Kconfig | 13 +++ drivers/usb/mux/Makefile | 1 + drivers/usb/mux/portmux-intel-gpio.c | 183

[PATCH v9 1/7] regulator: fixed: add support for ACPI interface

2016-05-29 Thread Lu Baolu
Add support to retrieve fixed voltage configure information through ACPI interface. This is needed for Intel Bay Trail devices, where a GPIO is used to control the USB vbus. Signed-off-by: Lu Baolu --- drivers/regulator/fixed.c | 46 ++ 1 file changed

Re: [PATCH v9 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-30 Thread Lu Baolu
Hi Heikki, On 05/30/2016 04:16 PM, Heikki Krogerus wrote: > Hi Baolu, > > On Mon, May 30, 2016 at 01:51:44PM +0800, Lu Baolu wrote: >> Add a maintainer entry for Intel USB dual role mux drivers and >> add myself as a maintainer. >> >> Signed-off-by: Lu B

Re: [PATCH v9 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-31 Thread Lu Baolu
Hi, On 05/30/2016 08:53 PM, Lu Baolu wrote: > Hi Heikki, > > On 05/30/2016 04:16 PM, Heikki Krogerus wrote: >> Hi Baolu, >> >> On Mon, May 30, 2016 at 01:51:44PM +0800, Lu Baolu wrote: >>> Add a maintainer entry for Intel USB dual role mux driver

[PATCH v10 4/7] usb: mux: add driver for Intel drcfg controlled port mux

2016-06-01 Thread Lu Baolu
Several Intel PCHs and SOCs have an internal mux that is used to share one USB port between device controller and host controller. The mux is handled through the Dual Role Configuration Register. Signed-off-by: Heikki Krogerus Signed-off-by: Lu Baolu Signed-off-by: Wu Hao Reviewed-by: Felipe

[PATCH v10 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-06-01 Thread Lu Baolu
Add a maintainer entry for Intel USB dual role mux drivers and add myself as a maintainer. Signed-off-by: Lu Baolu --- MAINTAINERS | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7304d2e..56a98d2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v10 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-06-01 Thread Lu Baolu
mux switch. Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi --- drivers/usb/host/pci-quirks.c| 42 +++- drivers/usb/host/xhci-ext-caps.h | 2 ++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb

[PATCH v10 5/7] mfd: intel_vuport: Add Intel virtual USB port MFD Driver

2016-06-01 Thread Lu Baolu
owner per platform_no_drv_owner.cocci] Suggested-by: David Cohen Signed-off-by: Lu Baolu Reviewed-by: Felipe Balbi Acked-by: Lee Jones --- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/intel-vuport.c | 86 ++ 3

[PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-01 Thread Lu Baolu
users are able to control the port role from user space. Some other archs (e.g. Renesas R-Car gen2 SoCs) need an external mux to swap usb roles as well. This code could also be leveraged for those archs. Signed-off-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi

[PATCH v10 0/7] usb: add support for Intel dual role port mux

2016-06-01 Thread Lu Baolu
mux could be found in Cherry Trail and Broxton devices. All patches have been verified on Intel's BayTrail, CherryTrail, and Broxton P platforms. Lu Baolu (7): regulator: fixed: add support for ACPI interface usb: mux: add generic code for dual role port mux usb: mux: add drive

[PATCH v10 3/7] usb: mux: add driver for Intel gpio controlled port mux

2016-06-01 Thread Lu Baolu
Chanwoo Choi] Signed-off-by: David Cohen Signed-off-by: Lu Baolu Reviewed-by: Heikki Krogerus Reviewed-by: Felipe Balbi Reviewed-by: Chanwoo Choi --- drivers/usb/mux/Kconfig | 13 +++ drivers/usb/mux/Makefile | 1 + drivers/usb/mux/portmux-intel-gpio.c | 183

[PATCH v10 1/7] regulator: fixed: add support for ACPI interface

2016-06-01 Thread Lu Baolu
Add support to retrieve fixed voltage configure information through ACPI interface. This is needed for Intel Bay Trail devices, where a GPIO is used to control the USB vbus. Signed-off-by: Lu Baolu --- drivers/regulator/fixed.c | 46 ++ 1 file changed

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-03 Thread Lu Baolu
Hi Peter, On 06/03/2016 03:41 PM, Peter Chen wrote: > On Thu, Jun 02, 2016 at 09:37:24AM +0800, Lu Baolu wrote: >> > Several Intel platforms implement USB dual role by having completely >> > separate xHCI and dwc3 IPs in PCH or SOC silicons. These two IPs share >> &g

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-04 Thread Lu Baolu
Hi Peter, On 06/04/2016 10:28 AM, Peter Chen wrote: > On Sat, Jun 04, 2016 at 12:06:06AM +0800, Lu Baolu wrote: >>> from my point,it is a dual-role switch >>> driver too, >> No, it's not a dual-role switch driver, but a driver for USB port >> multiplexing.

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-05 Thread Lu Baolu
equirement, we > should improve it, Roger also provide an example of dual role switch with > USB3 based on his OTG core. Why do we need an OTG framework to support a device driver? Is it something like a bus or class driver? Best regards, Lu Baolu -- 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 v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-05 Thread Lu Baolu
Hi Jun, On 06/06/2016 09:08 AM, Jun Li wrote: > >> -Original Message- >> From: Lu Baolu [mailto:baolu...@linux.intel.com] >> Sent: Sunday, June 05, 2016 4:47 PM >> To: Jun Li ; Peter Chen >> Cc: felipe.ba...@linux.intel.com; Mathias Nyman ; >> Gre

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-05 Thread Lu Baolu
Hi Peter, On 06/06/2016 10:05 AM, Peter Chen wrote: > On Sun, Jun 05, 2016 at 04:46:55PM +0800, Lu Baolu wrote: >> Hi, >> >> On 06/05/2016 04:33 PM, Jun Li wrote: >>>> Port mux is part of dual role switch, but not the whole thing. >>>>> Dual role sw

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-05 Thread Lu Baolu
Hi Peter, On 06/06/2016 09:25 AM, Peter Chen wrote: > On Sun, Jun 05, 2016 at 02:55:56PM +0800, Lu Baolu wrote: >> Hi Peter, >> >> On 06/04/2016 10:28 AM, Peter Chen wrote: >>> On Sat, Jun 04, 2016 at 12:06:06AM +0800, Lu Baolu wrote: >>>>> from my po

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-06 Thread Lu Baolu
ocumentation/ABI/testing/sysfs-bus-platform. > > I agree with Roger that the dual-role switch part in your code is better > to use OTG framework to reduce redundancy. I agree that we should use dual-role framework for role switch. Actually, my code doesn't do this work. It only adds a generic framework for port mux device and two mux device drivers used in Intel platform. Best regards, Lu Baolu -- 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 v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-06 Thread Lu Baolu
t we have concern, do dual role switch through > OTG/dual-role core, not do it by itself. That really depends on how do you define "dual role". Can you please provide an unambiguous definition of "dual role" used in OTG/dual-role framework? Best regards, Lu Baolu > >

Re: [PATCH v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-07 Thread Lu Baolu
OTG/dual-role code, my understanding is that "dual-role" is a "reduced OTG" which is for DRD devices lacking of some OTG negotiation protocols. We really can't say "it's the scope of OTG/dual-role" whenever it comes to "host and peripheral". Best regards, Lu Baolu -- 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 v10 2/7] usb: mux: add generic code for dual role port mux

2016-06-07 Thread Lu Baolu
t run an unnecessary OTG state machine, even thought it has nothing to do with my system, only because the two sides of my port mux device is a host and peripheral controller. Why? Best regards, Lu Baolu -- 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 v10 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-06-08 Thread Lu Baolu
Hi Greg, On 06/08/2016 12:45 PM, Greg Kroah-Hartman wrote: > On Thu, Jun 02, 2016 at 09:37:28AM +0800, Lu Baolu wrote: >> In some Intel platforms, a single usb port is shared between USB host >> and device controllers. The shared port is under control of a switch >> which is

Re: [PATCH v10 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-06-08 Thread Lu Baolu
Hi Greg, On 06/08/2016 11:45 PM, Greg Kroah-Hartman wrote: > On Wed, Jun 08, 2016 at 03:56:04PM +0800, Lu Baolu wrote: >> Hi Greg, >> >> On 06/08/2016 12:45 PM, Greg Kroah-Hartman wrote: >>> On Thu, Jun 02, 2016 at 09:37:28AM +0800, Lu Baolu wrote: >>>>

Re: [PATCH v10 1/7] regulator: fixed: add support for ACPI interface

2016-06-08 Thread Lu Baolu
Hi Felipe and Heikki, On 06/08/2016 12:42 PM, Greg Kroah-Hartman wrote: > On Thu, Jun 02, 2016 at 09:37:23AM +0800, Lu Baolu wrote: >> Add support to retrieve fixed voltage configure information through >> ACPI interface. This is needed for Intel Bay Trail devices, where a >

Re: [PATCH v10 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-06-15 Thread Lu Baolu
Hi Greg, On 06/09/2016 10:39 AM, Lu Baolu wrote: > Hi Greg, > > On 06/08/2016 11:45 PM, Greg Kroah-Hartman wrote: >> On Wed, Jun 08, 2016 at 03:56:04PM +0800, Lu Baolu wrote: >>> Hi Greg, >>> >>> On 06/08/2016 12:45 PM, Greg Kroah-Hartman wrote: >>

Re: [PATCH v10 6/7] usb: pci-quirks: add Intel USB drcfg mux device

2016-06-19 Thread Lu Baolu
Hi Greg, On 06/18/2016 08:58 AM, Greg Kroah-Hartman wrote: > On Thu, Jun 16, 2016 at 08:27:41AM +0800, Lu Baolu wrote: >> Hi Greg, >> >> On 06/09/2016 10:39 AM, Lu Baolu wrote: >>> Hi Greg, >>> >>> On 06/08/2016 11:45 PM, Greg Kroah-Hartman wrote: &

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
stop endpoint commands. If the timer is the tail end of the last - * stop endpoint command, and the endpoint's command is still pending, we assume - * the host is dying. Best regards, Lu Baolu > > We also need to clean up the command queue before trying to halt the > xHCI host in xh

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
Hi, On 12/01/2016 02:04 PM, Baolin Wang wrote: > Hi Baolu, > > On 1 December 2016 at 13:45, Lu Baolu wrote: >> Hi, >> >> On 11/30/2016 05:02 PM, Baolin Wang wrote: >>> If the hardware never responds to the stop endpoint command, the >>> URBs will

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Lu Baolu
Hi, On 12/01/2016 03:35 PM, Baolin Wang wrote: > On 1 December 2016 at 14:35, Lu Baolu wrote: >> Hi, >> >> On 12/01/2016 02:04 PM, Baolin Wang wrote: >>> Hi Baolu, >>> >>> On 1 December 2016 at 13:45, Lu Baolu wrote: >>>> Hi, >&

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Lu Baolu
Hi, On 12/01/2016 04:03 PM, Baolin Wang wrote: > On 1 December 2016 at 15:44, Lu Baolu wrote: >> Hi, >> >> On 12/01/2016 03:35 PM, Baolin Wang wrote: >>> On 1 December 2016 at 14:35, Lu Baolu wrote: >>>> Hi, >>>> >>>> On 12/01/

[PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Lu Baolu
# v3.16+ Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bdf6b13..13e05f6 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/h

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-01 Thread Lu Baolu
Hi, On 12/02/2016 12:18 PM, Baolin Wang wrote: > On 2 December 2016 at 10:29, Lu Baolu wrote: >> handle_cmd_completion() frees a command structure which might >> be still referenced by xhci->current_cmd. This might cause >> problem when xhci->current_cmd is accessed af

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-05 Thread Lu Baolu
Hi, On 12/02/2016 09:39 PM, Mathias Nyman wrote: > On 02.12.2016 04:29, Lu Baolu wrote: >> handle_cmd_completion() frees a command structure which might >> be still referenced by xhci->current_cmd. This might cause >> problem when xhci->current_cmd is accessed after t

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
atch for that one case > it seems that patch 2/2 can be replaced by a single line change: > > if (!xhci->current_cmd || timer_pending(&xhci->cmd_timer)) > > Right? > > -Mathias > It seems that the watch dog algorithm for command queue becomes more and more complica

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:06 PM, Baolin Wang wrote: > Hi, > > On 20 December 2016 at 12:29, Lu Baolu wrote: >> Hi Mathias, >> >> On 12/19/2016 08:13 PM, Mathias Nyman wrote: >>> On 19.12.2016 13:34, Baolin Wang wrote: >>>> Hi Mathias, >>>>

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:46 PM, Baolin Wang wrote: > On 20 December 2016 at 14:39, Lu Baolu wrote: >> Hi, >> >> On 12/20/2016 02:06 PM, Baolin Wang wrote: >>> Hi, >>> >>> On 20 December 2016 at 12:29, Lu Baolu wrote: >>>> Hi Mathias, >

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-20 Thread Lu Baolu
n"); 368 xhci_cleanup_command_queue(xhci); 369 } else { 370 unsigned long flags; 371 372 spin_lock_irqsave(&xhci->lock, flags); 373 xhci_handle_stopped_cmd_ring(xhci, xhci_next_queued_cmd(xhci)); 374 spin_u

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-20 Thread Lu Baolu
>current_cmd); 1327 spin_unlock_irqrestore(&xhci->lock, flags); This part of code is tricky. I have no idea about in which case should this code be executed? Anyway, we shouldn't call xhci_handle_stopped_cmd_ring() here, right? 1328 return; 1329 } Best regards, Lu Baolu -- 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 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:57 PM, Mathias Nyman wrote: > On 21.12.2016 08:57, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of >> xhci_handle_command_timeout() as well. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:48 PM, Mathias Nyman wrote: > On 21.12.2016 08:17, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of xhci_abort_cmd_ring() below. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >>&

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Lu Baolu
D to >> CMD_RING_STATE_RUNNING so ring will really restart in the interrupt >> handler. > Just for record (no chance to make patch I myself for now, sorry), while > checking locking slightly, I noticed unrelated missing locking. > > xhci_cleanup_command_queue() > >

Re: [PATCH 2/2] phy: Add new Intel Cherrytrail USB OTG phy driver

2016-12-22 Thread Lu Baolu
= platform_get_resource(pdev, IORESOURCE_MEM, 0); > + size = (res->end + 1) - res->start; "res" is used without check. > + phy->base = devm_ioremap_nocache(dev, res->start, size); This resource is part of xHCI MMIO. xHCI driver has already declared to use the who

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Lu Baolu
be an acceptable solution ? > For me? sure :-) Let's get Greg and Oliver to agree though. > >> About the "other 2-patch dwc3 series", I'm fine with you not taking >> the IDA patch, but the first patch is unrelated to IDA, it is a pure >> bug-fix and real

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Lu Baolu
but the first patch is unrelated to IDA, it is a pure >>> bug-fix and really should be upstreamed. >>> >>> Matthias, assuming Felipe is ok with putting this in drivers/misc >>> (minus the phy bindings), are you ok with the xhci blurb which >>> registers t

[PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
of calling functions without locking in xhci_handle_command_timeout(). Cc: # 3.7+ Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 7971

[PATCH 0/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
Hi Mathias, This is a follow-up patch for below comment "fix the lock to cover abort+CRR check, and send it to usb-linus +stable" in below discussion thread. https://lkml.org/lkml/2016/12/21/186 It's based on v4.9. Best regards, Lu Baolu Lu Baolu (1): usb: xhci:

[PATCH 0/1] xhci: Fix race related to abort operation

2016-12-22 Thread Lu Baolu
ng waiting for the command stopped event. It sits at the same place in your timeout_race_fixes branch. (git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes) Best regards, Lu Baolu OGAWA Hirofumi (1): xhci: Fix race related to abort operation drivers/usb/host

[PATCH 1/1] xhci: Fix race related to abort operation

2016-12-22 Thread Lu Baolu
CMD_RING_PAUSE operation] [baolu: release xhci->lock before wait and apply it back again after wait. This is the reason my signed-off-by is added.] CC: Signed-off-by: OGAWA Hirofumi Signed-off-by: Lu Baolu Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 1 + drivers/usb/host/x

[PATCH 4/4] usb: xhci: warn on command timeout in stopped command ring

2016-12-22 Thread Lu Baolu
situation to the upper layer. In rare cases, if the driver sees a command timeout in a stopped command ring, driver should let the user know it. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci

[PATCH 0/4] refactor command timeout handling

2016-12-22 Thread Lu Baolu
usb: xhci: warn on command timeout in stopped command ring are my proposals. They base on the top of your timeout_race_fixes branch. (git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes) Lu Baolu (4): usb: xhci: remove unnecessary second abort try usb: xhci: r

[PATCH 1/4] usb: xhci: remove unnecessary second abort try

2016-12-22 Thread Lu Baolu
The second try was a workaround for (what we thought was) command ring failing to stop in the first place. But this turns out to be due to the race that we have fixed(see "xhci: Fix race related to abort operation"). With that fix, it is time to remove the second try. Signed-off-by

[PATCH 2/4] usb: xhci: remove CRR polling in xhci_abort_cmd_ring()

2016-12-22 Thread Lu Baolu
cpu cycles are wasted on polling registers. This patch removes polling for CRR (Command Ring Running). Wait for completion, and check CRR if completion times out is enough. Suggested-by: Mathias Nyman Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 49

[PATCH 3/4] usb: xhci: add XHCI_MISS_CA_EVENT quirk bit

2016-12-22 Thread Lu Baolu
ts, if the command completion for abort command ring misses, we shall assume that there are larger problems with the host and assert HCRST. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 17 + drivers/usb/host/xhci.h | 6 ++ 2 files changed, 11 insertions(+), 12

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-26 Thread Lu Baolu
and interrupt threads. Or, I missed anything? Best regards, Lu Baolu > > Signed-off-by: Baolin Wang > --- > drivers/usb/dwc3/gadget.c |6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c >

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-26 Thread Lu Baolu
Hi, On 12/27/2016 10:58 AM, Baolin Wang wrote: > Hi, > > On 27 December 2016 at 10:39, Lu Baolu wrote: >> Hi, >> >> On 12/26/2016 04:01 PM, Baolin Wang wrote: >>> On some platfroms(like x86 platform), when one core is running the USB >>> gadget &g

Re: [PATCH 06/37] usb: host: xhci: WARN on unexpected COMP_SUCCESS

2016-12-29 Thread Lu Baolu
td->urb->ep->desc.bEndpointAddress, > - requested, remaining); > - } > + dev_WARN_ONCE(dev, (ep_trb != td->last_trb) || remaining, > + "ep%d%s: unexpected success! TRB %p/%p size > %d/%d\n", > +

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2016-12-29 Thread Lu Baolu
d as a RW type. 724 temp = readl(&xhci->op_regs->status); 725 writel(temp & ~STS_EINT, &xhci->op_regs->status); I will correct these in a separated patch and cc stable as well. Best regards, Lu Baolu > > Signed-off-by: Felipe Balbi > --- >

Re: [PATCH 24/37] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-29 Thread Lu Baolu
trb->generic.field[1] = 0; > + trb->generic.field[2] = 0; > + /* Preserve only the cycle bit of this TRB */ > + trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); > + trb->generic.field[3] = cpu_to_le32(TRB_TYPE(TRB_CMD

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2016-12-29 Thread Lu Baolu
S(ring, trb) > +); > + > +DEFINE_EVENT(xhci_log_trb, xhci_handle_command, > + TP_PROTO(struct xhci_ring *ring, struct xhci_generic_trb *trb), > + TP_ARGS(ring, trb) > +); > + > +DEFINE_EVENT(xhci_log_trb, xhci_handle_transfer, > + TP_PROTO(struct xhci_ring *r

[PATCH 1/1] usb: xhci: clear EINT bit in status correctly

2016-12-29 Thread Lu Baolu
4+ CC: Felipe Balbi Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1cd5641..18ea6b8 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -721,7 +

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:52 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> On 12/29/2016 07:00 PM, Felipe Balbi wrote: >>> Many other bits in USBSTS register are "clear-by-writing-1". Let's make >>> sure that we clear *only* STS_EINT and not a

Re: [PATCH 24/37] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:54 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> On 12/29/2016 07:00 PM, Felipe Balbi wrote: >>> instead of open coding how to convert a TRB to no-op, let's use our >>> newly introduced helper. >>> >>> Signed-

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2016-12-31 Thread Lu Baolu
Hi, On 12/30/2016 03:47 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >>> +DEFINE_EVENT(xhci_log_trb, xhci_handle_event, >>> + TP_PROTO(struct xhci_ring *ring, struct xhci_generic_trb *trb), >>> + TP_ARGS(ring, trb) >>> +); >>>

Re: [PATCH 09/37] usb: host: xhci: clear only STS_EINT

2017-01-02 Thread Lu Baolu
Hi, On 01/02/2017 04:47 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> Hi, >> >> On 12/30/2016 03:52 PM, Felipe Balbi wrote: >>> Hi, >>> >>> Lu Baolu writes: >>>> On 12/29/2016 07:00 PM, Felipe Balbi wrote: >>>

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-02 Thread Lu Baolu
Hi, On 01/02/2017 04:53 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> Hi, >> >> On 12/30/2016 03:47 PM, Felipe Balbi wrote: >>> Hi, >>> >>> Lu Baolu writes: >>>>> +DEFINE_EVENT(xhci_log_trb, xhci_handle_event,

[PATCH v2 1/1] usb: xhci: clear EINT bit in status correctly

2017-01-02 Thread Lu Baolu
4+ Cc: Felipe Balbi Signed-off-by: Lu Baolu --- Change log: v1->v2: - Fixed a warning reported by 0-day kbuild robot. drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 1cd5641..bb08c6b 1006

[PATCH 3/4] usb: xhci: use list_is_singular for cmd_list

2017-01-03 Thread Lu Baolu
Use list_is_singular() to check if cmd_list has only one entry. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 95be9e8..40947e7 100644 --- a

[PATCH 4/4] usb: xhci: remove unnecessary return in xhci_pci_setup()

2017-01-03 Thread Lu Baolu
Remove the unnecessary return line in xhci_pci_setup(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index e96ae80..ace3f57 100644 --- a/drivers/usb/host/xhci-pci.c +++ b

[PATCH 0/4] several cleanup patches

2017-01-03 Thread Lu Baolu
Hi Mathias, This series includes several tiny cleanup patches for xhci host controller driver. These make the code slightly more readable. There's no functional change. Please consider it for your for-usb-next branch. Best regards, Lu Baolu Lu Baolu (4): usb: xhci: remove unnece

[PATCH 1/4] usb: xhci: remove unnecessary assignment

2017-01-03 Thread Lu Baolu
Drop an unnecessary assignment in prepare_transfer(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bdf6b13..3cc303f 100644 --- a/drivers/usb/host/xhci-ring.c +++ b

[PATCH 2/4] usb: xhci: avoid unnecessary calculation

2017-01-03 Thread Lu Baolu
No need to calculate remainder and length_field, if there is no data phase of a control transfer. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host

Re: [PATCH 4/4] usb: xhci: remove unnecessary return in xhci_pci_setup()

2017-01-04 Thread Lu Baolu
Hi, On 01/05/2017 02:12 AM, Andy Shevchenko wrote: > On Wed, Jan 4, 2017 at 3:51 AM, Lu Baolu wrote: >> Remove the unnecessary return line in xhci_pci_setup(). >> >> Signed-off-by: Lu Baolu >> --- >> drivers/usb/host/xhci-pci.c | 2 -- >> 1 file cha

[PATCH 1/1] usb: xhci: set RWE only for remote wakeup capable devices

2017-01-12 Thread Lu Baolu
d-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 0c8deb9..d887e09 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4191,7 +4191,

Re: [PATCH 1/1] usb: xhci: set RWE only for remote wakeup capable devices

2017-01-12 Thread Lu Baolu
Hi Mathias, On 01/12/2017 04:53 PM, Lu Baolu wrote: > Xhci spec requires in section 4.23.5.1.1.1 that the RWE bit of USB2 > PORTPMSC register should only set for remote wakeup capble devices. > > This was suggested by Mathias in the following discussion thread. > http://marc.info

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-15 Thread Lu Baolu
B_CYCLE ? 'C' : 'c'); > + break; > + case TRB_STOP_RING: > + sprintf(str, "%s: slot %d sp %d ep %d flags %c", > + xhci_trb_type_string(TRB_FIELD_TO_TYPE(field3)), > + TRB_TO_SL

Re: [PATCH 31/37] usb: host: xhci: add urb_enqueue/dequeue/giveback tracers

2017-01-15 Thread Lu Baolu
gt; +++ b/drivers/usb/host/xhci.c > @@ -1383,6 +1383,8 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb > *urb, gfp_t mem_flags) > urb_priv->td_cnt = 0; > urb->hcpriv = urb_priv; > > + trace_xhci_urb_enqueue(urb); > + > if (usb_endpoint_xf

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-15 Thread Lu Baolu
Hi, On 01/16/2017 03:03 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> On 12/29/2016 07:01 PM, Felipe Balbi wrote: >>> instead of having a tracer that can only trace command completions, >>> let's promote this tracer so it can trace and decode any TRB

Re: [PATCH 35/37] usb: host: xhci: remove newline from tracer

2017-01-15 Thread Lu Baolu
m + 1)); > ), > - TP_printk("\nctx_64=%d, ctx_type=%u, ctx_dma=@%llx, ctx_va=@%p", > + TP_printk("ctx_64=%d, ctx_type=%u, ctx_dma=@%llx, ctx_va=@%p", > __entry->ctx_64, __entry->ctx_type, > (unsigned long

Re: [PATCH 36/37] usb: host: xhci: add xhci_virt_device tracer

2017-01-16 Thread Lu Baolu
t the same time. > + > DECLARE_EVENT_CLASS(xhci_log_urb, > TP_PROTO(struct urb *urb), > TP_ARGS(urb), > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index c0f3670e5a51..e5f095b276fc 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xh

Re: [PATCH 30/37] usb: host: xhci: make a generic TRB tracer

2017-01-16 Thread Lu Baolu
Hi, On 01/16/2017 04:55 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >>>>> + __entry->type = ring->type; >>>>> + __entry->field0 = le32_to_cpu(trb->field[0]); >>>>> + __entry->field1 = le32_to_

Re: [PATCH 31/37] usb: host: xhci: add urb_enqueue/dequeue/giveback tracers

2017-01-16 Thread Lu Baolu
Hi, On 01/16/2017 04:59 PM, Felipe Balbi wrote: > Hi, > > Lu Baolu writes: >> Hi, >> >> On 12/29/2016 07:01 PM, Felipe Balbi wrote: >>> These three new tracers will help us tie TRBs into URBs by *also* >>> looking into URB lifetime. >>

  1   2   3   4   5   6   7   >