[PATCH] usbip: usbip_host: fix NULL-ptr deref and use-after-free errors

2018-05-14 Thread Shuah Khan (Samsung OSG)
usbip_host updates device status without holding lock from stub probe, disconnect and rebind code paths. When multiple requests to import a device are received, these unprotected code paths step all over each other and drive fails with NULL-ptr deref and use-after-free errors. The driver uses a

RE: [PATCH/RFC v3 1/4] base: devcon: add a new API to find the graph

2018-05-14 Thread Yoshihiro Shimoda
Hi Heikki, > From: Heikki Krogerus, Sent: Monday, May 14, 2018 10:28 PM > > On Mon, May 14, 2018 at 06:15:57PM +0900, Yoshihiro Shimoda wrote: > > diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c > > index d427e80..5a0da33 100644 > > --- a/drivers/base/devcon.c > > +++

Re: USB Floppy Disk Driver

2018-05-14 Thread Randy Dunlap
On 05/14/2018 05:51 PM, Joshua Hudson wrote: > Has anybody tried the USB floppy disk driver in awhile? I just did to > read an old disk, and I couldn't read a single byte. > > I started thinking maybe the hardware's bad, but dd didn't raise en > error even after I pulled it out and got "USB

Re: [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM

2018-05-14 Thread David R. Bild
On Mon, May 14, 2018 at 3:08 PM, Jason Gunthorpe wrote: > On Mon, May 14, 2018 at 02:59:36PM -0500, David R. Bild wrote: >> On Mon, May 14, 2018 at 2:31 PM, Jason Gunthorpe wrote: The driver can setup enough to use the TPM >> > framework to send commands before

Re: [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM

2018-05-14 Thread Jason Gunthorpe
On Mon, May 14, 2018 at 02:59:36PM -0500, David R. Bild wrote: > On Mon, May 14, 2018 at 2:31 PM, Jason Gunthorpe wrote: > > > > On Thu, May 10, 2018 at 09:41:53AM -0500, David R. Bild wrote: > > > > > 3) Allow the driver to register the TPM with TPM driver, but not yet > > >

Re: Race related to e04a0442d33b "HID: core: remove the absolute need of hid_have_special_driver[]"

2018-05-14 Thread Heiner Kallweit
Am 14.05.2018 um 11:58 schrieb Benjamin Tissoires: > Hi Heiner, > > On Fri, May 11, 2018 at 12:11 AM, Heiner Kallweit > wrote: >> Due to some other issue with one devices supported by hid-led I figured >> out that it's no longer needed to list devices with own driver in >>

Re: [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM

2018-05-14 Thread David R. Bild
On Mon, May 14, 2018 at 2:31 PM, Jason Gunthorpe wrote: > > On Thu, May 10, 2018 at 09:41:53AM -0500, David R. Bild wrote: > > > 3) Allow the driver to register the TPM with TPM driver, but not yet > > expose the TPM to userspace. Let the driver do some additional work > > (like

Re: [PATCH v3 2/2] usb: misc: xapea00x: perform platform initialization of TPM

2018-05-14 Thread Jason Gunthorpe
On Thu, May 10, 2018 at 09:41:53AM -0500, David R. Bild wrote: > 3) Allow the driver to register the TPM with TPM driver, but not yet > expose the TPM to userspace. Let the driver do some additional work > (like set the platform hierarchy password) and then explicitly inform > the TPM driver

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

2018-05-14 Thread russianneuromancer
Hello! > I didn't get any feedback about the suggested patch. If you talk about this one https://marc.info/?l=linux-usb=15252835690 2325=2 then unfortunately I missed it. Mathias, please confirm, is this patch I need to check on Dell 5855? 14/05/2018 в 16:27 +0300, Mathias Nyman: > On

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

2018-05-14 Thread russianneuromancer
Hello! > I didn't get any feedback about the suggested patch. If you talk about this one https://marc.info/?l=linux-usb=15252835690 2325=2 then unfortunately I missed it. Mathias, please confirm, is this patch I need to check on Dell 5855? 14/05/2018 в 16:27 +0300, Mathias Nyman: > On

Re: [PATCH/RFC v3 1/4] base: devcon: add a new API to find the graph

2018-05-14 Thread Randy Dunlap
On 05/14/2018 02:15 AM, Yoshihiro Shimoda wrote: > This patch adds a new API "device_connection_find_by_graph()" to > find device connection by using graph. > > Signed-off-by: Yoshihiro Shimoda > --- > Documentation/driver-api/device_connection.rst | 4 +-- >

[PATCH] musb fixes for v4.17-rc6

2018-05-14 Thread Bin Liu
Hi Greg, Here is one musb fix for v4.17-rc6, which fixes a race condition in musb transitioning from resume to suspend. Please let me know if any change is needed. Regards, -Bin. Daniel Glöckner (1): usb: musb: fix remote wakeup racing with suspend drivers/usb/musb/musb_host.c| 5

[PATCH] usb: musb: fix remote wakeup racing with suspend

2018-05-14 Thread Bin Liu
From: Daniel Glöckner 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 the USB spec to transition directly

Re: [PATCH/RFC v3 1/4] base: devcon: add a new API to find the graph

2018-05-14 Thread Heikki Krogerus
On Mon, May 14, 2018 at 06:15:57PM +0900, Yoshihiro Shimoda wrote: > This patch adds a new API "device_connection_find_by_graph()" to > find device connection by using graph. > > Signed-off-by: Yoshihiro Shimoda > --- >

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

2018-05-14 Thread Mathias Nyman
On 11.05.2018 19:37, gert wrote: 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

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

2018-05-14 Thread Heikki Krogerus
On Sat, May 12, 2018 at 02:42:47PM -0700, Guenter Roeck wrote: > On 05/11/2018 06:18 AM, Heikki Krogerus wrote: > > 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

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

2018-05-14 Thread Heikki Krogerus
On Sat, May 12, 2018 at 06:25:09PM -0700, Randy Dunlap wrote: > On 05/11/2018 06:18 AM, Heikki Krogerus wrote: > > 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

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

2018-05-14 Thread Heikki Krogerus
On Sun, May 13, 2018 at 12:30:51AM +0300, Andy Shevchenko wrote: > On Fri, May 11, 2018 at 4:18 PM, Heikki Krogerus > wrote: > > This adds more complete handling of VDMs and registration of > > partner alternate modes, and introduces callbacks for > > alternate

Re: Race related to e04a0442d33b "HID: core: remove the absolute need of hid_have_special_driver[]"

2018-05-14 Thread Benjamin Tissoires
Hi Heiner, On Fri, May 11, 2018 at 12:11 AM, Heiner Kallweit wrote: > Due to some other issue with one devices supported by hid-led I figured > out that it's no longer needed to list devices with own driver in > hid_have_special_driver[]. > > So I removed the entries for

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

2018-05-14 Thread Jun Li
Hi > -Original Message- > From: Mats Karrman [mailto:mats.dev.l...@gmail.com] > Sent: 2018年5月12日 5:37 > To: Jun Li ; robh...@kernel.org; gre...@linuxfoundation.org; > heikki.kroge...@linux.intel.com; li...@roeck-us.net > Cc: a.ha...@samsung.com; cw00.c...@samsung.com; >

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

2018-05-14 Thread Jun Li
Hi > -Original Message- > From: Mats Karrman [mailto:mats.dev.l...@gmail.com] > Sent: 2018年5月12日 3:56 > To: Jun Li ; robh...@kernel.org; gre...@linuxfoundation.org; > heikki.kroge...@linux.intel.com; li...@roeck-us.net > Cc: a.ha...@samsung.com; cw00.c...@samsung.com; >

[PATCH/RFC v3 1/4] base: devcon: add a new API to find the graph

2018-05-14 Thread Yoshihiro Shimoda
This patch adds a new API "device_connection_find_by_graph()" to find device connection by using graph. Signed-off-by: Yoshihiro Shimoda --- Documentation/driver-api/device_connection.rst | 4 +-- drivers/base/devcon.c | 43

[PATCH/RFC v3 4/4] arm64: dts: renesas: r8a7795: add OF graph for usb role switch

2018-05-14 Thread Yoshihiro Shimoda
This patch adds OF graph properties for usb role switch in r8a7795 into USB3.0 host/peripheral nodes. TODO: - need patches for other SoCs. Signed-off-by: Yoshihiro Shimoda --- arch/arm64/boot/dts/renesas/r8a7795.dtsi | 12 1 file changed, 12

[PATCH/RFC v3 0/4] usb: role: rcar-usb3-role-switch: add support for R-Car SoCs

2018-05-14 Thread Yoshihiro Shimoda
This patch set is based on Felipe's usb.git / testing/next branch (commit id = 5d1332a8eabd8bd5b8c322d45542968ee6f113be). I still marked this patch set as "RFC". I would like to know whether this way is good or not. Changes from RFC v2: - Add registering usb role switch into

[PATCH/RFC v3 3/4] usb: gadget: udc: renesas_usb3: use usb role switch API

2018-05-14 Thread Yoshihiro Shimoda
This patch uses usb role switch API if the register suceeeded. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c

[PATCH/RFC v3 2/4] usb: gadget: udc: renesas_usb3: Add register of usb role switch

2018-05-14 Thread Yoshihiro Shimoda
This patch adds role switch support for R-Car SoCs into the USB 3.0 peripheral driver. Some R-Car SoCs (e.g. R-Car H3) have USB 3.0 dual-role device controller which has the USB 3.0 xHCI host and Renesas USB 3.0 peripheral. Unfortunately, the mode change register contains the USB 3.0 peripheral

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

2018-05-14 Thread Jun Li
Hi > -Original Message- > From: Mats Karrman [mailto:mats.dev.l...@gmail.com] > Sent: 2018年5月12日 3:52 > To: Jun Li ; robh...@kernel.org; gre...@linuxfoundation.org; > heikki.kroge...@linux.intel.com; li...@roeck-us.net > Cc: a.ha...@samsung.com; cw00.c...@samsung.com; >

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

2018-05-14 Thread Jun Li
Hi > -Original Message- > From: Mats Karrman [mailto:mats.dev.l...@gmail.com] > Sent: 2018年5月12日 3:49 > To: Jun Li ; robh...@kernel.org; gre...@linuxfoundation.org; > heikki.kroge...@linux.intel.com; li...@roeck-us.net > Cc: a.ha...@samsung.com; cw00.c...@samsung.com; >

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

2018-05-14 Thread Mathias Nyman
On 11.05.2018 23:06, Jordan Glover wrote: 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 ---

[PATCH 0/1] xhci fix for usb-linus 4.17

2018-05-14 Thread Mathias Nyman
Hi Greg One more xhci fix for 4.17. Commit: 44a182b9d177 ("xhci: Fix use-after-free in xhci_free_virt_device") Revealed a race by causing a NULL pointer dereference regression in 4.17-rc4 and stable. Fix it. -Mathias Mathias Nyman (1): xhci: Fix USB3 NULL pointer dereference at logical

[PATCH 1/1] xhci: Fix USB3 NULL pointer dereference at logical disconnect.

2018-05-14 Thread Mathias Nyman
Hub driver will try to disable a USB3 device twice at logical disconnect, racing with xhci_free_dev() callback from the first port disable. This can be triggered with "udisksctl power-off --block-device " or by writing "1" to the "remove" sysfs file for a USB3 device in 4.17-rc4. USB3 devices

Re: [PATCH 1/2] USB: dwc3: get extcon device by OF graph bindings

2018-05-14 Thread Andrzej Hajda
On 31.01.2018 16:57, Andrzej Hajda wrote: > extcon device is used to detect host/device connection. Since extcon > OF property is deprecated, alternative method should be added. > This method uses OF graph bindings to locate extcon. > > Signed-off-by: Andrzej Hajda Ping, 3.5

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

2018-05-14 Thread Mathias Nyman
On 12.05.2018 04:21, Jacob Saunders wrote: 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

Re: [PATCH v2] usb: chipidea: Hook into mux framework to toggle usb switch

2018-05-14 Thread Peter Rosin
On 2018-04-18 07:48, yos...@codeaurora.org wrote: > On 2018-04-17 17:11, Peter Rosin wrote: >> On 2018-04-17 15:52, Yossi Mansharoff wrote: >>> On the db410c 96boards platform we have a TC7USB40MU on the board >>> to mux the D+/D- lines coming from the controller between a micro >>> usb "device"

[PATCH v3 1/2] dt-bindings: usb: add bindings doc for HiSilicon STB xHCI host controller

2018-05-14 Thread sunjg79
From: Jianguo Sun This commit adds bindings doc for HiSilicon STB xHCI host controller. Signed-off-by: Jianguo Sun --- .../bindings/usb/hisilicon,histb-xhci.txt | 45 ++ 1 file changed, 45 insertions(+) create mode

[PATCH v3 0/2] add support for HiSilicon STB xHCI host controller

2018-05-14 Thread sunjg79
From: Jianguo Sun This patch set adds bindings doc and xhci driver for xHCI host controller on HiSilicon STB SoCs. changes in v3: - fix typo of "pipeE" - remove optional property of "quirk-broken-port-ped" changes in v2: - add optional properties in bindings doc

[PATCH v3 2/2] xhci: hisilicon: support HiSilicon STB xHCI host controller

2018-05-14 Thread sunjg79
From: Jianguo Sun This commit adds support for HiSilicon STB xHCI host controller. There are two xHCI host controllers on HiSilicon STB SoCs. Each one requires additional configuration before exposing interface compliant with xHCI. Reviewed-by: Chunfeng Yun