[PATCH v3] usb: host: ohci: fix a race condition between shutdown and irq

2019-08-26 Thread Yoshihiro Shimoda
This patch fixes an issue that the following error is possible to happen when ohci hardware causes an interruption and the system is shutting down at the same time. [ 34.851754] usb 2-1: USB disconnect, device number 2 [ 35.166658] irq 156: nobody cared (try booting with the "irqpoll" option)

RE: [PATCH v2] usb: host: ohci: fix a race condition between shutdown and irq

2019-08-26 Thread Yoshihiro Shimoda
Hi Greg, Alan, I'm afraid but, I would like to recall this patch because I lacked the last sentence in the commit log. I'll submit v3 patch soon. Best regards, Yoshihiro Shimoda > -Original Message- > From: Yoshihiro Shimoda > Sent: Tuesday, August 27, 2019 10:57 AM > To: gre...@linuxfo

Re: Ryzen7 3700U xhci fails on resume from sleep

2019-08-26 Thread Daniel Drake
On Mon, Aug 26, 2019 at 9:32 PM Mathias Nyman wrote: > On 26.8.2019 12.29, Rafael J. Wysocki wrote: > > I wonder if you can reproduce this with the pm-s2idle-rework branch > > from linux-pm.git merged in. > > Root cause looks similar to: > https://bugzilla.kernel.org/show_bug.cgi?id=203885 > > Mik

RE: [EXT] Re: [PATCH v1] usb: dwc3: remove the call trace of USBx_GFLADJ

2019-08-26 Thread Ran Wang
Hi Felipe, On Thursday, August 15, 2019 13:59, Felipe Balbi wrote: > > Hi, > > Yinbo Zhu writes: > >> Yinbo Zhu writes: > >> >> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > >> >> > index > >> >> > 98bce85c29d0..a133d8490322 100644 > >> >> > --- a/drivers/usb/dwc3/core.c >

RE: [PATCH] usb: host: ohci: fix a race condition between shutdown and irq

2019-08-26 Thread Yoshihiro Shimoda
Hi Alan, > From: Alan Stern, Sent: Tuesday, August 27, 2019 12:58 AM > > On Mon, 26 Aug 2019, Yoshihiro Shimoda wrote: > > > Hi Alan, > > > > > From: Alan Stern, Sent: Saturday, August 24, 2019 12:33 AM > > > > > > On Fri, 23 Aug 2019, Yoshihiro Shimoda wrote: > > > > The ohci_shutdown() should

[PATCH v2] usb: host: ohci: fix a race condition between shutdown and irq

2019-08-26 Thread Yoshihiro Shimoda
This patch fixes an issue that the following error is possible to happen when ohci hardware causes an interruption and the system is shutting down at the same time. [ 34.851754] usb 2-1: USB disconnect, device number 2 [ 35.166658] irq 156: nobody cared (try booting with the "irqpoll" option)

Re: reeze while write on external usb 3.0 hard disk [Bug 204095]

2019-08-26 Thread Piergiorgio Sartor
On Tue, Aug 20, 2019 at 06:37:22PM +0200, Piergiorgio Sartor wrote: > On Tue, Aug 20, 2019 at 09:23:26AM +0200, Christoph Hellwig wrote: > > On Mon, Aug 19, 2019 at 10:14:25AM -0400, Alan Stern wrote: > > > Let's bring this to the attention of some more people. > > > > > > It looks like the bug th

[PATCH v8] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-26 Thread Suwan Kim
There are bugs on vhci with usb 3.0 storage device. In USB, each SG list entry buffer should be divisible by the bulk max packet size. But with native SG support, this problem doesn't matter because the SG buffer is treated as contiguous buffer. But without native SG support, USB storage driver bre

Re: [PATCH v7] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-26 Thread Suwan Kim
On Tue, Aug 27, 2019 at 12:00:07AM +0900, Suwan Kim wrote: > There are bugs on vhci with usb 3.0 storage device. In USB, each SG > list entry buffer should be divisible by the bulk max packet size. > But with native SG support, this problem doesn't matter because the > SG buffer is treated as conti

Re: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6

2019-08-26 Thread Alan Stern
On Mon, 26 Aug 2019, Andrea Vai wrote: > ok, so you can grab them at > > http://fisica.unipv.it/transfer/usbmon_logs.zip > > (they will be automatically removed from there in a couple of weeks). > > For each size there is a .txt file (which contains the terminal > output) and 10 bad.mon.out_...

Re: [PATCH v3 04/11] modpost: add support for symbol namespaces

2019-08-26 Thread Jessica Yu
+++ Matthias Maennich [21/08/19 12:49 +0100]: Add support for symbols that are exported into namespaces. For that, extract any namespace suffix from the symbol name. In addition, emit a warning whenever a module refers to an exported symbol without explicitly importing the namespace that it is de

