[PATCH] usb: renesas_usbhs: fixup unreadable macro

2012-10-12 Thread Kuninori Morimoto
mod.h has irq_bempsts/irq_brdysts to keep each irq status, but it was difficult to find where they were used on renesas_usbhs driver by using "grep irq_" command, since it used irq_##status macro. This patch fixup them Signed-off-by: Kuninori Morimoto --- drivers/usb/renesas_usbhs/fifo.c |

Problems with pre-installed gadget serial driver on Windows

2012-10-12 Thread Matthias Wieloch
Hello, for my device AT91SAM9263 device I use the USB serial gadget driver to communicate over a serial channel. For windows I used the linux-cdc-acm.inf file given in Documentation

Re: [PATCH 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-12 Thread Vikas Sajjan
Hi Felipe, On 11 October 2012 13:17, Felipe Balbi wrote: > > Hi, > > On Wed, Oct 10, 2012 at 07:35:47PM +0530, Vikas C Sajjan wrote: > > From: Vikas Sajjan > > > > Adding the suspend and resume funtionality to DWC3 core. > > > > Signed-off-by: Abhilash Kesavan > > Signed-off-by: Vikas C Sajjan

Re: [PATCH 1/4] usb: phy: add a new driver for usb3 phy

2012-10-12 Thread kishon
Hi Tony, On Thursday 11 October 2012 06:29 AM, Tony Lindgren wrote: Hi, * Kishon Vijay Abraham I [120919 04:32]: Added a driver for usb3 phy that handles the interaction between usb phy device and dwc3 controller. This also includes device tree support for usb3 phy driver and the documentati

Re: [PATCH] usbhid: use GFP_NOIO in reset code path

2012-10-12 Thread Jiri Kosina
On Fri, 12 Oct 2012, Ming Lei wrote: > > Keeping allowed gfp_flag inside task_struct should be one solution, and > > let that teach mm to allocate memory, see the draft idea below: > > > > diff --git a/drivers/usb/storage/transport.c > > b/drivers/usb/storage/transport.c > > index c0543c8..781447

Re: pre_reset() in bas-gigaset.c

2012-10-12 Thread Tilman Schmidt
Hi Oliver, Am 10.10.2012 20:51, schrieb Oliver Neukum: > As pre_reset() and suspend() are identical there is a problem with > resetting. > > /* kill all URBs and delayed work that might still be pending */ > usb_kill_urb(ucs->urb_ctrl); > usb_kill_urb(ucs->urb_int_in); >

[PATCH v3 1/1] usb: phy: change phy notify functions

2012-10-12 Thread Peter Chen
The patch includes both API change and caller change. The main changes like below: - add notify_suspend/notify_resume callback This let usb phy driver has the chance to change hw settings during the controller suspend/resume procedure. Besides, old parameter "port" is useless for phy notify, as

[PATCH] usb: phy: samsung: Introducing usb phy driver for hsotg

2012-10-12 Thread Praveen Paneri
platform_set_drvdata() required for driver's remove function, so adding it back. >From v6: Added TODO for phy bindings with controller Dropped platform_set_drvdata() from driver probe This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to en

Re: [PATCH 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-12 Thread Felipe Balbi
Hi, On Fri, Oct 12, 2012 at 02:29:39PM +0530, Vikas Sajjan wrote: > > > @@ -339,49 +390,9 @@ static int __devinit dwc3_core_init(struct dwc3 > > > *dwc) > > > } > > > dwc->revision = reg; > > > > > > - /* issue device SoftReset too */ > > > - timeout = jiffies + msecs_to_jiffie

Re: [PATCH 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-12 Thread kishon
Hi, On Wednesday 10 October 2012 07:35 PM, Vikas C Sajjan wrote: From: Vikas Sajjan Adding the suspend and resume funtionality to DWC3 core. Signed-off-by: Abhilash Kesavan Signed-off-by: Vikas C Sajjan CC: Doug Anderson --- drivers/usb/dwc3/core.c | 268 +---

Re: [PATCH 01/12] usbnet: introduce usbnet 3 command helpers

2012-10-12 Thread Oliver Neukum
On Thursday 11 October 2012 10:36:22 Alan Stern wrote: > It's worse than you may realize. When a SCSI disk is suspended, all of > its ancestor devices may be suspended too. Pages can't be read in from > the drive until all those ancestors are resumed. This means that all > runtime resume code p

Re: [PATCH 1/3] usb: dwc3: Add the suspend/resume functionality

2012-10-12 Thread Vikas Sajjan
Hi kishon, On 12 October 2012 16:27, kishon wrote: > Hi, > > > On Wednesday 10 October 2012 07:35 PM, Vikas C Sajjan wrote: >> >> From: Vikas Sajjan >> >> Adding the suspend and resume funtionality to DWC3 core. >> >> Signed-off-by: Abhilash Kesavan >> Signed-off-by: Vikas C Sajjan >> CC: Doug

Re: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers

2012-10-12 Thread Hans de Goede
Hi, On 10/11/2012 11:53 PM, Greg Kroah-Hartman wrote: On Thu, Oct 11, 2012 at 11:37:07PM +0200, Henrik Rydberg wrote: Hi Hans, Oh what fun (not). The best way to figure out what really is going on is to get some usb level traces. Note my first hunch is that whath you're seeing is a device fir

Re: pre_reset() in bas-gigaset.c

2012-10-12 Thread Ming Lei
On Fri, Oct 12, 2012 at 5:26 PM, Tilman Schmidt wrote: > > Good point. I'll have to think about that. > > At first sight, I can simply omit the cancel_work_sync() in > the pre_reset() case. In the worst case, the uncancelled > int_in_work() will call usb_clear_halt(), try to resubmit the > alread

Re: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers

2012-10-12 Thread Alan Stern
On Thu, 11 Oct 2012, Henrik Rydberg wrote: > From 40b70394747eea51fdd07cc8213dd6afd24b1b30 Mon Sep 17 00:00:00 2001 > From: Henrik Rydberg > Date: Thu, 11 Oct 2012 23:27:04 +0200 > Subject: [PATCH] usbdevfs: Fix broken scatter-gather transfer > > The recently introduced handling of large bulk tr

Re: USB errors, ehci testing modes

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Tim Sander wrote: > Hi Alan > > Thanks for your reply! You're welcome. > > > I have some stange errors on a arm pcm043 with internal usb phy. The log > > > is attached at the end of the mail. It would be nice if someone could > > > give me a pointer whats going wrong?. It w

Re: [alsa-devel] usb audio race at disconnect time

2012-10-12 Thread Takashi Iwai
At Thu, 11 Oct 2012 18:41:52 +0200, Takashi Iwai wrote: > > [Added Daniel and Clemens in the loop] > > At Thu, 11 Oct 2012 17:17:59 +0200, > Matthieu CASTET wrote: > > > > Hi, > > > > while doing some monkey tests on a product we found races in usb audio code > > when > > the device in unplugg

[PATCH 0/2] USB-audio disconnection race fixes

2012-10-12 Thread Takashi Iwai
Hi, these two patches are for fixing races at disconnection of USB audio devices. The first patch tries to close the race at open/close, and the next is for other PCM and mixer ops in usb-audio driver. It seems working as far as I've tested with Matthieu's test cases. thanks, Takashi -- To un

[PATCH 1/2] ALSA: PCM: Fix some races at disconnection

2012-10-12 Thread Takashi Iwai
Fix races at PCM disconnection: - while a PCM device is being opened or closed - while the PCM state is being changed without lock in prepare, hw_params, hw_free ops Signed-off-by: Takashi Iwai --- sound/core/pcm.c| 7 ++- sound/core/pcm_native.c | 16 2 files cha

[PATCH 2/2] ALSA: usb-audio: Fix races at disconnection

2012-10-12 Thread Takashi Iwai
Close some races at disconnection of a USB audio device by adding the chip->shutdown_mutex and chip->shutdown check at appropriate places. The spots to put bandaids are: - PCM prepare, hw_params and hw_free - where the usb device is accessed for communication or get speed, in mixer.c and others;

Re: usb audio device can't work when it is attached to host via usb 2.0 hub

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Elric Fu wrote: > > What is error -145 on your platform? Is it -ETIMEDOUT? > > Yes. -145 means -ETIMEOUT. > > > > >> usb core send a get configuration descriptor request, but the control > >> transfer > >> will be timeout again. > >> > >> I used the usb analyzer to capture

Re: [PATCH v3 1/1] usb: phy: change phy notify functions

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Peter Chen wrote: > @@ -4187,9 +4190,17 @@ static void hub_port_connect_change(struct usb_hub > *hub, int port1, > } > } > > + if (hcd->phy && !hdev->parent && > + !(portstatus & USB_PORT_STAT_CONNECTION)) > + usb_phy_

Re: [PATCH 1/4] usb: phy: add a new driver for usb3 phy

2012-10-12 Thread Tony Lindgren
* kishon [121012 02:10]: > Hi Tony, > > On Thursday 11 October 2012 06:29 AM, Tony Lindgren wrote: > >Hi, > > > >* Kishon Vijay Abraham I [120919 04:32]: > >>Added a driver for usb3 phy that handles the interaction between usb phy > >>device and dwc3 controller. > >> > >>This also includes devic

Re: About resume time optimization for bus resume routine

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Peter Chen wrote: > Taking EHCI controller as an example, it just needs to change ehci_bus_resume, > if there is any enabled, unsuspended port, set hcd->unsuspended_device_on_port We don't need to do that. See below. > > usb_bus_resume() can poll the port statuses to see if

Re: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers

2012-10-12 Thread Henrik Rydberg
Hi Alan, > Instead of introducing a new local variable, why not simply update > uurb->buffer? That's what we do elsewhere in the code. It seemed fragile, due to these scary lines: if (is_in && uurb->buffer_length > 0) as->userbuffer = uurb->buffer; else

Re: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers

2012-10-12 Thread Henrik Rydberg
> >>Or, the large bulk transfer actually never worked in the first place. > > Large input transfers certainly do, as they were part of my tests, but > I must admit my test cases seem to not include large output transfers > (my bad). Oh right, I should change the wording to reflect that this is fo

Re: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Henrik Rydberg wrote: > Hi Alan, > > > Instead of introducing a new local variable, why not simply update > > uurb->buffer? That's what we do elsewhere in the code. > > It seemed fragile, due to these scary lines: > > if (is_in && uurb->buffer_length > 0) >

Re: [PATCH] usbhid: use GFP_NOIO in reset code path

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Ming Lei wrote: > In fact, the error handling case may be generalized to the context > which is doing the actual IO transfer, and the change on mass storage > should be as below. We can find other similar situations too, such as > mmc thread(mmc_queue_thread). Right. But the

Re: [PATCH 01/12] usbnet: introduce usbnet 3 command helpers

2012-10-12 Thread Ming Lei
On Fri, Oct 12, 2012 at 9:51 PM, Oliver Neukum wrote: > On Thursday 11 October 2012 10:36:22 Alan Stern wrote: > >> It's worse than you may realize. When a SCSI disk is suspended, all of >> its ancestor devices may be suspended too. Pages can't be read in from >> the drive until all those ancest

Re: [PATCH 01/12] usbnet: introduce usbnet 3 command helpers

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Ming Lei wrote: > > probably easiest for the runtime PM core to use tsk_set_allowd_gfp() > > before calling any runtime_resume method. > > Yes, it might be done in usb runtime resume context because all > usb device might include a mass storage interface. But, in fact, > we c

Re: usb issue on Intel chipset: abrupt mouse movements, usb keyboard loosing key events

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Martin Vysny wrote: > usb issue: abrupt mouse movements, usb keyboard loosing key events > > After some boots, the USB mouse behaves strangely (abrupt mouse > movements), also, USB keyboard tends to loose some keypresses. This > behavior occurs randomly (I can't find out wh

Re: [PATCH 01/12] usbnet: introduce usbnet 3 command helpers

2012-10-12 Thread Alan Stern
On Fri, 12 Oct 2012, Oliver Neukum wrote: > On Thursday 11 October 2012 10:36:22 Alan Stern wrote: > > > It's worse than you may realize. When a SCSI disk is suspended, all of > > its ancestor devices may be suspended too. Pages can't be read in from > > the drive until all those ancestors are

Re: [PATCH 01/12] usbnet: introduce usbnet 3 command helpers

2012-10-12 Thread Ming Lei
On Fri, Oct 12, 2012 at 11:17 PM, Ming Lei wrote: > Suppose mutex_lock(A) is called in pre_reset(), one solution is that > always calling tsk_set_allowd_gfp(~GFP_IOFS) before each mutex_lock(A). > We can do it only for devices with storage interface in current > configuration. The problem will b

Re: usb audio race at disconnect time

2012-10-12 Thread Matthieu CASTET
Hi, Takashi Iwai a écrit : > [Added Daniel and Clemens in the loop] > > > I don't think this is needed. > > So... the below is a quick hack I did without testing at all. > Hopefully this can give some advance. Thanks for the quick patch. The patch didn't apply cleany of linus tree, of which t

Re: Hibernation with LPM, was: Re: xhci: LPM issues using Western Digital harddrive

2012-10-12 Thread Alan Stern
On Thu, 11 Oct 2012, Alan Stern wrote: > On Thu, 11 Oct 2012, Sarah Sharp wrote: > > > Thinking about this further, USB 2.1 devices need to be brought out of > > their low power link state (L1) before they are suspended. Some xHCI > > host controllers have hardware-driven USB 2.1 LPM, so the dev

Re: pre_reset() in bas-gigaset.c

2012-10-12 Thread Tilman Schmidt
Am 12.10.2012 16:17, schrieb Ming Lei: > On Fri, Oct 12, 2012 at 5:26 PM, Tilman Schmidt wrote: > >> At first sight, I can simply omit the cancel_work_sync() in >> the pre_reset() case. In the worst case, the uncancelled >> int_in_work() will call usb_clear_halt(), try to resubmit the >> already

Re: Linux xHCI driver problems (reset ep)

2012-10-12 Thread Yuliya T
Hi Alan, Thank you for the suggestion. We independently ended up with the same workaround, but still weren't happy with it. The problem is we don't want to relinquish access to the device, but to do set-interface, you have to do release interface, and t's a little strange that you are releasing

Re: pre_reset() in bas-gigaset.c

2012-10-12 Thread Ming Lei
On Sat, Oct 13, 2012 at 6:11 AM, Tilman Schmidt wrote: > > I'm not sure I understand your argument. > > There are two cases I have to worry about: > (1) a reset triggered by int_in_work() > (2) a reset triggered by some other source external to the driver > > In case (1) the current design will de