Re: [PATCH] usb: reducing an usb-port auto-resume latency.

2017-08-23 Thread Mathias Nyman
On 23.08.2017 09:18, anshuman.gu...@intel.com wrote: From: Anshuman Gupta This patch will improve the variable auto-resume latency of an usb-port. When xhci gets a port status change event interrupt due to PORT_PLC (port link state transition), linux Host controller driver drives the resume

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-18 Thread Mathias Nyman
On 16.08.2017 05:15, Lu Baolu wrote: Hi, On 08/15/2017 07:30 PM, Mathias Nyman wrote: On 11.08.2017 05:41, Lu Baolu wrote: Xhci driver handles USB transaction errors on transfer events, but transaction errors are possible on address device command completion events as well. The xHCI

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-18 Thread Mathias Nyman
On 16.08.2017 05:15, Lu Baolu wrote: Hi, On 08/15/2017 07:30 PM, Mathias Nyman wrote: On 11.08.2017 05:41, Lu Baolu wrote: Xhci driver handles USB transaction errors on transfer events, but transaction errors are possible on address device command completion events as well. The xHCI

Re: [PATCH v5 1/1] usb:host:xhci support option to disable the xHCI USB2 HW LPM

2017-08-18 Thread Mathias Nyman
On 17.08.2017 06:19, Thang Q. Nguyen wrote: On Tue, Aug 8, 2017 at 11:27 AM, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI-compliant controllers to always enable hardware USB2 LPM. However, the current xHCI driver always enable it when seeing HLC=1. This

Re: [PATCH v5 1/1] usb:host:xhci support option to disable the xHCI USB2 HW LPM

2017-08-18 Thread Mathias Nyman
On 17.08.2017 06:19, Thang Q. Nguyen wrote: On Tue, Aug 8, 2017 at 11:27 AM, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI-compliant controllers to always enable hardware USB2 LPM. However, the current xHCI driver always enable it when seeing HLC=1. This patch supports an

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-15 Thread Mathias Nyman
through below links. http://marc.info/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Lu Baolu <baolu...@linux.intel.com> --- drivers/usb/host/xhci.c | 5 + 1 fil

Re: [PATCH v3 5/5] usb: xhci: Handle USB transaction error on address command

2017-08-15 Thread Mathias Nyman
through below links. http://marc.info/?l=linux-usb=149362010728921=2 http://marc.info/?l=linux-usb=149252752825755=2 Suggested-by: Mathias Nyman Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-10 Thread Mathias Nyman
On 10.08.2017 03:35, Lu Baolu wrote: Hi, On 08/09/2017 03:58 PM, Mathias Nyman wrote: On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() is a helper for disabling a slot when a device goes away or recovers from error situations. Currently, it checks the corespoding virt-dev pointer

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-10 Thread Mathias Nyman
On 10.08.2017 03:35, Lu Baolu wrote: Hi, On 08/09/2017 03:58 PM, Mathias Nyman wrote: On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() is a helper for disabling a slot when a device goes away or recovers from error situations. Currently, it checks the corespoding virt-dev pointer

Re: [PATCH v2 2/5] usb: xhci: Fix potential memory leak in xhci_disable_slot()

2017-08-09 Thread Mathias Nyman
On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() allows the invoker to pass a command pointer as paramenter. Otherwise, it will allocate one. This will cause memory leak when a command structure was allocated inside of this function while queuing command trb fails. Another problem comes

Re: [PATCH v2 2/5] usb: xhci: Fix potential memory leak in xhci_disable_slot()

2017-08-09 Thread Mathias Nyman
On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() allows the invoker to pass a command pointer as paramenter. Otherwise, it will allocate one. This will cause memory leak when a command structure was allocated inside of this function while queuing command trb fails. Another problem comes

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-09 Thread Mathias Nyman
On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() is a helper for disabling a slot when a device goes away or recovers from error situations. Currently, it checks the corespoding virt-dev pointer and returns directly (w/o issuing disable slot command) if it's null. This is unnecessary

Re: [PATCH v2 1/5] usb: xhci: Disable slot even virt-dev is null

2017-08-09 Thread Mathias Nyman
On 27.07.2017 05:21, Lu Baolu wrote: xhci_disable_slot() is a helper for disabling a slot when a device goes away or recovers from error situations. Currently, it checks the corespoding virt-dev pointer and returns directly (w/o issuing disable slot command) if it's null. This is unnecessary

Re: [PATCH] xhci: fix memleak in xhci_run()