RE: [PATCH] usb: host: ohci: fix a race condition between shutdown and irq

2019-08-26 Thread Alan Stern
On Mon, 26 Aug 2019, Yoshihiro Shimoda wrote: > Hi Alan, > > > From: Alan Stern, Sent: Saturday, August 24, 2019 12:33 AM > > > > On Fri, 23 Aug 2019, Yoshihiro Shimoda wrote: > > > > > This patch fixes an issue that the following error is > > > possible to happen when ohci hardware causes an i

Re: [PATCH v2 2/2] USB: storage: ums-realtek: Make auto-delink support optionally

2019-08-26 Thread Alan Stern
On Mon, 26 Aug 2019, Kai-Heng Feng wrote: > Auto-delink requires writing special registers to ums-realtek device. > Unconditionally enable auto-delink may break newer devices. > > So only enable auto-delink by default for the original three IDs, > 0x0138, 0x0158 and 0x0159. > > Realtek is workin

RE: [RFC 1/3] net: cdc_ncm: add get/set ethernet address functions

2019-08-26 Thread Mario.Limonciello
> -Original Message- > From: Oliver Neukum > Sent: Monday, August 26, 2019 4:00 AM > To: Hyde, Charles - Dell Team; linux-usb@vger.kernel.org > Cc: Limonciello, Mario; nic_s...@realtek.com; linux-a...@vger.kernel.org > Subject: Re: [RFC 1/3] net: cdc_ncm: add get/set ethernet address funct

[PATCH v7] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-26 Thread Suwan Kim
There are bugs on vhci with usb 3.0 storage device. In USB, each SG list entry buffer should be divisible by the bulk max packet size. But with native SG support, this problem doesn't matter because the SG buffer is treated as contiguous buffer. But without native SG support, USB storage driver bre

[PATCH 1/2] usb: xhci: ext-caps: Add property to disable Intel SW switch

2019-08-26 Thread Heikki Krogerus
From: Saranya Gopal In platforms like Intel Cherrytrail, 'SW switch enable' bit should not be enabled for role switch. This patch adds a property to Intel USB Role Switch platform driver to denote that SW switch should be disabled in Cherrytrail devices. Signed-off-by: Saranya Gopal Signed-off-

