Re: [PATCH 3/6] dt-bindings: mtu3: add devicetree bindings

2016-05-12 Thread chunfeng yun
Hi, On Wed, 2016-05-11 at 09:54 -0500, Rob Herring wrote: > On Tue, May 10, 2016 at 04:23:31PM +0800, Chunfeng Yun wrote: > > add a DT binding doc for MediaTek USB3 DRD driver > > > > Signed-off-by: Chunfeng Yun > > --- > > Documentation/devicetree/bindings/usb/mtu3.txt | 86 > >

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
Hi, > >> and when has this actually happened ? Host should not send more data in > >> this case, if it does, it's an error on the host side. Also, returning > >> -EOVERFLOW is not exactly correct here, because you'd violate POSIX > >> specification of read(), right ? > >> > > This can happen if th

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: > Hi, > >> >> and when has this actually happened ? Host should not send more data in >> >> this case, if it does, it's an error on the host side. Also, returning >> >> -EOVERFLOW is not exactly correct here, because you'd violate POSIX >> >> specification of read(), r

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
> > The extra bytes can be anything(random), they just data from APP layer. > > It doesn't make sense for you to check. So I will not dump them, sorry. > > interesting, so you claim to have found a bug, but when asked to provide > more information your answer is "no" ? Thanks :-) > Do you really

