Re: Chipidea usb otg support for IMX/MXS (device functionality)

2013-06-21 Thread Marek Vasut
Hi, > Dear Michael Grzeschik, > > > Hi Marek, > > > > On Fri, Jun 21, 2013 at 01:26:10PM +0200, Marek Vasut wrote: > > > Hi, > > > > > > > Hi, > > > > > > > > On Wed, May 29, 2013 at 08:07:55AM +, Chen Peter-B29397 wrote: > > > > > > Indeed, I've been using the patchset "Add tested id swit

Re: [PATCH 0/9] usb: gadget/uvc: stability and usability fixes

2013-06-21 Thread Laurent Pinchart
Hi Michael, On Tuesday 18 June 2013 17:12:53 Michael Grzeschik wrote: > On Tue, Jun 04, 2013 at 05:08:19PM +0200, Michael Grzeschik wrote: > > Hi, > > > > this series is fixing some stability and usability issues found with the > > usb uvc-gadget. It's needed to make the device usable as an v4l2s

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Sat, Jun 22, 2013 at 1:42 AM, Alan Stern wrote: > On Sat, 22 Jun 2013, Ming Lei wrote: > >> On Sat, Jun 22, 2013 at 12:45 AM, Alan Stern >> wrote: >> >> Sorry, could you explain why that won't work? I understand the URBs >> >> with maxp-unaligned length still can be completed. >> > >> > Suppo

Re: [RFC PATCH v1 5/6] USB: EHCI: improve interrupt qh unlink

2013-06-21 Thread Alan Stern
On Thu, 20 Jun 2013, Ming Lei wrote: > IMO, there is no any side effect when we change the state to > QH_STATE_UNLINK_WAIT and later change back to QH_STATE_LINKED > later under this situation. I don't like the idea of changing an invariant. > The reason why I use QH_STATE_UNLINK_WAIT here is fo

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Sat, 22 Jun 2013, Ming Lei wrote: > On Sat, Jun 22, 2013 at 12:45 AM, Alan Stern > wrote: > >> Sorry, could you explain why that won't work? I understand the URBs > >> with maxp-unaligned length still can be completed. > > > > Suppose the SG list has two elements, where the first element's le

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Denis V. Lunev wrote: > Alan, > > simple stupid question. Does [v2] patch description is good or I should > re-write it like >689d6eac (USB: UHCI: add native scatter-gather support(v1)) It would be better to change the patch title. The problem isn't related to alignmen

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Sat, Jun 22, 2013 at 12:45 AM, Alan Stern wrote: >> Sorry, could you explain why that won't work? I understand the URBs >> with maxp-unaligned length still can be completed. > > Suppose the SG list has two elements, where the first element's length > is 1000 (not a multiple of 64) and the secon

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Denis V. Lunev
On 6/21/13 7:19 PM, Alan Stern wrote: On Fri, 21 Jun 2013, Konstantin Filatov wrote: Your patch skips a chunk of data to transfer. This is a corruption of data. It's unacceptable. We can return an error code if we treat the request as malformed, but we can't transfer data selectively. I agree

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Sat, Jun 22, 2013 at 12:36 AM, Alan Stern wrote: > > No, they won't. pktsze gets reinitialized each time through the loop. You are right, the pktsze will get reinitialized, then there is a short packet in the middle of transfer, so it violates the above description of USB spec which only allo

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Sat, 22 Jun 2013, Ming Lei wrote: > On Sat, Jun 22, 2013 at 12:13 AM, Alan Stern > wrote: > > On Fri, 21 Jun 2013, Ming Lei wrote: > > > > I'm not sure what you mean. Do you mean that usb_sg_init() should fail > > if the SG element length isn't a multiple of the maxpacket size? That > > pro

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Sat, 22 Jun 2013, Ming Lei wrote: > On Sat, Jun 22, 2013 at 12:08 AM, Alan Stern > wrote: > > On Fri, 21 Jun 2013, Ming Lei wrote: > >> But the patch violates USB spec, doesn't it? > > > > No, the client driver violates the kernel's requirements by submitting > > an SG transfer that can't be

