f_mass_storage configuration races (Was: Virtual hub, resets etc...)

2019-07-04 Thread Benjamin Herrenschmidt
Sooo... I think I found what's going on with some of the issues triggering things like usb_composite_setup_continue: Unexpected call Or possibly gadget: common->fsg is NULL in fsg_setup at 489 But I mostly tracked down the former. Fundamentally, it boils down to the storage g

[PATCH] usb: gadget: mass_storage: Fix races between fsg_disable and fsg_set_alt

2019-07-04 Thread Benjamin Herrenschmidt
If fsg_disable() and fsg_set_alt() are called too closely to each other (for example due to a quick reset/reconnect), what can happen is that fsg_set_alt sets common->new_fsg from an interrupt while handle_exception is trying to process the config change caused by fsg_disable(): fsg_disabl

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-04 Thread EJ Hsu
Based on my initial debugging, USB CV TD 9.13 will consecutively set device to configuration #1 by sending "Set Configuration" transfer. So, in set_config() function, it will try to disable each interface first and then set up each interface. That is, the fsg_disable() will be called first and t

[balbi-usb:testing/next 33/43] trace.c:undefined reference to `usb_decode_ctrl'

2019-07-04 Thread kbuild test robot
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/balbi/usb.git testing/next head: b2357839c56ab7d06bcd4e866ebc2d0e2b7997f3 commit: 3db1b636c07e15ff7410db782832dc2e7ffd2bce [33/43] usb:gadget Separated decoding functions from dwc3 driver. config: arm-multi_v7_defconfig (attached

[PATCH net] r8152: set RTL8152_UNPLUG only for real disconnection

2019-07-04 Thread Hayes Wang
Set the flag of RTL8152_UNPLUG if and only if the device is unplugged. Some error codes sometimes don't mean the real disconnection of usb device. For those situations, set the flag of RTL8152_UNPLUG causes the driver skips some flows of disabling the device, and it let the device stay at incorrect

Re: [PATCH 1/8] clk: tegra: Add PLLE HW power sequencer control

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:46, JC Kuo wrote: > PLLE hardware power sequencer has to be enabled after PEX/SATA > UPHY PLL's sequencers are enabled. > > tegra210_plle_hw_sequence_start() for XUSB PADCTL driver to enable > PLLE hardware sequencer at proper time. > > tegra210_plle_hw_sequence_is_enabled() fo

Re: [PATCH 2/8] clk: tegra: don't enable PLLE HW sequencer at init

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:46, JC Kuo wrote: > PLLE hardware power sequencer references PEX/SATA UPHY PLL hardware > power sequencers' output to enable/disable PLLE. PLLE hardware power > sequencer has to be enabled only after PEX/SATA UPHY PLL's sequencers > are enabled. > > Signed-off-by: JC Kuo > ---

Re: [PATCH 3/8] phy: tegra: xusb: t210: rearrange UPHY init

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:46, JC Kuo wrote: > This commit is a preparation for enabling XUSB LP0 support. By LP0 do you mean ELPG? If so please stick to using one name for referring to the power-state in question. > It rearranges T210 XUSB PADCTL UPHY initialization sequence, Please use Tegra210 and no

Re: [PATCH 4/8] phy: tegra: xusb: add sleepwalk and suspend/resume

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:46, JC Kuo wrote: > This commit adds sleepwalk/wake and suspend/resume interfaces > to Tegra XUSB PHY driver. If you adding new custom global APIs, you really need to explain why these are needed and how they are used. If we can avoid adding such global APIs, it is preferred. C

Re: [PATCH 5/8] soc/tegra: pmc: support T210 USB 2.0 Sleepwalk

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:48, JC Kuo wrote: > This commit implements Tegra210 PMC USB 2.0 (UTMI and HSIC) Sleepwalk > programming sequence. With Sleepwalk enabled, XUSB host controller > can be put into ELPG (Engine Level PowerGate) state when controller > is idle to save power. The Sleepwalk logic is in

Re: [PATCH 6/8] phy: tegra: xusb: t210: support wake and sleepwalk

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:48, JC Kuo wrote: > This commit implements Tegra210 XUSB PADCTL wake and sleepwalk > routines. This patch does not apply cleanly. I am not sure how this was generated but appears to come from windows (with ^M end of line character). Please fix this. Alot of these enable/disble

Re: [PATCH 8/8] xhci: tegra: enable ELPG for runtime/system PM

2019-07-04 Thread Jon Hunter
On 14/06/2019 08:48, JC Kuo wrote: > This commit enables XUSB host controller ELPG for runtime and system > power management. > > NEED CLEANUP. > > Signed-off-by: JC Kuo > --- > drivers/usb/host/xhci-tegra.c | 802 -- > 1 file changed, 671 insertions(+), 131 d

[PATCH] ALSA: usb-audio: Fix parse of UAC2 Extension Units

2019-07-04 Thread Takashi Iwai
Extension Unit (XU) is used to have a compatible layout with Processing Unit (PU) on UAC1, and the usb-audio driver code assumed it for parsing the descriptors. Meanwhile, on UAC2, XU became slightly incompatible with PU; namely, XU has a one-byte bmControls bitmap while PU has two bytes bmControl

RE: [PATCH V3] usb: gadget: storage: Remove warning message

2019-07-04 Thread Alan Stern
On Thu, 4 Jul 2019, EJ Hsu wrote: > Based on my initial debugging, USB CV TD 9.13 will consecutively set device > to configuration #1 by sending "Set Configuration" transfer. > So, in set_config() function, it will try to disable each interface first and > then set up each interface. That is, th

Re: Virtual hub, resets etc...

2019-07-04 Thread Alan Stern
On Thu, 4 Jul 2019, Benjamin Herrenschmidt wrote: > Hi Folks ! > > (Michal: Mass storage issue near the end...) > > So I'd like to pick your brains on what you think is the best policy to > implement for this case: > > The issue is around the Aspeed vhub driver which I wrote. > > To recap, the

Re: [PATCH 0/3] usb: gadget: u_serial: Fix and cleanup

2019-07-04 Thread Ladislav Michl
On Wed, Jul 03, 2019 at 06:33:55PM +0200, Ladislav Michl wrote: > Following patchset makes console work (patch 1) for at AT91SAM9G20 board > connected to xhci_hcd and does some cleanup. > Tested with "console=ttyS0,115200n8 console=ttyGS0,115200n8" on kernel > command line and following inittab: >

[PATCH] usb: xhci: fix length check in xhci_align_td

2019-07-04 Thread Lorenzo Bianconi
Fix the following warning due to a wrong length check after sg_pcopy_to_buffer in xhci_align_td xhci_hcd :00:04.0: WARN Wrong bounce buffer write length: 158 != 284 xhci_hcd :00:04.0: WARN Wrong bounce buffer write length: 234 != 158 xhci_hcd :00:04.0: WARN Wrong bounce buffer write le

Fwd: Re: New USB Device

2019-07-04 Thread Markus Breunig
Hi Greg, using a serial device driver is the idea of the manufacturer "www.gns-gmbh.com". In the LINUX instructions of the ADS-B receiver some hints to use the device are given via usbserial. In practice the "GNS 5890 ADS-B Receiver" is similare to some GPS Receivers with NMEA 0183 interface sta

Re: Virtual hub, resets etc...

2019-07-04 Thread Benjamin Herrenschmidt
On Thu, 2019-07-04 at 12:13 -0400, Alan Stern wrote: > > - bus reset: When I sense a bus reset, that's where I'm not too sure > > what to do. Currently I clear all the status bits of the ports > > except USB_PORT_STAT_SUSPEND. Thus I clear USB_PORT_STAT_ENABLE. > > But I'm not sure what to do wit

Re: Virtual hub, resets etc...

2019-07-04 Thread Benjamin Herrenschmidt
On Fri, 2019-07-05 at 07:44 +1000, Benjamin Herrenschmidt wrote: > > >- At some point I had code to reject EP queue() if the device > > > is > > > suspended with -ESHUTDOWN. The end result was bad ... > > > f_mass_storage > > > goes into an infinite loop of trying to queue the same stuff in > >

Re: [PATCH 0/3] usb: gadget: u_serial: Fix and cleanup

2019-07-04 Thread Ladislav Michl
On Thu, Jul 04, 2019 at 06:32:56PM +0200, Ladislav Michl wrote: > On Wed, Jul 03, 2019 at 06:33:55PM +0200, Ladislav Michl wrote: > > Following patchset makes console work (patch 1) for at AT91SAM9G20 board > > connected to xhci_hcd and does some cleanup. > > Tested with "console=ttyS0,115200n8 con

Re: Virtual hub, resets etc...

2019-07-04 Thread Alan Stern
On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > On Thu, 2019-07-04 at 12:13 -0400, Alan Stern wrote: > > > - bus reset: When I sense a bus reset, that's where I'm not too sure > > > what to do. Currently I clear all the status bits of the ports > > > except USB_PORT_STAT_SUSPEND. Thus I clea

Re: Virtual hub, resets etc...

2019-07-04 Thread Alan Stern
On Fri, 5 Jul 2019, Benjamin Herrenschmidt wrote: > On Fri, 2019-07-05 at 07:44 +1000, Benjamin Herrenschmidt wrote: > > > >- At some point I had code to reject EP queue() if the device > > > > is > > > > suspended with -ESHUTDOWN. The end result was bad ... > > > > f_mass_storage > > > > goes

Re: Virtual hub, resets etc...

2019-07-04 Thread Benjamin Herrenschmidt
On Thu, 2019-07-04 at 21:34 -0400, Alan Stern wrote: > > It is the right HW behaviour. But with our gadget stack, it doesn't > > reset or cleanup anything. Though since the port gets disabled, I > > suppose re-enabling it will cause a reset and will sort that out. > > That's right. (Except that y

Re: Virtual hub, resets etc...

2019-07-04 Thread Benjamin Herrenschmidt
On Thu, 2019-07-04 at 21:37 -0400, Alan Stern wrote: > > > > Talking of which... do we need this ? > > > > --- a/drivers/usb/gadget/composite.c > > +++ b/drivers/usb/gadget/composite.c > > @@ -1976,6 +1976,7 @@ void composite_disconnect(struct usb_gadget *gadget) > > * disconnect callback

Re: [PATCH] [PATCH v7] USB: serial: pl2303: Add new PID to support PL2303HXN (TYPE_HXN)

2019-07-04 Thread Charles Yeh
Is there any need to modify it? If there is no need to modify, how long does it take to complete REVIEW? Charles Yeh Charles Yeh 於 2019年7月2日 週二 下午8:30寫道: > > Prolific has developed a new USB to UART chip: PL2303HXN > PL2303HXN : PL2303GC/PL2303GS/PL2303GT/PL2303GL/PL2303GE/PL2303GB > The Vendor

[GIT PULL] usb: chipidea: changes for v5.3-rc1

2019-07-04 Thread Peter Chen
The following changes since commit 8ea5b2abd07e2280a332bd9c1a7f4dd15b9b6c13: Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2019-05-09 19:35:41 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb.git/

Re: [PATCH 2/8] clk: tegra: don't enable PLLE HW sequencer at init

2019-07-04 Thread JC Kuo
On 7/4/19 8:22 PM, Jon Hunter wrote: > > On 14/06/2019 08:46, JC Kuo wrote: >> PLLE hardware power sequencer references PEX/SATA UPHY PLL hardware >> power sequencers' output to enable/disable PLLE. PLLE hardware power >> sequencer has to be enabled only after PEX/SATA UPHY PLL's sequencers >> are

Re: [PATCH] [PATCH v7] USB: serial: pl2303: Add new PID to support PL2303HXN (TYPE_HXN)

2019-07-04 Thread Greg KH
A: http://en.wikipedia.org/wiki/Top_post Q: Were do I find info about this thing called top-posting? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? A: No. Q: Should I incl

Re: [GIT PULL] usb: chipidea: changes for v5.3-rc1

2019-07-04 Thread gre...@linuxfoundation.org
On Fri, Jul 05, 2019 at 03:32:40AM +, Peter Chen wrote: > The following changes since commit 8ea5b2abd07e2280a332bd9c1a7f4dd15b9b6c13: > > Merge branch 'fixes' of > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (2019-05-09 19:35:41 > -0700) > > are available in the git repository

Re: Fwd: Re: New USB Device

2019-07-04 Thread Greg KH
On Thu, Jul 04, 2019 at 10:47:47PM +0200, Markus Breunig wrote: > Hi Greg, > > using a serial device driver is the idea of the manufacturer > "www.gns-gmbh.com". In the LINUX instructions of the ADS-B receiver some > hints to use the device are given via usbserial. Any pointers to those instructi

Re: [PATCH 3/8] phy: tegra: xusb: t210: rearrange UPHY init

2019-07-04 Thread JC Kuo
On 7/4/19 9:32 PM, Jon Hunter wrote: > > On 14/06/2019 08:46, JC Kuo wrote: >> This commit is a preparation for enabling XUSB LP0 support. > > By LP0 do you mean ELPG? If so please stick to using one name for > referring to the power-state in question. > >> It rearranges T210 XUSB PADCTL UPHY in