flash fail with mediatek device

2019-04-29 Thread Румен Петров
Hello, I would like to use  "SP Flash Tool"  to flash Android MediaTek. Process ends with error S_FT_DA_NO_RESPONSE and I have no more ideas how to proceed. Internet has many clips on non-linux system that shows working "SP Flash Tool" with specific CDC driver. Unfortunately is not clear config

Re: [PATCH 0/5] USB: fix tty unthrottle races

2019-04-29 Thread Johan Hovold
On Thu, Apr 25, 2019 at 06:05:35PM +0200, Johan Hovold wrote: > This series fixes a couple of long-standing issues in USB serial and > cdc-acm which essentially share the same implementation. > > As noted by Oliver a few years back, read-urb completion can race with > unthrottle() running on anoth

Re: flash fail with mediatek device

2019-04-29 Thread Greg KH
On Mon, Apr 29, 2019 at 11:13:12AM +0300, Румен Петров wrote: > Hello, > > I would like to use  "SP Flash Tool"  to flash Android MediaTek. That's great, but there is nothing that we can do to help out here, please contact MediaTek about this as this is their specific userspace tool, and you are

Re: [PATCH 1/5] USB: serial: fix unthrottle races

2019-04-29 Thread Oliver Neukum
On Do, 2019-04-25 at 18:05 +0200, Johan Hovold wrote: > @@ -484,6 +503,12 @@ void usb_serial_generic_unthrottle(struct tty_struct > *tty) > port->throttled = port->throttle_req = 0; > spin_unlock_irq(&port->lock); > > + /* > +* Matches the smp_mb__after_atomic() in

Re: [PATCH 1/5] USB: serial: fix unthrottle races

2019-04-29 Thread Johan Hovold
On Mon, Apr 29, 2019 at 11:50:58AM +0200, Oliver Neukum wrote: > On Do, 2019-04-25 at 18:05 +0200, Johan Hovold wrote: > > @@ -484,6 +503,12 @@ void usb_serial_generic_unthrottle(struct tty_struct > > *tty) > > port->throttled = port->throttle_req = 0; > > spin_unlock_irq(&port->lo

Re: [PATCH 5/5] USB: cdc-acm: clean up throttle handling

2019-04-29 Thread Oliver Neukum
On Do, 2019-04-25 at 18:05 +0200, Johan Hovold wrote: > Clean up the throttle implementation by dropping the redundant > throttle_req flag which was a remnant from back when USB serial had only > a single read URB, something which was later carried over to cdc-acm. > > Also convert the throttled f

Re: [PATCH 4/5] USB: cdc-acm: fix unthrottle races

2019-04-29 Thread Oliver Neukum
On Do, 2019-04-25 at 18:05 +0200, Johan Hovold wrote: > Fix two long-standing bugs which could potentially lead to memory > corruption or leave the port throttled until it is reopened (on weakly > ordered systems), respectively, when read-URB completion races with > unthrottle(). > > First, the UR

Re: [PATCH 01/14] usb: dwc2: Fix dwc2_restore_device_registers() function.

2019-04-29 Thread Artur Petrosyan
On 4/27/2019 00:43, Doug Anderson wrote: > Hi, > > On Fri, Apr 12, 2019 at 6:38 AM Artur Petrosyan > wrote: >> >> - Added backup of DCFG register. >> - Added Set the Power-On Programming done bit. >> >> Signed-off-by: Artur Petrosyan >> --- >> drivers/usb/dwc2/gadget.c | 10 ++ >> 1 f

Re: [PATCH v1 03/14] usb: dwc2: Fix wakeup detected and session request interrupt handlers.

2019-04-29 Thread Artur Petrosyan
Hi, On 4/27/2019 00:44, Doug Anderson wrote: > Hi, > > On Fri, Apr 19, 2019 at 1:05 PM Artur Petrosyan > wrote: >> >> @@ -426,8 +438,6 @@ static void dwc2_handle_wakeup_detected_intr(struct >> dwc2_hsotg *hsotg) >> /* Change to L0 state */ >> hsotg->lx_state =

Re: [PATCH v1 04/14] usb: dwc2: Fix suspend state in host mode for partial power down.

2019-04-29 Thread Artur Petrosyan
Hi, On 4/27/2019 00:45, Doug Anderson wrote: > Hi, > > On Fri, Apr 19, 2019 at 1:05 PM Artur Petrosyan > wrote: >> >> - In dwc2_port_suspend() function added waiting for the >>HPRT0.PrtSusp register field to be set. >> >> - In _dwc2_hcd_suspend() function added checking of >>"hsotg->flag

Re: [PATCH v1 08/14] usb: dwc2: Add default param to control power optimization.

2019-04-29 Thread Artur Petrosyan
Hi, On 4/27/2019 00:46, Doug Anderson wrote: > Hi, > > On Fri, Apr 19, 2019 at 11:53 AM Artur Petrosyan > wrote: >> >> - Added a default param "power_saving" to enable or >>disable hibernation or partial power down features. >> >> - Printed hibernation param in hw_params_show and >>power

