Re: [PATCH 1/2] usb: gadget/uvc: remove connect/disconnect calls on open/release

2013-05-06 Thread Laurent Pinchart
Hi Peter,

On Monday 06 May 2013 10:35:25 Peter Chen wrote:
> On Sun, May 5, 2013 at 2:22 AM, Bhupesh SHARMA wrote:

[snip]

> > The whole point of having a user-space application governing the behavior
> > of UVC webcam gadget as per commands from a UVC host is to plug the same
> > with a real video capture source driver to provide the video frames
> > captured from say a camera sensor and route the UVC specific control
> > requests to a real video capture device by converting the same to
> > equivalent V4L2 commands.
> > 
> > Let's take an example. Let's say you have a camera sensor that supports
> > capture in two modes:
> > 
> > 1. 640*480, YUV422 (default mode)
> > 2. 640*480, JPEG
> > 
> > Lets say the UVC webcam gadget suggest to the host that it supports
> > 640*480, YUV422 output by default (to be in sync with the characteristics
> > of the actual capture source).
> > 
> > Now on the Host, some user tries to open the UVC webcam appearing to him
> > as one /dev/videoX node using the CHEESE application, and he
> > tries to capture frames in MJPEG format as it is also supported by the UVC
> > webcam, no before streaming frames this control command should be routed
> > as a V4L2_S_FMT(640*480, JPEG) command to the V4L2 video capture driver.
> > This is where the user-space application comes into picture.
> > 
> > Also note that the format is selected from the Host side before the
> > streaming is started. So, you should not connect to the UDC, unless you
> > have the user-space application up and running and is present to pass
> > relevant UVC commands (after converting them to equivalent V4L2 commands)
> > to the video capture driver.
> 
> I am curious is it possible the above two things done by kernel layer eg,
> usb camera driver layer.

It might be possible, but would be pretty complex and hackish, as the V4L2 
subsystem hasn't been designed with access from kernelspace in mind. Moreover, 
capturing directly from a V4L2 device will not cover all use cases. You might 
want to build a UVC device that processes data before streaming it, or that 
even generates data in software. All this needs to be done in userspace.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: gadget/uvc: remove connect/disconnect calls on open/release

2013-05-06 Thread Laurent Pinchart
Hi Michael,

On Friday 03 May 2013 10:37:40 Michael Grzeschik wrote:
> Hi Laurent,
> 
> On Fri, May 03, 2013 at 01:20:15AM +0200, Laurent Pinchart wrote:
> [snip]
> 
> > I'm open to suggestions :-) What features of the userspace application do
> > you think could (and should) be moved to kernelspace ? Many of them are
> > highly application-specific.
> 
> All UVC_EVENTS beneath STREAMON and STREAMOFF could go into the kernelspace.
> I have seen such codepath:
> 
> [1]
> v4l2_event_queue/* kernelspace */
> v4l2_event_dequeue  /* kernelspace */
> 
> uvc_events_process_setup/* userspace */
> uvc_events_process_class/* userspace */
> uvc_events_process_streaming/* userspace */
> uvc_fill_streaming_control  /* userspace */
> 
> The codepath [1] is needed to respond with the possible supported
> streaming capabilities. That information really should come from the
> uvc_descriptor_header. We already have this information in the kernel,
> there is no need for redundancy.
> 
> [2]
> v4l2_event_queue/* kernelspace */
> v4l2_event_dequeue  /* kernelspace */
> 
> uvc_events_process_data /* userspace */
> 
> /* in case of UVC_VS_COMMIT_CONTROL */
> uvc_video_set_format/* kernelspace */
> uvc_v4l2_do_ioctl   /* kernelspace */
> 
> The codepath [2] is really odd, as we jump out of the kernel back into
> the kernel just to gather some information about the requested
> videoformat by the host. The application itself should call the ioctl
> VIDIOC_G_FMT on UVC_EVENT_STREAMON and change its videosetup likewise.

Those two code paths could indeed be moved to the kernel. I'm open to patches 
:-) One point to keep in mind is that format-specific processing (such as 
computing the dwMaxVideoFrameSize value) needs to be implemented in an 
extensible way to minimize required changes to the code when adding a new 
format.

UVC-specific control events (uvc_events_process_control), however, still need 
to be processed in userspace. The current UVC gadget application ignores them, 
but in a real product they will need to be handled to control the video 
source.

> This should be possible with gstreamer. I currently work on an derived
> version of the gstv4l2sink -> gstv4l2uvcsink to handle the uvc
> specialities.
> 
> And addressing the initial problem with the missing userspace application;
> The gadget can loose its dependency to it, if the kernel would produce dummy
> frames with the requested format and switch over to the real streaming
> data, when opened.

I'm not too fond about that. The kernel driver would need to generate dummy 
frames in all supported formats, which can easily become an issue with M(J)PEG 
formats. Then, on the host side, applications might not expect dummy frames, 
as they could mess up the application logic (especially in case of automatic 
image processing). Moreover, even if we could generate dummy frames we would 
still have an issue with controls handling.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] usb: gadget/uvc: remove connect/disconnect calls on open/release

2013-05-06 Thread Peter Chen
On Fri, May 3, 2013 at 6:13 AM, Vladimir Zapolskiy
 wrote:
> This change removes calls of uvc_function_connect()/uvc_function_disconnect()
> functions from open()/close() syscalls.
>
> This is a bugfix in g_webcam module, in some test scenarios (e.g. UDC in
> suspend mode or OTG in host mode) straightforward control of D+ pull-up
> might lead to system's misbehaviour.
>

When UDC is in suspend mode, pull-up dp is controller's behavior.
Can you give an explanation how the system will go to abnormal
when UDC in suspend mode or OTG in host mode?

> Most probably a root cause of some reported system freezes on g_webcam
> module probe [1] is related to the issue described above, for instance
> if udev's v4l_id helper opens a new V4L2 device node to query device
> capabilities.
>
> Alternatively to this chage checks may be added to UDC driver's .pullup
> functions, however presence of pullup controls from uvcvideo seems to
> be redundant.
>
> [1] http://kerneltrap.org/mailarchive/linux-usb/2010/12/29/6268355/thread
>
> Vladimir Zapolskiy (2):
>   usb: gadget/uvc: remove connect/disconnect calls on open/release
>   usb: gadget/uvc: remove connection/disconnection routines
>
>  drivers/usb/gadget/f_uvc.c|   24 
>  drivers/usb/gadget/uvc.h  |3 ---
>  drivers/usb/gadget/uvc_v4l2.c |5 -
>  3 files changed, 32 deletions(-)
>
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
BR,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Removing vestiges of CONFIG_USB_SUSPEND

