RE: [PATCH] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Du, Changbin
> > > > You are right, but the problem is the request->status is wrong. If the data > > send out but report caller as -EINTR, it will introduce duplicate-send > > issue. > > > > Why -EINTR, the kernel-doc said it should return -ECONNRESET for active > request, see include/linux/usb/gadget.h. > >

Re: [PATCH] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Peter Chen
On Tue, Jan 05, 2016 at 04:09:47AM +, Du, Changbin wrote: > > > To avoid this, just dequeue the request first. After usb_ep_dequeue, the > > > request must be done or canceled. > > > > > > With this change, we can ensure no race condition in f_fs driver. But > > > actually I found some of the u

Charity/Donation

2016-01-04 Thread Skoll, Jeff
Hi, My name is Jeffrey Skoll, a philanthropist and the founder of one of the largest private foundations in the world. I believe strongly in ‘giving while living.’ I had one idea that never changed in my mind — that you should use your wealth to help people and I have decided to secretly give US

RE: [PATCH] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Du, Changbin
> > To avoid this, just dequeue the request first. After usb_ep_dequeue, the > > request must be done or canceled. > > > > With this change, we can ensure no race condition in f_fs driver. But > > actually I found some of the udc driver has analogical issue in its > > dequeue implementation. For ex

Re: [PATCH] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Peter Chen
On Tue, Dec 29, 2015 at 02:36:58PM +0800, changbin...@intel.com wrote: > From: "Du, Changbin" > > ffs_epfile_io and ffs_epfile_io_complete runs in different context, but > there is no synchronization between them. > > consider the following scenario: > 1) ffs_epfile_io interrupted by sigal while

Re: [PATCH net] r8152: add reset_resume function

2016-01-04 Thread David Miller
From: Hayes Wang Date: Mon, 4 Jan 2016 14:38:46 +0800 > When the reset_resume() is called, the flag of SELECTIVE_SUSPEND should be > cleared and reinitialize the device, whether the SELECTIVE_SUSPEND is set > or not. If reset_resume() is called, it means the power supply is cut or the > device is

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Joe Perches
On Mon, 2016-01-04 at 19:07 -0300, Geyslan G. Bem wrote: > 2016-01-04 18:52 GMT-03:00 Sergei Shtylyov : > > > > > > This patch fixes coding style issues reported by checkpatch > > > > > > concerning > > > > > > to unnecessary space after a cast. > > > > > This is a case where checkpatch is wrong,

Re: Re: [PATCH v11 0/4] Allow USB devices to remain runtime-suspended when sleeping

2016-01-04 Thread Derek Basehore
On Mon, Nov 02, 2015 at 02:50:40AM +0100, Rafael J. Wysocki wrote: > > I've queued up this series for the second half of the v4.4 merge window. > > Thanks, > Rafael > > > ___ > linux-arm-kernel mailing list > linux-arm-ker...@lists.infradead.org > htt

RE: [PATCH v5 04/11] usbip: kernel module for userspace URBs transmission

2016-01-04 Thread fx IWATA NOBUO
Dear Oliver, > You cannot honor GFP_NOIO GFP_NOIO is used in original kernel space transmission relating sk_buf. It is not used for userspace transmission. I added 'if' statement around the block to skip the block where GFP_NOIO is used for kernel space transmission. > the cleanest solution woul

[PATCH v2 2/2] usbip: single thread event handler

2016-01-04 Thread Nobuo Iwata
This patch reduces number of event handling threads to one. In existing implementation, event kernel threads are created for each port. The functions of the threads are terminationg connection and error handling. It's too expensive to have to each port. With this patch, event handler is a singl

[PATCH v2 1/2] usbip: vhci number of ports extension

2016-01-04 Thread Nobuo Iwata
This patch extends number of ports limitation in application (vhci) side. To do so, vhci driver supports multiple host controllers. The number of controllers can be specified as a module parameter 'num_controllers'. The default is 1. ex) # insmod vhci_hcd.ko num_controllers=4 Also, ports per