2017-07-20 Thread Mathias Nyman
On 20.07.2017 08:40, shuw...@redhat.com wrote: From: Shu Wang Found this issue by kmemleak. xhci_run() did not check return val and free command for xhci_queue_vendor_command() unreferenced object 0x88011c0be500 (size 64): comm "kworker/0:1", pid 58, jiffies

Re: [PATCH] xhci: fix memleak in xhci_run()

2017-07-20 Thread Mathias Nyman
On 20.07.2017 08:40, shuw...@redhat.com wrote: From: Shu Wang Found this issue by kmemleak. xhci_run() did not check return val and free command for xhci_queue_vendor_command() unreferenced object 0x88011c0be500 (size 64): comm "kworker/0:1", pid 58, jiffies 4294670908 (age 50.420s)

Re: [PATCH 2/2] usb: host: pci_quirks: Force hard reset of Renesas uPD72020x USB controller

2017-07-17 Thread Mathias Nyman
b/host/pci-quirks.h | 1 + drivers/usb/host/xhci-pci.c | 7 +++ 3 files changed, 28 insertions(+) Acked-by: Mathias Nyman <mathias.ny...@linux.intel.com>

Re: [PATCH 2/2] usb: host: pci_quirks: Force hard reset of Renesas uPD72020x USB controller

2017-07-17 Thread Mathias Nyman
+ drivers/usb/host/xhci-pci.c | 7 +++ 3 files changed, 28 insertions(+) Acked-by: Mathias Nyman

Re: usb data toggle reset in xhci_endpoint_reset

2017-06-28 Thread Mathias Nyman
On 28.06.2017 16:17, Dennis Wassenberg wrote: Hi all, I have a question regarding the usb data toggle reset patch at https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/log/?h=ep_reset_halt_test I know that it is just experimental. Now I am in the situation that I need exactly

Re: usb data toggle reset in xhci_endpoint_reset

2017-06-28 Thread Mathias Nyman
On 28.06.2017 16:17, Dennis Wassenberg wrote: Hi all, I have a question regarding the usb data toggle reset patch at https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/log/?h=ep_reset_halt_test I know that it is just experimental. Now I am in the situation that I need exactly

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-13 Thread Mathias Nyman
On 06.06.2017 09:33, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 9:33 PM, Mathias Nyman <mathias.ny...@intel.com> wrote: On 05.06.2017 15:57, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 6:14 PM, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 20.05.2017 10:24, Tha

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-13 Thread Mathias Nyman
On 06.06.2017 09:33, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 9:33 PM, Mathias Nyman wrote: On 05.06.2017 15:57, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 6:14 PM, Mathias Nyman wrote: On 20.05.2017 10:24, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI 1.0

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-05 Thread Mathias Nyman
On 05.06.2017 15:57, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 6:14 PM, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 20.05.2017 10:24, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI 1.0 compliant controllers to always enable hardware USB2 LPM. H

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-05 Thread Mathias Nyman
On 05.06.2017 15:57, Thang Q. Nguyen wrote: On Mon, Jun 5, 2017 at 6:14 PM, Mathias Nyman wrote: On 20.05.2017 10:24, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI 1.0 compliant controllers to always enable hardware USB2 LPM. However, the current xHCI driver always

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-05 Thread Mathias Nyman
On 20.05.2017 10:24, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI 1.0 compliant controllers to always enable hardware USB2 LPM. However, the current xHCI driver always enable it by setting HLE=1 when seeing HLC=1. This makes certain xHCI controllers that have broken USB2

Re: [v2 1/1] usb:host:xhci support option to disable xHCI 1.0 USB2 HW LPM

2017-06-05 Thread Mathias Nyman
On 20.05.2017 10:24, Thang Q. Nguyen wrote: XHCI specification 1.1 does not require xHCI 1.0 compliant controllers to always enable hardware USB2 LPM. However, the current xHCI driver always enable it by setting HLE=1 when seeing HLC=1. This makes certain xHCI controllers that have broken USB2

Re: [LINUX PATCH] usb: xhci: Add toggle cycle bit for the last seg trb when cached ring is used

2017-06-01 Thread Mathias Nyman
On 31.05.2017 16:41, Anurag Kumar Vulisha wrote: At present USB 2.0 cameras fail to play when run for 2nd time or greater. This issue occurs only when previous endpoint cached ring is used instead of allocating a new endpoint ring. The root cause of the problem narrows down to the Toggle bit,

Re: [LINUX PATCH] usb: xhci: Add toggle cycle bit for the last seg trb when cached ring is used

2017-06-01 Thread Mathias Nyman
On 31.05.2017 16:41, Anurag Kumar Vulisha wrote: At present USB 2.0 cameras fail to play when run for 2nd time or greater. This issue occurs only when previous endpoint cached ring is used instead of allocating a new endpoint ring. The root cause of the problem narrows down to the Toggle bit,