2013-05-06 Thread Kevin Hilman
Hi Alan,

Alan Stern  writes:

> Felipe and Kevin:
>
> While removing the remaining usages of USB_SUSPEND (things that I
> missed in the original patch), I noticed that
> arch/arm/configs/omap2plus_defconfig does not enable PM_RUNTIME -- even
> though it currently does enable USB_SUSPEND, which depends on
> PM_RUNTIME.  Was this an oversight?

Looks like an oversight, but covered up by some other default options
in mach-omap2/Kconfig.  Specifially, config ARCH_OMAP2PLUS_TYPICAL
(default y) does a select PM_RUNTIME.

> In a little while I will submit a patch which removes USB_SUSPEND from
> that file.  You or someone else may want to write a separate patch to
> enable PM_RUNTIME.

I think we'll be covered by our current defaults.

Thanks for the heads up.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2 v6 RESEND] sierra_net: keep status interrupt URB active

2013-05-06 Thread Dan Williams
The driver and firmware sync up through SYNC messages, and the
firmware's affirmative reply to these SYNC messages appears to be the
"Reset" indication received via the status interrupt endpoint.  Thus the
driver needs the status interrupt endpoint always active so that the
Reset indication can be received even if the netdev is closed, which is
the case right after device insertion.

If the Reset indication is not received by the driver, it continues
sending SYNC messages to the firmware, which crashes about 10 seconds
later and the device stops responding.

Signed-off-by: Dan Williams 
---
 drivers/net/usb/sierra_net.c | 38 +++---
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index a923d61..a79e9d3 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -426,6 +426,13 @@ static void sierra_net_dosync(struct usbnet *dev)
 
dev_dbg(&dev->udev->dev, "%s", __func__);
 
+   /* The SIERRA_NET_HIP_MSYNC_ID command appears to request that the
+* firmware restart itself.  After restarting, the modem will respond
+* with the SIERRA_NET_HIP_RESTART_ID indication.  The driver continues
+* sending MSYNC commands every few seconds until it receives the
+* RESTART event from the firmware
+*/
+
/* tell modem we are ready */
status = sierra_net_send_sync(dev);
if (status < 0)
@@ -704,6 +711,9 @@ static int sierra_net_bind(struct usbnet *dev, struct 
usb_interface *intf)
/* set context index initially to 0 - prepares tx hdr template */
sierra_net_set_ctx_index(priv, 0);
 
+   /* prepare sync message template */
+   memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg));
+
/* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
dev->rx_urb_size  = SIERRA_NET_RX_URB_SIZE;
if (dev->udev->speed != USB_SPEED_HIGH)
@@ -739,11 +749,6 @@ static int sierra_net_bind(struct usbnet *dev, struct 
usb_interface *intf)
kfree(priv);
return -ENODEV;
}
-   /* prepare sync message from template */
-   memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg));
-
-   /* initiate the sync sequence */
-   sierra_net_dosync(dev);
 
return 0;
 }
@@ -766,8 +771,9 @@ static void sierra_net_unbind(struct usbnet *dev, struct 
usb_interface *intf)
netdev_err(dev->net,
"usb_control_msg failed, status %d\n", status);
 
-   sierra_net_set_private(dev, NULL);
+   usbnet_status_stop(dev);
 
+   sierra_net_set_private(dev, NULL);
kfree(priv);
 }
 
@@ -908,6 +914,24 @@ static const struct driver_info sierra_net_info_direct_ip 
= {
.tx_fixup = sierra_net_tx_fixup,
 };
 
+static int
+sierra_net_probe(struct usb_interface *udev, const struct usb_device_id *prod)
+{
+   int ret;
+
+   ret = usbnet_probe(udev, prod);
+   if (ret == 0) {
+   struct usbnet *dev = usb_get_intfdata(udev);
+
+   ret = usbnet_status_start(dev, GFP_KERNEL);
+   if (ret == 0) {
+   /* Interrupt URB now set up; initiate sync sequence */
+   sierra_net_dosync(dev);
+   }
+   }
+   return ret;
+}
+
 #define DIRECT_IP_DEVICE(vend, prod) \
{USB_DEVICE_INTERFACE_NUMBER(vend, prod, 7), \
.driver_info = (unsigned long)&sierra_net_info_direct_ip}, \
@@ -930,7 +954,7 @@ MODULE_DEVICE_TABLE(usb, products);
 static struct usb_driver sierra_net_driver = {
.name = "sierra_net",
.id_table = products,
-   .probe = usbnet_probe,
+   .probe = sierra_net_probe,
.disconnect = usbnet_disconnect,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
-- 
1.8.1.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2 v6 RESEND] usbnet: allow status interrupt URB to always be active

2013-05-06 Thread Dan Williams
Some drivers (sierra_net) need the status interrupt URB
active even when the device is closed, because they receive
custom indications from firmware.  Add functions to refcount
the status interrupt URB submit/kill operation so that
sub-drivers and the generic driver don't fight over whether
the status interrupt URB is active or not.

A sub-driver can call usbnet_status_start() at any time, but
the URB is only submitted the first time the function is
called.  Likewise, when the sub-driver is done with the URB,
it calls usbnet_status_stop() but the URB is only killed when
all users have stopped it.  The URB is still killed and
re-submitted for suspend/resume, as before, with the same
refcount it had at suspend.

Signed-off-by: Dan Williams 
---
NOTE: Oliver already ACK-ed this series, but Ming disagreed about the
mem_flags argument to usbnet_status_start() and consensus seems far away;
given that it's not userspace API/ABI, I'd like to see the series go in.

 drivers/net/usb/usbnet.c   | 77 ++
 include/linux/usb/usbnet.h |  5 +++
 2 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 1e5a9b7..f95cb03 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -252,6 +252,70 @@ static int init_status (struct usbnet *dev, struct 
usb_interface *intf)
return 0;
 }
 