[PATCH v2 0/2] usbip: vhci number of ports extension

2016-01-04 Thread Nobuo Iwata
This series of patches extends number of ports limitaion in application (vhci) side. 0. Version info v2) # Added static to some functions and variables not called from other files. 1. Overview This series conatins 2 patches. 1/2: Extends number of ports using multiple host controllers.

[PATCH v6 08/11] usbip: letting connection establishment replaceable

2016-01-04 Thread Nobuo Iwata
To introduce some application protocols like WebSocket, this patch allows to substitute connection establishment and termination. In combination with previous patch, both connection and transmission can be replaced. usbip_connection_operations_t includes open and close operation. Open method r

[PATCH v6 07/11] usbip: letting send and receive replaceable

2016-01-04 Thread Nobuo Iwata
This patch allows to substitute send, receive and shutdown routines for both a) request/response PDUs among utilities and b) user space URBs transmission. usbip_sock_t is introduced instead of sockfd. it includes function pointers of send/receive/shutdown routines, an argument for the routines

[PATCH v6 06/11] usbip: readme about user space URBs transmission

2016-01-04 Thread Nobuo Iwata
Addition to README regarding user space URBs transmission. Signed-off-by: Nobuo Iwata --- tools/usb/usbip/README | 22 ++ 1 file changed, 22 insertions(+) diff --git a/tools/usb/usbip/README b/tools/usb/usbip/README index 74f4afb..6b61da5 100644 --- a/tools/usb/usbip/README

[PATCH v6 05/11] usbip: tools for userspace URBs transmission

2016-01-04 Thread Nobuo Iwata
Originally, USB/IP transmits requests and response PDUs for preparation to transfer URBs in user space, after completion of the preparation, URBs are transmitted in kernel space. To make easy to introduce application network protocols like WebSocket, the driver, usbip_ux.ko, forwards URBs to US

[PATCH v6 09/11] usbip: deriving functions as libraries

2016-01-04 Thread Nobuo Iwata
To utilize core parts of USB/IP to application protocol implementations, this patch derives libraries by exposing some functions of utilities and removing some unnecessary portions. Following functions are exposed. For command: - usbip_attach_device() - usbip_detach_port() - usbip_bind_device()

[PATCH v6 11/11] usbip: USB over WebSocket

