Re: [PATCH] usb: uhci: Add clk support to uhci-platform

2018-01-11 Thread Sergei Shtylyov
Hello! On 1/12/2018 8:51 AM, Benjamin Herrenschmidt wrote: The Aspeed SoCs use uhci-platform. With the new dynamic clock control framework, the corresponding IP block clock must be properly enabled. This is a simplified variant of what ehci-platform does, it looks for *one* clock attached to

[PATCH v3 2/3] usb/gadget: Add an EP dispose() callback for EP lifetime tracking

2018-01-11 Thread Benjamin Herrenschmidt
Some UDC may want to allocate endpoints dynamically, either because the HW supports an arbitrary large number or because (like the Aspeed BMC SoCs), the pool of HW endpoints is shared between multiple gadgets. The allocation side can be done rather easily using the existing match_ep() UDC hook.

[PATCH v3 3/3] usb/gadget: Add driver for Aspeed SoC virtual hub

2018-01-11 Thread Benjamin Herrenschmidt
The Aspeed BMC SoCs support a "virtual hub" function. It provides some HW support for a top-level USB2 hub behind which sit 5 gadget "ports". This driver adds support for the full functionality, emulating the hub standard requests and exposing 5 UDC gadget drivers corresponding to the ports. The

[PATCH v3 1/3] usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

2018-01-11 Thread Benjamin Herrenschmidt
The current code tries to test for bits that are masked out by usb_endpoint_maxp(). Instead, use the proper accessor to access the new high bandwidth bits. Signed-off-by: Benjamin Herrenschmidt --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH v4 10/16] phy: qcom-qmp: Move register offsets to header file

2018-01-11 Thread Vivek Gautam
Hi Manu, On Wed, Jan 3, 2018 at 4:58 PM, Manu Gautam wrote: > New revision (v3) of QMP PHY uses different offsets > for almost all of the registers. Hence, move these > definitions to header file so that updated offsets > can be added for QMP v3. > > Signed-off-by: Manu

Re: [PATCH] phy: work around 'phys' references to usb-phy devices

2018-01-11 Thread Kishon Vijay Abraham I
Hi Arnd, On Thursday 11 January 2018 11:46 PM, Eric Anholt wrote: > Arnd Bergmann writes: > >> On Thu, Jan 11, 2018 at 2:30 PM, Kishon Vijay Abraham I >> wrote: >>> On Thursday 11 January 2018 02:27 AM, Arnd Bergmann wrote: On Mon, Jan 8, 2018 at 7:32 PM,

[PATCH v2] usb: uhci: Add clk support to uhci-platform

2018-01-11 Thread Benjamin Herrenschmidt
The Aspeed SoCs use uhci-platform. With the new dynamic clock control framework, the corresponding IP block clock must be properly enabled. This is a simplified variant of what ehci-platform does, it looks for *one* clock attached to the device, and if it's there, enables it. Signed-off-by:

[PATCH] usb: uhci: Add clk support to uhci-platform

2018-01-11 Thread Benjamin Herrenschmidt
The Aspeed SoCs use uhci-platform. With the new dynamic clock control framework, the corresponding IP block clock must be properly enabled. This is a simplified variant of what ehci-platform does, it looks for *one* clock attached to the device, and if it's there, enables it. Signed-off-by:

[PATCH] usb: dwc3: core: power on PHYs before initializing core

2018-01-11 Thread William Wu
The dwc3_core_init() gets the PHYs and initializes the PHYs with the usb_phy_init() and phy_init() functions before initializing core, and power on the PHYs after core initialization is done. However, some platforms (e.g. Rockchip RK3399 DWC3 with Type-C USB3 PHY), it needs to do some special

Re: [PATCH] usb: dwc2: Fix endless deferral probe

2018-01-11 Thread Arnd Bergmann
On Wed, Jan 10, 2018 at 1:15 PM, Stefan Wahren wrote: > Hi Arnd, > > > Am 09.01.2018 um 22:33 schrieb Arnd Bergmann: >> >> On Tue, Jan 9, 2018 at 8:28 PM, Stefan Wahren >> wrote: >>> >>> The dwc2 USB driver tries to find a generic PHY first and

Re: [PATCH v4 2/3] dt-bindings: usb: renesas_usbhs: Add support for RZ/A1

