Re: [PATCH v1 1/1] usb: xhci: do not create and register shared_hcd when USB3.0 is disabled

2018-01-16 Thread Mathias Nyman
Hi, Sorry about the delay On 04.01.2018 07:17, Thang Q. Nguyen wrote: Hi, On Sat, Dec 16, 2017 at 10:45 AM, Thang Q. Nguyen wrote: From: Tung Nguyen Currently, hcd->shared_hcd always creates and registers to the usb-core. If, for some reasons, USB3 downstream port is disabled, no roothub po

Re: [PATCH 1/2] usb: xhci: Remove ep_trb from xhci_cleanup_halted_endpoint()

2018-01-11 Thread Mathias Nyman
On 10.01.2018 06:59, Lu Baolu wrote: Function argument ep_trb for xhci_cleanup_halted_endpoint() isn't needed anymore. Cleanup it. Signed-off-by: Lu Baolu --- Thanks, adding both to queue -Mathias

Re: [PATCH v4 3/3] usb: host: Implement workaround for Erratum A-009668

2018-01-04 Thread Mathias Nyman
On 19.12.2017 12:16, yinbo@nxp.com wrote: From: yinbo.zhu This issue is observed in USB 2.0 mode when the USB 3.0 host controller is connected to a FS/LS device via a hub. The host controller issues start-split (SSPLIT) and (CSPLIT) tokens to accomplish a split-transaction. A split-transact

Re: [PATCH v4 2/3] usb: host: Implement workaround for Erratum A-009611

2018-01-04 Thread Mathias Nyman
On 19.12.2017 12:16, yinbo@nxp.com wrote: From: yinbo.zhu This is a occasional problem where the software issues an End Transfer command while a USB transfer is in progress, resulting in the TxFIFO being flushed when the lower layer is waiting for data, causing the super speed (ss) transmi

Re: [PATCH v4 1/3] usb: host: Implement workaround for Erratum A-007463

2018-01-04 Thread Mathias Nyman
On 19.12.2017 12:16, yinbo@nxp.com wrote: From: yinbo.zhu When a transaction error (defined in Section 4.10.2.3, "USB Transaction Error" of the xHCI Specification) occurs on the USB, the host controller reports this through a transfer event with the completion code "USB Transaction Error".

Re: [PATCH v2] USB: host: Use zeroing memory allocator rather than allocator/memset

2018-01-02 Thread Mathias Nyman
es) return -ENOMEM; - memset(erst->entries, 0, size); erst->num_entries = evt_ring->num_segs; seg = evt_ring->first_seg; For the xhci part: Acked-by: Mathias Nyman

Re: [PATCH] usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201

2017-12-13 Thread Mathias Nyman
On 12.12.2017 18:54, Ard Biesheuvel wrote: On 12 December 2017 at 16:47, Daniel Thompson wrote: When plugging in a USB webcam I see the following message: xhci_hcd :04:00.0: WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk? handle_tx_event: 913 callbacks suppressed

Re: [PATCH] xhci: Fix use-after-free in xhci debugfs