2016-01-04 Thread Nobuo Iwata
This patch adds utilities transmit packets via WebSocket protocol. WebSocket version of utilities as following. usbws : command usbwsa : application-side daemon usbwsd : device-side daemon The command supports all sub-command (ie. list, connect, disconnect, port, bind, unbind, attach and de

[PATCH v6 10/11] usbip: added const qualifier to arguments of some functions

2016-01-04 Thread Nobuo Iwata
This patch adds 'const' qualifier to 'char*' arguments of library interfaces to make acceptable std::string.c_str(). Essentially, these qualifiers are better to be used even if not to use C++. Although, I just added to functions related to previous patch. Also, it changes C++ reserved words (ie

[PATCH v6 01/11] usbip: exporting devices

2016-01-04 Thread Nobuo Iwata
USB/IP supports a function to import USB devices from application-side machine by attach command. The usage is as following. dev:# (Physically attach your USB device.) dev:# insmod usbip-core.ko and usbip-host.ko dev:# usbipd -D // Start usbip daemon. dev:# usbip list -l // List local USB devices

[PATCH v6 04/11] usbip: kernel module for userspace URBs transmission

2016-01-04 Thread Nobuo Iwata
Originally, USB/IP transmits requests and response PDUs for preparation to transfer URBs in user space, after the preparation, URBs are transmitted in kernel space. To make easy to introduce application network protocols like WebSocket and so on, the driver, usbip_ux.ko, forwards URBs to USB/IP

[PATCH v6 02/11] usbip: readme and manuals about exporting devices

2016-01-04 Thread Nobuo Iwata
This patch adds function and usage of export to README and manuals. The wording, 'server' and 'client' is changed also. For existing attach command, the daemon runs device side machine and attach command is executed in application side machine. Then 'server' is used for device side and 'client'

[PATCH v6 03/11] usbip: safe completion against usb_kill_urb()

2016-01-04 Thread Nobuo Iwata
stub_shutdown_connection() : drivers/usb/usbip/stub_dev.c stub_device_cleanup_urbs() : drivers/usb/usbip/stub_main.c requests to kill pending URBs and clears priv lists. stub_complete() : drivers/usb/usbip/stub_tx.c might be called with URBs to have been requested to kill. To avoid kernel

[PATCH v6 00/11] usbip: features to USB over WebSocket

2016-01-04 Thread Nobuo Iwata
Dear all, This series of patches introduces WebSocket to USB/IP. 0. Version info v6) # Added __rcu annotation to a RCU pointer to clear sparse warnings. # Corrected a copy to RCU pointer with rcu_rcu_assign_pointer(). # Added __user annotations to arguments of read/write method. # Added stati

Re: [PATCH 17/17] usb: host: ehci-dbg: refactor fill_periodic_buffer function

2016-01-04 Thread Geyslan G. Bem
2016-01-04 18:01 GMT-03:00 Alan Stern : > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > >> This patch fixes a coding style issue reported by checkpatch related to >> many leading tabs, removing a 'do while' loop and making use of goto tag >> instead. > > This is highly questionable. It's a big amou

Re: [PATCH 09/17] usb: host: ehci-dbg: fix up function definitions

2016-01-04 Thread Geyslan G. Bem
2016-01-04 18:00 GMT-03:00 Alan Stern : > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > >> Functions must have the opening brace at the beginning of the next line >> and body conforming indentation. > > This isn't necessary if the function is an empty static inline void > routine. Ok. It's more relat

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Geyslan G. Bem
2016-01-04 18:52 GMT-03:00 Sergei Shtylyov : > Hello. > > On 01/05/2016 12:49 AM, Greg Kroah-Hartman wrote: > > This patch fixes coding style issues reported by checkpatch concerning > to unnecessary space after a cast. This is a case where checkpatch is wrong, IMO. Casts sh

Re: [PATCH 07/17] usb: host: ehci-dbg: fix unsigned comparison

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > 2016-01-04 17:50 GMT-03:00 Alan Stern : > > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > > > >> This patch fixes an unsigned comparison to less than 0. > > > > No, it doesn't. It changes an unsigned comparison for less than or > > equal to 0, which is ve

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Sergei Shtylyov
Hello. On 01/05/2016 12:49 AM, Greg Kroah-Hartman wrote: This patch fixes coding style issues reported by checkpatch concerning to unnecessary space after a cast. This is a case where checkpatch is wrong, IMO. Casts should always be followed by a space. I will not accept this patch. Ok. I

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Greg Kroah-Hartman
On Mon, Jan 04, 2016 at 06:40:38PM -0300, Geyslan G. Bem wrote: > 2016-01-04 17:58 GMT-03:00 Alan Stern : > > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > > > >> This patch fixes coding style issues reported by checkpatch concerning > >> to unnecessary space after a cast. > > > > This is a case wher

[PATCH 3/5] usb: f_fs: replace unnecessary goto with a return

2016-01-04 Thread Michal Nazarewicz
In ffs_epfile_io error label points to a return path which includes a kfree(data) call. However, at the beginning of the function data is always NULL so some of the early ‘goto error’ can safely be replaced with a trivial return statement. Signed-off-by: Michal Nazarewicz --- drivers/usb/gadget

[PATCH 5/5] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Michal Nazarewicz
From: "Du, Changbin" ffs_epfile_io and ffs_epfile_io_complete runs in different context, but there is no synchronization between them. consider the following scenario: 1) ffs_epfile_io interrupted by sigal while wait_for_completion_interruptible 2) then ffs_epfile_io set ret to -EINTR 3) just be