+/* Submit the interrupt URB if not previously submitted, increasing refcount */
+int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags)
+{
+   int ret = 0;
+
+   WARN_ON_ONCE(dev->interrupt == NULL);
+   if (dev->interrupt) {
+   mutex_lock(&dev->interrupt_mutex);
+
+   if (++dev->interrupt_count == 1)
+   ret = usb_submit_urb(dev->interrupt, mem_flags);
+
+   dev_dbg(&dev->udev->dev, "incremented interrupt URB count to 
%d\n",
+   dev->interrupt_count);
+   mutex_unlock(&dev->interrupt_mutex);
+   }
+   return ret;
+}
+EXPORT_SYMBOL_GPL(usbnet_status_start);
+
+/* For resume; submit interrupt URB if previously submitted */
+static int __usbnet_status_start_force(struct usbnet *dev, gfp_t mem_flags)
+{
+   int ret = 0;
+
+   mutex_lock(&dev->interrupt_mutex);
+   if (dev->interrupt_count) {
+   ret = usb_submit_urb(dev->interrupt, mem_flags);
+   dev_dbg(&dev->udev->dev,
+   "submitted interrupt URB for resume\n");
+   }
+   mutex_unlock(&dev->interrupt_mutex);
+   return ret;
+}
+
+/* Kill the interrupt URB if all submitters want it killed */
+void usbnet_status_stop(struct usbnet *dev)
+{
+   if (dev->interrupt) {
+   mutex_lock(&dev->interrupt_mutex);
+   WARN_ON(dev->interrupt_count == 0);
+
+   if (dev->interrupt_count && --dev->interrupt_count == 0)
+   usb_kill_urb(dev->interrupt);
+
+   dev_dbg(&dev->udev->dev,
+   "decremented interrupt URB count to %d\n",
+   dev->interrupt_count);
+   mutex_unlock(&dev->interrupt_mutex);
+   }
+}
+EXPORT_SYMBOL_GPL(usbnet_status_stop);
+
+/* For suspend; always kill interrupt URB */
+static void __usbnet_status_stop_force(struct usbnet *dev)
+{
+   if (dev->interrupt) {
+   mutex_lock(&dev->interrupt_mutex);
+   usb_kill_urb(dev->interrupt);
+   dev_dbg(&dev->udev->dev, "killed interrupt URB for suspend\n");
+   mutex_unlock(&dev->interrupt_mutex);
+   }
+}
+
 /* Passes this packet up the stack, updating its accounting.
  * Some link protocols batch packets, so their rx_fixup paths
  * can return clones as well as just modify the original skb.
@@ -725,7 +789,7 @@ int usbnet_stop (struct net_device *net)
if (!(info->flags & FLAG_AVOID_UNLINK_URBS))
usbnet_terminate_urbs(dev);
 
-   usb_kill_urb(dev->interrupt);
+   usbnet_status_stop(dev);
 
usbnet_purge_paused_rxq(dev);
 
@@ -787,7 +851,7 @@ int usbnet_open (struct net_device *net)
 
/* start any status interrupt transfer */
if (dev->interrupt) {
-   retval = usb_submit_urb (dev->interrupt, GFP_KERNEL);
+   retval = usbnet_status_start(dev, GFP_KERNEL);
if (retval < 0) {
netif_err(dev, ifup, dev->net,
  "intr submit %d\n", retval);
@@ -1458,6 +1522,8 @@ usbnet_probe (struct usb_interface *udev, const struct 
usb_device_id *prod)
dev->delay.data = (unsigned long) dev;
init_timer (&dev->delay);
mutex_init (&dev->phy_mutex);
+   mutex_init(&dev->interrupt_mutex);
+   dev->interrupt_count = 0;
 
dev->net = net;
strcpy (net->name, "usb%d");
@@ -1593,7 +1659,7 @@ int usbnet_suspend (struct usb_interface *intf, 
pm_message_t message)
 */
netif_d

RE: [PATCH 04/11] USB: ehci-sead3: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Steven J. Hill
Tested and works fine. Thank you.


Acked-by: Steven J. Hill 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] option: add device IDs for Dell 5804 (Novatel E371) WWAN card

2013-05-06 Thread Dan Williams
A rebranded Novatel E371 for AT&T's LTE bands.

Cc: 
Signed-off-by: Dan Williams 
---
 drivers/usb/serial/option.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 7343728..58cbb94 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -196,6 +196,7 @@ static void option_instat_callback(struct urb *urb);
 
 #define DELL_PRODUCT_5800_MINICARD_VZW 0x8195  /* Novatel E362 */
 #define DELL_PRODUCT_5800_V2_MINICARD_VZW  0x8196  /* Novatel E362 */
+#define DELL_PRODUCT_5804_MINICARD_ATT 0x819b  /* Novatel E371 */
 
 #define KYOCERA_VENDOR_ID  0x0c88
 #define KYOCERA_PRODUCT_KPC650 0x17da
@@ -771,6 +772,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, 
/* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 
DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 
DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) },
+   { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 
DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) },
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },   /* 
ADU-E100, ADU-310 */
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
-- 
1.8.1.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 net-next] net/usb: new driver for RTL8152

2013-05-06 Thread David Miller
From: Hayes Wang 
Date: Fri, 3 May 2013 10:01:25 +0800

> Add new driver for supporting Realtek RTL8152 Based USB 2.0 Ethernet Adapters
> 
> Signed-off-by: Hayes Wang 

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: XHCI and USB 2 soundcard

2013-05-06 Thread Alan Stern
On Mon, 6 May 2013, [ISO-8859-1] Aur�lien Leblond wrote:

> Hello all,
> 
> I have two usb soundcards at home and my laptop has both EHCI and XHCI
> usb ports.
> 
> The M-Audio Fast-Track Ultra (USB 2) is not recognized by ALSA when
> plugged on a USB 3 (XHCI) port on the kernel 3.9.
> 
> I'm trying to figure out where the problem lies to report the issue to
> the proper team: is it with XHCI or with ALSA?

Neither one.  The problem is in the device.

> In dmesg, this is what happens when the FTU is plugged:
> [  107.461175] usb 3-1: new high-speed USB device number 3 using xhci_hcd
> [  107.481695] usb 3-1: config 1 interface 3 altsetting 0 bulk
> endpoint 0x7 has invalid maxpacket 8
> [  107.481705] usb 3-1: config 1 interface 3 altsetting 0 bulk
> endpoint 0x87 has invalid maxpacket 8

See those warnings?  They indicate that the device has invalid entries 
in its endpoint descriptors.  The xHCI hardware can't cope with those 
invalid entries.

> [  107.483384] usb 3-1: New USB device found, idVendor=0763, idProduct=2080
> [  107.483392] usb 3-1: New USB device strings: Mfr=1, Product=2, 
> SerialNumber=0
> [  107.483398] usb 3-1: Product: Fast Track Ultra
> [  107.483403] usb 3-1: Manufacturer: M-Audio
> [  107.483886] xhci_hcd :04:00.0: ERROR: unexpected command
> completion code 0x11.
> [  107.483899] usb 3-1: can't set config #1, error -22

This error is the result.  It prevents the system from using the 
device.

Now, the xhci-hcd driver ought to be smart enough to compensate for
mistakes like this (they are relatively common).  Does the patch below
help?

Alan Stern



