Re: [PATCH v2 1/3] usb: roles: intel_xhci: Always allow user control

2018-05-23 Thread Heikki Krogerus
On Wed, May 23, 2018 at 07:10:58PM +0300, Sergei Shtylyov wrote: > On 05/23/2018 05:37 PM, Heikki Krogerus wrote: > > > Trying to determine the USB port type with this mux is very > > difficult. To simplify the situation, always allowing user > >s/allowing/allow/? Else the statement doesn't p

Re: [PATCH v2 1/3] usb: roles: intel_xhci: Always allow user control

2018-05-23 Thread Heikki Krogerus
On Wed, May 23, 2018 at 08:03:43PM +0200, Hans de Goede wrote: > Hi, > > On 23-05-18 16:37, Heikki Krogerus wrote: > > Trying to determine the USB port type with this mux is very > > difficult. To simplify the situation, always allowing user > > control, even if the port is USB Type-C port. > > >

Documentation On Gadget Drivers (g_ffs)

2018-05-23 Thread R0b0t1
All that is in tree is ./Documentation/usb/functionfs.txt which I can not get the information I need from. I happened to find https://events.static.linuxfound.org/sites/events/files/slides/LinuxConNA-Make-your-own-USB-gadget-Andrzej.Pietrasiewicz.pdf, but the commands within did not work and I do n

Re: [PATCH] usb: hub: Per-port setting to use old enumeration scheme

2018-05-23 Thread Nicolas Boichat
On Thu, May 24, 2018 at 12:39 AM, Greg Kroah-Hartman wrote: > On Wed, May 23, 2018 at 10:03:55AM -0400, Alan Stern wrote: >> On Wed, 23 May 2018, Nicolas Boichat wrote: >> >> > The "old" enumeration scheme is considerably faster (it takes >> > ~294ms instead of ~439ms to get the descriptor). >> >

Re: usb HC busted?

2018-05-23 Thread Sudip Mukherjee
Hi Mathias, On Fri, May 18, 2018 at 04:19:02PM +0300, Mathias Nyman wrote: > On 18.05.2018 16:04, Sudip Mukherjee wrote: > > Hi Mathias, > > > > On Fri, May 18, 2018 at 03:55:04PM +0300, Mathias Nyman wrote: > > > Hi, > > > > > > Looks like event for Transfer block (TRB) at 0x32a21060 was never

Re: [PATCH v3] usbip: dynamically allocate idev by nports found in sysfs

2018-05-23 Thread Michael Grzeschik
On Wed, May 23, 2018 at 10:44:57AM -0600, Shuah Khan wrote: > On 05/23/2018 03:22 AM, Michael Grzeschik wrote: > > As the amount of available ports varies by the kernels build > > configuration. To remove the limitation of the fixed 128 ports > > we allocate the amount of idevs by using the number

[PATCH] usb: gadget: f_uvc: Expose configuration name through video node

2018-05-23 Thread Kieran Bingham
From: Kieran Bingham When utilising multiple instantiations of a UVC gadget on a composite device, there is no clear method to link a particular configuration to its respective video node. Provide a means for identifying the correct video node by exposing the name of the function configuration t

Re: [PATCH v2 1/3] usb: roles: intel_xhci: Always allow user control

2018-05-23 Thread Hans de Goede
Hi, On 23-05-18 16:37, Heikki Krogerus wrote: Trying to determine the USB port type with this mux is very difficult. To simplify the situation, always allowing user control, even if the port is USB Type-C port. Signed-off-by: Heikki Krogerus --- .../usb/roles/intel-xhci-usb-role-switch.c

[PATCH v3 3/3] Revert "xhci: Reset Renesas uPD72020x USB controller for 32-bit DMA issue"

2018-05-23 Thread Marc Zyngier
This reverts commit 8466489ef5ba48272ba4fa4ea9f8f403306de4c7. Now that we can properly reset the uPD72020x without a hard PCI reset, let's get rid of the existing quirks. Tested-by: Domenico Andreoli Signed-off-by: Marc Zyngier --- drivers/usb/host/pci-quirks.c | 20 drive

[PATCH v3 2/3] xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers

2018-05-23 Thread Marc Zyngier
Some Renesas controllers get into a weird state if they are reset while programmed with 64bit addresses (they will preserve the top half of the address in internal, non visible registers). You end up with half the address coming from the kernel, and the other half coming from the firmware. Also,

[PATCH v3 1/3] xhci: Allow more than 32 quirks

