RE: [PATCH 2/2] usb: dwc2: gadget reuse ahbcfg assigned from platform

2015-02-06 Thread Kaukab, Yousaf
> -Original Message- > From: Zhangfei Gao [mailto:zhangfei@linaro.org] > Sent: Thursday, February 5, 2015 3:22 AM > To: Kaukab, Yousaf > Cc: ba...@ti.com; john.y...@synopsys.com; linux-usb@vger.kernel.org > Subject: Re: [PATCH 2/2] usb: dwc2: gadget reuse ahbcfg assigned from > platfo

Re: [PATCH 3/5] fs: remove ki_nbytes

2015-02-06 Thread Robert Baldyga
On 02/06/2015 08:03 AM, Al Viro wrote: > On Thu, Feb 05, 2015 at 10:29:42AM -0500, Alan Stern wrote: >> On Wed, 4 Feb 2015, Al Viro wrote: >> > Um... readv() is also going through ->aio_read(). Why does readv() do this but not read()? Wouldn't it make more sense to have all th

[PATCH V5 6/8] USB: f81232: clarify f81232_ioctl()

2015-02-06 Thread Peter Hung
We extract TIOCGSERIAL section in f81232_ioctl() to f81232_get_serial_info() to make it clarify The f81232_set_mctrl() replace set_control_lines() to do MCR control so we clean-up the set_control_lines() function. Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 34 ++

[PATCH V5 8/8] USB: f81232: modify/add author

2015-02-06 Thread Peter Hung
Add me to co-author and fix no '>' in greg kh's email Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 07abf0c..8799b66 100644 --- a/drivers/usb/serial/f

[PATCH V5 4/8] USB: f81232: implement set_termios

2015-02-06 Thread Peter Hung
The original driver had do not any h/w change in driver. This patch implements with configure H/W for baud/parity/word length/stop bits functional. Some init step extract to f81232_port_init(), called once with open(). And refine baudrate setting to f81232_set_baudrate() Signed-off-by: Peter Hung

[PATCH V5 2/8] USB: f81232: implement read IIR/MSR with endpoint

2015-02-06 Thread Peter Hung
The interrupt Endpoint will report current IIR. If we got IIR with MSR Changed , We will do read MSR with interrupt_work worker to do f81232_read_msr() func. Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 109 1 file changed, 100 insertio

[PATCH V5 7/8] USB: f81232: fix error in f81232_carrier_raised()

2015-02-06 Thread Peter Hung
It's should compared with UART_MSR_DCD, not UART_DCD. also we clean-up some non-used define to avoid impropriety use. Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drive

[PATCH V5 5/8] USB: f81232: implement MCR/MSR function

2015-02-06 Thread Peter Hung
This patch implement relative MCR/MSR function, such like tiocmget()/tiocmset()/dtr_rts(). The f81232_set_mctrl() replace set_control_lines() to do MCR control so we clean-up the set_control_lines() function. Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 98 +++

[PATCH V5 3/8] USB: f81232: implement RX bulk-in ep

2015-02-06 Thread Peter Hung
The F81232 bulk-in is RX data + LSR channel, data format is [LSR+Data][LSR+Data]. , We had reimplemented in this patch. Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 68 +++-- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git

[PATCH V5 1/8] USB: f81232: Rename private struct member name

2015-02-06 Thread Peter Hung
Change private struct member name from line_status to modem_status. It will store MSR for some functions used Signed-off-by: Peter Hung --- drivers/usb/serial/f81232.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81

[PATCH V5 0/8] USB: f81534: v5 patch

2015-02-06 Thread Peter Hung
This series patch V5 is improvement from V4 as following: 1. transform all function not to use private data as parameter, using usb_serial_port instead. 2. Some init step we extract it from set_term() to f81232_port_init() and run it when open port only. 3. We'll force re-read msr in tiocm

Re: [PATCH 4/4] usb: phy: add phy-hi6220

2015-02-06 Thread Peter Chen
On Thu, Feb 05, 2015 at 10:47:00PM +0800, Zhangfei Gao wrote: > Add usb phy controller for hi6220 platform > > Signed-off-by: Zhangfei Gao > --- > drivers/usb/phy/Kconfig | 9 ++ > drivers/usb/phy/Makefile | 1 + > drivers/usb/phy/phy-hi6220.c | 290 > ++

[PATCH] USB: image: use msecs_to_jiffies for time conversion