[PATCH 1/5] usb: f_fs: fix memory leak when ep changes during transfer

2016-01-04 Thread Michal Nazarewicz
In the ffs_epfile_io function, data buffer is allocated for non-halt requests. Later, after grabing a mutex, the function checks that epfile->ep is still ep and if it’s not, it set ret to -ESHUTDOWN and follow a path including spin_unlock_irq (just after ‘ret = -ESHUTDOWN’), mutex_unlock (after if

[PATCH 2/5] usb: f_fs: fix ffs_epfile_io returning success on req alloc failure

2016-01-04 Thread Michal Nazarewicz
In the AIO path, if allocating of a request failse, the function simply goes to the error_lock path whose end result is returning value of ret. However, at this point ret’s value is zero (assigned as return value from ffs_mutex_lock). Fix by adding ‘ret = -ENOMEM’ statement. Signed-off-by: Michal

[PATCH 4/5] usb: f_fs: refactor ffs_epfile_io

2016-01-04 Thread Michal Nazarewicz
Eliminate one of the return paths by using a ‘goto error_mutex’ and rearrange some if-bodies which results in reduction of the indention level and thus hopefully makes the function easier to read and reason about. Signed-off-by: Michal Nazarewicz --- drivers/usb/gadget/function/f_fs.c | 127

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Geyslan G. Bem
2016-01-04 17:58 GMT-03:00 Alan Stern : > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > >> This patch fixes coding style issues reported by checkpatch concerning >> to unnecessary space after a cast. > > This is a case where checkpatch is wrong, IMO. Casts should always be > followed by a space. I

Re: [PATCH 07/17] usb: host: ehci-dbg: fix unsigned comparison

2016-01-04 Thread Geyslan G. Bem
2016-01-04 17:50 GMT-03:00 Alan Stern : > On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > >> This patch fixes an unsigned comparison to less than 0. > > No, it doesn't. It changes an unsigned comparison for less than or > equal to 0, which is very different from less than 0. You're right. The stateman

Re: [linux-sunxi] Re: [PATCH v2 1/3] reset: Add shared reset_control_[de]assert variants

2016-01-04 Thread Michal Suchanek
On 4 January 2016 at 21:39, Philipp Zabel wrote: > Am Samstag, den 19.12.2015, 11:55 +0100 schrieb Hans de Goede: >> On 18-12-15 12:08, Maxime Ripard wrote: >> > - If the reset line is in a !exclusive use with more than 1 user, >> >the refcount is modified and an error is returned to

Re: [PATCH 17/17] usb: host: ehci-dbg: refactor fill_periodic_buffer function

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > This patch fixes a coding style issue reported by checkpatch related to > many leading tabs, removing a 'do while' loop and making use of goto tag > instead. This is highly questionable. It's a big amount of code churn, nearly impossible to verify vi

Re: [PATCH 09/17] usb: host: ehci-dbg: fix up function definitions

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > Functions must have the opening brace at the beginning of the next line > and body conforming indentation. This isn't necessary if the function is an empty static inline void routine. Alan Stern > This patch also reduces qh_lines() header definition

Re: [PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > This patch fixes coding style issues reported by checkpatch concerning > to unnecessary space after a cast. This is a case where checkpatch is wrong, IMO. Casts should always be followed by a space. I will not accept this patch. This must be somethi

Re: [PATCH 07/17] usb: host: ehci-dbg: fix unsigned comparison

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Geyslan G. Bem wrote: > This patch fixes an unsigned comparison to less than 0. No, it doesn't. It changes an unsigned comparison for less than or equal to 0, which is very different from less than 0. > Signed-off-by: Geyslan G. Bem > --- > > Notes: > I'm not sure abo

Re: [linux-sunxi] Re: [PATCH v2 1/3] reset: Add shared reset_control_[de]assert variants

2016-01-04 Thread Philipp Zabel
Am Samstag, den 19.12.2015, 11:55 +0100 schrieb Hans de Goede: > On 18-12-15 12:08, Maxime Ripard wrote: [...] > > I guess we could also have something like this: > > > >* The driver gets the reference to the reset line using > > reset_control_get or its shared variant. > > > > - If y

Re: [PATCH] usb: f_fs: avoid race condition with ffs_epfile_io_complete

2016-01-04 Thread Michal Nazarewicz
On Tue, Dec 29 2015, changbin...@intel.com wrote: > From: "Du, Changbin" > > ffs_epfile_io and ffs_epfile_io_complete runs in different context, but > there is no synchronization between them. > > consider the following scenario: > 1) ffs_epfile_io interrupted by sigal while > wait_for_completion_

[PATCH 08/17] usb: host: ehci-dbg: remove unnecessary space after cast

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to unnecessary space after a cast. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.

[PATCH 03/17] usb: host: ehci-dbg: use C89-style comments

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch. Coding style demands usage of C89-style comments and a specific format when it's multiline. This also removes the Free Software Foundation address because FSF can change it again. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/eh

[PATCH 02/17] usb: host: ehci-dbg: remove space before open square bracket

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch. The only change in this patch that isn't just removing spaces before opening square brackets is at line 213 where the initialization of fls_strings[] is placed in same line. Signed-off-by: Geyslan G. Bem --- Notes: Before this patc

[PATCH 01/17] usb: host: ehci-dbg: remove space before open parenthesis

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch. The vast majority of changes in this patch are removing spaces before opening parenthesis, but in some cases, a few additional changes are made to fix other coding style issues. These additional changes are: - Spaces around >> on line

[PATCH 07/17] usb: host: ehci-dbg: fix unsigned comparison

2016-01-04 Thread Geyslan G. Bem
This patch fixes an unsigned comparison to less than 0. Signed-off-by: Geyslan G. Bem --- Notes: I'm not sure about that comparison because in qh_lines() temp receives the snprintf() return and thereafter occurs this comparison: if (size < temp) temp = size;

[PATCH 06/17] usb: host: ehci-dbg: put spaces around operators

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to missing spaces around operators. There is an additional change on line 49 that removes unnecessary parenthesis around ternary operands. Signed-off-by: Geyslan G. Bem --- Notes: Tested by compilation only. drivers/us

[PATCH 05/17] usb: host: ehci-dbg: fix up closing parenthesis

2016-01-04 Thread Geyslan G. Bem
This patch puts the closing parenthesis at the statement end removing unnecessary "new line". Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c i

[PATCH 11/17] usb: host: ehci-dbg: convert macro to inline function

2016-01-04 Thread Geyslan G. Bem
This patch converts macros into inline functions since the usage of second is encouraged by Coding Style instead of the first. Macros converted to functions: - dbg_status - dbg_cmd - dbg_port - speed_char The size after changes remains the same. Before: text data bss dec hex filename 369

[PATCH 16/17] usb: host: ehci-dbg: prefer kmalloc_array over kmalloc times size

2016-01-04 Thread Geyslan G. Bem
This patch fixes a coding style issue reported by checkpatch related to kmalloc_array usage. On same line the sizeof operand was enclosed by parenthesis. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH 10/17] usb: host: ehci-dbg: use a blank line after struct declarations

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to missing line after struct declarations. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index a