2018-05-23 Thread Marc Zyngier
We now have 32 different quirks, and the field that holds them is full. Let's bump it up to the next stage so that we can handle some more... The type is now an unsigned long long, which is 64bit on most architectures. We take this opportunity to change the quirks from using (1 << x) to BIT_ULL(x)

[PATCH v3 0/3] Revised Renesas uPD72020x workaround for 32bit DMA issue

2018-05-23 Thread Marc Zyngier
Back around the 4.13 timeframe, we tried to address a rather bad issue with the Renesas uPD72020x USB3 controller family. They have trouble with the programming of the base addresses which tend to stick on XHCI reset. This makes transitionning from 64bit to 32bit addresses completely unsafe. This w

Re: [PATCH v2 2/3] xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers

2018-05-23 Thread Marc Zyngier
On 21/05/18 09:23, Mathias Nyman wrote: > On 18.05.2018 19:29, Marc Zyngier wrote: >> Some Renesas controllers get into a weird state if they are reset while >> programmed with 64bit addresses (they will preserve the top half of the >> address in internal, non visible registers). >> >> You end up w

Re: [PATCH v3] usbip: dynamically allocate idev by nports found in sysfs

2018-05-23 Thread Shuah Khan
On 05/23/2018 03:22 AM, Michael Grzeschik wrote: > As the amount of available ports varies by the kernels build > configuration. To remove the limitation of the fixed 128 ports > we allocate the amount of idevs by using the number we get > from the kernel. > > Signed-off-by: Michael Grzeschik > -

Re: [PATCH] usb: hub: Per-port setting to use old enumeration scheme

2018-05-23 Thread Greg Kroah-Hartman
On Wed, May 23, 2018 at 10:03:55AM -0400, Alan Stern wrote: > On Wed, 23 May 2018, Nicolas Boichat wrote: > > > The "old" enumeration scheme is considerably faster (it takes > > ~294ms instead of ~439ms to get the descriptor). > > > > It is currently only possible to use the old scheme globally >

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-23 Thread Greg KH
On Wed, May 23, 2018 at 02:08:27PM +0200, Oliver Neukum wrote: > Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: > > +static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *file_data, > > +   unsigned int __user *arg) > > +{ > > +   struct

Re: [PATCH v2 1/3] usb: roles: intel_xhci: Always allow user control

2018-05-23 Thread Sergei Shtylyov
On 05/23/2018 05:37 PM, Heikki Krogerus wrote: > Trying to determine the USB port type with this mux is very > difficult. To simplify the situation, always allowing user s/allowing/allow/? Else the statement doesn't parse for me. :-) > control, even if the port is USB Type-C port. > > Signed

Re: [PATCH v2 3/3] usb: typec: fusb302: Fix debugfs issue

2018-05-23 Thread Sergei Shtylyov
Hello! On 05/23/2018 05:37 PM, Heikki Krogerus wrote: > Removing the "fusb302" debugfs directory when unloading > the driver. That allows the driver to be loaded more then > ones. The directory will not get actually removed until it s/ones/once/? > is empty, so only after the last instance h

[PATCH] usb: gadget: uvc: configfs: Move function to avoid forward declaration

2018-05-23 Thread Laurent Pinchart
The to_f_uvc_opts() function is forward-declared without needing to, as its definition can simply be moved up in the file. Fix it. Signed-off-by: Laurent Pinchart --- drivers/usb/gadget/function/uvc_configfs.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drive

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

2018-05-23 Thread Rob Herring
On Wed, May 23, 2018 at 1:52 AM, Yoshihiro Shimoda wrote: > Hi Rob, > > Thank you for the review! > >> From: Rob Herring, Sent: Wednesday, May 23, 2018 2:13 AM >> >> On Tue, May 22, 2018 at 09:01:07PM +0900, Yoshihiro Shimoda wrote: >> > This patch adds role switch support for R-Car SoCs into the

[PATCH v2 0/3] [PATCH 0/4] usb: typec: fixes for Cherry Trails

2018-05-23 Thread Heikki Krogerus
Hi, This is second version of the remaining patches that fix various problems I encountered while testing my USB Type-C Alternate Mode patches with GPD Win board (Intel Cherry Trail based). In this version I've addressed the problems pointed out by Hans and Guenter. Link to the original version:

[PATCH v2 1/3] usb: roles: intel_xhci: Always allow user control

2018-05-23 Thread Heikki Krogerus
Trying to determine the USB port type with this mux is very difficult. To simplify the situation, always allowing user control, even if the port is USB Type-C port. Signed-off-by: Heikki Krogerus --- .../usb/roles/intel-xhci-usb-role-switch.c| 21 +-- 1 file changed, 1 insert

[PATCH v2 2/3] platform: x86: intel_cht_int33fe: Fix dependencies

2018-05-23 Thread Heikki Krogerus
The driver will not probe unless bq24190 is loaded, so making it a dependency. Signed-off-by: Heikki Krogerus Cc: Wolfram Sang Cc: Darren Hart Cc: Andy Shevchenko --- drivers/i2c/busses/Kconfig | 3 +-- drivers/platform/x86/Kconfig | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)