2015-02-06 Thread Nicholas Mc Guire
This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Note that the indentation is not aligned with the correct ( here due to lines going over 80 char - not sure if this is the right way t

[PATCH] USB: legotower: use msecs_to_jiffies for time conversion

2015-02-06 Thread Nicholas Mc Guire
This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Patch was only compile tested with x86_64_defconfig + CONFIG_USB_LEGOTOWER=m Patch is against 3.19.0-rc7 (localversion-next is -next-

[PATCH] usb: isp1760: use msecs_to_jiffies for time conversion

2015-02-06 Thread Nicholas Mc Guire
This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Patch was only compile tested with x86_64_defconfig + CONFIG_USB_ISP1760=m Patch is against 3.19.0-rc7 (localversion-next is -next-20

Re: [PATCH 4/4] usb: phy: add phy-hi6220

2015-02-06 Thread Zhangfei Gao
On 6 February 2015 at 16:41, Peter Chen wrote: > On Thu, Feb 05, 2015 at 10:47:00PM +0800, Zhangfei Gao wrote: >> @@ -18,6 +18,7 @@ obj-$(CONFIG_SAMSUNG_USBPHY)+= >> phy-samsung-usb.o >> obj-$(CONFIG_TWL6030_USB)+= phy-twl6030-usb.o >> obj-$(CONFIG_USB_EHCI_TEGRA)

[RFC PATCH 1/2] usb: dwc3: ep0: preparation for implementing chained TRB

2015-02-06 Thread Kishon Vijay Abraham I
No functional change. Modified few things so that there are no code duplication while implementing chained TRB. Signed-off-by: Kishon Vijay Abraham I --- drivers/usb/dwc3/ep0.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b

[RFC PATCH 2/2] usb: dwc3: Add chained TRB support for ep0

2015-02-06 Thread Kishon Vijay Abraham I
dwc3 can do only max packet aligned transfers. So in case request length is not max packet aligned and is bigger than DWC3_EP0_BOUNCE_SIZE two chained TRBs is required to handle the transfer. Signed-off-by: Kishon Vijay Abraham I --- *) Did eumeration testing with g_zero in kernel *) Similar patc

Re: [PATCH V5 6/8] USB: f81232: clarify f81232_ioctl()

2015-02-06 Thread Sergei Shtylyov
Hello. On 2/6/2015 12:46 PM, Peter Hung wrote: We extract TIOCGSERIAL section in f81232_ioctl() to f81232_get_serial_info() to make it clarify You're also changing 'ser.baud_rate' from 460800 to 115200. And explicitly overriding some previously initialized to 0 fields. The f81232_set_m

Re: [PATCH] USB: image: use msecs_to_jiffies for time conversion

2015-02-06 Thread Sergei Shtylyov
Hello. On 2/6/2015 12:50 PM, Nicholas Mc Guire wrote: This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Note that the indentation is not aligned with the correct ( here due to

[PATCH 1/3] usb: gadget: rndis: use rndis_params instead of configNr

2015-02-06 Thread Andrzej Pietrasiewicz
RNDIS function has a limitation on the number of allowed instances. So far it has been RNDIS_MAX_CONFIGS, which happens to be one. In order to eliminate this kind of arbitrary limitation we should not preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params instances but instead al

[PATCH 2/3] usb: gadget: rndis: style correction

2015-02-06 Thread Andrzej Pietrasiewicz
Don't use a space between function name and parameter list opening bracket. All other functions in this file comply wich checkpatch rules. Signed-off-by: Andrzej Pietrasiewicz --- drivers/usb/gadget/function/rndis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/

[PATCH 3/3] usb: gadget: rndis: remove the limit of available rndis connections

2015-02-06 Thread Andrzej Pietrasiewicz
RNDIS function has a limitation on the number of allowed instances. So far it has been RNDIS_MAX_CONFIGS, which happens to be one. In order to eliminate this kind of arbitrary limitation we should not preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params instances but instead al

[PATCH 0/3] Eliminate limitation on the number of RNDIS instances

2015-02-06 Thread Andrzej Pietrasiewicz
This is meant for 3.21. RNDIS function has a limitation on the number of allowed instances. So far it has been RNDIS_MAX_CONFIGS, which happens to be one. In order to eliminate this kind of arbitrary limitation we should not preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params

Re: [PATCH 2/2] usb: musb: Fix getting a generic phy for musb_dsps

2015-02-06 Thread George Cherian
Hi Tony, You also need to add similar things in dsps_musb_reset(); Otherwise you might not recover from a BABBLE condition. On 02/05/2015 10:05 PM, Tony Lindgren wrote: We still have a combination of legacy phys and generic phys in use so we need to support both types of phy for musb_dsps.c.

Re: [PATCH] USB: image: use msecs_to_jiffies for time conversion

2015-02-06 Thread Nicholas Mc Guire
On Fri, 06 Feb 2015, Sergei Shtylyov wrote: > Hello. > > On 2/6/2015 12:50 PM, Nicholas Mc Guire wrote: > >> This is only an API consolidation and should make things more readable >> it replaces var * HZ / 1000 by msecs_to_jiffies(var). > >> Signed-off-by: Nicholas Mc Guire >> --- > >> Note that

Re: [PATCH] USB: image: use msecs_to_jiffies for time conversion

2015-02-06 Thread Sergei Shtylyov
On 2/6/2015 4:36 PM, Nicholas Mc Guire wrote: This is only an API consolidation and should make things more readable it replaces var * HZ / 1000 by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire --- Note that the indentation is not aligned with the correct ( here due to lines goi

Re: [PATCH 2/2] usb: dwc2: gadget reuse ahbcfg assigned from platform

2015-02-06 Thread Zhangfei Gao
On 6 February 2015 at 16:07, Kaukab, Yousaf wrote: >> >> GAHBCFG_HBSTLEN_INCR4 << diff --git a/drivers/usb/dwc2/gadget.c >> >> b/drivers/usb/dwc2/gadget.c index 15aa578..20085de 100644 >> >> --- a/drivers/usb/dwc2/gadget.c >> >> +++ b/drivers/usb/dwc2/gadget.c >> >> @@ -2314,9 +2314,13 @@ void s3c

Re: [RFC PATCH 2/2] usb: dwc3: Add chained TRB support for ep0

2015-02-06 Thread Felipe Balbi
Hi, On Fri, Feb 06, 2015 at 05:25:35PM +0530, Kishon Vijay Abraham I wrote: > dwc3 can do only max packet aligned transfers. So in case request length > is not max packet aligned and is bigger than DWC3_EP0_BOUNCE_SIZE > two chained TRBs is required to handle the transfer. > > Signed-off-by: Kish

[PATCH] xhci: Fix the lack of support for the Handle Port Configure Error

2015-02-06 Thread Gregory CLEMENT
From: Shimmer Huang Linux xHCI driver does not check the CEC bit in register PORTSC when handling port status events. If Port Configure Error for root hub port occurs, CEC bit in PORTSC would be set by xHC and remains 1. This happends when the root port fails to configure its link partner, e.g. t

[PATCH v2] usb: dwc2: Register interrupt handler only once gadget is correctly initialized

2015-02-06 Thread Romain Perier
Don't register interrupt handler before usb gadget is correctly initialized. For some embedded platforms which don't have a usb-phy, it crashes the driver because an interrupt is emitted with non-initialized hardware. According to devm_request_irq documentation, an interrupt can be emitted at any t

Re: [PATCH 2/2] usb: musb: Fix getting a generic phy for musb_dsps

2015-02-06 Thread Bin Liu
Tony, On Fri, Feb 6, 2015 at 11:23 AM, Tony Lindgren wrote: > * George Cherian [150206 05:05]: >> Hi Tony, >> >> You also need to add similar things in dsps_musb_reset(); >> >> Otherwise you might not recover from a BABBLE condition. > > Thank I totally missed that, updated patch below. > > Do y

Re: [PATCH 2/2] usb: musb: Fix getting a generic phy for musb_dsps

2015-02-06 Thread Tony Lindgren
* George Cherian [150206 05:05]: > Hi Tony, > > You also need to add similar things in dsps_musb_reset(); > > Otherwise you might not recover from a BABBLE condition. Thank I totally missed that, updated patch below. Do you have some testcase that easily triggers BABBLE on MUSB? Regards, Ton

Re: [PATCH 2/2] usb: dwc2: gadget reuse ahbcfg assigned from platform

2015-02-06 Thread John Youn
On 2/6/2015 6:02 AM, Zhangfei Gao wrote: > On 6 February 2015 at 16:07, Kaukab, Yousaf wrote: > GAHBCFG_HBSTLEN_INCR4 << diff --git a/drivers/usb/dwc2/gadget.c > b/drivers/usb/dwc2/gadget.c index 15aa578..20085de 100644 > --- a/drivers/usb/dwc2/gadget.c > +++ b/drivers/usb/dwc2/gad

[PATCH v2 2/4] Documentation: dt-bindings: add dt binding info for hi6220

2015-02-06 Thread Zhangfei Gao
Signed-off-by: Zhangfei Gao --- .../devicetree/bindings/usb/hi6220-usb.txt | 49 ++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/hi6220-usb.txt diff --git a/Documentation/devicetree/bindings/usb/hi6220-usb.txt b/Documenta

[PATCH v2 0/4] add usb support for hi6220

2015-02-06 Thread Zhangfei Gao
v2: address comments from Sergei and Peter add hi6220_phy_setup(false) code v1: hi6220 usb controller is inherited from dwc2 add phy accordingly support otg gadget/host Zhangfei Gao (4): Documentation: dt-bindings: add dt binding info for hi6220 dwc2 Documentation: dt-bindings: add dt binding

[PATCH v2 1/4] Documentation: dt-bindings: add dt binding info for hi6220 dwc2

2015-02-06 Thread Zhangfei Gao
Add necessary dwc2 binding documentation for Hisilicon soc: hi6220 Signed-off-by: Zhangfei Gao --- Documentation/devicetree/bindings/usb/dwc2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt i

[PATCH v2 3/4] usb: dwc2: platform: add hi6220 support

2015-02-06 Thread Zhangfei Gao
Signed-off-by: Zhangfei Gao --- drivers/usb/dwc2/platform.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index ae095f0..f7c67db 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform

[PATCH v2 4/4] usb: phy: add phy-hi6220-usb

2015-02-06 Thread Zhangfei Gao
Add usb phy controller for hi6220 platform Signed-off-by: Zhangfei Gao --- drivers/usb/phy/Kconfig | 9 ++ drivers/usb/phy/Makefile | 1 + drivers/usb/phy/phy-hi6220-usb.c | 297 +++ 3 files changed, 307 insertions(+) create mode 100644 d

Re: [PATCH 3/5] fs: remove ki_nbytes

2015-02-06 Thread Al Viro
On Thu, Feb 05, 2015 at 10:29:42AM -0500, Alan Stern wrote: > On Wed, 4 Feb 2015, Al Viro wrote: > > > > > Um... readv() is also going through ->aio_read(). > > > > > > Why does readv() do this but not read()? Wouldn't it make more sense > > > to have all the read* calls use the same internal

[PATCH 4/6] gadget/function/f_fs.c: switch to ->{read,write}_iter()

2015-02-06 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/usb/gadget/function/f_fs.c | 136 - 1 file changed, 58 insertions(+), 78 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 11704e7..04c6542 100644 --- a/d

[PATCH 3/6] gadget/function/f_fs.c: use put iov_iter into io_data

2015-02-06 Thread Al Viro
From: Al Viro both on aio and non-aio sides Signed-off-by: Al Viro --- drivers/usb/gadget/function/f_fs.c | 86 +++--- 1 file changed, 25 insertions(+), 61 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index

[PATCH 5/6] gadgetfs: use-after-free in ->aio_read()

2015-02-06 Thread Al Viro
From: Al Viro AIO_PREAD requests call ->aio_read() with iovec on caller's stack, so if we are going to access it asynchronously, we'd better get ourselves a copy - the one on kernel stack of aio_run_iocb() won't be there anymore. function/f_fs.c take care of doing that, legacy/inode.c doesn't...

[PATCH 6/6] gadget: switch ep_io_operations to ->read_iter/->write_iter

2015-02-06 Thread Al Viro
From: Al Viro Signed-off-by: Al Viro --- drivers/usb/gadget/legacy/inode.c | 355 +++--- 1 file changed, 141 insertions(+), 214 deletions(-) diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 9fbbaa0..b825edc 100644 --- a/d

[PATCH 2/6] gadget/function/f_fs.c: close leaks

2015-02-06 Thread Al Viro
From: Al Viro If ffs_epfile_io() fails in AIO case, we end up leaking io_data (and iovec_copy in case of AIO read). Signed-off-by: Al Viro --- drivers/usb/gadget/function/f_fs.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs

[PATCH 1/6] new helper: dup_iter()

2015-02-06 Thread Al Viro
From: Al Viro Copy iter and kmemdup the underlying array for the copy. Returns a pointer to result of kmemdup() to be kfree()'d later. Signed-off-by: Al Viro --- include/linux/uio.h | 2 ++ mm/iov_iter.c | 15 +++ 2 files changed, 17 insertions(+) diff --git a/include/linu