Re: flash fail with mediatek device

2019-04-29 Thread Румен Петров
Greg KH wrote: On Mon, Apr 29, 2019 at 11:13:12AM +0300, Румен Петров wrote: Hello, I would like to use  "SP Flash Tool"  to flash Android MediaTek. That's great, but there is nothing that we can do to help out here, please contact MediaTek about this as this is their specific userspace tool,

[PATCH] usb: dwc2: Set actual frame number for completed ISOC transfer for none DDMA

2019-04-29 Thread Minas Harutyunyan
On ISOC OUT transfer completion, in none DDMA mode, set actual frame number returning to function driver in usb_request. Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c in

Re: [PATCH v1 09/14] usb: dwc2: Update dwc2_handle_usb_suspend_intr function.

2019-04-29 Thread Artur Petrosyan
On 4/27/2019 00:52, Doug Anderson wrote: > Hi, > > On Fri, Apr 19, 2019 at 11:53 AM Artur Petrosyan > wrote: >> >> To avoid working in two modes (partial power down >> and hibernation) changed conditions for entering >> partial power down or hibernation. >> >> Instead of checking hw_params.power_

Re: [PATCH v1 14/14] usb: dwc2: Add enter/exit hibernation from system issued suspend/resume

2019-04-29 Thread Artur Petrosyan
Hi, On 4/27/2019 01:01, Doug Anderson wrote: > Hi, > > On Fri, Apr 19, 2019 at 1:05 PM Artur Petrosyan > wrote: >> >> Added a new flow of entering and exiting hibernation when PC is >> hibernated or suspended. >> >> Signed-off-by: Artur Petrosyan >> --- >> drivers/usb/dwc2/hcd.c | 128 >> +++

[PATCH] [PATCH v2] USB:serial:pl2303:Add new PID to support PL2303HXN (TYPE_HXN)

2019-04-29 Thread Charles Yeh
Prolific has developed a new USB to UART chip: PL2303HXN PL2303HXN : PL2303GC/PL2303GS/PL2303GT/PL2303GL/PL2303GE/PL2303GB The Vendor request used by the PL2303HXN (TYPE_HXN) is different from the existing PL2303 series (TYPE_HX & TYPE_01). Therefore, different Vendor requests are used to issue rel

[PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()

2019-04-29 Thread Wei Yongjun
Add the missing unlock before return from function ccg_cmd_write_flash_row() in the error handling case. Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support") Signed-off-by: Wei Yongjun --- drivers/usb/typec/ucsi/ucsi_ccg.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()

2019-04-29 Thread Heikki Krogerus
On Mon, Apr 29, 2019 at 12:26:30PM +, Wei Yongjun wrote: > Add the missing unlock before return from function ccg_cmd_write_flash_row() > in the error handling case. > > Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support") > Signed-off-by: Wei Yongjun Acked-by: Heikki

[PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
This is the UAS version of 747668dbc061b3e62bc1982767a3a1f9815fcf0e usb-storage: Set virt_boundary_mask to avoid SG overflows We are not as likely to be vulnerable as storage, as it is unlikelier that UAS is run over a controller without native support for SG, but the issue exists. Signed-off-by

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > Sent: 29 April 2019 13:20 > This is the UAS version of > > 747668dbc061b3e62bc1982767a3a1f9815fcf0e > usb-storage: Set virt_boundary_mask to avoid SG overflows > > We are not as likely to be vulnerable as storage, as it is unlikelier > that UAS is run over a controller witho

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > From: Oliver Neukum > > > > +* USB has unusual scatter-gather requirements: the length of each > > +* scatterlist element except the last must be divisible by the > > +* Bulk maxpacket value. Fortunately this value is always a >

[PATCH] This patch fixes endian issue in xHCI for scratchpad buffer.

2019-04-29 Thread Aleksey Kuleshov
Scratchpad buffer is an array of pointers every of which must be in little endian format. Signed-off-by: Aleksey Kuleshov --- drivers/usb/host/xhci-mem.c | 6 +++--- drivers/usb/host/xhci.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/d

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > Sent: 29 April 2019 14:38 > On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > > From: Oliver Neukum > > > > > > + * USB has unusual scatter-gather requirements: the length of each > > > + * scatterlist element except the last must be divisible by the > > > + * Bulk ma

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
On Mo, 2019-04-29 at 14:19 +, David Laight wrote: > From: Oliver Neukum > > Sent: 29 April 2019 14:38 > > On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > > > From: Oliver Neukum > > > > > > > > +* USB has unusual scatter-gather requirements: the length of > > > > each > > > >

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > On Mo, 2019-04-29 at 14:19 +, David Laight wrote: > > From: Oliver Neukum > > > Sent: 29 April 2019 14:38 > > > On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > > > > From: Oliver Neukum > > > > > > > > > > + * USB has unusual scatter-gather requirements: the l

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
On Mo, 2019-04-29 at 15:06 +, David Laight wrote: > From: Oliver Neukum > > On Mo, 2019-04-29 at 14:19 +, David Laight wrote: > > AFAICT controllers do not export that property. > > Perhaps they need to Feel free to make a patch. > > > Even if you decide the code is 'good enough' (

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Alan Stern
On Mon, 29 Apr 2019, Oliver Neukum wrote: > On Mo, 2019-04-29 at 15:06 +, David Laight wrote: > > From: Oliver Neukum > > > On Mo, 2019-04-29 at 14:19 +, David Laight wrote: > > > > AFAICT controllers do not export that property. > > > > Perhaps they need to > > Feel free to make a

RE: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()

2019-04-29 Thread Ajay Gupta
Hi Wei > -Original Message- > From: Wei Yongjun > Sent: Monday, April 29, 2019 5:27 AM > To: Heikki Krogerus ; Greg Kroah-Hartman > ; Ajay Gupta ; Wolfram Sang > > Cc: Wei Yongjun ; linux-usb@vger.kernel.org; > kernel-janit...@vger.kernel.org > Subject: [PATCH -next] usb: typec: ucsi: cc

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote: > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > On Mo, 2019-04-29 at 15:06 +, David Laight wrote: > > > But the statement the old comment made are no longer correct. > > Perhaps David would be satisfied if the comment were changed to say

Re: [PATCH 01/14] usb: dwc2: Fix dwc2_restore_device_registers() function.

2019-04-29 Thread Doug Anderson
Hi, On Mon, Apr 29, 2019 at 3:51 AM Artur Petrosyan wrote: > > On 4/27/2019 00:43, Doug Anderson wrote: > > Hi, > > > > On Fri, Apr 12, 2019 at 6:38 AM Artur Petrosyan > > wrote: > >> > >> - Added backup of DCFG register. > >> - Added Set the Power-On Programming done bit. > >> > >> Signed-off-b

Re: [PATCH v1 04/14] usb: dwc2: Fix suspend state in host mode for partial power down.

2019-04-29 Thread Doug Anderson
Hi, On Mon, Apr 29, 2019 at 4:03 AM Artur Petrosyan wrote: > > Hi, > > On 4/27/2019 00:45, Doug Anderson wrote: > > Hi, > > > > On Fri, Apr 19, 2019 at 1:05 PM Artur Petrosyan > > wrote: > >> > >> - In dwc2_port_suspend() function added waiting for the > >>HPRT0.PrtSusp register field to be

Re: [PATCH v1 08/14] usb: dwc2: Add default param to control power optimization.

2019-04-29 Thread Doug Anderson
Hi, On Mon, Apr 29, 2019 at 4:30 AM Artur Petrosyan wrote: > > Hi, > > On 4/27/2019 00:46, Doug Anderson wrote: > > Hi, > > > > On Fri, Apr 19, 2019 at 11:53 AM Artur Petrosyan > > wrote: > >> > >> - Added a default param "power_saving" to enable or > >>disable hibernation or partial power d

Re: [PATCH v1 14/14] usb: dwc2: Add enter/exit hibernation from system issued suspend/resume

2019-04-29 Thread Doug Anderson
Hi, On Mon, Apr 29, 2019 at 5:01 AM Artur Petrosyan wrote: > > Hi, > > On 4/27/2019 01:01, Doug Anderson wrote: > > Hi, > > > > On Fri, Apr 19, 2019 at 1:05 PM Artur Petrosyan > > wrote: > >> > >> Added a new flow of entering and exiting hibernation when PC is > >> hibernated or suspended. > >>

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Alan Stern
On Mon, 29 Apr 2019, Oliver Neukum wrote: > On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote: > > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > > > On Mo, 2019-04-29 at 15:06 +, David Laight wrote: > > > > > But the statement the old comment made are no longer correct. > > > > Perhaps D

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Oliver Neukum
On Mo, 2019-04-29 at 13:55 -0400, Alan Stern wrote: > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote: > > > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > > > > > On Mo, 2019-04-29 at 15:06 +, David Laight wrote: > > > > > > > But the stat

Re: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread Alan Stern
On Mon, 29 Apr 2019, Oliver Neukum wrote: > On Mo, 2019-04-29 at 13:55 -0400, Alan Stern wrote: > > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > > > On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote: > > > > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > > > > > > > On Mo, 2019-04-29 at 15:

Re: [PATCH] usb: gadget: dwc2: fix zlp handling

2019-04-29 Thread Minas Harutyunyan
Hi Felipe, On 4/1/2019 3:33 PM, Minas Harutyunyan wrote: On 4/1/2019 2:51 PM, Andrzej Pietrasiewicz wrote: The patch 10209abe87f5ebfd482a00323f5236d6094d0865 usb: dwc2: gadget: Add scatter-gather mode avoided a NULL pointer dereference (hs_ep->req == NULL) by calling dwc2_gadget_fill_nonisoc_x