[PATCH v2 3/3] usb: typec: fusb302: Fix debugfs issue

2018-05-23 Thread Heikki Krogerus
Removing the "fusb302" debugfs directory when unloading the driver. That allows the driver to be loaded more then ones. The directory will not get actually removed until it is empty, so only after the last instance has been removed. This fixes an issue where the driver can't be re-loaded if it has

Re: [PATCH] usb: hub: Per-port setting to use old enumeration scheme

2018-05-23 Thread Alan Stern
On Wed, 23 May 2018, Nicolas Boichat wrote: > The "old" enumeration scheme is considerably faster (it takes > ~294ms instead of ~439ms to get the descriptor). > > It is currently only possible to use the old scheme globally > (/sys/module/usbcore/parameters/old_scheme_first), which is not > desir

Re: [Query] checking hub port status while USB 2.0 port is resuming.

2018-05-23 Thread Alan Stern
On Wed, 23 May 2018, Anshuman Gupta wrote: > On Tue, May 22, 2018 at 11:54:19AM -0400, Alan Stern wrote: > > On Tue, 22 May 2018, Anshuman Gupta wrote: > > > > > On Tue, May 22, 2018 at 09:53:09AM -0400, Alan Stern wrote: > > > > On Tue, 22 May 2018, Anshuman Gupta wrote: > > > > > > > Thanks Ala

Re: dwc2: Regression on 96Boards Hikey due to enabling power down

2018-05-23 Thread Artur Petrosyan
Hi Mani, Could you please test the patch ([PATCH] usb: dwc2: Fix host exit from hibernation flow.) which should fix issue seen on your setup and provide feedback. Meantime we will debug issue reported by John Stultz, which is another case/scenario. Regards, Artur On 5/22/2018 22:45, Manivann

[PATCH] usb: dwc2: Fix host exit from hibernation flow.

2018-05-23 Thread Artur Petrosyan
In case when a hub is connected to DWC2 host auto suspend occurs and host goes to hibernation. When any device connected to hub host hibernation exiting incorrectly. - Added dwc2_hcd_rem_wakeup() function call to exit from suspend state by remote wakeup. - Increase timeout value for port suspen

[PATCH] dwc2: gadget: Fix ISOC IN DDMA PID bitfield value calculation

2018-05-23 Thread Minas Harutyunyan
PID bitfield in descriptor should be set based on particular request length, not based on EP's mc value. PID value can't be set to 0 even request length is 0. Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH 09/12] usb: usbtmc: Fix ioctl USBTMC_IOCTL_CLEAR

