Fwd: patch "xhci: Fix use-after-free in xhci_free_virt_device" causes kernel crashes on 4.16.8 on unplug

2018-05-11 Thread Jacob Saunders
On Linux kernel 4.16.8 (using Arch Linux) if I eject a USB 3.0 device from my system (unplug or "udisksctl power-off --block-device /dev/sde), it freezes instantly with a null pointer error in XHCI. I've been unable to successfully capture a kernel log of the error (and my cameras did not retur

Re: [PATCH v5 14/14] staging: typec: tcpci: move tcpci driver out of staging

2018-05-11 Thread Mats Karrman
Hi Li Jun, This patch takes away building the entire staging/typec tree but this is still not empty after your patch, another driver "tcpci_rt1711h" is there. Better just remove tcpci from staging/typec/{Kconfig,Makefile} // Mats On 2018-05-03 02:24, Li Jun wrote: Move TCPCI(Typec port contro

Re: usbcore: NULL pointer dereference after detaching USB disk with linux 4.17

2018-05-11 Thread Jordan Glover
On May 11, 2018 6:14 PM, Mathias Nyman wrote: > > I think that just adding the below code should be enough for 4.17 > > diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c > > index 72ebbc9..32cd52c 100644 > > --- a/drivers/usb/host/xhci-hub.c > > +++ b/drivers/usb/host/xhc

Re: [PATCH v5 05/14] usb: typec: add API to get typec basic port power and data config

2018-05-11 Thread Mats Karrman
Hi Li Jun, On 2018-05-03 02:24, Li Jun wrote: This patch adds 3 APIs to get the typec port power and data type, and preferred power role by its name string. Signed-off-by: Li Jun --- drivers/usb/typec/class.c | 52 +++ include/linux/usb/typec.h |

Re: [PATCH v5 03/14] staging: typec: tcpci: add compatible string for nxp ptn5110

2018-05-11 Thread Mats Karrman
Hi Li Jun, On 2018-05-03 02:24, Li Jun wrote: Add nxp ptn5110 typec controller compatible string: usb-tcpci,ptn5110, which is a standard tcpci chip with power delivery support. Signed-off-by: Li Jun --- drivers/staging/typec/tcpci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drive

Re: [PATCH v5 01/14] dt-bindings: connector: add properties for typec

2018-05-11 Thread Mats Karrman
Hi Li Jun, On 2018-05-03 02:24, Li Jun wrote: Add bingdings supported by current typec driver, so user can pass all those properties via dt. Signed-off-by: Li Jun --- .../bindings/connector/usb-connector.txt | 44 +++ include/dt-bindings/usb/pd.h

Re: [RFC PATCH 1/7] usb: typec: Generalize mux mode names

2018-05-11 Thread Mats Karrman
On 2018-05-11 13:14, Heikki Krogerus wrote: On Fri, May 11, 2018 at 11:05:55AM +0200, Mats Karrman wrote: On 2018-05-10 19:49, Heikki Krogerus wrote: On Thu, May 10, 2018 at 10:04:21AM +0200, Mats Karrman wrote: Hi, On 05/09/2018 02:49 PM, Heikki Krogerus wrote: On Tue, May 08, 2018 at 09

Re: general protection fault in usb_find_alt_setting

2018-05-11 Thread Dmitry Vyukov
On Sun, Nov 12, 2017 at 10:06 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on > d9e0e63d9a6f88440eb201e1491fcf730272c706 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is

Fwd: Enabling USB (auto)suspend for xHCI controllers incurs random device failures since kernel 4.15

2018-05-11 Thread gert
Since the upgrade to Linux 4.15 (and also in 4.16), I'm experiencing an issue where all my USB devices just die seemingly without any cause. Both my laptop's internal (attached) keyboard as well as my external keyboard die. Replugging the external keyboard unfortunately does not solve the p

Re: usbcore: NULL pointer dereference after detaching USB disk with linux 4.17

2018-05-11 Thread Mathias Nyman
On 11.05.2018 15:11, Jordan Glover wrote: On May 11, 2018 1:46 PM, Mathias Nyman wrote: Hi On 10.05.2018 14:49, Jordan Glover wrote: Hello, Detaching plugged external usb disk with: "udisksctl power-off --block-device " causes NULL pointer dereference and kernel hang. Tested with 4.17-rc4

Re: [PATCH/RFC v2 1/6] dt-bindings: usb: add Renesas R-Car USB 3.0 role switch

2018-05-11 Thread Rob Herring
On Mon, May 7, 2018 at 9:43 PM, Yoshihiro Shimoda wrote: > Hi Rob, > > Sorry for the delayed response. I had a vacation in last week. > >> From: Rob Herring, Sent: Saturday, April 28, 2018 5:06 AM >> >> On Thu, Apr 26, 2018 at 08:26:41PM +0900, Yoshihiro Shimoda wrote: >> > This patch adds a new d

Re: [PATCH v2] musb: fix remote wakeup racing with suspend

2018-05-11 Thread Bin Liu
Hi, On Thu, May 03, 2018 at 04:43:25PM +0200, Daniel Glöckner wrote: > It has been observed that writing 0xF2 to the power register while it > reads as 0xF4 results in the register having the value 0xF0, i.e. clearing > RESUME and setting SUSPENDM in one go does not work. It might also violate > t

[RFC PATCH v3 0/5] usb: typec: Support for Alternate Modes

2018-05-11 Thread Heikki Krogerus
Hi, This is the third version of my proposal for more complete alternate mode support. In this version I'm including a proposal for the mux handling. Basically, I'm proposing that every supported alternate will have its own mux handle. That should allow us to support multiple alternate modes at th

[RFC PATCH v3 3/5] usb: typec: Bus type for alternate modes

2018-05-11 Thread Heikki Krogerus
Introducing a simple bus for the alternate modes. Bus allows binding drivers to the discovered alternate modes the partners support. Signed-off-by: Heikki Krogerus --- Documentation/ABI/obsolete/sysfs-class-typec | 48 +++ Documentation/ABI/testing/sysfs-bus-typec| 51 +++ Documentation/AB

[RFC PATCH v3 2/5] usb: typec: Register a device for every mode

2018-05-11 Thread Heikki Krogerus
Before a device was created for every discovered SVID, but this will create a device for every discovered mode of every SVID. The idea is to make it easier to create mode specific drivers once a bus for the alternate mode is added. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 1

[RFC PATCH v3 1/5] usb: typec: mux: Get the mux identifier from function parameter

2018-05-11 Thread Heikki Krogerus
In order for the muxes to be usable with alternate modes, the alternate mode devices will need also to be able to get a handle to the muxes on top of the port devices. To make that possible, the muxes need to be possible to request with an identifier. This will change the API so that the mux ident

[RFC PATCH v3 4/5] usb: typec: pi3usb30532: Start using generic state values

2018-05-11 Thread Heikki Krogerus
Instead of the tcpm specific mux states, using the generic USB type-c connector state values. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux/pi3usb30532.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/mux/pi3usb30532.c b/drivers/usb/

[RFC PATCH v3 5/5] usb: typec: tcpm: Support for Alternate Modes

2018-05-11 Thread Heikki Krogerus
This adds more complete handling of VDMs and registration of partner alternate modes, and introduces callbacks for alternate mode operations. Only DFP role is supported for now. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tcpm.c | 156 +++ include/li

Re: usbcore: NULL pointer dereference after detaching USB disk with linux 4.17

2018-05-11 Thread Jordan Glover
On May 11, 2018 1:46 PM, Mathias Nyman wrote: > Hi > > On 10.05.2018 14:49, Jordan Glover wrote: > > > Hello, > > > > Detaching plugged external usb disk with: "udisksctl power-off > > --block-device " causes NULL pointer dereference and kernel hang. > > Tested with 4.17-rc4 on Manjaro Linux

Re: usbcore: NULL pointer dereference after detaching USB disk with linux 4.17

2018-05-11 Thread Mathias Nyman
Hi On 10.05.2018 14:49, Jordan Glover wrote: Hello, Detaching plugged external usb disk with: "udisksctl power-off --block-device " causes NULL pointer dereference and kernel hang. Tested with 4.17-rc4 on Manjaro Linux config and my own custom config with two different usb disks. It doesn't

Re: dwc2 device testing with Service Interval plus LPM

2018-05-11 Thread Grigor Tovmasyan
On 5/11/2018 2:42 PM, Felipe Balbi wrote: > > Hi, > > Grigor Tovmasyan writes: > >> Hi all, >> >> I want to test a new feature of HSOTG core: Service Interval + LPM support >> in device mode. >> What I need to use from host side to be able generate appropriate ISOC IN >> traffic? > > Audio c

Re: dwc2 device testing with Service Interval plus LPM

2018-05-11 Thread Felipe Balbi
Hi, Grigor Tovmasyan writes: > Hi all, > > I want to test a new feature of HSOTG core: Service Interval + LPM support in > device mode. > What I need to use from host side to be able generate appropriate ISOC IN > traffic? Audio class, camera class, g_zero isoc tests... -- balbi -- To unsu

dwc2 device testing with Service Interval plus LPM

2018-05-11 Thread Grigor Tovmasyan
Hi all, I want to test a new feature of HSOTG core: Service Interval + LPM support in device mode. What I need to use from host side to be able generate appropriate ISOC IN traffic? Thanks, Grigor. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message

[PATCH v2 0/3] Fix an Atmel USBA UDC issue introducted in 4.17-rc1

2018-05-11 Thread Romain Izard
The use of GPIO descriptors takes care of inversion flags declared in the device tree. The conversion of the Atmel USBA UDC driver introduced in 4.17-rc1 missed it, and as a result the inversion will not work. In addition, cleanup the code to remove an include left behind after the suppression of

[PATCH v2 2/3] usb: gadget: udc: atmel: Remove obsolete include

2018-05-11 Thread Romain Izard
The include defines the private platform_data structure used with AVR platforms. It has no user since 7c55984e191f. Remove it. Acked-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off-by: Romain Izard --- drivers/usb/gadget/udc/atmel_usba_udc.c | 1 - include/linux/usb/atmel_usba_udc.h

[PATCH v2 1/3] usb: gadget: udc: atmel: GPIO inversion is handled by gpiod

2018-05-11 Thread Romain Izard
When converting to GPIO descriptors, gpiod_get_value automatically handles the line inversion flags from the device tree. Do not invert the line twice. Fixes: 3df034081021 ("usb: gadget: udc: atmel: convert to use GPIO descriptors") Acked-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off

[PATCH v2 3/3] usb: gadget: udc: atmel: Fix indenting

2018-05-11 Thread Romain Izard
Fix the fallout of the conversion to GPIO descriptors in 3df034081021. Acked-by: Ludovic Desroches Acked-by: Nicolas Ferre Signed-off-by: Romain Izard --- drivers/usb/gadget/udc/atmel_usba_udc.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/

[PATCH v5 1/2] usb: dwc2: alloc dma aligned buffer for isoc split in

2018-05-11 Thread William Wu
The commit 3bc04e28a030 ("usb: dwc2: host: Get aligned DMA in a more supported way") rips out a lot of code to simply the allocation of aligned DMA. However, it also introduces a new issue when use isoc split in transfer. In my test case, I connect the dwc2 controller with an usb hs Hub (GL852G-12

[PATCH v5 2/2] usb: dwc2: fix isoc split in transfer with no data

2018-05-11 Thread William Wu
If isoc split in transfer with no data (the length of DATA0 packet is zero), we can't simply return immediately. Because the DATA0 can be the first transaction or the second transaction for the isoc split in transaction. If the DATA0 packet with no data is in the first transaction, we can return im

[PATCH v5 0/2] usb: dwc2: fix isoc split in transfer issue

2018-05-11 Thread William Wu
This patch fix dma unaligned problem and data lost problem for isoc split in transfer. Test on rk3288 platform, use an usb hs Hub (GL852G-12) and an usb fs audio device (Plantronics headset) to capture and playback. William Wu (2): usb: dwc2: alloc dma aligned buffer for isoc split in usb: dw

Re: [PATCH v4 1/2] usb: dwc2: alloc dma aligned buffer for isoc split in

2018-05-11 Thread wlf
Dear Doug, 在 2018年05月11日 05:01, Doug Anderson 写道: Hi, On Wed, May 9, 2018 at 3:11 AM, William Wu wrote: The commit 3bc04e28a030 ("usb: dwc2: host: Get aligned DMA in a more supported way") rips out a lot of code to simply the allocation of aligned DMA. However, it also introduces a new issue

Re: [PATCH v3 1/2] usb: dwc2: alloc dma aligned buffer for isoc split in

2018-05-11 Thread wlf
Dear Doug, 在 2018年05月11日 04:59, Doug Anderson 写道: Hi, On Wed, May 9, 2018 at 1:55 AM, wlf wrote: + } else if (hsotg->params.host_dma) { Are you sure this is "else if"? Can't you have descriptor DMA enabled in the controller and still need to do a normal DMA transfer if you plug in a