Index: usb-3.9/drivers/usb/host/xhci-mem.c
===
--- usb-3.9.orig/drivers/usb/host/xhci-mem.c
+++ usb-3.9/drivers/usb/host/xhci-mem.c
@@ -1423,15 +1423,17 @@ int xhci_endpoint_init(struct xhci_hcd *
ep_ctx->ep_info2 |= cpu_to_le32(xhci_get_endpoint_type(udev, ep));
 
/* Set the max packet size and max burst */
+   max_packet = GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc));
+   max_burst = 0;
switch (udev->speed) {
case USB_SPEED_SUPER:
-   max_packet = usb_endpoint_maxp(&ep->desc);
-   ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet));
/* dig out max burst from ep companion desc */
-   max_packet = ep->ss_ep_comp.bMaxBurst;
-   ep_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(max_packet));
+   max_burst = ep->ss_ep_comp.bMaxBurst;
break;
case USB_SPEED_HIGH:
+   /* Some devices get this wrong */
+   if (usb_endpoint_xfer_bulk(&ep->desc))
+   max_packet = 512;
/* bits 11:12 specify the number of additional transaction
 * opportunities per microframe (USB 2.0, section 9.6.6)
 */
@@ -1439,17 +1441,16 @@ int xhci_endpoint_init(struct xhci_hcd *
usb_endpoint_xfer_int(&ep->desc)) {
max_burst = (usb_endpoint_maxp(&ep->desc)
 & 0x1800) >> 11;
-   ep_ctx->ep_info2 |= cpu_to_le32(MAX_BURST(max_burst));
}
-   /* Fall through */
+   break;
case USB_SPEED_FULL:
case USB_SPEED_LOW:
-   max_packet = GET_MAX_PACKET(usb_endpoint_maxp(&ep->desc));
-   ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet));
break;
default:
BUG();
}
+   ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet) |
+   MAX_BURST(max_burst));
max_esit_payload = xhci_get_max_esit_payload(xhci, udev, ep);
ep_ctx->tx_info = 
cpu_to_le32(MAX_ESIT_PAYLOAD_FOR_EP(max_esit_payload));
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/13] usb: chipidea: ci13xxx_imx: Let device core handle pinctrl

2013-05-06 Thread Fabio Estevam
Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for handling pinctrl.

So remove devm_pinctrl_get_select_default() from the driver. 

Cc: Alexander Shishkin 
Cc: 
Signed-off-by: Fabio Estevam 
---
 drivers/usb/chipidea/ci13xxx_imx.c |7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/usb/chipidea/ci13xxx_imx.c 
b/drivers/usb/chipidea/ci13xxx_imx.c
index 8c29122..7c0718e 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "ci.h"
 #include "ci13xxx_imx.h"
@@ -100,7 +99,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
struct device_node *phy_np;
struct resource *res;
struct regulator *reg_vbus;
-   struct pinctrl *pinctrl;
int ret;
 
if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL)
@@ -119,11 +117,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
return -ENOENT;
}
 
-   pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
-   if (IS_ERR(pinctrl))
-   dev_warn(&pdev->dev, "pinctrl get/select failed, err=%ld\n",
-   PTR_ERR(pinctrl));
-
data->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(data->clk)) {
dev_err(&pdev->dev,
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/7] usb: gadget: f_uac2: Remove redundant platform_set_drvdata()

2013-05-06 Thread Jassi Brar
On 6 May 2013 17:07, Sachin Kamat  wrote:
> Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
> driver is bound) removes the need to set driver data field to
> NULL.
>
> Signed-off-by: Sachin Kamat 
> Cc: Jaswinder Singh 

Acked-by: Jaswinder Singh 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] usb: phy: mxs-usb: Remove redundant platform_set_drvdata()

2013-05-06 Thread Marek Vasut
Dear Sachin Kamat,

fixing CC here

> Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
> driver is bound) removes the need to set driver data field to
> NULL.
> 
> Signed-off-by: Sachin Kamat 
> Cc: Marek Vasut 
> ---
>  drivers/usb/phy/phy-mxs-usb.c |2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
> index 9d4381e..3b64277 100644
> --- a/drivers/usb/phy/phy-mxs-usb.c
> +++ b/drivers/usb/phy/phy-mxs-usb.c
> @@ -180,8 +180,6 @@ static int mxs_phy_remove(struct platform_device *pdev)
> 
>   usb_remove_phy(&mxs_phy->phy);
> 
> - platform_set_drvdata(pdev, NULL);
> -
>   return 0;
>  }

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Bug in xhci_hcd? Related to powersave mode?

2013-05-06 Thread Keks Dose
Dear all,

I use an external 2.5'' HD for backups, filesystem is btrfs. System: openSuse 
12.3, kernel 3.8.9, but the bug ocurred earlier, at least it was present in 
12.2:

If I connect the cable to the USB 3.0 port of my notebook (Thinkpad T 420s), up 
and running KDE, the HD (as well capable of USB 3.0) is not recognized by KDE. 
The device notifier shows no device. But there is something wrong, e.g. s2ram 
no longer works.

My workaround for a long time was to suspend the notebook, connect the cable, 
wake it up and then the computer "found" the HD.

If I put the plug of the 2.5' HD into the USB 3.0 port and ask, being root:


dmesg | tail -50
...

[ 7402.732517] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 7407.720250] xhci_hcd :0d:00.0: Timeout while waiting for address device 
command
[ 7423.926379] xhci_hcd :0d:00.0: Stopped the command ring failed, maybe 
the host is dead
[ 7423.978212] xhci_hcd :0d:00.0: Host not halted after 16000 microseconds.
[ 7423.978217] xhci_hcd :0d:00.0: Abort command ring failed
[ 7423.979085] [sched_delayed] sched: RT throttling activated
[ 7423.980776] xhci_hcd :0d:00.0: HC died; cleaning up
[ 7429.168320] xhci_hcd :0d:00.0: Timeout while waiting for address device 
command
[ 7429.168337] xhci_hcd :0d:00.0: Abort the command ring, but the xHCI is 
dead.
[ 7429.368829] usb 3-1: device not accepting address 2, error -108
[ 7429.368852] hub 3-0:1.0: cannot disable port 1 (err = -19)
[ 7434.356530] xhci_hcd :0d:00.0: Timeout while waiting for a slot
[ 7434.356547] xhci_hcd :0d:00.0: Abort the command ring, but the xHCI is 
dead.
[ 7434.356575] hub 3-0:1.0: cannot reset port 1 (err = -19)
[ 7434.356588] hub 3-0:1.0: cannot disable port 1 (err = -19)
[ 7434.356597] xHCI xhci_free_dev called with unaddressed device
[ 7439.344340] xhci_hcd :0d:00.0: Timeout while waiting for a slot
[ 7439.344353] xhci_hcd :0d:00.0: Abort the command ring, but the xHCI is 
dead.
[ 7439.344376] hub 3-0:1.0: cannot reset port 1 (err = -19)
[ 7439.344384] hub 3-0:1.0: cannot disable port 1 (err = -19)
[ 7439.344390] xHCI xhci_free_dev called with unaddressed device
[ 7444.331946] xhci_hcd :0d:00.0: Timeout while waiting for a slot
[ 7444.331960] xhci_hcd :0d:00.0: Abort the command ring, but the xHCI is 
dead.
[ 7444.331982] hub 3-0:1.0: cannot reset port 1 (err = -19)
[ 7444.331990] hub 3-0:1.0: cannot disable port 1 (err = -19)
[ 7444.331997] xHCI xhci_free_dev called with unaddressed device
[ 7444.332005] hub 3-0:1.0: unable to enumerate USB device on port 1
[ 7444.332010] hub 3-0:1.0: cannot disable port 1 (err = -19)