2017-12-13 Thread Mathias Nyman
On 11.12.2017 00:14, Alexander Kappner wrote: Trying to read from debugfs after the system has resumed from hibernate causes a use-after-free and thus a protection fault. Steps to reproduce: Hibernate system, resume from hibernate, then run $ cat /sys/kernel/debug/usb/xhci/*/command-ring/enque

Re: [PATCH] usb: xhci: fix incorrect memset()

2017-12-12 Thread Mathias Nyman
On 11.12.2017 19:05, Arnd Bergmann wrote: On Mon, Dec 11, 2017 at 6:01 PM, Greg Kroah-Hartman wrote: On Mon, Dec 11, 2017 at 02:59:13PM +0200, Mathias Nyman wrote: On 11.12.2017 13:27, Arnd Bergmann wrote: gcc-8 warnings about the new driver using a memset with a bogus length: drivers/usb

Re: [PATCH] usb: xhci: fix incorrect memset()

2017-12-11 Thread Mathias Nyman
On 11.12.2017 13:27, Arnd Bergmann wrote: gcc-8 warnings about the new driver using a memset with a bogus length: drivers/usb/host/xhci-dbgcap.c: In function 'xhci_dbc_eps_exit': drivers/usb/host/xhci-dbgcap.c:369:2: error: 'memset' used with length equal to number of elements without multiplic

Re: [PATCH] usb-core: Fix potential null pointer dereference in xhci-debugfs.c

2017-12-11 Thread Mathias Nyman
On 10.12.2017 00:38, Alexander Kappner wrote: Hi Mathias, thanks for the patch! The system now resumes cleanly from hibernate even with usbmuxd doing its thing. Tested-by: Alexander Kappner While testing this I hit some other issues with xhci-debugfs.c but I'll write these up in a separate

Re: [PATCH] usb-core: Fix potential null pointer dereference in xhci-debugfs.c

2017-12-08 Thread Mathias Nyman
at frees them together, can you try it out? If it doesn't help we need to add some elaborate tracing Thanks -Mathias >From 811aad86287e78879b7e7f28e0c266bcd2a2f73e Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Fri, 8 Dec 2017 18:50:18 +0200 Subject: [PATCH] xhci: Only free xhci_virt_d

Re: [PATCH] usb-core: Fix potential null pointer dereference in xhci-debugfs.c

2017-12-07 Thread Mathias Nyman
On 07.12.2017 11:26, Alexander Kappner wrote: Date: Wed, 6 Dec 2017 15:28:37 -0800 Subject: [PATCH] usb-core: Fix potential null pointer dereference in xhci-debugfs.c (Added this as reply subject, please remember to send mail with proper subject) My kernel crashed just after resuming from h

Re: [PATCH] usb: xhci: fix TDS for MTK xHCI1.1

2017-12-06 Thread Mathias Nyman
On 06.12.2017 08:42, Chunfeng Yun wrote: For MTK's xHCI 1.0 or latter, TD size is the number of max packet sized packets remaining in the TD, not including this TRB (following spec). For MTK's xHCI 0.96 and older, TD size is the number of max packet sized packets remaining in the TD, including t

[PATCH] usb: Don't print a warning if interface driver rebind is deferred at resume

2017-12-04 Thread Mathias Nyman
ce later. [one-liner by Jerry Snitselaar posted in a mailing list question -Mathias] Suggested-by: Jerry Snitselaar Signed-off-by: Mathias Nyman --- drivers/usb/core/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c

Re: question about usb_rebind_intf

2017-11-17 Thread Mathias Nyman
On 17.11.2017 19:09, Greg Kroah-Hartman wrote: On Fri, Nov 17, 2017 at 09:35:51AM -0700, Jerry Snitselaar wrote: Should this skip warning that the rebind failed if device_attach is returning -EPROBE_DEFER? If I do something like 'rtcwake -m mem -s 30' on a laptop I have here I will see a couple

Re: [PATCH v3 2/3] usb: xhci: Add DbC support in xHCI driver

2017-11-13 Thread Mathias Nyman
Ok, review last part diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c new file mode 100644 index 000..fe5fef0 --- /dev/null +++ b/drivers/usb/host/xhci-dbgtty.c @@ -0,0 +1,586 @@ +/** + * xhci-dbgtty.c - tty glue for xHCI debug capability + * + * Copyright (C) 201

Re: [PATCH v3] usb:xhci fix panic in xhci_free_virt_devices_depth_first

2017-11-07 Thread Mathias Nyman
On 07.11.2017 04:01, Yu Chen wrote: From: Yu Chen Check vdev->real_port 0 to avoid panic [9.261347] [] xhci_free_virt_devices_depth_first+0x58/0x108 [9.261352] [] xhci_mem_cleanup+0x1bc/0x570 [9.261355] [] xhci_stop+0x140/0x1c8 [9.261365] [] usb_remove_hcd+0xfc/0x1d0 [9.261

Re: [PATCH v2] usb:xhci fix panic in xhci_free_virt_devices_depth_first

2017-11-06 Thread Mathias Nyman
On 06.11.2017 14:36, Chen Yu wrote: On 2017/11/6 19:32, Greg KH wrote: A simple process is as below: xhci_plat_probe() | usb_add_hcd() xhci_plat_remove() ||

Re: [PATCH] xhci: Cancel cmd_timer before cleanup the command queue in xhci_hc_died()

2017-11-01 Thread Mathias Nyman
On 01.11.2017 18:03, Greg Kroah-Hartman wrote: On Fri, Sep 29, 2017 at 05:12:47PM +0800, Jeffy Chen wrote: When the cmd_timer fired, it would try to access the command struct. So cancel it before cleanup the command queue in xhci_hc_died(), to avoid use-after-free reported by KASAN: [ 176.95253

Re: [PATCH v2 0/4] usb: xhci: fix build warnings

2017-10-31 Thread Mathias Nyman
On 26.10.2017 13:46, Corentin Labbe wrote: Hello This patchset fix some build warnings on usb/xhci. Regards Changes since v1: - Changed subject of patch Corentin Labbe (4): usb: xhci: remove unused variable last_freed_endpoint usb: xhci: remove unused variable ep usb: xhci: remove un

Re: [PATCH v3 2/3] usb: xhci: Add DbC support in xHCI driver

2017-10-24 Thread Mathias Nyman
Hi Skipping lists, partial review. Many of the questions are real questions that I was wondering about while lookinga the code. Not necessarily thing that must be changed. On 05.09.2017 04:58, Lu Baolu wrote: xHCI compatible USB host controllers(i.e. super-speed USB3 controllers) can be implem

Re: [PATCH] usb: xhci: tegra: use time64_t for printing timestamp

2017-10-20 Thread Mathias Nyman
On 20.10.2017 10:19, Arnd Bergmann wrote: The time_t type and time_to_tm() function are deprecated because of y2038 problems. In this driver, they are used to pretty-print the timestamp of the firmware build. This is fine as long as we don't get a firmware build past 2038. Converting to time64_t

Re: [PATCH v2 7/9] usb: host: modify description for MTK xHCI config

2017-10-17 Thread Mathias Nyman
On 17.10.2017 13:20, Greg Kroah-Hartman wrote: On Fri, Oct 13, 2017 at 01:32:14PM +0300, Mathias Nyman wrote: On 13.10.2017 11:26, Chunfeng Yun wrote: Due to all MediaTek SoCs with xHCI host controller use this driver, remove limitation for specific SoCs Signed-off-by: Chunfeng Yun

Re: [PATCH v2 7/9] usb: host: modify description for MTK xHCI config

2017-10-13 Thread Mathias Nyman
On 13.10.2017 11:26, Chunfeng Yun wrote: Due to all MediaTek SoCs with xHCI host controller use this driver, remove limitation for specific SoCs Signed-off-by: Chunfeng Yun --- xHCI parts of series look good to me, If Rob Herring agrees with the dt changes I can send it forward -Mathias

Re: [PATCH] xhci: Cope with VIA VL805 readahead

2017-10-12 Thread Mathias Nyman
On 11.10.2017 18:46, David Laight wrote: From: Mathias Nyman Sent: 11 October 2017 15:41 .. If possible I'd like to try and find some other solution before chopping the Segment size to smaller than 256. I think that your first proposal of adding the guard page to the segment pool cou

Re: [PATCH] xhci: Cope with VIA VL805 readahead

2017-10-11 Thread Mathias Nyman
On 10.10.2017 21:09, Robin Murphy wrote: The VIA VL805 host controller is well-known for causing problems on systems with IOMMUs enabled, ranging from triggering endless streams of fault messages to locking itself up completely. It appears that the root of the problem might be an over-aggressive

Re: [PATCH 4.13 077/160] usb: host: xhci-plat: allow sysdev to inherit from ACPI

2017-10-11 Thread Mathias Nyman
allocated device. Instead of type FWNODE_ACPI, you would end up with FWNODE_PDATA) Fixes: 4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration") Tested-by: Thang Q. Nguyen mailto:tqngu...@apm.com>> Signed-off-by: Adam Wallis mailto:awal...@codeaurora.

Re: [PATCH v3 07/14] xhci: Add Intel cherrytrail extended cap / otg phy mux handling

2017-10-05 Thread Mathias Nyman
XHCI_INTEL_CHT_USB_MUX quirk there. --- Acked-by: Mathias Nyman

Re: [PATCH v2] xhci: Cleanup current_cmd in xhci_cleanup_command_queue()

2017-10-02 Thread Mathias Nyman
On 29.09.2017 14:07, Jeffy Chen wrote: KASAN reported use-after-free bug when xhci host controller died: [ 176.952537] BUG: KASAN: use-after-free in xhci_handle_command_timeout+0x68/0x224 [ 176.960846] Write of size 4 at addr ffc0cbb01608 by task kworker/3:3/1680 ... [ 177.180644] Freed b

Re: [PATCH v1] usb: host: Implement workaround for Erratum A-007463

2017-09-20 Thread Mathias Nyman
On 20.09.2017 12:24, yinbo@nxp.com wrote: From: "yinbo.zhu" When a transaction error (defined in Section 4.10.2.3, "USB Transaction Error" of the xHCI Specification) occurs on the USB, the host controller reports this through a transfer event with the completion code "USB Transaction Error"

Re: [PATCH v2 04/11] usb: xhci: Add Intel cherrytrail extended cap / otg phy mux handling

2017-09-19 Thread Mathias Nyman
Hi, sorry about the long delay On 07.09.2017 18:49, Hans de Goede wrote: Hi, On 07-09-17 15:14, Mathias Nyman wrote: On 05.09.2017 19:42, Hans de Goede wrote: The Intel cherrytrail xhci controller has an extended cap mmio-range which contains registers to control the muxing to the xhci

Re: [PATCH] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"

2017-09-18 Thread Mathias Nyman
On 16.09.2017 07:49, Kai-Heng Feng wrote: On Mon, Aug 28, 2017 at 9:56 PM, Kai-Heng Feng wrote: On Mon, Aug 28, 2017 at 6:14 PM, Mathias Nyman wrote: On 28.08.2017 12:29, Greg KH wrote: Adding more people who were involved in the original patch. Users are now seeing the unresponsive USB2

Re: [PATCH 2/2] usb: host: Implement workaround for Erratum A-009668

2017-09-14 Thread Mathias Nyman
On 11.09.2017 12:43, yinbo@nxp.com wrote: From: "yinbo.zhu" Description: This issue is observed in USB 2.0 mode when the USB 3.0 host controller is connected to a FS/LS device via a hub. The host controller issues start-split (SSPLIT) and complete-split (CSPLIT) tokens to accomplish a spl

Re: [PATCH 1/2] usb: host: Implement workaround for Erratum A-009611

2017-09-14 Thread Mathias Nyman
On 11.09.2017 12:41, yinbo@nxp.com wrote: From: "yinbo.zhu" Description: This is a occasional problem where the software issues an End Transfer command while a USB transfer is in progress, resulting in the TxFIFO being flushed when the lower layer is waiting for data,causing the super spee

Re: [PATCH v2] USB: xhci: reducing HS port auto-resume latency.

2017-09-12 Thread Mathias Nyman
Hi On 12.09.2017 08:57, anshuman gupta wrote: I have addressed the feedback on the patch description with reference to thread https://patchwork.kernel.org/patch/9916641/ with [PATCH V2] please provide your review comments. I'm taking the patch and sending it forward to Greg after the merge wi

Re: [PATCH v2 04/11] usb: xhci: Add Intel cherrytrail extended cap / otg phy mux handling

2017-09-07 Thread Mathias Nyman
On 05.09.2017 19:42, Hans de Goede wrote: The Intel cherrytrail xhci controller has an extended cap mmio-range which contains registers to control the muxing to the xhci (host mode) or the dwc3 (device mode) and vbus-detection for the otg usb-phy. Having a mux driver included in the xhci code (o

Re: [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device

2017-09-05 Thread Mathias Nyman
On 06.09.2017 06:47, Thang Q. Nguyen wrote: On Tue, Sep 5, 2017 at 6:14 PM, Mathias Nyman mailto:mathias.ny...@linux.intel.com>> wrote: On 24.08.2017 05 :53, Thang Q. Nguyen wrote: On Sat, Aug 19, 2017 at 10:43 AM, Thang Q. Nguyen mailto:tqngu...@apm.com&g

Re: [PATCH v2 1/1] usb:xhci: update condition to select bus->sysdev from parent device

2017-09-05 Thread Mathias Nyman
On 24.08.2017 05:53, Thang Q. Nguyen wrote: On Sat, Aug 19, 2017 at 10:43 AM, Thang Q. Nguyen wrote: From: "Thang Q. Nguyen" For commit 4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration"), sysdev points to devices known to the system firmware or hardware for DMA parameters. Howe

Re: [PATCH v3 1/3] usb: xhci-mtk: add generic compatible string

2017-09-01 Thread Mathias Nyman
*dev) #ifdef CONFIG_OF static const struct of_device_id mtk_xhci_of_match[] = { { .compatible = "mediatek,mt8173-xhci"}, + { .compatible = "mediatek,mtk-xhci"}, { }, }; MODULE_DEVICE_TABLE(of, mtk_xhci_of_match); Acked-by: Mathias Nyman

Re: [PATCH] Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"

2017-08-28 Thread Mathias Nyman
On 28.08.2017 12:29, Greg KH wrote: On Tue, Aug 22, 2017 at 05:14:47PM +0800, Kai-Heng Feng wrote: This reverts commit dec08194ffeccfa1cf085906b53d301930eae18f. Commit dec08194ffec ("xhci: Limit USB2 port wake support for AMD Promontory hosts") makes all high speed USB ports on ASUS PRIME B350M

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

2017-08-23 Thread Mathias Nyman
On 23.08.2017 17:30, Alan Stern wrote: On Wed, 23 Aug 2017, Mathias Nyman wrote: 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

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 si

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 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&m=149362010728921&w=2 http://marc.info/?l=linux-usb&m=149252752825755&w=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/u

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 and

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 u

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 and

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
| 1 + 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 thi

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 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 HW

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, whi

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 applied,

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 commi

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

2017-05-09 Thread Mathias Nyman
mp;dev->dev), &intel_dsm_uuid, 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
Abort 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

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

2017-04-12 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 cur

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 sy

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: On

[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 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
, 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 in

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 settin

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
uld 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+ From a quick glance it looks like rtsx_usb_ms probaly takes a mut

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 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 --- drivers/usb/host/xhci-mtk.c |6 +++--- 1 file cha

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 --- 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 i

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 sus

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 stren

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 pm_runtime_g

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 I

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 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 or hardware. S

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 por

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 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=>

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 lock-afte

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 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 and

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

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

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

2016-12-20 Thread Mathias Nyman
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/git/mnyman/xhci.git timeout_race_fixes Its based on 4.9 It includes a few other patches just to avoid conflic

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

2016-12-19 Thread Mathias Nyman
On 19.12.2016 13:34, Baolin Wang wrote: Hi Mathias, On 19 December 2016 at 18:33, Mathias Nyman wrote: On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the

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

2016-12-19 Thread Mathias Nyman
On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if

Re: xhci_reset_endpoint() doesn't reset endpoint

2016-12-14 Thread Mathias Nyman
On 14.12.2016 12:58, Michal Necasek wrote: prior to the endpoint reset. SetFeature(CLEAR_HALT) resets the toggle on the device, but not on the host. But we know for a fact that the device sends a packet (with data toggle 0) which the host USB stack never sees, and a data toggle mismatch explains

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

2016-12-12 Thread Mathias Nyman
On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if the timer is running and waiting on the xHCI lock, then it maybe get the wrong timeout command in xhci_handl

Re: usb:xhci: support disable usb2 LPM Remote Wakeup

2016-12-12 Thread Mathias Nyman
On 12.12.2016 06:00, Thang Q. Nguyen wrote: On Sat, Dec 10, 2016 at 4:36 AM, Rob Herring wrote: On Sun, Dec 04, 2016 at 07:42:01PM +0700, Thang Q. Nguyen wrote: From: Thang Nguyen As per USB 2.0 link power management addendum ECN, table 1-2, page 4, device or host initiated via resume signal

<    1   2   3   4   5   6   >