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 c

[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 fr

[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

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 co

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 enumerate/interac

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 c

[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 v

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 ge

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 a

Re: [PATCH v1 0/2] Add Embedded USB Debugger (EUD) driver

2018-08-31 Thread Trilok Soni
On 8/16/2018 5:05 PM, Prakruthi Deepak Heragu wrote: This is a series of patches that implements a driver for the control peripheral, EUD (Embedded USB Debugger). The EUD is a mini-USB hub implemented on chip to support the USB-based debug and trace capabilities. Apart from debug capabilities, EU

Re: linux-next: Tree for Aug 31 (drivers/usb/gadget/udc/renesas_usb3)

2018-08-31 Thread Randy Dunlap
On 08/30/2018 08:03 PM, Stephen Rothwell wrote: > Hi all, > > Changes since 20180830: > on i386: drivers/usb/gadget/udc/renesas_usb3.o: In function `renesas_usb3_probe': renesas_usb3.c:(.text+0x16da): undefined reference to `usb_of_get_companion_dev' Full randconfig file is attached. -- ~Ra

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 the

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 respons

[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 findin

[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 Mathias

[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 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 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. Sig

[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 insertions(+

[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 con

[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 --- drivers

[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 8f882549edee.

[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 a/drivers/platform/x86/intel_cht_int33fe

[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. Heik

[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 cor

Re: [PATCH 5/6] dt-bindings: usb: renesas_usbhs: Add r8a774a1 support

2018-08-31 Thread Rob Herring
On Fri, 24 Aug 2018 08:56:14 +0100, Fabrizio Castro wrote: > Document RZ/G2M (R8A774A1) SoC bindings. > > Signed-off-by: Fabrizio Castro > Reviewed-by: Biju Das > --- > Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Reviewed

Re: [PATCH 6/6] usb: gadget: udc: renesas_usb3: Add r8a774a1 support

2018-08-31 Thread Rob Herring
On Fri, 24 Aug 2018 08:56:15 +0100, Fabrizio Castro wrote: > Document RZ/G2M (R8A774A1) SoC bindings. > > Signed-off-by: Fabrizio Castro > Reviewed-by: Biju Das > --- > Documentation/devicetree/bindings/usb/renesas_usb3.txt | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Review

Re: [PATCH 3/6] dt-bindings: usb-xhci: Add r8a774a1 support

2018-08-31 Thread Rob Herring
On Fri, 24 Aug 2018 08:56:12 +0100, Fabrizio Castro wrote: > Document RZ/G2M (R8A774A1) SoC bindings. > > Signed-off-by: Fabrizio Castro > Reviewed-by: Biju Das > --- > Documentation/devicetree/bindings/usb/usb-xhci.txt | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Reviewed-by:

Re: [PATCH 2/3] dt-bindings: usb: fusb302: Use usb-connector bindings for configuration

2018-08-31 Thread Rob Herring
On Tue, 21 Aug 2018 13:28:22 +0100, Adam Thomson wrote: > There are now generic usb-connector bindings which can be used > to define a port controllers configuration for USB-PD, so device > specific bindings are no longer necessary. > > This update deprecates 'fcs,operating-sink-microwatt', and re

Re: [PATCH 1/3] dt-bindings: connector: Add support for USB-PD PPS APDOs to bindings

2018-08-31 Thread Rob Herring
On Tue, 21 Aug 2018 13:28:21 +0100, Adam Thomson wrote: > Add support for PPS APDOs to connector bindings so a port controller > can specify support for PPS, as per existing FIXED/BATT/VAR PDOs. > > Signed-off-by: Adam Thomson > --- > .../bindings/connector/usb-connector.txt | 8 +++--

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 understand

[PATCH v2 3/3] usb: renesas_usbhs: Add multiple clocks management

2018-08-31 Thread Yoshihiro Shimoda
R-Car Gen3 needs to enable clocks of both host and peripheral. Since [eo]hci-platform disables the reset(s) when the drivers are removed, renesas_usbhs driver doesn't work correctly. To fix this issue, this patch adds multiple clocks management on this renesas_usbhs driver. Signed-off-by: Yoshihir

[PATCH v2 2/3] dt-bindings: usb: renesas_usbhs: add clock-names property

2018-08-31 Thread Yoshihiro Shimoda
R-Car Gen3 needs to enable clocks of both host and peripheral. Otherwise, other side device cannot work correctly. So, this patch adds a property of clock-names for R-Car Gen3 as an optional. Signed-off-by: Yoshihiro Shimoda --- Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++ 1 f

[PATCH v2 1/3] usb: renesas_usbhs: Add reset_control

2018-08-31 Thread Yoshihiro Shimoda
R-Car Gen3 needs to deassert resets of both host and peripheral. Since [eo]hci-platform is possible to assert the reset(s) when the probing failed, renesas_usbhs driver doesn't work correctly regardless of finished probing. To fix this issue, this patch adds reset_control on this renesas_usbhs driv

[PATCH v2 0/3] usb: renesas_usbhs: add reset_control and multiple clocks management

2018-08-31 Thread Yoshihiro Shimoda
This patch set is based on Felipe's usb.git / testing/next branch (the commit id is 5b394b2ddf0347bef56e50c69a58773c94343ff3) with the following patch: https://patchwork.kernel.org/patch/10574875/ Changes from v1: - Fix error path on patch 3/3. - Use clk_bulk_disable_unprepare() instead of two

Re: [PATCH V2 3/4] serial: f81232: implement break control

2018-08-31 Thread Johan Hovold
On Thu, Aug 30, 2018 at 09:55:46AM +0800, Ji-Ze Hong (Peter Hong) wrote: > Hi Johan, > > This article is duplication with > [PATCH V2 3/4] USB: serial: f81232: implement break control > [PATCH V2 3/4] serial: f81232: implement break control > (Title not start with USB token) > > Should I di

Re: [PATCH] usb: core: phy: clean up return value check about devm_of_phy_get_by_index()

2018-08-31 Thread Chunfeng Yun
hi, Sorry, please ignore the patch, forgot version number On Fri, 2018-08-31 at 17:55 +0800, Chunfeng Yun wrote: > Use IS_ERR() instead of IS_ERR_OR_NULL() because devm_of_phy_get_by_index() > never return NULL value; > But still need ignore the error of -ENODEV, for more information, please > ref

Re: [PATCH v3] usb: core: phy: fix return value checking about devm_of_phy_get_by_index()

2018-08-31 Thread Chunfeng Yun
On Fri, 2018-08-31 at 11:41 +0200, Johan Hovold wrote: > On Thu, Aug 30, 2018 at 09:16:40AM +0800, Chunfeng Yun wrote: > > Use IS_ERR() instead of IS_ERR_OR_NULL() because devm_of_phy_get_by_index() > > never return NULL value; > > But still need ignore the error of -ENODEV, for more information, p

[PATCH v5] usb: core: phy: clean up return value check about devm_of_phy_get_by_index()

2018-08-31 Thread Chunfeng Yun
Use IS_ERR() instead of IS_ERR_OR_NULL() because devm_of_phy_get_by_index() never return NULL value; But still need ignore the error of -ENODEV, for more information, please refer to: [0] https://lkml.org/lkml/2018/4/19/88 [1] https://patchwork.kernel.org/patch/10160181/ Signed-off-by: Chunfeng Yu

[PATCH] usb: core: phy: clean up return value check about devm_of_phy_get_by_index()

2018-08-31 Thread Chunfeng Yun
Use IS_ERR() instead of IS_ERR_OR_NULL() because devm_of_phy_get_by_index() never return NULL value; But still need ignore the error of -ENODEV, for more information, please refer to: [0] https://lkml.org/lkml/2018/4/19/88 [1] https://patchwork.kernel.org/patch/10160181/ Signed-off-by: Chunfeng Yu

Re: [PATCH v3] usb: core: phy: fix return value checking about devm_of_phy_get_by_index()

2018-08-31 Thread Johan Hovold
On Thu, Aug 30, 2018 at 09:16:40AM +0800, Chunfeng Yun wrote: > Use IS_ERR() instead of IS_ERR_OR_NULL() because devm_of_phy_get_by_index() > never return NULL value; > But still need ignore the error of -ENODEV, for more information, please > refer to: > [0] https://lkml.org/lkml/2018/4/19/88 > [1

RE: [PATCH 3/3] usb: renesas_usbhs: Add multiple clocks management

2018-08-31 Thread Yoshihiro Shimoda
Hi Geert-san, > From: Geert Uytterhoeven, Sent: Friday, August 31, 2018 4:22 PM > > Hi Shimoda-san, > > On Fri, Aug 31, 2018 at 8:50 AM Yoshihiro Shimoda > wrote: > > R-Car Gen3 needs to enable clocks of both host and peripheral. > > Since [eo]hci-platform disables the reset(s) when the drivers

Re: [PATCH 3/3] usb: renesas_usbhs: Add multiple clocks management

2018-08-31 Thread Geert Uytterhoeven
Hi Shimoda-san, On Fri, Aug 31, 2018 at 8:50 AM Yoshihiro Shimoda wrote: > R-Car Gen3 needs to enable clocks of both host and peripheral. > Since [eo]hci-platform disables the reset(s) when the drivers are > removed, renesas_usbhs driver doesn't work correctly. To fix this > issue, this patch add