AND:


tail /var/log/messages
2013-04-29T10:36:52.150008+02:00 linux-ik7b rtkit-daemon[2840]: Successfully 
demoted thread 2847 of process 2839 (/usr/bin/pulseaudio).
2013-04-29T10:36:52.150916+02:00 linux-ik7b rtkit-daemon[2840]: Successfully 
demoted thread 2846 of process 2839 (/usr/bin/pulseaudio).
2013-04-29T10:36:52.151957+02:00 linux-ik7b rtkit-daemon[2840]: Successfully 
demoted thread 2839 of process 2839 (/usr/bin/pulseaudio).
2013-04-29T10:36:52.152877+02:00 linux-ik7b rtkit-daemon[2840]: Demoted 3 
threads.
2013-04-29T10:37:01.621692+02:00 linux-ik7b kernel: [ 7407.720250] xhci_hcd 
:0d:00.0: Timeout while waiting for address device command
2013-04-29T10:37:01.621720+02:00 linux-ik7b kernel: [ 7423.926379] xhci_hcd 
:0d:00.0: Stopped the command ring failed, maybe the host is dead
2013-04-29T10:37:01.621723+02:00 linux-ik7b kernel: [ 7423.978212] xhci_hcd 
:0d:00.0: Host not halted after 16000 microseconds.
2013-04-29T10:37:01.621725+02:00 linux-ik7b kernel: [ 7423.978217] xhci_hcd 
:0d:00.0: Abort command ring failed
2013-04-29T10:37:01.624254+02:00 linux-ik7b kernel: [ 7423.979085] 
[sched_delayed] sched: RT throttling activated
2013-04-29T10:37:01.624266+02:00 linux-ik7b kernel: [ 7423.980776] xhci_hcd 
:0d:00.0: HC died; cleaning up
=

Some seconds later:

=

tail /var/log/messages
2013-04-29T10:37:17.026654+02:00 linux-ik7b kernel: [ 7439.344376] hub 3-0:1.0: 
cannot reset port 1 (err = -19)
2013-04-29T10:37:17.026659+02:00 linux-ik7b kernel: [ 7439.344384] hub 3-0:1.0: 
cannot disable port 1 (err = -19)
2013-04-29T10:37:17.026665+02:00 linux-ik7b kernel: [ 7439.344390] xHCI 
xhci_free_dev called with unaddressed device
2013-04-29T10:37:22.026625+02:00 linux-ik7b kernel: [ 7444.331946] xhci_hcd 
:0d:00.0: Timeout while waiting for a slot
2013-04-29T10:37:22.026661+02:00 linux-ik7b kernel: [ 7444.331960] xhci_hcd 
:0d:00.0: Abort the command ring, but the xHCI is dead.
2013-04-29T10:37:22.02+02:00 linux-ik7b kernel: [ 7444.331982] hub 3-0:1.0: 
cannot reset port 1 (err = -19)
2013-04-29T10:37:22.026670+02:00 linux-ik7b kernel: [ 7444.331990] hub 3-0:1.

[PATCH 5/5] usb: phy: nop: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
---
 drivers/usb/phy/phy-nop.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/phy/phy-nop.c b/drivers/usb/phy/phy-nop.c
index 2b10cc9..638cc5d 100644
--- a/drivers/usb/phy/phy-nop.c
+++ b/drivers/usb/phy/phy-nop.c
@@ -254,8 +254,6 @@ static int nop_usb_xceiv_remove(struct platform_device 
*pdev)
 
usb_remove_phy(&nop->phy);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/5] usb: phy: mv-usb: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Chao Xie 
---
 drivers/usb/phy/phy-mv-usb.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index c987bbe..4a6b03c 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -667,7 +667,6 @@ int mv_otg_remove(struct platform_device *pdev)
mv_otg_disable(mvotg);
 
usb_remove_phy(&mvotg->phy);
-   platform_set_drvdata(pdev, NULL);
 
return 0;
 }
@@ -850,8 +849,6 @@ err_destroy_workqueue:
flush_workqueue(mvotg->qwork);
destroy_workqueue(mvotg->qwork);
 
-   platform_set_drvdata(pdev, NULL);
-
return retval;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/5] usb: phy: mxs-usb: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Marek Vasut 
---
 drivers/usb/phy/phy-mxs-usb.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 9d4381e..3b64277 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -180,8 +180,6 @@ static int mxs_phy_remove(struct platform_device *pdev)
 
usb_remove_phy(&mxs_phy->phy);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/5] usb: phy: gpio-vbus-usb: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Philipp Zabel 
---
 drivers/usb/phy/phy-gpio-vbus-usb.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c 
b/drivers/usb/phy/phy-gpio-vbus-usb.c
index 4c76074..1d32af2 100644
--- a/drivers/usb/phy/phy-gpio-vbus-usb.c
+++ b/drivers/usb/phy/phy-gpio-vbus-usb.c
@@ -343,7 +343,6 @@ err_irq:
gpio_free(pdata->gpio_pullup);
gpio_free(pdata->gpio_vbus);
 err_gpio:
-   platform_set_drvdata(pdev, NULL);
kfree(gpio_vbus->phy.otg);
kfree(gpio_vbus);
return err;
@@ -365,7 +364,6 @@ static int __exit gpio_vbus_remove(struct platform_device 
*pdev)
if (gpio_is_valid(pdata->gpio_pullup))
gpio_free(pdata->gpio_pullup);
gpio_free(gpio);
-   platform_set_drvdata(pdev, NULL);
kfree(gpio_vbus->phy.otg);
kfree(gpio_vbus);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/5] usb: phy: ab8500-usb: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
---
 drivers/usb/phy/phy-ab8500-usb.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 4acef26..e5eb1b5 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -892,8 +892,6 @@ static int ab8500_usb_remove(struct platform_device *pdev)