Re: [PATCH] usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk

2017-05-29 Thread Mathias Nyman
On 27.05.2017 22:26, Corentin Labbe wrote: When plugging an USB webcam I see the following message: [106385.615559] xhci_hcd :04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk? [106390.583860] handle_tx_event: 913 callbacks suppressed With this patch

Re: [PATCH] usb: xhci: ASMedia ASM1042A chipset need shorts TX quirk

2017-05-29 Thread Mathias Nyman
On 27.05.2017 22:26, Corentin Labbe wrote: When plugging an USB webcam I see the following message: [106385.615559] xhci_hcd :04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk? [106390.583860] handle_tx_event: 913 callbacks suppressed With this patch

Re: I'd like to donate a MacBook Pro

2017-05-11 Thread Mathias Nyman
On 04.05.2017 05:34, Alex Henrie wrote: 2017-05-03 8:58 GMT-06:00 Joerg Roedel : On Wed, May 03, 2017 at 08:35:47AM -0600, Alex Henrie wrote: 2017-05-03 5:58 GMT-06:00 Greg KH : On Tue, May 02, 2017 at 10:55:09PM -0600, Alex Henrie wrote: Today I

Re: I'd like to donate a MacBook Pro

2017-05-11 Thread Mathias Nyman
On 04.05.2017 05:34, Alex Henrie wrote: 2017-05-03 8:58 GMT-06:00 Joerg Roedel : On Wed, May 03, 2017 at 08:35:47AM -0600, Alex Henrie wrote: 2017-05-03 5:58 GMT-06:00 Greg KH : On Tue, May 02, 2017 at 10:55:09PM -0600, Alex Henrie wrote: Today I ran a regression test to determine which

Re: [PATCH v1] ACPI: Switch to use generic UUID API

2017-05-09 Thread Mathias Nyman
, 3, 1, NULL); ACPI_FREE(obj); } For the xhci part above: Acked-by: Mathias Nyman <mathias.ny...@linux.intel.com>

Re: [PATCH v1] ACPI: Switch to use generic UUID API

2017-05-09 Thread Mathias Nyman
, 3, 1, NULL); ACPI_FREE(obj); } For the xhci part above: Acked-by: Mathias Nyman

Re: Asmedia USB 1343 crashes

2017-05-04 Thread Mathias Nyman
command ring failed [294504.576799] xhci_hcd :02:00.0: xHCI host not responding to stop endpoint command. [294504.576805] xhci_hcd :02:00.0: Assuming host is dying, halting host. At this point you have reached the limit of my knowledge. The best person to help is Mathias Nyman, the xHCI

Re: Asmedia USB 1343 crashes

2017-05-04 Thread Mathias Nyman
command ring failed [294504.576799] xhci_hcd :02:00.0: xHCI host not responding to stop endpoint command. [294504.576805] xhci_hcd :02:00.0: Assuming host is dying, halting host. At this point you have reached the limit of my knowledge. The best person to help is Mathias Nyman, the xHCI

Re: [REGRESSION next-20170410] Commit a6ff6cbf1fab ("usb: xhci: Add helper function xhci_set_power_on().") breaks armada-385

2017-04-13 Thread Mathias Nyman
On 12.04.2017 10:47, Ralph Sennhauser wrote: Hi Guoqing Zhang, Commit a6ff6cbf1fabe7500d8ac25e133e3346db0a0fca ("usb: xhci: Add helper function xhci_set_power_on().") causes a null pointer dereference on an armada-385. Below the kernel as well as the bisect log. Seems Guoqing Zhang is not

Re: [REGRESSION next-20170410] Commit a6ff6cbf1fab ("usb: xhci: Add helper function xhci_set_power_on().") breaks armada-385

2017-04-13 Thread Mathias Nyman
On 12.04.2017 10:47, Ralph Sennhauser wrote: Hi Guoqing Zhang, Commit a6ff6cbf1fabe7500d8ac25e133e3346db0a0fca ("usb: xhci: Add helper function xhci_set_power_on().") causes a null pointer dereference on an armada-385. Below the kernel as well as the bisect log. Seems Guoqing Zhang is not

Re: [PATCH] usb: host: plat: Enable xHCI plat runtime PM

2017-04-10 Thread Mathias Nyman
On 10.04.2017 10:57, Baolin Wang wrote: Hi Mathias, On 30 March 2017 at 11:26, Baolin Wang wrote: Enable the xHCI plat runtime PM for parent device to suspend/resume xHCI. Also call pm_runtime_forbid() in probe() function to force users to explicitly enable runtime pm