[PATCH 13/17] usb: host: ehci-dbg: remove blank line before close brace

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issue reported by checkpatch concerning to an unnecessary line before close brace. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index a42b05

[PATCH 12/17] usb: host: ehci-dbg: add blank line after declarations

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to missing line after variable declarations. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index db

[PATCH 14/17] usb: host: ehci-dbg: replace sizeof operand

2016-01-04 Thread Geyslan G. Bem
This patch fixes a coding style issue reported by checkpatch concerning to usage of sizeof operand as a variable instead the type. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drive

[PATCH 17/17] usb: host: ehci-dbg: refactor fill_periodic_buffer function

2016-01-04 Thread Geyslan G. Bem
This patch fixes a coding style issue reported by checkpatch related to many leading tabs, removing a 'do while' loop and making use of goto tag instead. Others changes in this patch are: - Some multiline statements are reduced (718, 729, 780, 786, 790). - A constant is moved to right on line 7

[PATCH 15/17] usb: host: ehci-dbg: enclose conditional blocks with braces

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to conditional blocks without braces. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/e

[PATCH 09/17] usb: host: ehci-dbg: fix up function definitions

2016-01-04 Thread Geyslan G. Bem
Functions must have the opening brace at the beginning of the next line and body conforming indentation. This patch also reduces qh_lines() header definition to two lines. Signed-off-by: Geyslan G. Bem --- drivers/usb/host/ehci-dbg.c | 44 +--- 1 file cha