else if (ab->mode == USB_PERIPHERAL)
ab8500_usb_peri_phy_dis(ab);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] usb: gadget: atmel_usba_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Nicolas Ferre

On 06/05/2013 13:37, Sachin Kamat :

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Nicolas Ferre 


Acked-by: Nicolas Ferre 


---
  drivers/usb/gadget/atmel_usba_udc.c |2 --
  1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c 
b/drivers/usb/gadget/atmel_usba_udc.c
index f2a970f..5a5128a 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1992,8 +1992,6 @@ err_map_regs:
  err_get_hclk:
clk_put(pclk);

-   platform_set_drvdata(pdev, NULL);
-
return ret;
  }





--
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] usb: gadget: s3c2410_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
---
 drivers/usb/gadget/s3c2410_udc.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index d0e75e1..7f5e3a6 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1948,8 +1948,6 @@ static int s3c2410_udc_remove(struct platform_device 
*pdev)
iounmap(base_addr);
release_mem_region(rsrc_start, rsrc_len);
 
-   platform_set_drvdata(pdev, NULL);
-
if (!IS_ERR(udc_clock) && udc_clock != NULL) {
clk_disable(udc_clock);
clk_put(udc_clock);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] usb: gadget: pxa25x_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Eric Miao 
---
 drivers/usb/gadget/pxa25x_udc.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index ef47495..95c531d 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -2236,7 +2236,6 @@ static int __exit pxa25x_udc_remove(struct 
platform_device *pdev)
dev->transceiver = NULL;
}
 
-   platform_set_drvdata(pdev, NULL);
the_controller = NULL;
return 0;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] usb: gadget: imx_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Darius Augulis 
---
 drivers/usb/gadget/imx_udc.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index b5cebd6..9b2d24e 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -1511,8 +1511,6 @@ static int __exit imx_udc_remove(struct platform_device 
*pdev)
if (pdata->exit)
pdata->exit(&pdev->dev);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] usb: gadget: f_uac2: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Jaswinder Singh 
---
 drivers/usb/gadget/f_uac2.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c
index c7468b6..03c1fb6 100644
--- a/drivers/usb/gadget/f_uac2.c
+++ b/drivers/usb/gadget/f_uac2.c
@@ -456,8 +456,6 @@ static int snd_uac2_remove(struct platform_device *pdev)
 {
struct snd_card *card = platform_get_drvdata(pdev);
 
-   platform_set_drvdata(pdev, NULL);
-
if (card)
return snd_card_free(card);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] usb: gadget: bcm63xx_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Kevin Cernekee 
---
 drivers/usb/gadget/bcm63xx_udc.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 6e65182..9780c57 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -2420,7 +2420,6 @@ static int bcm63xx_udc_remove(struct platform_device 
*pdev)
usb_del_gadget_udc(&udc->gadget);
BUG_ON(udc->driver);
 
-   platform_set_drvdata(pdev, NULL);
bcm63xx_uninit_udc_hw(udc);
 
return 0;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] usb: gadget: dummy_hcd: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Alan Stern 
---
 drivers/usb/gadget/dummy_hcd.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index a792e32..22236ec 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1001,7 +1001,6 @@ static int dummy_udc_remove(struct platform_device *pdev)
struct dummy*dum = platform_get_drvdata(pdev);
 
usb_del_gadget_udc(&dum->gadget);
-   platform_set_drvdata(pdev, NULL);
device_remove_file(&dum->gadget.dev, &dev_attr_function);
return 0;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] usb: gadget: atmel_usba_udc: Remove redundant platform_set_drvdata()

2013-05-06 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat 
Cc: Nicolas Ferre 
---
 drivers/usb/gadget/atmel_usba_udc.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c 
b/drivers/usb/gadget/atmel_usba_udc.c
index f2a970f..5a5128a 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1992,8 +1992,6 @@ err_map_regs:
 err_get_hclk:
clk_put(pclk);
 
-   platform_set_drvdata(pdev, NULL);
-
return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] usb: gadget/uvc: remove connect/disconnect calls on open/release

2013-05-06 Thread Vladimir Zapolskiy

Hi,

On 05/04/13 21:22, Bhupesh SHARMA wrote:

Hi,

On 5/3/2013 6:00 PM, Vladimir Zapolskiy wrote:

Hi Laurent,

thank you for the comment.

On 05/03/13 02:05, Laurent Pinchart wrote:

Hi Vladimir,

On Friday 03 May 2013 02:00:29 Vladimir Zapolskiy wrote:

On 05/03/13 01:18, Laurent Pinchart wrote:

On Friday 03 May 2013 01:13:48 Vladimir Zapolskiy wrote:

This change removes redundant calls to uvc_function_connect() and
uvc_function_disconnect() on V4L2 device node open and release.

These two functions attemp to control pull-up on D+ line directly,
however such an action should be performed by an UDC iteself, and
within
the gadget there is no information about current mode of the
controller.

The UDC may be in suspended state, or an OTG controller may be in
host
mode, therefore it seems better not to try to forcibly pull-up D+
line
on open() syscall.


OK, but we then need to fix the problem properly. The UVC gadget
must not
appear connected until an application opens the corresponding device.
Likewise, it must disconnect from the bus when the application
closes the
device. How can this be guaranteed properly ?


For better understanding of the issue, could you explain briefly why
do you
prefer to have the gadget not connected to the bus, if device node is
not
opened?


As soon as the gadget will connect to the bus the device will be
enumerated by
the host and bound to a host driver that will query the device using
UVC-
specific requests. The userspace application is involved in replying
to those
requests, so it needs to be bound to the device on the gadget side or
the
initialization process on the host side will fail.


It might be a flaw in design, if a kernel space component depends on a
user
space application to be operable. Also the same scenario seems to be
invalid,
if an application unawared of specific to UVC features of /dev/videoX
opens
the device node, e.g.
http://git.kernel.org/cgit/linux/hotplug/udev.git/tree/src/v4l_id/v4l_id.c

or yavta etc. I presume a host should dictate behaviour of device and
gadget
in particular, and not a target's user space application, please correct
me.

About this particular change, as I mentioned in a cover letter an
alternative
approach may be to add sanity checks to .pullup operations for every UDC
driver
(or probably to usb_gadget_connect()), but in this case it is not clear
how UVC
gadget is going to be notified about changes of UDC state, e.g. assume a
test
that /dev/videoX is opened, when OTG is in Host mode, device registration
doesn't happen on open(), and then USB B cable is inserted to the port.