[PATCH 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-26 Thread Heikki Krogerus
From: Saranya Gopal Enable static DRD mode in Intel platforms which guarantees successful role switch all the time. This fixes issues like software role switch failure after cold boot and issue with role switch when USB 3.0 cable is used. But, do not enable static DRD mode for Cherrytrail devices

[PATCH 0/2] usb: roles: intel: Use static mode by default

2019-08-26 Thread Heikki Krogerus
Hi Hans, These have been in my queue for a while now. For some reason I've been under the impression that there was still an issue with them, but that was a misunderstanding. Saranya and Balaji, I'm really sorry about that. Hans, I don't know if you remember these, but they address an issue where

Re: [PATCH v6] usbip: Implement SG support to vhci-hcd and stub driver

2019-08-26 Thread Suwan Kim
On Sat, Aug 24, 2019 at 01:41:50PM -0600, shuah wrote: > Hi Suwan, > > Thanks for the patch. A few comments. > > On 8/22/19 4:11 PM, Suwan Kim wrote: > > There are bugs on vhci with usb 3.0 storage device. In USB, each SG > > list entry buffer should be divisible by the bulk max packet size. > >

Re: Ryzen7 3700U xhci fails on resume from sleep

2019-08-26 Thread Mathias Nyman
On 26.8.2019 12.29, Rafael J. Wysocki wrote: On Mon, Aug 26, 2019 at 11:11 AM Daniel Drake wrote: Hi, Working with a new consumer laptop based on AMD Ryzen 7 3700U, all USB functionality goes dead upon suspend/resume (s2idle). Reproduced on linus master from today. I wonder if you can repro

[PATCH] usb: dwc3: don't set gadget->is_otg flag

2019-08-26 Thread Roger Quadros
This reverts commit 6a4290cc28be1 ("usb: dwc3: gadget: set the OTG flag in dwc3 gadget driver.") We don't yet support any of the OTG mechanisms (HNP/SRP/ADP) and are not setting gadget->otg_caps, so don't set gadget->is_otg flag. If we do then we end up publishing a OTG1.0 descriptor in the gadg

[PATCH v11 0/6] Introduced new Cadence USBSS DRD Driver.

2019-08-26 Thread Pawel Laszczak
This patch introduce new Cadence USBSS DRD driver to linux kernel. The Cadence USBSS DRD Controller is a highly configurable IP Core which can be instantiated as Dual-Role Device (DRD), Peripheral Only and Host Only (XHCI)configurations. The current driver has been validated with FPGA burned. We

[PATCH v11 4/6] usb:common Simplify usb_decode_get_set_descriptor function.

2019-08-26 Thread Pawel Laszczak
Patch moves switch responsible for decoding descriptor type outside snprintf. It improves code readability a little. Signed-off-by: Pawel Laszczak --- drivers/usb/common/debug.c | 113 +++-- 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/drivers/u

[PATCH v11 2/6] usb:common Separated decoding functions from dwc3 driver.

2019-08-26 Thread Pawel Laszczak
Patch moves some decoding functions from driver/usb/dwc3/debug.h driver to driver/usb/common/debug.c file. These moved functions include: dwc3_decode_get_status dwc3_decode_set_clear_feature dwc3_decode_set_address dwc3_decode_get_set_descriptor dwc3_decode_get_configuration

[PATCH v11 1/6] dt-bindings: add binding for USBSS-DRD controller.

2019-08-26 Thread Pawel Laszczak
This patch aim at documenting USB related dt-bindings for the Cadence USBSS-DRD controller. Signed-off-by: Pawel Laszczak Reviewed-by: Rob Herring --- .../devicetree/bindings/usb/cdns-usb3.txt | 45 +++ 1 file changed, 45 insertions(+) create mode 100644 Documentation/devic

[PATCH v11 6/6] usb:cdns3 Fix for stuck packets in on-chip OUT buffer.

2019-08-26 Thread Pawel Laszczak
Controller for OUT endpoints has shared on-chip buffers for all incoming packets, including ep0out. It's FIFO buffer, so packets must be handled by DMA in correct order. If the first packet in the buffer will not be handled, then the following packets directed for other endpoints and functions will

[PATCH v11 3/6] usb:common Patch simplify usb_decode_set_clear_feature function.

2019-08-26 Thread Pawel Laszczak
Patch adds usb_decode_test_mode and usb_decode_device_feature functions, which allow to make more readable and simplify the usb_decode_set_clear_feature function. Signed-off-by: Pawel Laszczak --- drivers/usb/common/debug.c | 89 ++ 1 file changed, 43 insertio

[PATCH v4] usb: chipidea: add role switch class support

2019-08-26 Thread jun . li
From: Li Jun USB role is fully controlled by usb role switch consumer(e.g. typec), usb port can be at host mode(USB_ROLE_HOST), device mode connected to host(USB_ROLE_DEVICE), or not connecting any partner(USB_ROLE_NONE). Signed-off-by: Li Jun --- changes for v4: - Add spinlock for role set().

Re: NULL pointer issue due to .pullup timeout at dwc3

2019-08-26 Thread Felipe Balbi
Hi, Peter Chen writes: > Hi Balbi, > > When do configfs function add and remove stress test, I find dwc3 > gadget .pullup will timeout if there is a request on the way. Even I what do you mean by "a request on the way"? > enlarge the delay, there is still timeout for .pullup. > > diff --git a

NULL pointer issue due to .pullup timeout at dwc3

2019-08-26 Thread Peter Chen
Hi Balbi, When do configfs function add and remove stress test, I find dwc3 gadget .pullup will timeout if there is a request on the way. Even I enlarge the delay, there is still timeout for .pullup. diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f13bef950951..e95955b6

Re: Ryzen7 3700U xhci fails on resume from sleep

2019-08-26 Thread Rafael J. Wysocki
On Mon, Aug 26, 2019 at 11:11 AM Daniel Drake wrote: > > Hi, > > Working with a new consumer laptop based on AMD Ryzen 7 3700U, all USB > functionality goes dead upon suspend/resume (s2idle). Reproduced on > linus master from today. I wonder if you can reproduce this with the pm-s2idle-rework bra

AW: AW: [Patch v5] usb: hcd: use managed device resources

2019-08-26 Thread Schmid, Carsten
> > Thanks for fixing this, it solves a real upstream xhci related issue since > 4.19. > Fix is outside xhci so accepting this is no longer up to me, but for Greg: > > Reviewed-by: Mathias Nyman > Fixes: fa31b3cb2ae1 ("xhci: Add Intel extended cap / otg phy mux handling") > Cc: # v4.19+ Anyth

Re: [RFC 1/3] net: cdc_ncm: add get/set ethernet address functions

2019-08-26 Thread Oliver Neukum
Am Freitag, den 23.08.2019, 22:26 + schrieb charles.h...@dellteam.com: > This patch adds support for pushing a MAC address out to USB based > ethernet controllers driven by cdc_ncm. With this change, ifconfig can > now set the device's MAC address. For example, the Dell Universal Dock > D6000

Ryzen7 3700U xhci fails on resume from sleep

2019-08-26 Thread Daniel Drake
Hi, Working with a new consumer laptop based on AMD Ryzen 7 3700U, all USB functionality goes dead upon suspend/resume (s2idle). Reproduced on linus master from today. <<>> Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. <<>> xhci_hcd :03:00.3: Refused to change power sta

Re: [PATCH v2 1/2 RESEND] usb: core: phy: add support for PHY calibration

2019-08-26 Thread Marek Szyprowski
Hi Greg On 2019-08-08 11:41, Marek Szyprowski wrote: > Some PHYs (for example Exynos5 USB3.0 DRD PHY) require calibration to be > done after every USB HCD reset. Generic PHY framework has been already > extended with phy_calibrate() function in commit 36914111e682 ("drivers: > phy: add calibrate m

Re: AW: [Patch v5] usb: hcd: use managed device resources

2019-08-26 Thread Mathias Nyman
On 26.8.2019 11.09, Schmid, Carsten wrote: Upstream version of driver is identical in the affected code. Fix was tested successfully on 4.14.129. Provided patch applies and compiles on v5.2.8 stable. As this is also a bugfix, please consider it to go to stable trees too. How far back should it

AW: [Patch v5] usb: hcd: use managed device resources

2019-08-26 Thread Schmid, Carsten
>>> Upstream version of driver is identical in the affected code. >>> Fix was tested successfully on 4.14.129. >>> Provided patch applies and compiles on v5.2.8 stable. >>> As this is also a bugfix, please consider it to go to stable trees too. >> >> How far back should it go, just 4.14? Was this

RE: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver

2019-08-26 Thread Pawel Laszczak
Hi Peter > >On 19-07-21 19:32:18, Pawel Laszczak wrote: >> This patch introduce new Cadence USBSS DRD driver to Linux kernel. >> >> The Cadence USBSS DRD Controller is a highly configurable IP Core which >> can be instantiated as Dual-Role Device (DRD), Peripheral Only and >> Host Only (XHCI)confi

Re: [PATCH 2/2] usb: dwc3: st: Add of_dev_put() in probe function

2019-08-26 Thread Patrice CHOTARD
On 8/19/19 9:24 AM, Nishka Dasgupta wrote: > In function st_dwc3_probe, variable child_pdev takes the value returned > by of_find_device_by_node, which gets a device pointer but does not put > it. If child_pdev is not put before the probe function returns, it may > cause a reference leak. Hence pu

Re: [PATCH 1/2] usb: dwc3: st: Add of_node_put() before return in probe function

2019-08-26 Thread Patrice CHOTARD
Hi Nishka On 8/19/19 9:24 AM, Nishka Dasgupta wrote: > The local variable child in the function st_dwc3_probe takes the return > value of of_get_child_by_name, which gets a node and does not put it. If > the function returns without releasing child, this could cause a memory > error. Hence put chi

Re: [PATCH v2] usb: typec: ucsi: add support for separate DP altmode devices

2019-08-26 Thread Heikki Krogerus
Hi Ajay, On Mon, Aug 19, 2019 at 10:23:29PM +, Ajay Gupta wrote: > > > diff --git a/drivers/usb/typec/ucsi/ucsi.h > > > b/drivers/usb/typec/ucsi/ucsi.h index de87d0b8319d..7bbdf83c8d4a > > > 100644 > > > --- a/drivers/usb/typec/ucsi/ucsi.h > > > +++ b/drivers/usb/typec/ucsi/ucsi.h > > > @@ -27

Re: [Patch v5] usb: hcd: use managed device resources

2019-08-26 Thread Mathias Nyman
On 25.8.2019 11.29, Greg KH wrote: On Fri, Aug 23, 2019 at 02:11:28PM +, Schmid, Carsten wrote: Using managed device resources in usb_hcd_pci_probe() allows devm usage for resource subranges, such as the mmio resource for the platform device created to control host/device mode mux, which is

AW: [Patch v5] usb: hcd: use managed device resources

2019-08-26 Thread Schmid, Carsten
>> Upstream version of driver is identical in the affected code. >> Fix was tested successfully on 4.14.129. >> Provided patch applies and compiles on v5.2.8 stable. >> As this is also a bugfix, please consider it to go to stable trees too. > > How far back should it go, just 4.14? Was this caused

[PATCH 1/1] usb: gadget: configfs: fix concurrent issue between composite APIs

2019-08-26 Thread Peter Chen
We meet several NULL pointer issues if configfs_composite_unbind and composite_setup (or composite_disconnect) are running together. These issues occur when do the function switch stress test, the configfs_compsoite_unbind is called from user mode by echo "" to /sys/../UDC entry, and meanwhile, the