[PATCH 04/17] usb: host: ehci-dbg: move trailing statements to next line

2016-01-04 Thread Geyslan G. Bem
This patch fixes coding style issues reported by checkpatch concerning to switch case statements. There are few additional changes made to fix other coding styles issues. These additional changes are: - The compound statement "({...})" on line 474 is pulled out from snprintf parameters. - O

Re: [PATCH 1/3] usb: musb: core: call init and shutdown for the usb phy

2016-01-04 Thread Felipe Balbi
Hi, Bin Liu writes: > Hi, > > On Mon, Jan 4, 2016 at 12:22 PM, Felipe Balbi wrote: >> >> Hi, >> >> Bin Liu writes: >>> Hi, >>> >>> On Fri, Dec 18, 2015 at 5:02 AM, Uwe Kleine-König >>> wrote: The phy's init routine must be called before it can be used. Do so in musb_init_controller

[PATCH v2 1/4] USB: mxu11x0: fix memory leak on usb_serial private data

2016-01-04 Thread Mathieu OTHACEHE
On nominal execution, private data allocated on port_probe and attach are never freed. Add port_remove and release callbacks to free them respectively. Signed-off-by: Mathieu OTHACEHE --- Changes in v2: * Move release callback after attach callback drivers/usb/serial/mxu11x0.c | 20 +++

[PATCH v2 0/4] USB: mxu11x0: fixes and follow ups

2016-01-04 Thread Mathieu OTHACEHE
Hi, Here are the follow up commits proposed during last Johan review of the new mxu11x0 driver. I also patched a memory leak on usb_serial private data. In v2, I fixed the trivial issues reported by Johan in commits 1/4 and 4/4. About commit 2/4, I was wrong in last cover-letter message. The exac

[PATCH v2 3/4] USB: mxu11x0: remove duplicated set_termios call

2016-01-04 Thread Mathieu OTHACEHE
The function mxu1_set_termios is called twice in open callback. Only the first call is necessary. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/mxu11x0.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/serial/mxu11x0.c b/drivers/usb/serial/mxu11x0.c index 7ad2727..6326

[PATCH v2 2/4] USB: mxu11x0: clean device control commands

2016-01-04 Thread Mathieu OTHACEHE
Sending OPEN and START commands twice is not necessary for this driver. Also send STOP command at close. Signed-off-by: Mathieu OTHACEHE --- Changes in v2: * Only remove OPEN_PORT and START_PORT in open callback. drivers/usb/serial/mxu11x0.c | 21 +++-- 1 file changed, 7 insert

[PATCH v2 4/4] USB: mxu11x0: move firmware download and endpoint testing to probe callback

2016-01-04 Thread Mathieu OTHACEHE
Move interrupt in endpoint test and firmware download to a new probe callback. This avoids unnecessary memory allocations done by core before port_probe callback is called. If the device has to be reseted (firmware downloaded) or if the interface is incorrect (no interrupt in endpoint), the probe