Re: [PATCH] usb: host: plat: Enable xHCI plat runtime PM

2017-04-10 Thread Mathias Nyman
On 10.04.2017 10:57, Baolin Wang wrote: Hi Mathias, On 30 March 2017 at 11:26, Baolin Wang wrote: Enable the xHCI plat runtime PM for parent device to suspend/resume xHCI. Also call pm_runtime_forbid() in probe() function to force users to explicitly enable runtime pm using power/control in

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-27 Thread Mathias Nyman
On 24.03.2017 18:25, Diego Viola wrote: On Thu, Mar 23, 2017 at 2:12 PM, Diego Viola <diego.vi...@gmail.com> wrote: On Thu, Mar 23, 2017 at 2:02 PM, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 22.03.2017 19:51, Mathias Nyman wrote: On 22.03.2017 00:52, Diego Viola wro

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-27 Thread Mathias Nyman
On 24.03.2017 18:25, Diego Viola wrote: On Thu, Mar 23, 2017 at 2:12 PM, Diego Viola wrote: On Thu, Mar 23, 2017 at 2:02 PM, Mathias Nyman wrote: On 22.03.2017 19:51, Mathias Nyman wrote: On 22.03.2017 00:52, Diego Viola wrote: On Tue, Mar 21, 2017 at 12:29 PM, Diego Viola wrote

[RFT PATCH] xhci: Manually give back cancelled URBs if queuing for cancel fails

2017-03-24 Thread Mathias Nyman
tart_wait_urb+0xe5/0x170 [usbcore] [ 245.285541] ? try_to_del_timer_sync+0x53/0x80 [ 245.286434] usb_bulk_msg+0xbd/0x160 [usbcore] [ 245.287326] rtsx_usb_send_cmd+0x63/0x90 [rtsx_usb] Reported-by: diego.vi...@gmail.com Cc: sta...@vger.kernel.org Signed-off-by: Mathias Nyman <mathias.ny...

[RFT PATCH] xhci: Manually give back cancelled URBs if queuing for cancel fails

2017-03-24 Thread Mathias Nyman
tart_wait_urb+0xe5/0x170 [usbcore] [ 245.285541] ? try_to_del_timer_sync+0x53/0x80 [ 245.286434] usb_bulk_msg+0xbd/0x160 [usbcore] [ 245.287326] rtsx_usb_send_cmd+0x63/0x90 [rtsx_usb] Reported-by: diego.vi...@gmail.com Cc: sta...@vger.kernel.org Signed-off-by: Mathias Nyman --- drivers/usb/hos

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-23 Thread Mathias Nyman
On 22.03.2017 19:51, Mathias Nyman wrote: On 22.03.2017 00:52, Diego Viola wrote: On Tue, Mar 21, 2017 at 12:29 PM, Diego Viola <diego.vi...@gmail.com> wrote: On Tue, Mar 21, 2017 at 10:04 AM, Diego Viola <diego.vi...@gmail.com> wrote: On Mon, Mar 20, 2017 at 8:15 PM, Diego Vio

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-23 Thread Mathias Nyman
On 22.03.2017 19:51, Mathias Nyman wrote: On 22.03.2017 00:52, Diego Viola wrote: On Tue, Mar 21, 2017 at 12:29 PM, Diego Viola wrote: On Tue, Mar 21, 2017 at 10:04 AM, Diego Viola wrote: On Mon, Mar 20, 2017 at 8:15 PM, Diego Viola wrote: On Mon, Mar 20, 2017 at 3:27 PM, Diego Viola

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-22 Thread Mathias Nyman
Mon, Mar 20, 2017 at 3:27 PM, Diego Viola <diego.vi...@gmail.com> wrote: On Mon, Mar 20, 2017 at 1:32 PM, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 20.03.2017 17:39, Diego Viola wrote: On Mon, Mar 20, 2017 at 11:21 AM, Mathias Nyman <mathias.ny...@linux.intel.com>

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-22 Thread Mathias Nyman
, Mathias Nyman wrote: On 20.03.2017 17:39, Diego Viola wrote: On Mon, Mar 20, 2017 at 11:21 AM, Mathias Nyman wrote: On 19.03.2017 23:29, Diego Viola wrote: Still a problem with 4.11.0-rc2-ARCH+ xhci tracing can be added with: mount -t debugfs none /sys/kernel/debug echo xhci-hcd >>

Re: [PATCH v3] usb: xhci: bInterval quirk for TI TUSB73x0

2017-03-22 Thread Mathias Nyman
On 22.03.2017 13:43, Roger Quadros wrote: As per [1] issue #4, "The periodic EP scheduler always tries to schedule the EPs that have large intervals (interval equal to or greater than 128 microframes) into different microframes. So it maintains an internal counter and increments for each large