2018-05-23 Thread Oliver Neukum
Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: > Insert a sleep of 50 ms between subsequent CHECK_CLEAR_STATUS > control requests to avoid stressing the instrument with repeated > requests. > > Some instruments need time to cleanup internal I/O buffers. > Polling and repeated req

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-23 Thread Oliver Neukum
Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: > +static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *file_data, > +   unsigned int __user *arg) > +{ > +   struct usbtmc_device_data *data = file_data->data; > +   struct device *dev

Re: [PATCH 04/12] usb: usbtmc: Add ioctls for trigger, EOM bit and TermChar

2018-05-23 Thread Oliver Neukum
Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: > +   retval = usb_bulk_msg(data->usb_dev, > + usb_sndbulkpipe(data->usb_dev, > + data->bulk_out), > + buffer, USBTMC_HEADER_SIZE,

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-23 Thread Oliver Neukum
Am Montag, den 21.05.2018, 21:00 + schrieb guido@kiener- muenchen.de: > > I looked for a race here, but I do not find a race between open and release, > since a refcount of "file_data->data->kref" is always hold by > usbtmc_probe/disconnect. > > However I see a race between usbtmc_open and us

Re: Threaded interrupts for USB HCD instead of tasklets

2018-05-23 Thread Sebastian Andrzej Siewior
On 2018-05-22 15:14:17 [-0400], Alan Stern wrote: > On Tue, 22 May 2018, Sebastian Andrzej Siewior wrote: > > > On 2018-05-07 11:37:29 [-0400], Alan Stern wrote: > > > > As far as I understand it there should be no deadlock. Without the > > > > local_irq_save() things should not deadlock because t

[PATCH v3] usbip: dynamically allocate idev by nports found in sysfs

2018-05-23 Thread Michael Grzeschik
As the amount of available ports varies by the kernels build configuration. To remove the limitation of the fixed 128 ports we allocate the amount of idevs by using the number we get from the kernel. Signed-off-by: Michael Grzeschik --- v1 -> v2: - reworked memory allocation into one calloc call

[next, PATCH 4/6] usb: mtu3: avoid sleep in atomic context when enter test mode

2018-05-23 Thread Chunfeng Yun
Use readl_poll_timeout_atomic() instead of readl_poll_timeout() in atomic context Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_gadget_ep0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_gadget_ep0.c b/drivers/usb/mtu3/mtu3_gadget_ep0.c index

[next, PATCH 3/6] usb: mtu3: clear test_mode flag when reset

2018-05-23 Thread Chunfeng Yun
Clear test_mode flag when the gadget is reset by host, otherwise will affect the next test item. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c index de0de01..5c60a

[next, PATCH 1/6] usb: mtu3: re-enable controller to accept LPM request after LPM resume

2018-05-23 Thread Chunfeng Yun
After the controller receives a LPM request, it will reject the LPM request, and need software to re-enable it after LPM resume if the controller doesn't remote wakeup from L1 automatically Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_core.c | 8 +++- 1 file changed, 7 insertions(+)

[next, PATCH 6/6] usb: mtu3: fix warning of sleep in atomic context in notifier callback

2018-05-23 Thread Chunfeng Yun
The notifier callbacks of extcon are called in atomic context, but the callbacks will call regulator_enable()/regulator_disable() which may sleep caused by mutex, so use work queue to call the sleep functions. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h| 11 ++- drivers/u

[next, PATCH 5/6] usb: mtu3: reset gadget when VBUS_FALL interrupt arises

2018-05-23 Thread Chunfeng Yun
When VBUS_FALL interrupt arises, it means U3 device is disconnected with host, so need reset status of gadget Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_c

[next, PATCH 2/6] usb: mtu3: fix uncontinuous SeqN issue after disable EP

2018-05-23 Thread Chunfeng Yun
Reset EP when disable it to reset data toggle for U2 EP, and SeqN, flow control status etc for U3 EP, this can avoid issue of uncontinuous SeqN Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_core.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH v2 0/4] usb: dwc2: Make dwc2 endianness agnostic

2018-05-23 Thread Minas Harutyunyan
Hi Filipe, This patch series changing dwc2_readl/dwc2_writel functions prototypes. To avoid multiple re-basing, preferable to merge this series to your next branch as soon as possible. Do you have any objections? Thanks, Minas Acked-by: Minas Harutyunyan On 5/23/2018 11:54 AM, Gevorg Sahak

[PATCH v2 3/4] usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep

2018-05-23 Thread Gevorg Sahakyan
dwc2_readl_rep/dwc2_writel_rep functions using readl/writel in a loop. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 61 ++- drivers/usb/dwc2/gadget.c | 6 ++--- 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/drivers

[PATCH v2 4/4] usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

2018-05-23 Thread Gevorg Sahakyan
Declared dwc2_check_core_endianness() function for dynamicly check core endianness. Added needs_byte_swap flag to hsotg structure, and depending on flag swap value inside dwc2_readl/writel functions. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 21 +++-- drive

[PATCH v2 1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure

2018-05-23 Thread Gevorg Sahakyan
Moved dwc2_readl/writel functions after hsotg declaration for adding hsotg structure to dwc2_readl/writel function prototypes. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 108 1 file changed, 54 insertions(+), 54 deletions(-) dif

[PATCH v2 0/4] usb: dwc2: Make dwc2 endianness agnostic

2018-05-23 Thread Gevorg Sahakyan
This series contains patches which are make dwc2 core endianness agnostic Changes from v1: Rebased to latest balbi/next. Changes from v0: Moved dwc2_check_core_endianness() call after devm_ioremap_resource() to avoid ioread32() call on null pointer. Gevorg Sahakyan (4): usb: dwc2: Move dw