Re: [PATCH] cdc_acm: blacklist Samsung Phones in firmware update mode

2016-01-04 Thread Dan Williams
On Mon, 2016-01-04 at 12:32 +0700, Lars Melin wrote: > On 2016-01-04 05:00, Jose Alonso wrote: > > > > The program Heimdall (http://glassechidna.com.au/heimdall) is used > > to flash a new firmware in Samsung Mobile Phones. It uses only the > > library libusb to access the device. > > > > The mod

Re: [PATCH 1/3] usb: musb: core: call init and shutdown for the usb phy

2016-01-04 Thread Bin Liu
Hi, On Mon, Jan 4, 2016 at 12:22 PM, Felipe Balbi wrote: > > Hi, > > Bin Liu writes: >> Hi, >> >> On Fri, Dec 18, 2015 at 5:02 AM, Uwe Kleine-König >> wrote: >>> The phy's init routine must be called before it can be used. Do so in >>> musb_init_controller and the matching shutdown in musb_remo

Re: [PATCH 1/3] usb: musb: core: call init and shutdown for the usb phy

2016-01-04 Thread Felipe Balbi
Hi, Bin Liu writes: > Hi, > > On Fri, Dec 18, 2015 at 5:02 AM, Uwe Kleine-König > wrote: >> The phy's init routine must be called before it can be used. Do so in >> musb_init_controller and the matching shutdown in musb_remove. >> >> Signed-off-by: Uwe Kleine-König >> --- >> Note I'm not entir

Re: [PATCH 1/3] usb: musb: core: call init and shutdown for the usb phy

2016-01-04 Thread Bin Liu
Hi, On Fri, Dec 18, 2015 at 5:02 AM, Uwe Kleine-König wrote: > The phy's init routine must be called before it can be used. Do so in > musb_init_controller and the matching shutdown in musb_remove. > > Signed-off-by: Uwe Kleine-König > --- > Note I'm not entirely sure this is the right place, bu

Re: [PATCH] cdc_acm: blacklist Samsung Phones in firmware update mode

2016-01-04 Thread Jose Alonso
On Mon, 2016-01-04 at 18:23 +0100, Oliver Neukum wrote: > On Mon, 2016-01-04 at 23:06 +0700, Lars Melin wrote: > > On 2016-01-04 13:43, Oliver Neukum wrote: > > > On Mon, 2016-01-04 at 12:32 +0700, Lars Melin wrote: > > K > > > > > > > > 04e8:6601 is also used for Samsung SCH-U209 CDMA modem so ca

Re: [PATCH] cdc_acm: blacklist Samsung Phones in firmware update mode

2016-01-04 Thread Oliver Neukum
On Mon, 2016-01-04 at 23:06 +0700, Lars Melin wrote: > On 2016-01-04 13:43, Oliver Neukum wrote: > > On Mon, 2016-01-04 at 12:32 +0700, Lars Melin wrote: > K > >> > >> 04e8:6601 is also used for Samsung SCH-U209 CDMA modem so can not be > >> ignored. > >> 04e8:685d is an update mode id so it can be

Re: [PATCH] cdc_acm: blacklist Samsung Phones in firmware update mode

2016-01-04 Thread Lars Melin
On 2016-01-04 13:43, Oliver Neukum wrote: On Mon, 2016-01-04 at 12:32 +0700, Lars Melin wrote: K 04e8:6601 is also used for Samsung SCH-U209 CDMA modem so can not be ignored. 04e8:685d is an update mode id so it can be ignored by cdc-acm. 04e8:68c3 does not look like update mode, it has cdc-ac

Re: [PATCH v2] ehci-hcd: Disable memory-write-invalidate when the driver is removed

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Jia-Ju Bai wrote: > The driver calls pci_set_mwi to enable memory-write-invalidate when it > is initialized, but does not call pci_clear_mwi when it is removed. Many > other drivers calls pci_clear_mwi when pci_set_mwi is called, such as > r8169, 8139cp and e1000. > > This

Re: [PATCH v2] ehci-hcd: Cleanup memory resources when ehci_halt fails

2016-01-04 Thread Alan Stern
On Mon, 4 Jan 2016, Jia-Ju Bai wrote: > The driver calls ehci_mem_init to allocate memory resources. > But these resources are not freed when ehci_halt fails. > > This patch adds "ehci_mem_cleanup" in error handling code to fix this problem. > > Signed-off-by: Jia-Ju Bai > --- > drivers/usb/h

Re: [PATCH v2 RESEND] usb: Use memdup_user to reuse the code

2016-01-04 Thread Dan Carpenter
On Wed, Dec 30, 2015 at 09:15:55AM +, Pathak, Rahul (R.) wrote: > Hello Greg, > > This patch is not yet merged, its already been reviewed and acked by Alan. > Relax. Everyone is on vacation. This stuff is not life or death that it must be done right away. regards, dan carpenter -- To uns

Re: ftdi_sio bug: setting two custom baud rates in a row fails

2016-01-04 Thread Johan Hovold
On Sun, Jan 03, 2016 at 06:11:07PM -0500, Edwin Olson wrote: > Hi Johan et al, > > Now that I understand the behavior, and know how to work-around the > issue, I won't press too hard for functionality changes. But perhaps > the documentation can be improved by suggesting that the custom > divisor

Re: [PATCH] usb: serial: return -ENODEV if disconnected during TIOCMIWAIT

2016-01-04 Thread Oliver Neukum
On Mon, 2016-01-04 at 12:06 +0100, Johan Hovold wrote: > Now, we could extend this long-since established behaviour, but I'm > not > sure it's worth it given that any further calls using the hung up tty > device will also return with errno set to -EIO by the tty layer. And > this we can't easily ch

Re: [PATCH] usb: serial: return -ENODEV if disconnected during TIOCMIWAIT

2016-01-04 Thread Johan Hovold
On Mon, Jan 04, 2016 at 09:09:55AM +0100, Oliver Neukum wrote: > On Sun, 2016-01-03 at 17:22 +0100, Johan Hovold wrote: > > On Mon, Dec 21, 2015 at 02:17:22PM +0100, Oliver Neukum wrote: > > > Disconnecting a device is not just a hang up. The device is gone. > > > We should tell user space the trut

Re: [PATCH] usb: serial: return -ENODEV if disconnected during TIOCMIWAIT

2016-01-04 Thread Oliver Neukum
On Sun, 2016-01-03 at 17:22 +0100, Johan Hovold wrote: > On Mon, Dec 21, 2015 at 02:17:22PM +0100, Oliver Neukum wrote: > > Disconnecting a device is not just a hang up. The device is gone. > > We should tell user space the truth immediately. > > I'm not sure about this one. The usb-serial drivers

[PATCH v2] ehci-hcd: Disable memory-write-invalidate when the driver is removed

2016-01-04 Thread Jia-Ju Bai
The driver calls pci_set_mwi to enable memory-write-invalidate when it is initialized, but does not call pci_clear_mwi when it is removed. Many other drivers calls pci_clear_mwi when pci_set_mwi is called, such as r8169, 8139cp and e1000. This patch adds a function "ehci_pci_remove" to remove t

[PATCH v2] ehci-hcd: Cleanup memory resources when ehci_halt fails

2016-01-04 Thread Jia-Ju Bai
The driver calls ehci_mem_init to allocate memory resources. But these resources are not freed when ehci_halt fails. This patch adds "ehci_mem_cleanup" in error handling code to fix this problem. Signed-off-by: Jia-Ju Bai --- drivers/usb/host/ehci-hcd.c |4 +++- 1 file changed, 3 insertion