Re: [PATCH V2 5/6] USB: OHCI: make ohci-at91 a separate driver

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Manjunath Goudar wrote: > On 20 June 2013 22:23, Alan Stern wrote: > > > On Thu, 20 Jun 2013, Manjunath Goudar wrote: > > > > > > > @@ -686,7 +631,7 @@ ohci_hcd_at91_drv_suspend(struct platform_device > > > > *pdev, pm_message_t mesg) > > > > >* REVISIT: some boards

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Sat, Jun 22, 2013 at 12:13 AM, Alan Stern wrote: > On Fri, 21 Jun 2013, Ming Lei wrote: > > I'm not sure what you mean. Do you mean that usb_sg_init() should fail > if the SG element length isn't a multiple of the maxpacket size? That > probably will break wireless USB. > > Do you mean that u

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Sat, Jun 22, 2013 at 12:08 AM, Alan Stern wrote: > On Fri, 21 Jun 2013, Ming Lei wrote: >> But the patch violates USB spec, doesn't it? > > No, the client driver violates the kernel's requirements by submitting > an SG transfer that can't be carried out. Although it probably isn't > documented

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Ming Lei wrote: > On Fri, Jun 21, 2013 at 11:19 PM, Alan Stern > wrote: > > On Fri, 21 Jun 2013, Konstantin Filatov wrote: > > > >> > --- a/drivers/usb/host/uhci-q.c > >> > +++ b/drivers/usb/host/uhci-q.c > >> > @@ -977,6 +977,9 @@ static int uhci_submit_common(struct uhci_h

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 10:48 PM, Alan Stern wrote: > > Come to think of it, this shouldn't be a problem. Drivers _must_ > insure that all their URBs have completed before their disconnect > routine returns; otherwise the completion handler could get called > after the driver has been unloaded fr

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Ming Lei wrote: > On Fri, Jun 21, 2013 at 11:19 PM, Alan Stern > wrote: > > On Fri, 21 Jun 2013, Konstantin Filatov wrote: > > > >> > --- a/drivers/usb/host/uhci-q.c > >> > +++ b/drivers/usb/host/uhci-q.c > >> > @@ -977,6 +977,9 @@ static int uhci_submit_common(struct uhci_h

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 11:19 PM, Alan Stern wrote: > On Fri, 21 Jun 2013, Konstantin Filatov wrote: > >> > --- a/drivers/usb/host/uhci-q.c >> > +++ b/drivers/usb/host/uhci-q.c >> > @@ -977,6 +977,9 @@ static int uhci_submit_common(struct uhci_hcd *uhci, >> > struct urb *urb, >> > for (;

[PATCH] jacinto6 : usb3_phy: Updated dpll M,N values.

2013-06-21 Thread Ruchika Kharwar
Addition of the M and N recommended values for the USB3 PHY DPLL. Sysclk for DRA7xx is 20MHz. This yields: Clk = 20MHz * M/(N+1) = 20MHz * 1000 /(7+1) = 2.5 Ghz Signed-off-by: Nikhil Devshatwar Signed-off-by: Ruchika Kharwar --- drivers/usb/phy/phy-omap-usb3.c |7 ++- 1 file changed, 6

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 11:19 PM, Alan Stern wrote: > On Fri, 21 Jun 2013, Konstantin Filatov wrote: > >> > --- a/drivers/usb/host/uhci-q.c >> > +++ b/drivers/usb/host/uhci-q.c >> > @@ -977,6 +977,9 @@ static int uhci_submit_common(struct uhci_hcd *uhci, >> > struct urb *urb, >> > for (;

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 10:23 PM, Konstantin Filatov wrote: > On 06/21/2013 05:47 PM, Ming Lei wrote: >> >> The bug can be easily reproduced with Gadget Zero in full_speed mode >> connected to a host with UHCI controller by the standard test from >> tools/usb/ with command line >>testusb -a -t

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Konstantin Filatov wrote: > > --- a/drivers/usb/host/uhci-q.c > > +++ b/drivers/usb/host/uhci-q.c > > @@ -977,6 +977,9 @@ static int uhci_submit_common(struct uhci_hcd *uhci, > > struct urb *urb, > > for (;;) { /* Allow zero length packets */ > >

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Alan Stern
On Fri, 21 Jun 2013, Ming Lei wrote: > On Fri, Jun 21, 2013 at 5:20 PM, Oliver Neukum wrote: > > > > This is highly problematic. It is bound to cause resource leaks. > > > >> called. The situation might happen when driver->remove() doesn't > >> kill the URBs with the patch applied. > > > > Well,

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Konstantin Filatov
On 06/21/2013 05:47 PM, Ming Lei wrote: The bug can be easily reproduced with Gadget Zero in full_speed mode connected to a host with UHCI controller by the standard test from tools/usb/ with command line testusb -a -t 7 -c 2000 -s 4096 -v 41 I am wondering if it is a valid test, since the bui

Re: [v2] usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 8:35 PM, Denis V. Lunev wrote: > From: "Denis V. Lunev" > > From: Konstantin Filatov > > The following commit > commit 689d6eacd1b7c3677bfe6ee367766f21c3c80e26 > Author: Ming Lei > Date: Thu Sep 30 20:32:44 2010 +0800 > > USB: UHCI: add native scatter-gather

Re: Chipidea usb otg support for IMX/MXS (device functionality)

2013-06-21 Thread Marek Vasut
Dear Michael Grzeschik, > Hi Marek, > > On Fri, Jun 21, 2013 at 01:26:10PM +0200, Marek Vasut wrote: > > Hi, > > > > > Hi, > > > > > > On Wed, May 29, 2013 at 08:07:55AM +, Chen Peter-B29397 wrote: > > > > > Indeed, I've been using the patchset "Add tested id switch and vbus > > > > > conne

Re: usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Sergei Shtylyov
Hello. On 21-06-2013 15:00, Denis V. Lunev wrote: From: Konstantin Filatov Commit 689d6eac Please also specify that commit's summary line in parens. introduced an implementation of scatter-gather list for UHCI. This implementation has a bug in case when a non-last sg element was not

Re: Chipidea usb otg support for IMX/MXS (device functionality)

2013-06-21 Thread Michael Grzeschik
Hi Marek, On Fri, Jun 21, 2013 at 01:26:10PM +0200, Marek Vasut wrote: > Hi, > > > Hi, > > > > On Wed, May 29, 2013 at 08:07:55AM +, Chen Peter-B29397 wrote: > > > > Indeed, I've been using the patchset "Add tested id switch and vbus > > > > connect detect support for Chipidea" from Peter fo

[PATCH v5] usb: dwc3: use extcon fwrk to receive connect/disconnect

2013-06-21 Thread Kishon Vijay Abraham I
Modified dwc3-omap to receive connect and disconnect notification using extcon framework. Also did the necessary cleanups required after adapting to extcon framework. Signed-off-by: Kishon Vijay Abraham I Acked-by: Felipe Balbi Acked-by: Chanwoo Choi --- This patch should be applied after all o

Re: Chipidea usb otg support for IMX/MXS (device functionality)

2013-06-21 Thread Marek Vasut
Hi, > Hi, > > On Wed, May 29, 2013 at 08:07:55AM +, Chen Peter-B29397 wrote: > > > Indeed, I've been using the patchset "Add tested id switch and vbus > > > connect detect support for Chipidea" from Peter for quite some time on > > > top of 3.9 and it works like a charm for the gadget mode on

usb: UHCI: fix pkt size in TD for a non-aligned sg element

2013-06-21 Thread Denis V. Lunev
From: Konstantin Filatov Commit 689d6eac introduced an implementation of scatter-gather list for UHCI. This implementation has a bug in case when a non-last sg element was not aligned by TD's max-pkt-size. This bug was latent till commit 2851784f which initializes sg_table and enables using the

[PATCH] usb: phy: msm: Move mach depndend code to platform data

2013-06-21 Thread Ivan T. Ivanov
From: "Ivan T. Ivanov" This patch fix compilation error and is an intermediate step before the addition of DeviceTree support for newer targets. Fix suggested here: https://lkml.org/lkml/2013/6/19/381 Cc: David Brown Cc: Daniel Walker Cc: Bryan Huntsman Cc: Felipe Balbi Cc: Greg Kroah-Hartma

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 5:43 PM, Ming Lei wrote: > On Fri, Jun 21, 2013 at 5:20 PM, Oliver Neukum wrote: > > Drivers may let usbcore to do that by not setting driver->soft_unbind. > > I will fix the problem in v2, one solution I thought of is to flush > the endpoint's URBs which have been added t

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 5:20 PM, Oliver Neukum wrote: > > This is highly problematic. It is bound to cause resource leaks. > >> called. The situation might happen when driver->remove() doesn't >> kill the URBs with the patch applied. > > Well, there is no good way to handle this. But we have a si

[PATCH] staging: usbip: replace pr_warning() with pr_warn()

2013-06-21 Thread navin patidar
pr_warn() is preferred over pr_warning(). Signed-off-by: navin patidar --- drivers/staging/usbip/usbip_event.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c index 82123be..64933b9 100644 --- a/dri

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Oliver Neukum
On Friday 21 June 2013 17:13:48 Ming Lei wrote: > On Fri, Jun 21, 2013 at 4:33 PM, Oliver Neukum wrote: > > On Friday 21 June 2013 09:12:38 Ming Lei wrote: > >> >> This should be enough since during remove path usbcore will wait for all > >> >> URBs' completion which is only triggered by tasklet,

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Ming Lei
On Fri, Jun 21, 2013 at 4:33 PM, Oliver Neukum wrote: > On Friday 21 June 2013 09:12:38 Ming Lei wrote: >> >> This should be enough since during remove path usbcore will wait for all >> >> URBs' completion which is only triggered by tasklet, so once all URBs are >> >> finished, the tasklet list ha

Re: [RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

2013-06-21 Thread Oliver Neukum
On Friday 21 June 2013 09:12:38 Ming Lei wrote: > >> This should be enough since during remove path usbcore will wait for all > >> URBs' completion which is only triggered by tasklet, so once all URBs are > >> finished, the tasklet list has been empty already. > > > > No, usbcore only waits until t

[PATCH] usb: host: xhci-plat: release mem region while removing module

2013-06-21 Thread George Cherian
Do a release_mem_region of the hcd resource. Without this the subsequent insertion of module fails in request_mem_region. Signed-off-by: George Cherian --- drivers/usb/host/xhci-plat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c

Re: [PATCH] jacinto6 : usb3_phy: Updated dpll M,N values.

2013-06-21 Thread George Cherian
On 5/31/2013 1:24 AM, Ruchika Kharwar wrote: Addition of the M and N recommended values for the USB3 PHY DPLL. Sysclk for DRA7xx is 20MHz. This yields: Clk = 20MHz * M/(N+1) = 20MHz * 1000 /(7+1) = 2.5 Ghz Signed-off-by: Ruchika Kharwar --- drivers/usb/phy/phy-omap-usb3.c |7 ++- 1 f