2018-01-11 Thread Rob Herring
On Mon, Jan 08, 2018 at 07:30:54AM -0500, Chris Brandt wrote: > Document support for RZ/A1 SoCs > > Signed-off-by: Chris Brandt > Reviewed-by: Geert Uytterhoeven > --- > v4: > * Re-added "renesas,usbhs-r7s72100" > v3: > * Removed

Re: [PATCH v2 2/2] usb: dwc3: ep0: Reset TRB counter for ep0 IN

2018-01-11 Thread Thinh Nguyen
Hi, On 1/11/2018 12:16 AM, Felipe Balbi wrote: > > Hi, > > Thinh Nguyen writes: >> In control read transfer completion handler, the driver needs to reset >> the TRB enqueue counter. Since there is one control endpoint structure >> for each direction, we must also

Re: [PATCH v2 1/2] usb: dwc3: gadget: Set maxpacket size for ep0 IN

2018-01-11 Thread Thinh Nguyen
Hi, On 1/11/2018 12:16 AM, Felipe Balbi wrote: > > Hi, > > Thinh Nguyen writes: >> There are 2 control endpoint structures for DWC3. However, the driver >> only updates the OUT direction control endpoint structure during >> ConnectDone event. DWC3 driver needs to

Re: How usb port_dev suspend

2018-01-11 Thread Alan Stern
Questions like these should always be CC'ed to the linux-usb mailing list. On Wed, 10 Jan 2018 liuhongweich...@yahoo.co.jp wrote: > Good Morning Mr. Stern > > i am a learner of linux kernel of usb. nowadays, i am running linux on a > zhaoxin xhci,� > which is the same as via xhci but

Re: [PATCH v2] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-11 Thread Rafael J. Wysocki
On Thu, Jan 11, 2018 at 1:32 PM, Ulf Hansson wrote: [cut] >>> >>> The point is, we can go for this solution, but is it good enough? >> >> I would like to treat it as a step away from what is there today, >> retaining some of the existing functionality. >> >> From a quick

Re: linux-next: Tree for Jan 11 (usb/mtu3/)

2018-01-11 Thread Randy Dunlap
On 01/10/18 22:18, Stephen Rothwell wrote: > Hi all, > > Changes since 20180110: > on i386 or x86_64: ../drivers/usb/mtu3/mtu3_plat.c: In function 'mtu3_suspend': ../drivers/usb/mtu3/mtu3_plat.c:462:2: error: implicit declaration of function 'ssusb_wakeup_set'

Re: [PATCH] phy: work around 'phys' references to usb-phy devices

2018-01-11 Thread Eric Anholt
Arnd Bergmann writes: > On Thu, Jan 11, 2018 at 2:30 PM, Kishon Vijay Abraham I wrote: >> On Thursday 11 January 2018 02:27 AM, Arnd Bergmann wrote: >>> On Mon, Jan 8, 2018 at 7:32 PM, Kishon Vijay Abraham I >>> wrote: On Monday 08 January

Re: [PATCH stable 3.18-4.9] xhci: Fix ring leak in failure path of xhci_alloc_virt_device()