Re: [PATCH v3] usb: xhci: bInterval quirk for TI TUSB73x0

2017-03-22 Thread Mathias Nyman
On 22.03.2017 13:43, Roger Quadros wrote: As per [1] issue #4, "The periodic EP scheduler always tries to schedule the EPs that have large intervals (interval equal to or greater than 128 microframes) into different microframes. So it maintains an internal counter and increments for each large

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-03-22 Thread Mathias Nyman
On 22.03.2017 12:40, Baolin Wang wrote: Hi, On 22 March 2017 at 17:00, Felipe Balbi wrote: Hi, Baolin Wang writes: I don't yet understand why we can't just keep runtime pm disabled as a default for xhci platform devices. It could be enabled by

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-03-22 Thread Mathias Nyman
On 22.03.2017 12:40, Baolin Wang wrote: Hi, On 22 March 2017 at 17:00, Felipe Balbi wrote: Hi, Baolin Wang writes: I don't yet understand why we can't just keep runtime pm disabled as a default for xhci platform devices. It could be enabled by whatever creates the platform device by

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-20 Thread Mathias Nyman
On 20.03.2017 17:39, Diego Viola wrote: On Mon, Mar 20, 2017 at 11:21 AM, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 19.03.2017 23:29, Diego Viola wrote: Still a problem with 4.11.0-rc2-ARCH+ 4.11-rc2 has better xhci tracing, it shows each URB enqueue and dequeue and gi

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-20 Thread Mathias Nyman
On 20.03.2017 17:39, Diego Viola wrote: On Mon, Mar 20, 2017 at 11:21 AM, Mathias Nyman wrote: On 19.03.2017 23:29, Diego Viola wrote: Still a problem with 4.11.0-rc2-ARCH+ 4.11-rc2 has better xhci tracing, it shows each URB enqueue and dequeue and giveback. Could you try enabling xhci

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-20 Thread Mathias Nyman
ugzilla.kernel.org/attachment.cgi?id=255309 I'm not an expert on xHCI. This should be CC'ed to the xhci-hcd maintainer. Alan Stern Please let me know if I should provide something else. Thanks, Diego I've forwarded my email to Mathias Nyman. Diego Still a problem with 4.11.0-rc2-ARCH+ F

Re: Dell Inspiron 5558/0VNM2T hangs at resume from suspend when USB 3 is enabled

2017-03-20 Thread Mathias Nyman
to the xhci-hcd maintainer. Alan Stern Please let me know if I should provide something else. Thanks, Diego I've forwarded my email to Mathias Nyman. Diego Still a problem with 4.11.0-rc2-ARCH+ From a quick glance it looks like rtsx_usb_ms probaly takes a mutex (>dev_mu

Re: [PATCH] usb: hub: Fix crash after failure to read BOS descriptor

2017-03-09 Thread Mathias Nyman
x10/0x40 Since we don't know anything about LPM capabilities without BOS descriptor, don't attempt to enable LPM if it is not available. Fixes: 890dae886721 ("xhci: Enable LPM support only for hardwired ...") Cc: Mathias Nyman <mathias.ny...@linux.intel.com> Signed-off-by: Guenter

Re: [PATCH] usb: hub: Fix crash after failure to read BOS descriptor

2017-03-09 Thread Mathias Nyman
x10/0x40 Since we don't know anything about LPM capabilities without BOS descriptor, don't attempt to enable LPM if it is not available. Fixes: 890dae886721 ("xhci: Enable LPM support only for hardwired ...") Cc: Mathias Nyman Signed-off-by: Guenter Roeck --- Acked-by: Mathias Nyman

Re: [PATCH] usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers

2017-03-09 Thread Mathias Nyman
On 08.03.2017 21:49, Guenter Roeck wrote: Upstream commit 98d74f9ceaef ("xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI xhci controllers which can result in excessive timeouts, to the point where the system reports a deadlock.

Re: [PATCH] usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers

2017-03-09 Thread Mathias Nyman
On 08.03.2017 21:49, Guenter Roeck wrote: Upstream commit 98d74f9ceaef ("xhci: fix 10 second timeout on removal of PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI xhci controllers which can result in excessive timeouts, to the point where the system reports a deadlock.

Re: [PATCH 1/2] usb: xhci-mtk: check hcc_params after adding primary hcd

2017-03-08 Thread Mathias Nyman
On 08.03.2017 02:51, Chunfeng Yun wrote: On Tue, 2017-03-07 at 17:10 +0200, Mathias Nyman wrote: On 07.03.2017 05:32, Chunfeng Yun wrote: hcc_params is set in xhci_gen_setup() called from usb_add_hcd(), so checks the Maximum Primary Stream Array Size in the hcc_params register after adding

Re: [PATCH 1/2] usb: xhci-mtk: check hcc_params after adding primary hcd

2017-03-08 Thread Mathias Nyman
On 08.03.2017 02:51, Chunfeng Yun wrote: On Tue, 2017-03-07 at 17:10 +0200, Mathias Nyman wrote: On 07.03.2017 05:32, Chunfeng Yun wrote: hcc_params is set in xhci_gen_setup() called from usb_add_hcd(), so checks the Maximum Primary Stream Array Size in the hcc_params register after adding

Re: [PATCH 1/2] usb: xhci-mtk: check hcc_params after adding primary hcd

2017-03-07 Thread Mathias Nyman
On 07.03.2017 05:32, Chunfeng Yun wrote: hcc_params is set in xhci_gen_setup() called from usb_add_hcd(), so checks the Maximum Primary Stream Array Size in the hcc_params register after adding primary hcd. Signed-off-by: Chunfeng Yun ---

Re: [PATCH 1/2] usb: xhci-mtk: check hcc_params after adding primary hcd

2017-03-07 Thread Mathias Nyman
On 07.03.2017 05:32, Chunfeng Yun wrote: hcc_params is set in xhci_gen_setup() called from usb_add_hcd(), so checks the Maximum Primary Stream Array Size in the hcc_params register after adding primary hcd. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c |6 +++--- 1 file

Re: [PATCH 2/2] usb: xhci: remove dummy extra_priv_size for size of xhci_hcd struct

2017-03-07 Thread Mathias Nyman
On 07.03.2017 13:02, Thierry Reding wrote: On Tue, Mar 07, 2017 at 11:32:23AM +0800, Chunfeng Yun wrote: because hcd_priv_size is already size of xhci_hcd struct, extra_priv_size is not needed anymore for MTK and tegra drivers. Signed-off-by: Chunfeng Yun ---

Re: [PATCH 2/2] usb: xhci: remove dummy extra_priv_size for size of xhci_hcd struct

2017-03-07 Thread Mathias Nyman
On 07.03.2017 13:02, Thierry Reding wrote: On Tue, Mar 07, 2017 at 11:32:23AM +0800, Chunfeng Yun wrote: because hcd_priv_size is already size of xhci_hcd struct, extra_priv_size is not needed anymore for MTK and tegra drivers. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c |

Re: [PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup()

2017-03-07 Thread Mathias Nyman
On 07.03.2017 08:57, Chunfeng Yun wrote: simplify xhci_mtk_setup() and add xhci_mtk_start() for xhci_driver_overrides struct Code itself looks fine, but it's bit unclear for me what the benefit of this is? Signed-off-by: Chunfeng Yun ---

Re: [PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup()

2017-03-07 Thread Mathias Nyman
On 07.03.2017 08:57, Chunfeng Yun wrote: simplify xhci_mtk_setup() and add xhci_mtk_start() for xhci_driver_overrides struct Code itself looks fine, but it's bit unclear for me what the benefit of this is? Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c | 16

Re: [RFC PATCH] xhci: Use Cached ring during endpoint ring allocation

2017-02-23 Thread Mathias Nyman
On 22.02.2017 17:05, Anurag Kumar Vulisha wrote: Currently during endpoint initialization, a new endpoint ring is alloacte using xhci_ring_alloc(), if this function fails to allocate ring a cached ring(if available) is assigned to endpoint ring. This patch modifies the code that during endpoint

Re: [RFC PATCH] xhci: Use Cached ring during endpoint ring allocation

2017-02-23 Thread Mathias Nyman
On 22.02.2017 17:05, Anurag Kumar Vulisha wrote: Currently during endpoint initialization, a new endpoint ring is alloacte using xhci_ring_alloc(), if this function fails to allocate ring a cached ring(if available) is assigned to endpoint ring. This patch modifies the code that during endpoint

Re: [PATCH RESEND v8] usb: xhci: plat: Enable async suspend/resume

2017-02-21 Thread Mathias Nyman
On 20.02.2017 17:48, Robert Foss wrote: From: Andrew Bresticker USB host controllers can take a significant amount of time to suspend and resume, adding several hundred miliseconds to the kernel resume time. Since the XHCI controller has no outside dependencies (other

Re: [PATCH RESEND v8] usb: xhci: plat: Enable async suspend/resume

2017-02-21 Thread Mathias Nyman
On 20.02.2017 17:48, Robert Foss wrote: From: Andrew Bresticker USB host controllers can take a significant amount of time to suspend and resume, adding several hundred miliseconds to the kernel resume time. Since the XHCI controller has no outside dependencies (other than clocks, which are

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-02-20 Thread Mathias Nyman
On 20.02.2017 04:47, Baolin Wang wrote: Hi Mathias, On 6 February 2017 at 13:26, Baolin Wang <baolin.w...@linaro.org> wrote: Hi Mathias, On 31 January 2017 at 21:14, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 16.01.2017 12:56, Baolin Wang wrote: Hi Mathias, Hi

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-02-20 Thread Mathias Nyman
On 20.02.2017 04:47, Baolin Wang wrote: Hi Mathias, On 6 February 2017 at 13:26, Baolin Wang wrote: Hi Mathias, On 31 January 2017 at 21:14, Mathias Nyman wrote: On 16.01.2017 12:56, Baolin Wang wrote: Hi Mathias, Hi Sorry about the long review delay CC Alan in case my pm assumptions

Re: [PATCH v2 1/1] xhci: add USB2 test mode support

2017-02-08 Thread Mathias Nyman
On 08.02.2017 15:44, Alexander Stein wrote: This patch adds support for USB2 test mode (Test_J, Test_K, Test_SE0_NAK and Test_Packet) per XHCI spec 4.19.6. USB2 test mode is a required hardware feature for system integrators validating their hardware according to USB spec, regarding signal

Re: [PATCH v2 1/1] xhci: add USB2 test mode support

2017-02-08 Thread Mathias Nyman
On 08.02.2017 15:44, Alexander Stein wrote: This patch adds support for USB2 test mode (Test_J, Test_K, Test_SE0_NAK and Test_Packet) per XHCI spec 4.19.6. USB2 test mode is a required hardware feature for system integrators validating their hardware according to USB spec, regarding signal

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-01-31 Thread Mathias Nyman
On 16.01.2017 12:56, Baolin Wang wrote: Hi Mathias, Hi Sorry about the long review delay CC Alan in case my pm assumptions need to be corrected On 13 December 2016 at 15:49, Baolin Wang wrote: Enable the xhci plat runtime PM for parent device to suspend/resume

Re: [PATCH v5 1/2] usb: host: plat: Enable xhci plat runtime PM

2017-01-31 Thread Mathias Nyman
On 16.01.2017 12:56, Baolin Wang wrote: Hi Mathias, Hi Sorry about the long review delay CC Alan in case my pm assumptions need to be corrected On 13 December 2016 at 15:49, Baolin Wang wrote: Enable the xhci plat runtime PM for parent device to suspend/resume xhci. Also call

Re: [PATCH v5 0/4] usb: early: add support for early printk through USB3 debug port

2017-01-19 Thread Mathias Nyman
On 19.01.2017 11:09, Ingo Molnar wrote: * Greg Kroah-Hartman wrote: On Wed, Jan 18, 2017 at 02:20:30PM +0800, Lu Baolu wrote: Hi Greg, This patch series has been there for 2 months without further comments. Will you consider it for usb-next? I needed acks from

Re: [PATCH v5 0/4] usb: early: add support for early printk through USB3 debug port

2017-01-19 Thread Mathias Nyman
On 19.01.2017 11:09, Ingo Molnar wrote: * Greg Kroah-Hartman wrote: On Wed, Jan 18, 2017 at 02:20:30PM +0800, Lu Baolu wrote: Hi Greg, This patch series has been there for 2 months without further comments. Will you consider it for usb-next? I needed acks from the x86 maintainers before

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-19 Thread Mathias Nyman
On 19.01.2017 11:22, Greg KH wrote: On Wed, Jan 18, 2017 at 01:58:28PM +0200, Mathias Nyman wrote: On 12.01.2017 10:38, Roger Quadros wrote: Mathias, On 11/01/17 17:08, Alan Stern wrote: On Wed, 11 Jan 2017, Mathias Nyman wrote: On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-19 Thread Mathias Nyman
On 19.01.2017 11:22, Greg KH wrote: On Wed, Jan 18, 2017 at 01:58:28PM +0200, Mathias Nyman wrote: On 12.01.2017 10:38, Roger Quadros wrote: Mathias, On 11/01/17 17:08, Alan Stern wrote: On Wed, 11 Jan 2017, Mathias Nyman wrote: On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-18 Thread Mathias Nyman
On 12.01.2017 10:38, Roger Quadros wrote: Mathias, On 11/01/17 17:08, Alan Stern wrote: On Wed, 11 Jan 2017, Mathias Nyman wrote: On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann <a...@arndb.de> For xhci-hcd platform device, all the DMA parameters are not configured pr

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-18 Thread Mathias Nyman
On 12.01.2017 10:38, Roger Quadros wrote: Mathias, On 11/01/17 17:08, Alan Stern wrote: On Wed, 11 Jan 2017, Mathias Nyman wrote: On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-11 Thread Mathias Nyman
On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops for dwc3 devices. So, set the dma for xhci from sysdev. sysdev is pointing to device that is known to the system firmware

Re: [PATCH v5 4/6] usb: xhci: use bus->sysdev for DMA configuration

2017-01-11 Thread Mathias Nyman
On 17.11.2016 13:43, Sriram Dash wrote: From: Arnd Bergmann For xhci-hcd platform device, all the DMA parameters are not configured properly, notably dma ops for dwc3 devices. So, set the dma for xhci from sysdev. sysdev is pointing to device that is known to the system firmware or hardware.

Re: [PATCH 0/3] usb: xhci: Add broken port disable quirk

2017-01-03 Thread Mathias Nyman
On 03.01.2017 14:53, Felipe Balbi wrote: Hi, Roger Quadros writes: Mathias & Felipe, On 17/11/16 17:01, Roger Quadros wrote: Hi, Some XHCI controllers e.g. dwc3 based have a broken Port disable [1]. If the attached high-speed device is misbehaving, the USB stack typically

Re: [PATCH 0/3] usb: xhci: Add broken port disable quirk

2017-01-03 Thread Mathias Nyman
On 03.01.2017 14:53, Felipe Balbi wrote: Hi, Roger Quadros writes: Mathias & Felipe, On 17/11/16 17:01, Roger Quadros wrote: Hi, Some XHCI controllers e.g. dwc3 based have a broken Port disable [1]. If the attached high-speed device is misbehaving, the USB stack typically disables the

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

2017-01-02 Thread Mathias Nyman
On 27.12.2016 05:07, Baolin Wang wrote: Hi, On 21 December 2016 at 21:00, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 20.12.2016 0

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

2017-01-02 Thread Mathias Nyman
On 27.12.2016 05:07, Baolin Wang wrote: Hi, On 21 December 2016 at 21:00, Mathias Nyman wrote: On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related

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

2016-12-23 Thread Mathias Nyman
On 22.12.2016 03:46, Lu Baolu wrote: Hi, On 12/21/2016 11:18 PM, OGAWA Hirofumi wrote: Mathias Nyman <mathias.ny...@linux.intel.com> writes: We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what is for taking lock for register though, I guess it should be enough jus

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

2016-12-23 Thread Mathias Nyman
On 22.12.2016 03:46, Lu Baolu wrote: Hi, On 12/21/2016 11:18 PM, OGAWA Hirofumi wrote: Mathias Nyman writes: We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what is for taking lock for register though, I guess it should be enough just lock around of read=>wr

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

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:46, Lu Baolu wrote: In command timer function, xhci_handle_command_timeout(), xhci->lock is unlocked before call into xhci_abort_cmd_ring(). This might cause race between the timer function and the event handler. The xhci_abort_cmd_ring() function sets the CMD_RING_ABORT bit in

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

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:46, Lu Baolu wrote: In command timer function, xhci_handle_command_timeout(), xhci->lock is unlocked before call into xhci_abort_cmd_ring(). This might cause race between the timer function and the event handler. The xhci_abort_cmd_ring() function sets the CMD_RING_ABORT bit in

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

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:50, Lu Baolu wrote: Hi Mathias, This is a follow-up patch for below comment "rebase OGAWA Hirofumi's changes on top of that, and send to usb-linus only" in below discussion thread. https://lkml.org/lkml/2016/12/21/186 I rebased the patch and added unlock-before and

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

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:50, Lu Baolu wrote: Hi Mathias, This is a follow-up patch for below comment "rebase OGAWA Hirofumi's changes on top of that, and send to usb-linus only" in below discussion thread. https://lkml.org/lkml/2016/12/21/186 I rebased the patch and added unlock-before and

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 16:10, OGAWA Hirofumi wrote: Mathias Nyman <mathias.ny...@linux.intel.com> writes: Below is the latest code. I put my comments in line. 322 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) 323 { 324 u64 temp_64; 325 int ret; 326

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 16:10, OGAWA Hirofumi wrote: Mathias Nyman writes: Below is the latest code. I put my comments in line. 322 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) 323 { 324 u64 temp_64; 325 int ret; 326 327 xhci_dbg(xhci, "Abort co

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman <mathias.ny...@linux.intel.com> wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch: git://git.kernel.org/pub/scm/linux/kernel

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

2016-12-21 Thread Mathias Nyman
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: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races

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