Re: A question about 'lsusb'

2018-08-31 Thread Faisal Mehmood
On Fri, Aug 31, 2018 at 09:13:31AM -0700, Greg KH wrote: > On Thu, Aug 30, 2018 at 05:10:53PM -0400, Alan Stern wrote: > > On Thu, 30 Aug 2018, Faisal Mehmood wrote: > > > > > Based on my (limited) understanding if I were to disable udev, the > > > userspace should not be able to

RE: [PATCH v4 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-31 Thread Ajay Gupta
Hi Andy, > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C > > interface. > > > > This UCSI I2C driver uses I2C bus driver interface for communicating > > with Type-C controller. > > > Changes from v3 -> v4 > > Fixed comments from Andy > > Unfortunatelly not all

RE: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Hi Andy, > > Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C > > controller which can be accessed over I2C. > > > > This driver adds I2C bus driver to communicate with Type-C controller. > > I2C client driver will be part of USB Type-C UCSI driver. > > Thanks for an update, my

[PATCH v5 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C controller which can be accessed over I2C. This driver adds I2C bus driver to communicate with Type-C controller. I2C client driver will be part of USB Type-C UCSI driver. Signed-off-by: Ajay Gupta --- Changes from v1 -> v2

[PATCH v5 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-31 Thread Ajay Gupta
Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller over I2C interface. This UCSI I2C driver uses I2C bus driver interface for communicating with Type-C controller. Signed-off-by: Ajay Gupta --- Changes from v1 -> v2 Fixed identation in drivers/usb/typec/ucsi/Kconfig Changes

RE: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Ajay Gupta
Hi Andy > > > Latest NVIDIA GPU card has USB Type-C interface. There is a Type-C > > > controller which can be accessed over I2C. > > > + val &= ~(I2C_MST_CNTL_GEN_START | I2C_MST_CNTL_GEN_STOP > > > + | I2C_MST_CNTL_GEN_RAB); > > > > "|" should be on previous line to follow

[PATCH] usb: Avoid use-after-free by flushing endpoints early in usb_set_interface()

2018-08-31 Thread Mathias Nyman
The steps taken by usb core to set a new interface is very different from what is done on the xHC host side. xHC hardware will do everything in one go. One command is used to set up new endpoints, free old endpoints, check bandwidth, and run the new endpoints. All this is done by xHC when usb

Re: [PATCH v4 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-31 Thread Andy Shevchenko
On Fri, Aug 31, 2018 at 12:41 AM Ajay Gupta wrote: > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > over I2C interface. > > This UCSI I2C driver uses I2C bus driver interface for communicating > with Type-C controller. > Changes from v3 -> v4 > Fixed comments from Andy

Re: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-31 Thread Andy Shevchenko
On Fri, Aug 31, 2018 at 12:41 AM Ajay Gupta wrote: > > Latest NVIDIA GPU card has USB Type-C interface. There is a > Type-C controller which can be accessed over I2C. > > This driver adds I2C bus driver to communicate with Type-C controller. > I2C client driver will be part of USB Type-C UCSI

Re: musb_hdrc HNP?

2018-08-31 Thread Takashi Matsuzawa
Hello. I just confirmed what I wanted to see. I could do lsusb to list A-device (from b_host) and B-device (from a_host). Suspending from either side kicked role change between A-device and B-device (in both direction). I needed to wait 20ms after B-device seeing MUSB_INTR_CONNECT and before

Re: A few questions about gadgetfs

2018-08-31 Thread Andrey Konovalov
On Thu, Aug 30, 2018 at 10:50 PM, Alan Stern wrote: > On Thu, 30 Aug 2018, Andrey Konovalov wrote: > >> Hi Alan, >> >> I have a few questions about gadgetfs. >> >> According to documentation usb_gadget_driver->setup "queues a response >> to ep0, or returns negative to stall". >> >> Do I

[PATCH] usb: core: added uevent for over-current

2018-08-31 Thread Jon Flatley
After commit 1cbd53c8cd85 ("usb: core: introduce per-port over-current counters") usb ports expose a sysfs value 'over_current_count' to user space. This value on its own is not very useful as it requires manual polling. As a solution, fire a udev event from the usb hub device that specifies the

Re: A question about 'lsusb'

2018-08-31 Thread Greg KH
On Thu, Aug 30, 2018 at 05:10:53PM -0400, Alan Stern wrote: > On Thu, 30 Aug 2018, Faisal Mehmood wrote: > > > Based on my (limited) understanding if I were to disable udev, the > > userspace should not be able to enumerate/interact with any newly > > connected device since udev handles uevents

Re: A few questions about gadgetfs

2018-08-31 Thread Andrey Konovalov
On Fri, Aug 31, 2018 at 4:34 PM, Alan Stern wrote: > On Fri, 31 Aug 2018, Andrey Konovalov wrote: [...] >> Yes, I understand this. The idea is to stall/wait until the userspace >> provides a response. Like gadgetfs, but for every USB request. > > If all you want to do is wait, STALL is not the

[PATCH 7/8] usb: typec: class: Don't use port parent for getting mux handles

2018-08-31 Thread Heikki Krogerus
It is not possible to use the parent of the port device when requesting mux handles as the parent may be a multiport USB Type-C or PD controller. The muxes must be assigned to the ports, not the controllers. This will also move the requesting of the muxes after the port device is initialized.

[PATCH 4/8] usb: xhci: pci: Only create Intel mux device when it's needed

2018-08-31 Thread Heikki Krogerus
Only create thre Intel role mux device if the platform has USB peripheral controller PCI device. While here, enable the role mux on Apollo Lake platforms. Signed-off-by: Heikki Krogerus Cc: Mathias Nyman --- drivers/usb/host/xhci-pci.c | 20 +--- 1 file changed, 17

[PATCH 6/8] plarform: x86: intel_cht_int33fe: Add connections for the USB Type-C port

2018-08-31 Thread Heikki Krogerus
Assigning the mux to the USB Type-C port on top of fusb302. That will prepare this driver for the change in the USB Type-C class code, where the class driver will assume the muxes to be always assigned to the ports and not the controllers. Once the USB Type-C class driver has been updated, the

[PATCH 5/8] plarform: x86: intel_cht_int33fe: Fix the identifier for the mux connection

2018-08-31 Thread Heikki Krogerus
PI3USB30532 is used for muxing the port to DisplayPort on CHT platforms, so changing the connection ID so that the mux will get assigned to the alternate mode device and not the port device. Connection ID "typec-mux" is now reserved for Accessory Modes. Signed-off-by: Heikki Krogerus ---

[PATCH 1/8] drivers: base: Helpers for adding device connection descriptions

2018-08-31 Thread Heikki Krogerus
Introducing helpers for adding and removing multiple device connection descriptions at once. Signed-off-by: Heikki Krogerus --- include/linux/device.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index

[PATCH 8/8] plarform: x86: intel_cht_int33fe: Remove the old connections for the muxes

2018-08-31 Thread Heikki Krogerus
USB Type-C class driver now expects the muxes to be always assigned to the ports and not controllers, so the connections for the mux and fusb302 can be removed. Signed-off-by: Heikki Krogerus --- drivers/platform/x86/intel_cht_int33fe.c | 19 ++- 1 file changed, 6 insertions(+),

[PATCH 3/8] plarform: x86: intel_cht_int33fe: Use the USB role switch conditionally

2018-08-31 Thread Heikki Krogerus
Only adding connection between the USB role switch and FUSB302 when the board has USB Device Controller (UDC). Several CHT based products do not enable the UDC PCI device by default. Signed-off-by: Heikki Krogerus --- drivers/platform/x86/intel_cht_int33fe.c | 14 +++--- 1 file changed,

[PATCH 2/8] plarform: x86: intel_cht_int33fe: Register all connections at once

2018-08-31 Thread Heikki Krogerus
We can register all device connection descriptors with a single call to device_connections_add(). Signed-off-by: Heikki Krogerus --- drivers/platform/x86/intel_cht_int33fe.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git

[PATCH 0/8] usb: typec: A few more improvements for Intel CHT

2018-08-31 Thread Heikki Krogerus
Hi, The second last patch in this series will make it possible to use multiport USB Type-C and PD controllers with the muxes. The CHT connections are simply adapted to that. The rest of the series will mainly allow us to use the USB Type-C on CHT boards even without a USB device controller.

Re: A few questions about gadgetfs

2018-08-31 Thread Alan Stern
On Fri, 31 Aug 2018, Andrey Konovalov wrote: > On Thu, Aug 30, 2018 at 10:50 PM, Alan Stern > wrote: > > On Thu, 30 Aug 2018, Andrey Konovalov wrote: > > > >> Hi Alan, > >> > >> I have a few questions about gadgetfs. > >> > >> According to documentation usb_gadget_driver->setup "queues a

[PATCH 0/2] xhci fixes for usb-linus

2018-08-31 Thread Mathias Nyman
Hi Greg A couple of xhci fixes, one finding all quirks for platform xhci devices, and another fixing use-after-free case if stale URBs are cancelled on already re-allocated endpoints. -Mathias Anurag Kumar Vulisha (1): usb: host: xhci-plat: Iterate over parent nodes for finding quirks

[PATCH 2/2] xhci: Fix use after free for URB cancellation on a reallocated endpoint

2018-08-31 Thread Mathias Nyman
Make sure the cancelled URB is on the current endpoint ring. If the endpoint ring has been reallocated since the URB was enqueued then the URB may contain TD and TRB pointers to a already freed ring. In this the case return the URB without touching any of the freed ring structure data. Don't try

[PATCH 1/2] usb: host: xhci-plat: Iterate over parent nodes for finding quirks

2018-08-31 Thread Mathias Nyman
From: Anurag Kumar Vulisha In xhci_plat_probe() both sysdev and pdev->dev are being used for finding quirks. There are some drivers(like dwc3 host.c) which adds quirks(like usb3-lpm-capable) into pdev and the logic present in xhci_plat_probe() checks for quirks in either sysdev or pdev for

Re: [PATCH] usb: Avoid use-after-free by flushing endpoints early in usb_set_interface()

2018-08-31 Thread Alan Stern
On Fri, 31 Aug 2018, Mathias Nyman wrote: > The steps taken by usb core to set a new interface is very different from > what is done on the xHC host side. > > xHC hardware will do everything in one go. One command is used to set up > new endpoints, free old endpoints, check bandwidth, and run