I would appreciate your thoughts.


The whole point of having a user-space application governing the
behavior of UVC webcam gadget as per commands from a UVC host is to plug
the same with a real video capture source driver to provide the video
frames captured from say a camera sensor and route the UVC specific
control requests to a real video capture device by converting the same
to equivalent V4L2 commands.


thank you for the explanation, however my original question is about
avoiding critical hardware errors attended to the current gadget's design.
If you think that UDC should be controlled every time on open()/close()
syscalls, how do you see an optimal way to mitigate problems described
above?


Let's take an example. Let's say you have a camera sensor that supports
capture in two modes:

1. 640*480, YUV422 (default mode)
2. 640*480, JPEG

Lets say the UVC webcam gadget suggest to the host that it supports
640*480, YUV422 output by default (to be in sync with the
characteristics of the actual capture source).

Now on the Host, some user tries to open the UVC webcam appearing to him
as one /dev/videoX node using the CHEESE application, and he
tries to capture frames in MJPEG format as it is also supported by the
UVC webcam, no before streaming frames this control command should be
routed as a V4L2_S_FMT(640*480, JPEG) command to the V4L2 video capture
driver. This is where the user-space application comes into picture.

Also note that the format is selected from the Host side before the
streaming is started. So, you should not connect to the UDC, unless you
have the user-space application up and running and is present to pass
relevant UVC commands (after converting them to equivalent V4L2
commands) to the video capture driver.

The present design is an interface between two kernel subsystems which
are aware of each other and works fine for most use-cases.

Regards,
Bhupesh




Signed-off-by: Vladimir Zapolskiy
Cc: Laurent Pinchart
---

drivers/usb/gadget/uvc_v4l2.c | 5 -
1 file changed, 5 deletions(-)

diff --git a/drivers/usb/gadget/uvc_v4l2.c
b/drivers/usb/gadget/uvc_v4l2.c
index ad48e81..e2b66e1 100644
--- a/drivers/usb/gadget/uvc_v4l2.c
+++ b/drivers/usb/gadget/uvc_v4l2.c
@@ -132,20 +132,15 @@ uvc_v4l2_open(struct file *file)

handle->device =&uvc->video;
file->private_data =&handle->vfh;

- uvc_function_connect(uvc);

return 0;

}

static int
uvc

[PATCH 10/11] USB: ohci-spear: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ohci-spear.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 9020bf0..6f9a1dc 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -179,8 +179,6 @@ static int spear_ohci_hcd_drv_remove(struct platform_device 
*pdev)
spear_stop_ohci(ohci_p);
 
usb_put_hcd(hcd);
-
-   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/11] USB: ohci-platform: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ohci-platform.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index c3e7287..76a3531 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -157,7 +157,6 @@ static int ohci_platform_remove(struct platform_device *dev)
 
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
-   platform_set_drvdata(dev, NULL);
 
if (pdata->power_off)
pdata->power_off(dev);
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/11] USB: ohci-sm501: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ohci-sm501.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index 3b5b908..d479d5d 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -207,7 +207,6 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device 
*pdev)
sm501_modify_reg(pdev->dev.parent, SM501_IRQ_MASK, 0, 1 << 6);
sm501_unit_power(pdev->dev.parent, SM501_GATE_USB_HOST, 0);
 
-   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/11] USB: ohci-pxa27x: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ohci-pxa27x.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index efe71f3..4e0f088b 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -556,7 +556,6 @@ static int ohci_hcd_pxa27x_drv_remove(struct 
platform_device *pdev)
struct usb_hcd *hcd = platform_get_drvdata(pdev);
 
usb_hcd_pxa27x_remove(hcd, pdev);
-   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/11] USB: ohci-jz4740: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ohci-jz4740.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-jz4740.c b/drivers/usb/host/ohci-jz4740.c
index 8062bb9..d4ef539 100644
--- a/drivers/usb/host/ohci-jz4740.c
+++ b/drivers/usb/host/ohci-jz4740.c
@@ -221,7 +221,6 @@ static int jz4740_ohci_probe(struct platform_device *pdev)
return 0;
 
 err_disable:
-   platform_set_drvdata(pdev, NULL);
if (jz4740_ohci->vbus) {
regulator_disable(jz4740_ohci->vbus);
regulator_put(jz4740_ohci->vbus);
@@ -246,8 +245,6 @@ static int jz4740_ohci_remove(struct platform_device *pdev)
 
usb_remove_hcd(hcd);
 
-   platform_set_drvdata(pdev, NULL);
-
if (jz4740_ohci->vbus) {
regulator_disable(jz4740_ohci->vbus);
regulator_put(jz4740_ohci->vbus);
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/11] USB: ehci-platform: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-platform.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index f47f259..a98dd3b 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -146,7 +146,6 @@ static int ehci_platform_remove(struct platform_device *dev)
 
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
-   platform_set_drvdata(dev, NULL);
 
if (pdata->power_off)
pdata->power_off(dev);
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/11] USB: ehci-sh: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-sh.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
index b44d716..c4c0ee9 100644
--- a/drivers/usb/host/ehci-sh.c
+++ b/drivers/usb/host/ehci-sh.c
@@ -176,7 +176,6 @@ static int ehci_hcd_sh_remove(struct platform_device *pdev)
 
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
-   platform_set_drvdata(pdev, NULL);
 
clk_disable(priv->fclk);
clk_disable(priv->iclk);
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/11] USB: ehci-sead3: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-sead3.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-sead3.c b/drivers/usb/host/ehci-sead3.c
index f55477c..b2de52d 100644
--- a/drivers/usb/host/ehci-sead3.c
+++ b/drivers/usb/host/ehci-sead3.c
@@ -140,7 +140,6 @@ static int ehci_hcd_sead3_drv_remove(struct platform_device 
*pdev)
 
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
-   platform_set_drvdata(pdev, NULL);
 
return 0;
 }
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/11] USB: ehci-octeon: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-octeon.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c
index a89750f..45cc001 100644
--- a/drivers/usb/host/ehci-octeon.c
+++ b/drivers/usb/host/ehci-octeon.c
@@ -182,8 +182,6 @@ static int ehci_octeon_drv_remove(struct platform_device 
*pdev)
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/11] USB: ehci-mxc: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-mxc.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index c369767..e4c34ac 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -194,7 +194,6 @@ static int ehci_mxc_drv_remove(struct platform_device *pdev)
clk_disable_unprepare(priv->phyclk);
 
usb_put_hcd(hcd);
-   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/11] USB: ehci-mv: remove unnecessary platform_set_drvdata()