Re: [PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-12 Thread Peter Chen
On Wed, May 11, 2016 at 03:32:30PM +0300, Roger Quadros wrote: > Peter, > > On 11/05/16 14:02, Roger Quadros wrote: > > On 11/05/16 09:10, Peter Chen wrote: > >> On Mon, May 02, 2016 at 03:18:48PM +0300, Roger Quadros wrote: > >>> This is to prevent missing symbol build error if OTG is > >>> enabl

Re: [PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-12 Thread Roger Quadros
On 12/05/16 11:18, Peter Chen wrote: > On Wed, May 11, 2016 at 03:32:30PM +0300, Roger Quadros wrote: >> Peter, >> >> On 11/05/16 14:02, Roger Quadros wrote: >>> On 11/05/16 09:10, Peter Chen wrote: On Mon, May 02, 2016 at 03:18:48PM +0300, Roger Quadros wrote: > This is to prevent missing

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
On 12/05/16 07:00, Yoshihiro Shimoda wrote: > Hi, > >> From: Alan Stern >> Sent: Wednesday, May 11, 2016 11:47 PM >> >> On Wed, 11 May 2016, Roger Quadros wrote: >> What I mean is if you have 2 EHCI controllers with 2 companion controllers, don't you need to know which companion goes wit

Re: [RFC PATCH v2 4/4] ARM: dts: vf-colibri: USB device/host switch using extcon gpio

2016-05-12 Thread Peter Chen
On Wed, May 11, 2016 at 06:11:36PM +0530, Sanchayan Maity wrote: > Use USBC_DET feature of standard Colibri SODIMM pin 137 for USB > device/host switching using the generic extcon USB gpio implementation. > > Signed-off-by: Sanchayan Maity > --- > arch/arm/boot/dts/vf-colibri-eval-v3.dtsi | 12 +

[PATCH 34/36] usb: serial: ti_usb_3410_5052: Fix indentation problems

2016-05-12 Thread Mathieu OTHACEHE
Fix some minor indentation problems. Also correct a multi-line comment. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb

[PATCH 36/36] usb: serial: ti_usb_3410_5052: Add myself as an author

2016-05-12 Thread Mathieu OTHACEHE
Add myself in the copyright section and as an author of the driver. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH 35/36] usb: serial: ti_usb_3410_5052: Remove function prototypes

2016-05-12 Thread Mathieu OTHACEHE
Declare functions in a the right order to avoid prototyping. There is no functional change here. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 1112 - 1 file changed, 544 insertions(+), 568 deletions(-) diff --git a/drivers/usb/seria

[PATCH 25/36] usb: serial: ti_usb_3410_5052: Check old_termios parameter in set_termios

2016-05-12 Thread Mathieu OTHACEHE
The old_termios parameter is never used in set_termios callback. Add a check to old_termios to see if we can return right away because there is nothing to change. Add a check to old_termios CBAUD to see if we can set DTR/RTS because last speed was B0. Also pass NULL for old_termios in open callba

[PATCH 33/36] usb: serial: ti_usb_3410_5052: Add CMSPAR support

2016-05-12 Thread Mathieu OTHACEHE
Add CMSPAR support in set_termios callback. Move TI_UART_ENABLE_PARITY_CHECKING setting in the upper block to avoid doing it twice. Delete useless TI_UART_ENABLE_PARITY_CHECKING unsetting. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 19 ++- 1 file

[PATCH 27/36] usb: serial: ti_usb_3410_5052: Standardize debug and error messages

2016-05-12 Thread Mathieu OTHACEHE
Use the format "error text: error value\n" when possible. Drop redundant function names from error messages. Also move a couple err messages to dbg messages. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 83 +-- 1 file changed, 41 ins

[PATCH 24/36] usb: serial: ti_usb_3410_5052: Use usb_serial_generic_open

2016-05-12 Thread Mathieu OTHACEHE
Use usb_serial_generic_open in open callback to start read urb. Also remove useless usb_device pointer. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3

[PATCH 26/36] usb: serial: ti_usb_3410_5052: Fix firmware downloading

2016-05-12 Thread Mathieu OTHACEHE
The buffer used to store firmware is allocated to maximum firmware size (TI_FIRMWARE_BUF_SIZE) + header size. This buffer is filled with requested firmware (fw_p->size) and padded with 0xff bytes. The header is written over the 3 first bytes of the buffer (overwritting the 3 first bytes of the requ

[PATCH 28/36] usb: serial: ti_usb_3410_5052: Use variables for vendor and product

2016-05-12 Thread Mathieu OTHACEHE
Use variables for vendor and product in download_firmware to improve readability. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial

[PATCH 31/36] usb: serial: ti_usb_3410_5052: Use a mutex to protect shadow mcr

2016-05-12 Thread Mathieu OTHACEHE
Only shadow msr is accessed from interrupt context. So use the ti_port spinlock to protect only shadow msr. Add a mutex in ti_port to protect mcr from concurrent access. Also move shadow mcr setting out of ti_set_mcr function. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5

[PATCH 32/36] usb: serial: ti_usb_3410_5052: Remove prefixes from private structures

2016-05-12 Thread Mathieu OTHACEHE
Remove prefixes from ti_port and ti_device structures. Also change type of is_3410 from int to bool. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 114 +- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/drivers/usb/ser

[PATCH 29/36] usb: serial: ti_usb_3410_5052: Set shadow msr before waking up waiters

2016-05-12 Thread Mathieu OTHACEHE
Save msr before testing the delta and waking up any waiters. Also use port directly instead of tport->tp_port. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_

[PATCH 30/36] usb: serial: ti_usb_3410_5052: Remove backpointer in ti_port

2016-05-12 Thread Mathieu OTHACEHE
In ti_port structure, remove useless tp_tdev backpointer. Also remove pointer to usb_serial_port. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 44 --- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/drivers/usb/serial

[PATCH 22/36] usb: serial: ti_usb_3410_5052: Change ti_get/set_serial_info function arguments

2016-05-12 Thread Mathieu OTHACEHE
It is sufficient to pass usb_serial_port structure to ti_get_serial_info and ti_set_serial_info. Also move functions above ioctl to avoid function prototyping and use unsigned int instead of unsigned for cwait variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c |

[PATCH 23/36] usb: serial: ti_usb_3410_5052: Do not set shadow mcr in open callback

2016-05-12 Thread Mathieu OTHACEHE
Setting DTR/RTS is handled using dtr_rts in tty_core. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 2a993a2..d8bed30 100644 --- a/dr

[PATCH 21/36] usb: serial: ti_usb_3410_5052: Use generic close function

2016-05-12 Thread Mathieu OTHACEHE
Use usb_serial_generic_close in close callback. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 8350c6b

[PATCH 19/36] usb: serial: ti_usb_3410_5052: Do not modify interrupt context

2016-05-12 Thread Mathieu OTHACEHE
It is useless to pass a specific context (ti_device) to the interrupt callback. So use the default context (usb_serial_port). Remove useless variables in ti_interrupt_callback. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 55 +++ 1

[PATCH 15/36] usb: serial: ti_usb_3410_5052: Remove in_sync and out_sync functions

2016-05-12 Thread Mathieu OTHACEHE
ti_command_in_sync and ti_command_out_sync shouldn't use userspace datatypes (__uX), data should be void* to avoid casting and size should be size_t. This patch rewrite those functions with new names: ti_send_ctrl_data_urb and ti_recv_ctrl_urb. Also add a ti_send_ctrl_urb to simplify command sendi

[PATCH 18/36] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments

2016-05-12 Thread Mathieu OTHACEHE
Remove useless ti_device pointer, and change addr to u32. Move function upper to avoid function prototyping. Also change size variable in function from int to size_t. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 76 --- 1 file chang

[PATCH 09/36] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc

2016-05-12 Thread Mathieu OTHACEHE
Use kzalloc instead of kmalloc to avoid field initialisation to 0. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index

[PATCH 17/36] usb: serial: ti_usb_3410_5052: Remove useless tty_wakeup

2016-05-12 Thread Mathieu OTHACEHE
The generic driver doesn't call tty_wakeup in usb_serial_generic_msr_changed so this tty_wakeup seems useless. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/us

[PATCH 20/36] usb: serial: ti_usb_3410_5052: Remove usb_serial pointer in ti_port

2016-05-12 Thread Mathieu OTHACEHE
There is no need to keep a pointer to usb_serial in ti_port structure. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/

[PATCH 16/36] usb: serial: ti_usb_3410_5052: Use bulk_out_size in TIOCGSERIAL

2016-05-12 Thread Mathieu OTHACEHE
Use bulk_out_size instead of recalculate it with kfifo_size Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index eb4df1e..

[PATCH 10/36] usb: serial: ti_usb_3410_5052: Remove useless NULL-testing

2016-05-12 Thread Mathieu OTHACEHE
It is useless to check the return of usb_get_serial_port_data. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/ser

[PATCH 11/36] usb: serial: ti_usb_3410_5052: Use C_X macros instead of c_cflag manipulation

2016-05-12 Thread Mathieu OTHACEHE
Use C_X tty.h macros to avoid direct manipulation of termios c_cflag variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/seria

[PATCH 13/36] usb: serial: ti_usb_3410_5052: Remove unused variables

2016-05-12 Thread Mathieu OTHACEHE
Remove variables affected but never read. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 58df42d..00ae52e 100644 --- a/

[PATCH 14/36] usb: serial: ti_usb_3410_5052: Use macros instead of magic values

2016-05-12 Thread Mathieu OTHACEHE
Use macros to define 3410 and 5052 baud bases and remove useless casting. Use macro to define usb download timeout. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/usb/se

[PATCH 12/36] usb: serial: ti_usb_3410_5052: Use generic read/write callbacks

2016-05-12 Thread Mathieu OTHACEHE
Remove read_bulk_callback, write_bulk_callback, write, write_room, chars_in_buffer, throttle and unthrottle callbacks who uselessly reimplements generic functions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 315 -- 1 file changed,

[PATCH 07/36] usb: serial: ti_usb_3410_5052: Remove closing_wait module parameter

2016-05-12 Thread Mathieu OTHACEHE
Closing wait delay is configurable per device using TIOCSSERIAL. Also initialise tty_port closing_wait in port_probe with default value. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drive

[PATCH 08/36] usb: serial: ti_usb_3410_5052: Remove useless dev_dbg messages

2016-05-12 Thread Mathieu OTHACEHE
Remove useless or redundant dev_dbg messages. Fix debug-message typos. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/

[PATCH 01/36] usb: serial: ti_usb_3410_5052: Remove useless comments

2016-05-12 Thread Mathieu OTHACEHE
Remove lines commenting the obvious. Remove vi related comment. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_us

[PATCH 06/36] usb: serial: ti_usb_3410_5052: Do not use __uX types

2016-05-12 Thread Mathieu OTHACEHE
__uX types should only be used for user-space interactions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 66 ++- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/ser

[PATCH 04/36] usb: serial: ti_usb_3410_5052: Use inline functions rather than macro

2016-05-12 Thread Mathieu OTHACEHE
Inline functions are preferable to macros resembling functions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_

[PATCH 05/36] usb: serial: ti_usb_3410_5052: Remove unused data structures

2016-05-12 Thread Mathieu OTHACEHE
ti_read_data_request, ti_read_data_bytes and ti_interrupt are unused. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 21 - 1 file changed, 21 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c

[PATCH 00/36] usb: serial: ti_usb_3410_5052: clean driver

2016-05-12 Thread Mathieu OTHACEHE
Hi, The now reverted mxu11x0 turned out to be a copy of ti_usb_3410_5052 driver. This aim of this serie is to apply all of the cleanups we did in mxu11x0 to ti_usb_3410_5052. Thank you, Mathieu Mathieu OTHACEHE (36): usb: serial: ti_usb_3410_5052: Remove useless comments usb: serial: ti_usb

[PATCH 02/36] usb: serial: ti_usb_3410_5052: use __packed instead of __attribute__((packed))

2016-05-12 Thread Mathieu OTHACEHE
__packed is preferred over __attribute__((packed)) for portability. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410

[PATCH 03/36] usb: serial: ti_usb_3410_5052: Remove ti_usb_3410_5052.h

2016-05-12 Thread Mathieu OTHACEHE
The definitions in ti_usb_3410_5052.h are only used in ti_usb_3410_5052.c. The content of the header is copied in ti_usb_3410_5052.c. Also correct a typo in macro TI_PIPE_MODE_CONTINOUS. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 237

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > The problem is device side app sometimes received incorrect data >> caused >> >> > by the dropping. Most times the error can be detected by APP itself, but >> >> >> >> why ? app did e.g. read(5), that caused driver to queue a usb_request >> >> with length set t

Re: [RFC PATCH v2 4/4] ARM: dts: vf-colibri: USB device/host switch using extcon gpio

2016-05-12 Thread maitysanchayan
Hello Peter, On 16-05-12 16:40:16, Peter Chen wrote: > On Wed, May 11, 2016 at 06:11:36PM +0530, Sanchayan Maity wrote: > > Use USBC_DET feature of standard Colibri SODIMM pin 137 for USB > > device/host switching using the generic extcon USB gpio implementation. > > > > Signed-off-by: Sanchayan

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi again, Felipe Balbi writes: > @@ -811,7 +815,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct > ffs_io_data *io_data) >*/ > ret = interrupted ? -EINTR : ep->status; > if (io_data->read && ret > 0) { > - ret = copy_to

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
Hi, On 12/05/16 11:34, Roger Quadros wrote: > On 12/05/16 07:00, Yoshihiro Shimoda wrote: >> Hi, >> >>> From: Alan Stern >>> Sent: Wednesday, May 11, 2016 11:47 PM >>> >>> On Wed, 11 May 2016, Roger Quadros wrote: >>> > What I mean is if you have 2 EHCI controllers with 2 companion > contr

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
> >> > These all can lead host send more than device wanted bytes. For sure > >> > it wrong at host side, but device side don't know. > >> > >> but none of this means we have a bug at device side. In fact, by > >> allowing these extra bytes to reach userspace, we could be creating a > >> possible a

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
Hi, > > we need a min() here. Better version below: No need. copy_to_iter will do it for us. Best Regards, Du, Changbin > > diff --git a/drivers/usb/gadget/function/f_fs.c > b/drivers/usb/gadget/function/f_fs.c > index 73515d54e1cc..6c49b152f46e 100644 > --- a/drivers/usb/gadget/function/f_fs.c

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Christian Lamparter
On Tuesday, May 10, 2016 09:23:59 AM Arnd Bergmann wrote: > On Tuesday 10 May 2016 08:37:52 Benjamin Herrenschmidt wrote: > > On Mon, 2016-05-09 at 17:08 +0200, Arnd Bergmann wrote: > > > > > > Unfortunately, I don't see any way this could be done in MIPS specific > > > code: There is typically a

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > These all can lead host send more than device wanted bytes. For sure >> >> > it wrong at host side, but device side don't know. >> >> >> >> but none of this means we have a bug at device side. In fact, by >> >> allowing these extra bytes to reach userspace, we

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > These all can lead host send more than device wanted bytes. For sure >> >> > it wrong at host side, but device side don't know. >> >> >> >> but none of this means we have a bug at device side. In fact, by >> >> allowing these extra bytes to reach userspace, we

RE: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Yoshihiro Shimoda
Hi, > From: Roger Quadros > Sent: Thursday, May 12, 2016 6:32 PM > > Hi, > > On 12/05/16 11:34, Roger Quadros wrote: > > On 12/05/16 07:00, Yoshihiro Shimoda wrote: > >> Hi, > >> > >>> From: Alan Stern > >>> Sent: Wednesday, May 11, 2016 11:47 PM > >>> > >>> On Wed, 11 May 2016, Roger Quadros wr

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
> Hi, > > "Du, Changbin" writes: > >> >> > These all can lead host send more than device wanted bytes. For > sure > >> >> > it wrong at host side, but device side don't know. > >> >> > >> >> but none of this means we have a bug at device side. In fact, by > >> >> allowing these extra bytes to rea

[PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Arnd Bergmann
A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq MIPS system unfortunately broke big-endian operation on PowerPC APM82181 as reported by Christian Lamparter, and likely other systems. It actually introduced multiple issues: - it broke big-endian ARM kernels: any machine that wa

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> right, and that was my point: if we copy more to userspace, then we have >> a real big problem. >> > Yes, we drop the data because we userspace buffer is not enough this time. > The problem here is that really can we just drop it silently? Maybe not. Yeah, it prob

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi
Hi, Arnd Bergmann writes: > A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq > MIPS system unfortunately broke big-endian operation on PowerPC > APM82181 as reported by Christian Lamparter, and likely other > systems. > > It actually introduced multiple issues: > > - it broke

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Arnd Bergmann
On Thursday 12 May 2016 14:25:49 Felipe Balbi wrote: > > { > > u32 value = __raw_readl(addr); > > > > - /* In order to preserve endianness __raw_* operation is used. > > Therefore > > - * a barrier is needed to ensure IO access is not re-ordered across > > + /* in order to pr

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi
Hi, (Arnd, you didn't Cc dwc2's maintainer. I'm also not part of TI anymore) Arnd Bergmann writes: > On Thursday 12 May 2016 14:25:49 Felipe Balbi wrote: >> > { >> > u32 value = __raw_readl(addr); >> > >> > - /* In order to preserve endianness __raw_* operation is used. >> > There

[RFT PATCH] xhci: Fix handling timeouted commands on hosts in weird states.

2016-05-12 Thread Mathias Nyman
If commands timeout we mark them for abortion, then stop the command ring, and turn the commands to no-ops and finally restart the command ring. If the host is working properly the no-op commands will finish and pending completions are called. If we notice the host is failing driver clears the com

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Arnd Bergmann
On Thursday 12 May 2016 14:43:43 Felipe Balbi wrote: > >> How many more drivers will we have to 'fix' like this ? > > > > Endianess problems will keep coming up, and we have hundreds or thousands > > of drivers that are written with a particular design in mind that could > > be wrong as soon as som

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Arnd Bergmann
On Thursday 12 May 2016 11:58:18 Christian Lamparter wrote: > > > > Detecting the endianess of the > > > > device is probably the best future-proof solution, but it's also > > > > considerably more work to do in the driver, and comes with a > > > > tiny runtime overhead. > > > > > > The runtime ov

Re: [PATCH 04/36] usb: serial: ti_usb_3410_5052: Use inline functions rather than macro

2016-05-12 Thread Sergei Shtylyov
Hello. On 5/12/2016 11:48 AM, Mathieu OTHACEHE wrote: Inline functions are preferable to macros resembling functions. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/usb/se

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
Hi, On 12/05/16 13:31, Yoshihiro Shimoda wrote: > Hi, > >> From: Roger Quadros >> Sent: Thursday, May 12, 2016 6:32 PM >> >> Hi, >> >> On 12/05/16 11:34, Roger Quadros wrote: >>> On 12/05/16 07:00, Yoshihiro Shimoda wrote: Hi, > From: Alan Stern > Sent: Wednesday, May 11, 2016 1

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Christian Lamparter
On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: > On Thursday 12 May 2016 11:58:18 Christian Lamparter wrote: > > > > > Detecting the endianess of the > > > > > device is probably the best future-proof solution, but it's also > > > > > considerably more work to do in the driver, and come

Re: UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47

2016-05-12 Thread Greg Kroah-Hartman
On Thu, May 12, 2016 at 07:38:00PM +0300, Meelis Roos wrote: > I am seeing it on multiple different PC-s. > > [7.837957] > > [7.837959] UBSAN: Undefined behaviour in > drivers/usb/host/ehci-hub.c:877:47 And

UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47

2016-05-12 Thread Meelis Roos
I am seeing it on multiple different PC-s. [7.837957] [7.837959] UBSAN: Undefined behaviour in drivers/usb/host/ehci-hub.c:877:47 [7.837961] index -1 is out of range for type 'u32 [1]' [7.837964] CPU:

Re: Downloading tracks from gps via usb

2016-05-12 Thread Alan Stern
On Wed, 11 May 2016, Stephen Furner wrote: > The kernel is: 3.19.0-59-generic > > Listing the USB devices I see: > > stephen@stephen-N150P:~$ lsusb > Bus 001 Device 004: ID 0ac8:c33f Z-Star Microelectronics Corp. Webcam > Bus 001 Device 003: ID 0781:5567 SanDisk Corp. Cruzer Blade > Bus 001 Devi

Re: [PATCH] usb: ohci-at91: Suspend the ports while USB suspending

2016-05-12 Thread Alan Stern
On Thu, 12 May 2016, Wenyou Yang wrote: > In order to get lower consumption, as a workaround, suspend > the USB PORTA/B/C via set the SUSPEND_A/B/C bits of OHCI Interrupt > Configuration Register while OHCI USB suspending. What does this mean? What does suspending a port do? Is it the same as

RE: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Alan Stern
On Thu, 12 May 2016, Yoshihiro Shimoda wrote: > > > Alan, does USB core even know which EHCI and OHCI are linked to the same > > > port > > > or the handoff is software transparent? > > > > The core knows. It doesn't use the information for a whole lot of > > things, but it does use it in a cou

[PATCH 1/2] musb: sunxi: Add set_mode platform function

2016-05-12 Thread Hans de Goede
Move the mode handling to the platform_set_mode callback. Signed-off-by: Hans de Goede --- drivers/usb/musb/sunxi.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c index fdab423..2c33d9b 1006

[PATCH 2/2] musb: sunxi: Set state to A_WAIT_VRISE when enabling VBus

2016-05-12 Thread Hans de Goede
When the board is powering attached usb devices via the otg port sometimes / on some devices it takes slightly too long for the VBus detection code in phy-sun4i-usb.c to signal that VBus is high after enabling VBus and the musb hardware signals a MUSB_INTR_VBUSERROR interrupt. This commit sets the

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread John Youn
On 5/12/2016 6:30 AM, Christian Lamparter wrote: > On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: >> On Thursday 12 May 2016 11:58:18 Christian Lamparter wrote: >> Detecting the endianess of the >> device is probably the best future-proof solution, but it's also >> considera

Re: [PATCH net-next 4/5] treewide: replace dev->trans_start update with helper

2016-05-12 Thread Doug Ledford
On 05/03/2016 10:33 AM, Florian Westphal wrote: > Replace all trans_start updates with netif_trans_update helper. > change was done via spatch: > > struct net_device *d; > @@ > - d->trans_start = jiffies > + netif_trans_update(d) > > Compile tested only. > > Cc: user-mode-linux-de...@lists.sourc

Re: [PATCH 2/2] musb: sunxi: Set state to A_WAIT_VRISE when enabling VBus

2016-05-12 Thread Sergei Shtylyov
Hello. On 05/12/2016 09:31 PM, Hans de Goede wrote: When the board is powering attached usb devices via the otg port sometimes / on some devices it takes slightly too long for the VBus I think it's either VBUS or Vbus, not this strange spelling. detection code in phy-sun4i-usb.c to signa

Re: Downloading tracks from gps via usb

2016-05-12 Thread Alan Stern
You should use Reply-To-All so that your email goes to the mailing list as well as to me. On Thu, 12 May 2016, Stephen Furner wrote: > Alan, > > The following is an excerpt from strace output for gebabbel when > asking it to call the file from the gps. It has the relative time > stamp on each l

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Christian Lamparter
On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: > On 5/12/2016 6:30 AM, Christian Lamparter wrote: > > On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: > >> On Thursday 12 May 2016 11:58:18 Christian Lamparter wrote: > >> Detecting the endianess of the > >> device is probab

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Arnd Bergmann
On Thursday 12 May 2016 22:39:36 Christian Lamparter wrote: > On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: > > On 5/12/2016 6:30 AM, Christian Lamparter wrote: > > > On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: > > >> > > >> If I recall correctly, the rough consensus was to

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread John Youn
On 5/12/2016 1:39 PM, Christian Lamparter wrote: > On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: >> On 5/12/2016 6:30 AM, Christian Lamparter wrote: >>> On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: On Thursday 12 May 2016 11:58:18 Christian Lamparter wrote: Dete

[PATCH v3] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Arnd Bergmann
A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq MIPS system unfortunately broke big-endian operation on PowerPC APM82181 as reported by Christian Lamparter, and likely other systems. It actually introduced multiple issues: - it broke big-endian ARM kernels: any machine that wa

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-12 Thread Benjamin Herrenschmidt
On Thu, 2016-05-12 at 11:58 +0200, Christian Lamparter wrote: > > > http://www.linuxplumbersconf.org/2012/wp-content/uploads/2012/09/2012-lpc-ref-big-little-endian-herrenschmidt.odp > > > > but there are at least two more twists that you completely missed here: > > > > - Some architectures (e.g.

Re: NET2280: Adding PLX usb2380 support (issues encountered)

2016-05-12 Thread Tim Harvey
On Tue, Jan 26, 2016 at 6:40 AM, Justin DeFields wrote: > I spoke with the Avago/PLX FAE, and they said that the PLX software > team that worked on this driver is no longer with the company, so they > cannot offer support :( > > I'm not sure there is going to be a good answer for this issue. > Hop

Fwd: Downloading tracks from gps via usb

2016-05-12 Thread Stephen Furner
I apologise if this is a duplicate I had a bounce back from the list due to it since I had inadvertently included HTML. So I am resending. To: Alan Stern Cc: USB list Alan, I have looked through the strace output the following excerpt below directly includes references gebabbel. Is this more i

Re: NET2280: Adding PLX usb2380 support (issues encountered)

2016-05-12 Thread Justin DeFields
I've never received any answers for my questions unfortunately :(. If I remember correctly, just to get the deivce working (though I'm not sure how stable) I added a new structure for the 2380, and gave it all the same options as the 3380, except that I split the PLX_SUPERSPEED into 2 flags (PLX_S

Re: Downloading tracks from gps via usb

2016-05-12 Thread Stephen Furner
Alan, The permissions for the usb ports are: stephen@stephen-N150P:/$ ls -l dev/bus/usb total 0 drwxr-xr-x 2 root root 100 May 11 14:39 001 drwxr-xr-x 2 root root 60 May 12 01:48 002 drwxr-xr-x 2 root root 80 May 12 21:04 003 drwxr-xr-x 2 root root 60 May 11 14:39 004 drwxr-xr-x 2 root root 6

Re: [PATCH 3/6] dt-bindings: mtu3: add devicetree bindings

2016-05-12 Thread Alan Cooper
On Thu, May 12, 2016 at 3:24 AM, chunfeng yun wrote: >> > + - mediatek,enable-manual-drd : supports manual dual-role switch by sysfs >> > + interface; only used when receptacle is TYPE-A and also wants to >> > support >> > + dual-role mode. >> >> sysfs is a Linux detail that doesn't apply to

RE: [PATCH] usb: ohci-at91: Suspend the ports while USB suspending

2016-05-12 Thread Yang, Wenyou
Hi Alan, > -Original Message- > From: Alan Stern [mailto:st...@rowland.harvard.edu] > Sent: 2016年5月13日 2:11 > To: Yang, Wenyou > Cc: Greg Kroah-Hartman ; Ferre, Nicolas > ; linux-usb@vger.kernel.org; linux- > ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org > Subject: Re: [PAT

Re: [PATCH 3/6] dt-bindings: mtu3: add devicetree bindings

2016-05-12 Thread chunfeng yun
Hi, On Thu, 2016-05-12 at 19:02 -0400, Alan Cooper wrote: > On Thu, May 12, 2016 at 3:24 AM, chunfeng yun > wrote: > >> > + - mediatek,enable-manual-drd : supports manual dual-role switch by > >> > sysfs > >> > + interface; only used when receptacle is TYPE-A and also wants to > >> > support

Re: [PATCH 3/6] dt-bindings: mtu3: add devicetree bindings

2016-05-12 Thread Rob Herring
On Thu, May 12, 2016 at 9:00 PM, chunfeng yun wrote: > Hi, > > On Thu, 2016-05-12 at 19:02 -0400, Alan Cooper wrote: >> On Thu, May 12, 2016 at 3:24 AM, chunfeng yun >> wrote: >> >> > + - mediatek,enable-manual-drd : supports manual dual-role switch by >> >> > sysfs >> >> > + interface; only

Re: [PATCH 3/6] dt-bindings: mtu3: add devicetree bindings

2016-05-12 Thread chunfeng yun
On Thu, 2016-05-12 at 22:09 -0500, Rob Herring wrote: > On Thu, May 12, 2016 at 9:00 PM, chunfeng yun > wrote: > > Hi, > > > > On Thu, 2016-05-12 at 19:02 -0400, Alan Cooper wrote: > >> On Thu, May 12, 2016 at 3:24 AM, chunfeng yun > >> wrote: > >> >> > + - mediatek,enable-manual-drd : supports

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Du, Changbin
> Hi, > > "Du, Changbin" writes: > >> right, and that was my point: if we copy more to userspace, then we have > >> a real big problem. > >> > > Yes, we drop the data because we userspace buffer is not enough this time. > > The problem here is that really can we just drop it silently? Maybe not.

Re: [PATCH v3] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread John Youn
On 5/12/2016 1:56 PM, Arnd Bergmann wrote: > A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq > MIPS system unfortunately broke big-endian operation on PowerPC > APM82181 as reported by Christian Lamparter, and likely other > systems. > > It actually introduced multiple issues:

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> "Du, Changbin" writes: >> >> right, and that was my point: if we copy more to userspace, then we have >> >> a real big problem. >> >> >> > Yes, we drop the data because we userspace buffer is not enough this time. >> > The problem here is that really can we just dr