2018-01-11 Thread Greg KH
On Thu, Jan 11, 2018 at 05:01:36PM +, Ben Hutchings wrote: > This is a stable-only fix for the backport of commit 5d9b70f7d52e > ("xhci: Don't add a virt_dev to the devs array before it's fully > allocated"). > > In branches that predate commit c5628a2af83a ("xhci: remove endpoint > ring

[PATCH stable 3.18-4.9] xhci: Fix ring leak in failure path of xhci_alloc_virt_device()

2018-01-11 Thread Ben Hutchings
This is a stable-only fix for the backport of commit 5d9b70f7d52e ("xhci: Don't add a virt_dev to the devs array before it's fully allocated"). In branches that predate commit c5628a2af83a ("xhci: remove endpoint ring cache") there is an additional failure path in xhci_alloc_virt_device() where

Re: [GIT PULL] USB-serial fixes for v4.15-rc8

2018-01-11 Thread Greg Kroah-Hartman
On Thu, Jan 11, 2018 at 04:28:37PM +0100, Johan Hovold wrote: > Hi Greg, > > Here are a couple of device ids for -rc8, unless you prefer holding them off > for 4.16. > > Johan > > > The following changes since commit 30a7acd573899fd8b8ac39236eff6468b195ac7d: > > Linux 4.15-rc6 (2017-12-31

[PATCH v2] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE()

2018-01-11 Thread Masakazu Mokuno
As USB_DT_USB_SSP_CAP_SIZE() takes SSAC value as an argument, the low bound of the size for struct usb_ssp_cap_descriptor should be described by USB_DT_USB_SSP_CAP_SIZE(0), not by USB_DT_USB_SSP_CAP_SIZE(1) The type-specific length check patch was added to stable and needs to be fixed as well.

Re: [PATCH] USB: core: Fix misuse of USB_DT_USB_SSP_CAP_SIZE()

2018-01-11 Thread Masakazu Mokuno
Hi, On Tue, 9 Jan 2018 16:06:41 +0100 Greg KH wrote: > On Wed, Dec 20, 2017 at 03:14:09AM +0900, Masakazu Mokuno wrote: > > As USB_DT_USB_SSP_CAP_SIZE() takes SSAC value as an argument, the low > > bound of the size for struct usb_ssp_cap_descriptor should be

[GIT PULL] USB-serial fixes for v4.15-rc8

2018-01-11 Thread Johan Hovold
Hi Greg, Here are a couple of device ids for -rc8, unless you prefer holding them off for 4.16. Johan The following changes since commit 30a7acd573899fd8b8ac39236eff6468b195ac7d: Linux 4.15-rc6 (2017-12-31 14:47:43 -0800) are available in the Git repository at:

Re: [PATCH] phy: work around 'phys' references to usb-phy devices

2018-01-11 Thread Arnd Bergmann
On Thu, Jan 11, 2018 at 2:30 PM, Kishon Vijay Abraham I wrote: > On Thursday 11 January 2018 02:27 AM, Arnd Bergmann wrote: >> On Mon, Jan 8, 2018 at 7:32 PM, Kishon Vijay Abraham I wrote: >>> On Monday 08 January 2018 06:31 PM, Arnd Bergmann wrote: Stefan

Re: [PATCH 14/15] usb: dwc3: Add disabling of start_transfer failure quirk

2018-01-11 Thread Rob Herring
On Tue, Jan 9, 2018 at 2:45 AM, Felipe Balbi wrote: > > Hi, > > Rob Herring writes: >> On Fri, Jan 05, 2018 at 12:16:02PM -0800, Thinh Nguyen wrote: >>> In DWC_usb31 version 1.70a-ea06 and prior needs a SW workaround for isoc >>> START TRANSFER command failure.

[PATCH] usb: misc: usb3503: make sure reset is low for at least 100us

2018-01-11 Thread Stefan Agner
When using a GPIO which is high by default, and initialize the driver in USB Hub mode, initialization fails with: [ 111.757794] usb3503 0-0008: SP_ILOCK failed (-5) The reason seems to be that the chip is not properly reset. Probe does initialize reset low, however some lines later the code

Re: [PATCH] phy: work around 'phys' references to usb-phy devices

2018-01-11 Thread Kishon Vijay Abraham I
Hi Arnd, On Thursday 11 January 2018 02:27 AM, Arnd Bergmann wrote: > On Mon, Jan 8, 2018 at 7:32 PM, Kishon Vijay Abraham I wrote: >> Hi Arnd, >> >> On Monday 08 January 2018 06:31 PM, Arnd Bergmann wrote: >>> Stefan Wahren reports a problem with a warning fix that was merged >>>

Re: [PATCH v2] PM / runtime: Rework pm_runtime_force_suspend/resume()

2018-01-11 Thread Ulf Hansson
[...] >>> Index: linux-pm/drivers/base/power/domain.c >>> === >>> --- linux-pm.orig/drivers/base/power/domain.c >>> +++ linux-pm/drivers/base/power/domain.c >>> @@ -1048,8 +1048,9 @@ static int genpd_finish_suspend(struct d >>>

[PATCH] usb: uas: unconditionally bring back host after reset

2018-01-11 Thread Oliver Neukum
Quoting Hans: If we return 1 from our post_reset handler, then our disconnect handler will be called immediately afterwards. Since pre_reset blocks all scsi requests our disconnect handler will then hang in the scsi_remove_host call. This is esp. bad because our disconnect handler hanging for

Re: [PATCH] usb: uas: unconditionally bring back host after reset

2018-01-11 Thread Oliver Neukum
Am Donnerstag, den 11.01.2018, 12:22 +0100 schrieb Greg KH: > On Thu, Jan 11, 2018 at 11:59:54AM +0100, Oliver Neukum wrote: > > > > Quoting Hans: > > > > If we return 1 from our post_reset handler, then our disconnect handler > > will be called immediately afterwards. Since pre_reset blocks all

Re: [PATCH 1/2] usb: xhci: Remove ep_trb from xhci_cleanup_halted_endpoint()

2018-01-11 Thread Mathias Nyman
On 10.01.2018 06:59, Lu Baolu wrote: Function argument ep_trb for xhci_cleanup_halted_endpoint() isn't needed anymore. Cleanup it. Signed-off-by: Lu Baolu --- Thanks, adding both to queue -Mathias -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] usb: uas: unconditionally bring back host after reset

2018-01-11 Thread Greg KH
On Thu, Jan 11, 2018 at 11:59:54AM +0100, Oliver Neukum wrote: > Quoting Hans: > > If we return 1 from our post_reset handler, then our disconnect handler > will be called immediately afterwards. Since pre_reset blocks all scsi > requests our disconnect handler will then hang in the

[PATCH] usb: uas: unconditionally bring back host after reset

2018-01-11 Thread Oliver Neukum
Quoting Hans: If we return 1 from our post_reset handler, then our disconnect handler will be called immediately afterwards. Since pre_reset blocks all scsi requests our disconnect handler will then hang in the scsi_remove_host call. This is esp. bad because our disconnect handler hanging for

[PATCH v2] usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume

2018-01-11 Thread Roger Quadros
In order for ULPI PHYs to work, dwc3_phy_setup() and dwc3_ulpi_init() must be doene before dwc3_core_get_phy(). commit 541768b08a40 ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys") broke this. The other issue is that dwc3_core_get_phy() and dwc3_ulpi_init() should be

Re: [PATCH 1/2] usb: misc: xapea00x: add driver for Xaptum ENF Access Card

2018-01-11 Thread Oliver Neukum
Am Mittwoch, den 10.01.2018, 10:58 -0600 schrieb David R. Bild : > This commit adds a driver for the Xaptum ENF Access Card, a TPM2.0 > hardware module for authenticating IoT devices and gateways. > > The card consists of a SPI TPM 2.0 chip and a USB-SPI bridge. This > driver configures the

Re: [PATCH V3 2/6] usb: serial: f81534: add auto RTS direction support

2018-01-11 Thread Johan Hovold
On Thu, Jan 11, 2018 at 02:47:16PM +0800, Ji-Ze Hong (Peter Hong) wrote: > The F81532/534 had auto RTS direction support for RS485 mode. > We'll read it from internal Flash with address 0x2f01~0x2f04 for 4 ports. > There are 4 conditions below: > 0: F81534_PORT_CONF_RS232. > 1:

Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume

2018-01-11 Thread Roger Quadros
On 11/01/18 11:31, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: >>> Roger Quadros writes: >>> - ret = dwc3_core_soft_reset(dwc); >>> + ret = dwc3_core_get_phy(dwc); >> >> we can get_phy in dwc3_core_init() as it will get called

Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume

2018-01-11 Thread Felipe Balbi
Hi, Roger Quadros writes: >> Roger Quadros writes: >> -ret = dwc3_core_soft_reset(dwc); >> +ret = dwc3_core_get_phy(dwc); > > we can get_phy in dwc3_core_init() as it will get called on resume(). > This was the $subject of this

Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume

2018-01-11 Thread Roger Quadros
On 11/01/18 11:09, Roger Quadros wrote: > +Heikki > > On 11/01/18 10:25, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: >> -ret = dwc3_core_soft_reset(dwc); >> +ret = dwc3_core_get_phy(dwc); > > we can get_phy in dwc3_core_init() as it

Re: [RESEND PATCH 1/3] usb: dwc3: Don't reinitialize core during host bus-suspend/resume

2018-01-11 Thread Felipe Balbi
Hi, Roger Quadros writes: >>> In host mode runtime suspend/resume could happen very often with >>> device connected, and resetting h/w on every runtime_resume might not >>> be desired. And PHYs drivers can also support runtime_suspend which >>> would be preferred instead of

Re: [RESEND PATCH 1/3] usb: dwc3: Don't reinitialize core during host bus-suspend/resume

2018-01-11 Thread Roger Quadros
Felipe, On 11/01/18 11:04, Felipe Balbi wrote: > > Hi, > > Manu Gautam writes: > On 27/09/17 14:19, Manu Gautam wrote: >> Driver powers-off PHYs and reinitializes DWC3 core and gadget on >> resume. While this works fine for gadget mode but in host >>

Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume

2018-01-11 Thread Roger Quadros
+Heikki On 11/01/18 10:25, Felipe Balbi wrote: > > Hi, > > Roger Quadros writes: > - ret = dwc3_core_soft_reset(dwc); > + ret = dwc3_core_get_phy(dwc); we can get_phy in dwc3_core_init() as it will get called on resume(). This was the $subject of this

Re: [RESEND PATCH 1/3] usb: dwc3: Don't reinitialize core during host bus-suspend/resume

2018-01-11 Thread Felipe Balbi
Hi, Manu Gautam writes: On 27/09/17 14:19, Manu Gautam wrote: > Driver powers-off PHYs and reinitializes DWC3 core and gadget on > resume. While this works fine for gadget mode but in host > mode there is not re-initialization of host stack. Also,

[PATCH/RFC] usb: host: xhci-plat and rcar: reinitialize the xhci when the mode changes

2018-01-11 Thread Yoshihiro Shimoda
This patch adds extcon notifier to reinitialize the xhci when the mode of R-Car USB 3.0 controller changes from peripheral to host. Otherwise, the host controller cannot detect Super Speed after changed the mode because the PORTSC.PLS for usb3.0 will be set to Disabled. TODO in this RFC version:

Re: [RESEND PATCH 1/3] usb: dwc3: Don't reinitialize core during host bus-suspend/resume

2018-01-11 Thread Manu Gautam
Hi Felipe, On 1/11/2018 1:44 PM, Felipe Balbi wrote: > Hi, > > Manu Gautam writes: >>> On 27/09/17 14:19, Manu Gautam wrote: Driver powers-off PHYs and reinitializes DWC3 core and gadget on resume. While this works fine for gadget mode but in host mode

Re: [PATCH 10/15] usb: dwc3: gadget: Set maxpacket size for ep0 IN

2018-01-11 Thread Felipe Balbi
Hi, Thinh Nguyen writes: > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index bdf2a2014ebd..6ae924d95cbc 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -2751,6 +2751,8 @@ static void

Re: [PATCH] usb: dwc3: core: Don't try to get PHYs during suspend/resume

2018-01-11 Thread Felipe Balbi
Hi, Roger Quadros writes: - ret = dwc3_core_soft_reset(dwc); + ret = dwc3_core_get_phy(dwc); >>> >>> we can get_phy in dwc3_core_init() as it will get called on resume(). >>> This was the $subject of this patch. >> >> indeed. thanks :-) >> > > oops sorry. I meant we

Re: [PATCH v2 1/2] usb: dwc3: gadget: Set maxpacket size for ep0 IN

2018-01-11 Thread Felipe Balbi
Hi, Thinh Nguyen writes: > There are 2 control endpoint structures for DWC3. However, the driver > only updates the OUT direction control endpoint structure during > ConnectDone event. DWC3 driver needs to update the endpoint max packet > size for control IN endpoint

Re: [PATCH v2 2/2] usb: dwc3: ep0: Reset TRB counter for ep0 IN

2018-01-11 Thread Felipe Balbi
Hi, Thinh Nguyen writes: > In control read transfer completion handler, the driver needs to reset > the TRB enqueue counter. Since there is one control endpoint structure > for each direction, we must also track the TRB enqueue counter for each > direction. Currently

Re: [RESEND PATCH 1/3] usb: dwc3: Don't reinitialize core during host bus-suspend/resume

2018-01-11 Thread Felipe Balbi
Hi, Manu Gautam writes: >> On 27/09/17 14:19, Manu Gautam wrote: >>> Driver powers-off PHYs and reinitializes DWC3 core and gadget on >>> resume. While this works fine for gadget mode but in host >>> mode there is not re-initialization of host stack. Also, resetting >>>