2013-05-06 Thread Jingoo Han
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han 
---
 drivers/usb/host/ehci-mv.c |   16 ++--
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 4020629..915c2db 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -166,14 +166,14 @@ static int mv_ehci_probe(struct platform_device *pdev)
if (IS_ERR(ehci_mv->clk)) {
dev_err(&pdev->dev, "error getting clock\n");
retval = PTR_ERR(ehci_mv->clk);
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phyregs");
if (r == NULL) {
dev_err(&pdev->dev, "no phy I/O memory resource defined\n");
retval = -ENODEV;
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,
@@ -181,14 +181,14 @@ static int mv_ehci_probe(struct platform_device *pdev)
if (ehci_mv->phy_regs == 0) {
dev_err(&pdev->dev, "failed to map phy I/O memory\n");
retval = -EFAULT;
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "capregs");
if (!r) {
dev_err(&pdev->dev, "no I/O memory resource defined\n");
retval = -ENODEV;
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
ehci_mv->cap_regs = devm_ioremap(&pdev->dev, r->start,
@@ -196,13 +196,13 @@ static int mv_ehci_probe(struct platform_device *pdev)
if (ehci_mv->cap_regs == NULL) {
dev_err(&pdev->dev, "failed to map I/O memory\n");
retval = -EFAULT;
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
retval = mv_ehci_enable(ehci_mv);
if (retval) {
dev_err(&pdev->dev, "init phy error %d\n", retval);
-   goto err_clear_drvdata;
+   goto err_put_hcd;
}
 
offset = readl(ehci_mv->cap_regs) & CAPLENGTH_MASK;
@@ -274,8 +274,6 @@ err_set_vbus:
pdata->set_vbus(0);
 err_disable_clk:
mv_ehci_disable(ehci_mv);
-err_clear_drvdata:
-   platform_set_drvdata(pdev, NULL);
 err_put_hcd:
usb_put_hcd(hcd);
 
@@ -300,8 +298,6 @@ static int mv_ehci_remove(struct platform_device *pdev)
mv_ehci_disable(ehci_mv);
}
 
-   platform_set_drvdata(pdev, NULL);
-
usb_put_hcd(hcd);
 
return 0;
-- 
1.7.2.5


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] USB: Blacklisted Cinterion's PLxx WWAN Interface

2013-05-06 Thread Schemmel Hans-Christoph
/drivers/usb/serial/option.c: Blacklisted Cinterion's PLxx WWAN Interface (USB 
Interface 4), because it will be handled by QMI WWAN driver. Product IDs 
renamed.

Signed-off-by: Hans-Christoph Schemmel 
---
patch is against linux-3.9
--- linux-3.9/drivers/usb/serial/option.c.orig  2013-05-06 07:54:23.257334006 
+0200
+++ linux-3.9/drivers/usb/serial/option.c   2013-05-06 08:07:37.537272628 
+0200
@@ -341,8 +341,8 @@ static void option_instat_callback(struc
 #define CINTERION_PRODUCT_EU3_E0x0051
 #define CINTERION_PRODUCT_EU3_P0x0052
 #define CINTERION_PRODUCT_PH8  0x0053
-#define CINTERION_PRODUCT_AH6  0x0055
-#define CINTERION_PRODUCT_PLS8 0x0060
+#define CINTERION_PRODUCT_AHXX 0x0055
+#define CINTERION_PRODUCT_PLXX 0x0060
 
 /* Olivetti products */
 #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1263,8 +1263,9 @@ static const struct usb_device_id option
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) },
-   { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AH6) },
-   { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLS8) },
+   { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) },
+   { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX),
+   .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, 
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


XHCI and USB 2 soundcard

2013-05-06 Thread Aurélien Leblond
Hello all,

I have two usb soundcards at home and my laptop has both EHCI and XHCI
usb ports.

The M-Audio Fast-Track Ultra (USB 2) is not recognized by ALSA when
plugged on a USB 3 (XHCI) port on the kernel 3.9.

I'm trying to figure out where the problem lies to report the issue to
the proper team: is it with XHCI or with ALSA?

In dmesg, this is what happens when the FTU is plugged:
[  107.461175] usb 3-1: new high-speed USB device number 3 using xhci_hcd
[  107.481695] usb 3-1: config 1 interface 3 altsetting 0 bulk
endpoint 0x7 has invalid maxpacket 8
[  107.481705] usb 3-1: config 1 interface 3 altsetting 0 bulk
endpoint 0x87 has invalid maxpacket 8
[  107.483384] usb 3-1: New USB device found, idVendor=0763, idProduct=2080
[  107.483392] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  107.483398] usb 3-1: Product: Fast Track Ultra
[  107.483403] usb 3-1: Manufacturer: M-Audio
[  107.483886] xhci_hcd :04:00.0: ERROR: unexpected command
completion code 0x11.
[  107.483899] usb 3-1: can't set config #1, error -22

The device is seen by lsusb, but I don't think it really means much:
Bus 003 Device 004: ID 0763:2080 Midiman M-Audio RunTime DFU

aplay -l only doesn't show the sound card, even if I try to modprobe
snd-usb-audio manually:
 List of PLAYBACK Hardware Devices 
card 0: MID [HDA Intel MID], device 0: 92HD81B1X5 Analog [92HD81B1X5 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

The same FTU soundcard works on the same machine when plugged on a
USB2 port (EHCI).
The Edirol UA-25Ex (USB1) works on this USB3 port.

What do you guys think?
Is the issue with XHCI or ALSA?

Thanks in advance for the help!

Aurélien
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [V9 PATCH 01/12] usb: phy: protect phy init and shutdown for mutiple deivces

2013-05-06 Thread Chao Xie
On Tue, Apr 30, 2013 at 2:24 AM, Felipe Balbi  wrote:
> On Wed, Apr 24, 2013 at 02:23:15AM -0400, Chao Xie wrote:
>> diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
>> index 6b5978f..98d7e60 100644
>> --- a/include/linux/usb/phy.h
>> +++ b/include/linux/usb/phy.h
>> @@ -87,6 +87,14 @@ struct usb_phy {
>>   /* to support controllers that have multiple transceivers */
>>   struct list_headhead;
>>
>> + /*
>> +  * PHY may be shared by multiple devices.
>> +  * mutex and refcount are used to make sure PHY only initialize or
>> +  * shutdown once.
>
> bad grammar in this sentence.
>

I will fix it in the next version.

>> +  */
>> + struct mutexphy_mutex;
>> + unsigned intrefcount;
>
> why don't you use an atomic_t ?
>

Mutex will protect both ->init and ->shutdown routines. Thanks for
Russell's explanation.

> --
> balbi

Can you help to review other patches in this series? So I can fix all
the errors in the next version.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html