Re: [PATCH 1/2] dma: cppi41: start tear down only if channel is busy

2014-02-27 Thread Shevchenko, Andriy
On Thu, 2014-02-27 at 10:44 +0530, George Cherian wrote:
 Start the channel tear down only if the channel is busy, else just
 bail out. In some cases its seen that by the time the tear down is
 initiated the cppi completes the DMA, especially in ISOCH transfers.
 
 Signed-off-by: George Cherian george.cher...@ti.com
 ---
  drivers/dma/cppi41.c | 7 +--
  1 file changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
 index c18aebf..d028f36 100644
 --- a/drivers/dma/cppi41.c
 +++ b/drivers/dma/cppi41.c
 @@ -620,12 +620,15 @@ static int cppi41_stop_chan(struct dma_chan *chan)
   u32 desc_phys;
   int ret;
  
 + desc_phys = lower_32_bits(c-desc_phys);
 + desc_num = (desc_phys - cdd-descs_phys) / sizeof(struct cppi41_desc);
 + if (!cdd-chan_busy[desc_num])
 + return 0;
 +
   ret = cppi41_tear_down_chan(c);
   if (ret)
   return ret;
  
 - desc_phys = lower_32_bits(c-desc_phys);
 - desc_num = (desc_phys - cdd-descs_phys) / sizeof(struct cppi41_desc);
   WARN_ON(!cdd-chan_busy[desc_num]);

Do you still need this WARN_ON?

   cdd-chan_busy[desc_num] = NULL;
  


-- 
Andy Shevchenko andriy.shevche...@intel.com
Intel Finland Oy
-
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


RE: [PATCH 2/6] usb: gadget: mv_udc: disable HW zlt for ep0

2014-02-27 Thread Neil Zhang

 -Original Message-
 From: Felipe Balbi [mailto:ba...@ti.com]
 Sent: 2014年2月26日 23:19
 To: Neil Zhang
 Cc: ba...@ti.com; Peter Chen; gre...@linuxfoundation.org;
 linux-usb@vger.kernel.org; linux-ker...@vger.kernel.org; Alexander Shishkin
 Subject: Re: [PATCH 2/6] usb: gadget: mv_udc: disable HW zlt for ep0
 
 Hi,
 
 On Tue, Feb 25, 2014 at 05:48:17PM -0800, Neil Zhang wrote:
 Hardware zlt will try to send the zero length packet
 automatically when the data transferd is multiple times
 of max packet, this will cause issues on Windows.
 So let's disable HW zlt by default.
   
Would you have description that what kinds of issue on
Windows if zlt is is selected?
   
  
   Enumeration will fail.
  
 
  What causes enumeration fail, why it does not occur before?
 
 A unexpected zero packet cause enumeration fail.
 It's not easy that the descriptor is actually 1024 bytes, so not
 easy to be found.

   
Chipidea bug too? Does it follow ch 8.5.3.2 Variable-length Data
Stage, USB
   2.0 spec?
  
   wait, this is a chipidea core ? Why aren't you guys using the
   chipidea driver yet ? You need to switch over to that driver dude,
   we can't have duplicated code in the tree.
  
   I'm sorry, but I won't be taking this series, please use chipidea
   driver, it should be very simple to add a glue layer for your core to the
 chipidea driver.
  
 
  Yes, it use chipidea IP.
  But the driver is earlier than the chipidea one and we use it for our
  products.
  So it may be not that easy to switch to chipidea driver due to the
  stability.
 
 that's nonsense, the average chipidea glue layer is ~80 LOCs. You can write
 that in less than 2 hours and give it a try. We cannot have duplicate drivers 
 in
 the tree and development effort *must* be shared.
 
 If you guys use the same IP, why wouldn't you use the same chipidea driver ?
 
 sorry, you didn't convince me.

It's too sad!
Anyway we will estimate the chipidea driver to see whether it meets our 
requirement.

 
 --
 Balbi

Best Regards,
Neil Zhang
N�Р骒r��yb�X�肚�v�^�)藓{.n�+�伐�{焙柒��^n�r■�z���h�ㄨ��Ⅷ�G���h�(�茛j���m赇z罐��帼f"�h���~�m�

Re: [PATCH v2] u_ether: move hardware transmit to RX workqueue

2014-02-27 Thread clanlab.proj
On Wed, Feb 26, 2014 at 5:13 PM, Weinn clanlab.p...@gmail.com wrote:
 On Mon, Feb 24, 2014 at 10:57 PM, Manu Gautam mgau...@codeaurora.org wrote:

 On 2/22/2014 11:11 AM, Clanlab (Taiwan) Linux Project wrote:
 In order to reduce the interrupt times in the embedded system,
 a receiving workqueue is introduced.
 This modification also enhanced the overall throughput as the
 benefits of reducing interrupt occurrence.

 Hi all,

I've found that the NAPI version of my implementation was slower then
the previous work queue implementation.
I think I can post it later and let's see where the parameters codes/
could be adjustment.
Currently the weight/budget of rx_napi is 16 (GETHER_NAPI_WEIGHT == 16)
netif_napi_add(net, dev-rx_napi, gether_poll, GETHER_NAPI_WEIGHT);

Should I send a new patch which with new description about NAPI version?
Or should I just send the patch v3 and use the same patch subject?

Here is the benchmark (USB High speed) on RX channel. (PC-Device)

With work queue is implemented.
[  3]  2.0- 3.0 sec  9.75 MBytes  81.8 Mbits/sec
[  3]  3.0- 4.0 sec  10.4 MBytes  87.0 Mbits/sec
[  3]  4.0- 5.0 sec  10.2 MBytes  86.0 Mbits/sec
[  3]  5.0- 6.0 sec  10.4 MBytes  87.0 Mbits/sec
[  3]  6.0- 7.0 sec  10.4 MBytes  87.0 Mbits/sec
[  3]  7.0- 8.0 sec  9.88 MBytes  82.8 Mbits/sec
[  3]  8.0- 9.0 sec  10.5 MBytes  88.1 Mbits/sec
[  3]  9.0-10.0 sec  10.5 MBytes  88.1 Mbits/sec

With NAPI is implemented.
[  3] 23.0-24.0 sec  9.25 MBytes  77.6 Mbits/sec
[  3] 24.0-25.0 sec  9.50 MBytes  79.7 Mbits/sec
[  3] 25.0-26.0 sec  9.75 MBytes  81.8 Mbits/sec
[  3] 26.0-27.0 sec  9.25 MBytes  77.6 Mbits/sec
[  3] 27.0-28.0 sec  9.12 MBytes  76.5 Mbits/sec
[  3] 28.0-29.0 sec  10.4 MBytes  87.0 Mbits/sec
[  3] 29.0-30.0 sec  10.1 MBytes  84.9 Mbits/sec
[  3] 30.0-31.0 sec  9.62 MBytes  80.7 Mbits/sec
[  3] 31.0-32.0 sec  10.0 MBytes  83.9 Mbits/sec

Best regards,
Weinn
--
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 v2] u_ether: move hardware transmit to RX workqueue

2014-02-27 Thread clanlab.proj
On Thu, Feb 27, 2014 at 5:16 PM, Weinn clanlab.p...@gmail.com wrote:
 I've found that the NAPI version of my implementation was slower then
 the previous work queue implementation.
 I think I can post it later and let's see where the parameters codes/
 could be adjustment.
 Currently the weight/budget of rx_napi is 16 (GETHER_NAPI_WEIGHT == 16)
 netif_napi_add(net, dev-rx_napi, gether_poll, GETHER_NAPI_WEIGHT);

 Should I send a new patch which with new description about NAPI version?
 Or should I just send the patch v3 and use the same patch subject?

 Here is the benchmark (USB High speed) on RX channel. (PC-Device)

Hi all,
After I've replaced the WEIGHT/budget from 16 - 32,
I've got better performance from previous NAPI version, but still
cannot beat the work queue version.

Here is the result..
With NAPI: WEIGHT/budget == 32
[  3] 10.0-11.0 sec  9.88 MBytes  82.8 Mbits/sec
[  3] 11.0-12.0 sec  9.38 MBytes  78.6 Mbits/sec
[  3] 12.0-13.0 sec  10.1 MBytes  84.9 Mbits/sec
[  3] 13.0-14.0 sec  10.2 MBytes  86.0 Mbits/sec
[  3] 14.0-15.0 sec  10.0 MBytes  83.9 Mbits/sec
[  3] 15.0-16.0 sec  10.5 MBytes  88.1 Mbits/sec
[  3] 16.0-17.0 sec  9.38 MBytes  78.6 Mbits/sec
[  3] 17.0-18.0 sec  10.4 MBytes  87.0 Mbits/sec
[  3] 18.0-19.0 sec  10.4 MBytes  87.0 Mbits/sec


 With work queue is implemented.
 [  3]  2.0- 3.0 sec  9.75 MBytes  81.8 Mbits/sec
 [  3]  3.0- 4.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  4.0- 5.0 sec  10.2 MBytes  86.0 Mbits/sec
 [  3]  5.0- 6.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  6.0- 7.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  7.0- 8.0 sec  9.88 MBytes  82.8 Mbits/sec
 [  3]  8.0- 9.0 sec  10.5 MBytes  88.1 Mbits/sec
 [  3]  9.0-10.0 sec  10.5 MBytes  88.1 Mbits/sec

 With NAPI is WEIGHT/budget == 16
 [  3] 23.0-24.0 sec  9.25 MBytes  77.6 Mbits/sec
 [  3] 24.0-25.0 sec  9.50 MBytes  79.7 Mbits/sec
 [  3] 25.0-26.0 sec  9.75 MBytes  81.8 Mbits/sec
 [  3] 26.0-27.0 sec  9.25 MBytes  77.6 Mbits/sec
 [  3] 27.0-28.0 sec  9.12 MBytes  76.5 Mbits/sec
 [  3] 28.0-29.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3] 29.0-30.0 sec  10.1 MBytes  84.9 Mbits/sec
 [  3] 30.0-31.0 sec  9.62 MBytes  80.7 Mbits/sec
 [  3] 31.0-32.0 sec  10.0 MBytes  83.9 Mbits/sec
--
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] u_ether: move hardware transmit to RX NAPI

2014-02-27 Thread Weinn
From: Weinn Jheng clanlab.p...@gmail.com

In order to reduce the interrupt times in the embedded system,
a receiving workqueue is introduced.
This modification also enhanced the overall throughput as the
benefits of reducing interrupt occurrence.

This work was derived from previous work:
u_ether: move hardware transmit to RX workqueue.
Which should be base on codeaurora's work.

However, the benchmark on my platform shows the throughput
with workqueue is slightly better than NAPI.

Signed-off-by: Weinn Jheng clanlab.p...@gmail.com
Cc: David Brownell dbrown...@users.sourceforge.net
Cc: David S. Miller da...@davemloft.net
Cc: Stephen Hemminger shemmin...@vyatta.com
Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Manu Gautam mgau...@codeaurora.org
---
 drivers/usb/gadget/u_ether.c | 101 ---
 1 file changed, 66 insertions(+), 35 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index b7d4f82..50d09c2 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -48,6 +48,8 @@
 
 #define UETH__VERSION  29-May-2008
 
+#define GETHER_NAPI_WEIGHT 32
+
 struct eth_dev {
/* lock is held while accessing port_usb
 */
@@ -72,6 +74,7 @@ struct eth_dev {
struct sk_buff_head *list);
 
struct work_struct  work;
+   struct napi_struct  rx_napi;
 
unsigned long   todo;
 #defineWORK_RX_MEMORY  0
@@ -253,18 +256,16 @@ enomem:
DBG(dev, rx submit -- %d\n, retval);
if (skb)
dev_kfree_skb_any(skb);
-   spin_lock_irqsave(dev-req_lock, flags);
-   list_add(req-list, dev-rx_reqs);
-   spin_unlock_irqrestore(dev-req_lock, flags);
}
return retval;
 }
 
 static void rx_complete(struct usb_ep *ep, struct usb_request *req)
 {
-   struct sk_buff  *skb = req-context, *skb2;
+   struct sk_buff  *skb = req-context;
struct eth_dev  *dev = ep-driver_data;
int status = req-status;
+   boolrx_queue = 0;
 
switch (status) {
 
@@ -288,30 +289,8 @@ static void rx_complete(struct usb_ep *ep, struct 
usb_request *req)
} else {
skb_queue_tail(dev-rx_frames, skb);
}
-   skb = NULL;
-
-   skb2 = skb_dequeue(dev-rx_frames);
-   while (skb2) {
-   if (status  0
-   || ETH_HLEN  skb2-len
-   || skb2-len  VLAN_ETH_FRAME_LEN) {
-   dev-net-stats.rx_errors++;
-   dev-net-stats.rx_length_errors++;
-   DBG(dev, rx length %d\n, skb2-len);
-   dev_kfree_skb_any(skb2);
-   goto next_frame;
-   }
-   skb2-protocol = eth_type_trans(skb2, dev-net);
-   dev-net-stats.rx_packets++;
-   dev-net-stats.rx_bytes += skb2-len;
-
-   /* no buffer copies needed, unless hardware can't
-* use skb buffers.
-*/
-   status = netif_rx(skb2);
-next_frame:
-   skb2 = skb_dequeue(dev-rx_frames);
-   }
+   if (!status)
+   rx_queue = 1;
break;
 
/* software-driven interface shutdown */
@@ -334,22 +313,20 @@ quiesce:
/* FALLTHROUGH */
 
default:
+   rx_queue = 1;
+   dev_kfree_skb_any(skb);
dev-net-stats.rx_errors++;
DBG(dev, rx status %d\n, status);
break;
}
 
-   if (skb)
-   dev_kfree_skb_any(skb);
-   if (!netif_running(dev-net)) {
 clean:
spin_lock(dev-req_lock);
list_add(req-list, dev-rx_reqs);
spin_unlock(dev-req_lock);
-   req = NULL;
-   }
-   if (req)
-   rx_submit(dev, req, GFP_ATOMIC);
+
+   if (rx_queue  likely(napi_schedule_prep(dev-rx_napi)))
+   __napi_schedule(dev-rx_napi);
 }
 
 static int prealloc(struct list_head *list, struct usb_ep *ep, unsigned n)
@@ -414,16 +391,24 @@ static void rx_fill(struct eth_dev *dev, gfp_t gfp_flags)
 {
struct usb_request  *req;
unsigned long   flags;
+   int rx_counts = 0;
 
/* fill unused rxq slots with some skb */
spin_lock_irqsave(dev-req_lock, flags);
while (!list_empty(dev-rx_reqs)) {
+
+   if (++rx_counts  qlen(dev-gadget, dev-qmult))
+   break;
+
req = container_of(dev-rx_reqs.next,

[PATCH 1/3] hub: debug message for failing to enable device

2014-02-27 Thread oliver
From: Oliver Neukum oneu...@suse.de

This error case isn't reported during enumeration.

Signed-off-by: Oliver Neukum oli...@neukum.org
---
 drivers/usb/core/hub.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 726f4a1..3489bf1 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4111,8 +4111,12 @@ hub_port_init (struct usb_hub *hub, struct usb_device 
*udev, int port1,
 
did_new_scheme = true;
retval = hub_enable_device(udev);
-   if (retval  0)
+   if (retval  0) {
+   dev_err(udev-dev,
+   hub failed to enable device, error 
%d\n,
+   retval);
goto fail;
+   }
 
 #define GET_DESCRIPTOR_BUFSIZE 64
buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
-- 
1.8.4.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/3] USB: hub: handle -ETIMEDOUT during enumeration

2014-02-27 Thread oliver
From: Oliver Neukum oneu...@suse.de

I have a device that times out if enumerated after being
switched on while connected. Increasing timeouts or retries
doesn't help. The device needs an additional reset.

Signed-off-by: Oliver Neukum oli...@neukum.org
---
 drivers/usb/core/hub.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 3489bf1..cf992de 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4005,6 +4005,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device 
*udev, int port1,
enum usb_device_speed   oldspeed = udev-speed;
const char  *speed;
int devnum = udev-devnum;
+   boolsecond_reset = false;
 
/* root hub ports have a slightly longer reset period
 * (from USB 2.0 spec, section 7.1.7.5)
@@ -4136,6 +4137,20 @@ hub_port_init (struct usb_hub *hub, struct usb_device 
*udev, int port1,
USB_DT_DEVICE  8, 0,
buf, GET_DESCRIPTOR_BUFSIZE,
initial_descriptor_timeout);
+
+   /*
+* Some devices time out if they are powered on
+* when already connected. They need a second
+* reset.
+*/
+   if (r == -ETIMEDOUT  !second_reset) {
+   retval = hub_port_reset(hub, port1, 
udev, delay, false);
+   second_reset = true;
+   if (retval  0)
+   dev_err(udev-dev,
+   recovery from timeout 
failed, error %d\n,
+   retval);
+   }
switch (buf-bMaxPacketSize0) {
case 8: case 16: case 32: case 64: case 255:
if (buf-bDescriptorType ==
-- 
1.8.4.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 v2] u_ether: move hardware transmit to RX workqueue

2014-02-27 Thread clanlab.proj
On Thu, Feb 27, 2014 at 5:25 PM, clanlab.proj clanlab.p...@gmail.com wrote:

 Hi all,
 After I've replaced the WEIGHT/budget from 16 - 32,
 I've got better performance from previous NAPI version, but still
 cannot beat the work queue version.

Hi all,
Just to remind you, I've send an another patch which replaced rx_work
with rx_napi.
The subject of that patch is [PATCH] u_ether: move hardware transmit
to RX NAPI
So we can discuss which implementation is better to be adopted and
better to the system. Thanks for your review and suggestion. :)

 Here is the result..
 With NAPI: WEIGHT/budget == 32
 [ 3] 10.0-11.0 sec  9.88 MBytes  82.8 Mbits/sec
 [  3] 11.0-12.0 sec  9.38 MBytes  78.6 Mbits/sec
 [  3] 12.0-13.0 sec  10.1 MBytes  84.9 Mbits/sec
 [  3] 13.0-14.0 sec  10.2 MBytes  86.0 Mbits/sec
 [  3] 14.0-15.0 sec  10.0 MBytes  83.9 Mbits/sec
 [  3] 15.0-16.0 sec  10.5 MBytes  88.1 Mbits/sec
 [  3] 16.0-17.0 sec  9.38 MBytes  78.6 Mbits/sec
 [  3] 17.0-18.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3] 18.0-19.0 sec  10.4 MBytes  87.0 Mbits/sec


 With work queue is implemented.
 [  3]  2.0- 3.0 sec  9.75 MBytes  81.8 Mbits/sec
 [  3]  3.0- 4.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  4.0- 5.0 sec  10.2 MBytes  86.0 Mbits/sec
 [  3]  5.0- 6.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  6.0- 7.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3]  7.0- 8.0 sec  9.88 MBytes  82.8 Mbits/sec
 [  3]  8.0- 9.0 sec  10.5 MBytes  88.1 Mbits/sec
 [  3]  9.0-10.0 sec  10.5 MBytes  88.1 Mbits/sec

 With NAPI is WEIGHT/budget == 16
 [  3] 23.0-24.0 sec  9.25 MBytes  77.6 Mbits/sec
 [  3] 24.0-25.0 sec  9.50 MBytes  79.7 Mbits/sec
 [  3] 25.0-26.0 sec  9.75 MBytes  81.8 Mbits/sec
 [  3] 26.0-27.0 sec  9.25 MBytes  77.6 Mbits/sec
 [  3] 27.0-28.0 sec  9.12 MBytes  76.5 Mbits/sec
 [  3] 28.0-29.0 sec  10.4 MBytes  87.0 Mbits/sec
 [  3] 29.0-30.0 sec  10.1 MBytes  84.9 Mbits/sec
 [  3] 30.0-31.0 sec  9.62 MBytes  80.7 Mbits/sec
 [  3] 31.0-32.0 sec  10.0 MBytes  83.9 Mbits/sec

Best regards,
Weinn
--
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 V1 1/2] usb: gadget: zero: Add support for interrupt EP

2014-02-27 Thread Andrzej Pietrasiewicz

W dniu 25.02.2014 06:13, Amit Virdi pisze:

ccing: Felipe Balbi, Alen Stern

On 2/24/2014 3:55 PM, Amit VIRDI wrote:

Interrupt endpoints behave quite similar to the bulk endpoints with the
difference that the endpoints expect data sending/reception request at
particular intervals till the whole data has not been transmitted.

The interrupt EP support is added to gadget zero. A new alternate setting (=2)
has been added. It has 6 endpoints (2-BULK, 2-ISOC, 2-INTERRUPT). The default
parameters are set as:
  bInterval: 4
  wMaxPacketSize: 1024
However, the same can be overridden through the module parameter interface.

The code is tested for HS and SS on a platform having DWC3 controller.

Signed-off-by: Amit Virdi amit.vi...@st.com


I am not considering whether adding interrupt transfer support is a good thing
or not; but the configfs part looks good to me.

[for the configfs part]
Acked-by: Andrzej Pietrasiewicz andrze...@samsung.com



---
   drivers/usb/gadget/f_loopback.c   |   3 +-
   drivers/usb/gadget/f_sourcesink.c | 519 
--
   drivers/usb/gadget/g_zero.h   |  13 +-
   drivers/usb/gadget/zero.c |  21 ++
   4 files changed, 533 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c
index 4557cd0..bf04389 100644
--- a/drivers/usb/gadget/f_loopback.c
+++ b/drivers/usb/gadget/f_loopback.c
@@ -298,7 +298,8 @@ static void disable_loopback(struct f_loopback *loop)
  struct usb_composite_dev*cdev;

  cdev = loop-function.config-cdev;
-   disable_endpoints(cdev, loop-in_ep, loop-out_ep, NULL, NULL);
+   disable_endpoints(cdev, loop-in_ep, loop-out_ep, NULL, NULL, NULL,
+   NULL);
  VDBG(cdev, %s disabled\n, loop-function.name);
   }

diff --git a/drivers/usb/gadget/f_sourcesink.c 
b/drivers/usb/gadget/f_sourcesink.c
index d3cd52d..306de39 100644
--- a/drivers/usb/gadget/f_sourcesink.c
+++ b/drivers/usb/gadget/f_sourcesink.c
@@ -23,6 +23,13 @@
   #include gadget_chips.h
   #include u_f.h

+enum eptype {
+   EP_CONTROL = 0,
+   EP_BULK,
+   EP_ISOC,
+   EP_INTERRUPT,
+};
+
   /*
* SOURCE/SINK FUNCTION ... a primary testing vehicle for USB peripheral
* controller drivers.
@@ -55,6 +62,8 @@ struct f_sourcesink {
  struct usb_ep   *out_ep;
  struct usb_ep   *iso_in_ep;
  struct usb_ep   *iso_out_ep;
+   struct usb_ep   *int_in_ep;
+   struct usb_ep   *int_out_ep;
  int cur_alt;
   };

@@ -68,6 +77,10 @@ static unsigned isoc_interval;
   static unsigned isoc_maxpacket;
   static unsigned isoc_mult;
   static unsigned isoc_maxburst;
+static unsigned int_interval;
+static unsigned int_maxpacket;
+static unsigned int_mult;
+static unsigned int_maxburst;
   static unsigned buflen;

   /*-*/
@@ -92,6 +105,16 @@ static struct usb_interface_descriptor 
source_sink_intf_alt1 = {
  /* .iInterface  = DYNAMIC */
   };

+static struct usb_interface_descriptor source_sink_intf_alt2 = {
+   .bLength =  USB_DT_INTERFACE_SIZE,
+   .bDescriptorType =  USB_DT_INTERFACE,
+
+   .bAlternateSetting =2,
+   .bNumEndpoints =6,
+   .bInterfaceClass =  USB_CLASS_VENDOR_SPEC,
+   /* .iInterface  = DYNAMIC */
+};
+
   /* full speed support: */

   static struct usb_endpoint_descriptor fs_source_desc = {
@@ -130,6 +153,26 @@ static struct usb_endpoint_descriptor fs_iso_sink_desc = {
  .bInterval =4,
   };

+static struct usb_endpoint_descriptor fs_int_source_desc = {
+   .bLength =  USB_DT_ENDPOINT_SIZE,
+   .bDescriptorType =  USB_DT_ENDPOINT,
+
+   .bEndpointAddress = USB_DIR_IN,
+   .bmAttributes = USB_ENDPOINT_XFER_INT,
+   .wMaxPacketSize =   cpu_to_le16(1023),
+   .bInterval =4,
+};
+
+static struct usb_endpoint_descriptor fs_int_sink_desc = {
+   .bLength =  USB_DT_ENDPOINT_SIZE,
+   .bDescriptorType =  USB_DT_ENDPOINT,
+
+   .bEndpointAddress = USB_DIR_OUT,
+   .bmAttributes = USB_ENDPOINT_XFER_INT,
+   .wMaxPacketSize =   cpu_to_le16(1023),
+   .bInterval =4,
+};
+
   static struct usb_descriptor_header *fs_source_sink_descs[] = {
  (struct usb_descriptor_header *) source_sink_intf_alt0,
  (struct usb_descriptor_header *) fs_sink_desc,
@@ -140,6 +183,14 @@ static struct usb_descriptor_header 
*fs_source_sink_descs[] = {
  (struct usb_descriptor_header *) fs_source_desc,
  (struct usb_descriptor_header *) fs_iso_sink_desc,
  (struct usb_descriptor_header *) fs_iso_source_desc,
+   (struct usb_descriptor_header *) source_sink_intf_alt2,
+#define FS_ALT_IFC_2_OFFSET8
+   (struct 

Re: musb - high CPU load in DMA mode and dropouts during audio playback

2014-02-27 Thread Michal Šmucr

Hi George,

On 27.2.2014 5:15, George Cherian wrote:


I too see the backtraces will send a patch soon to fix the same.

Thanks, i applied it and most of backtraces was suppressed.
Several times i was able to invocate it again, but this time, it was 
before complete stuck of playback application (kill -9 was only way to 
end it).
From that moment, no other audio playback can be initiated until next 
reboot. If i tried to remedy situation by replugging of USB interface, 
it leaded to nice Oops (snippet from serial console is attached).



During my testing am not seeing the CPU usage as you mention.
That is interesting, i was able to reproduce it whenever i tried that, 
maybe it could be also some config issue.
Just for more complete info, i'm using build scripts by Robert C. Nelson 
and there are couple other patches applied to kernel before build (now 
including your previous ISOCH. handling ones) - 
https://github.com/RobertCNelson/linux-dev/tree/am33x-v3.14/patches , 
but it doesn't seems related to issue.



Could you please share you .config.

You'll find it attached.


I used aplay for testing playback and arecord for recording using USB
headsets.
I tried mpd as player, but i'm able to reproduce kworker load also with 
aplay or alsa built-in speaker-test (eg. speaker-test -c 2 -D plughw:0,0).
Regarding hardware i tried few XMOS based UAC2 interfaces and recently 
also interface with TI PCM2904 USB codec, which could be very close to 
headset, you tried. It doesn't matter according to my tests.


Thanks,

Michal



config-3.14.0-rc4-bone0.gz
Description: application/gzip
 [  176.322424] usb 2-1: USB disconnect, device number 2
[  179.654157] usb 2-1: new high-speed USB device number 3 using musb-hdrc
[  179.795133] usb 2-1: device v249c p930b is not supported
[  179.800758] usb 2-1: New USB device found, idVendor=249c, idProduct=930b
[  179.807928] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  179.815489] usb 2-1: Product: M2Tech USB Audio 2.0
[  179.820540] usb 2-1: Manufacturer: M2Tech
[  179.824901] usb 2-1: SerialNumber: 
[  329.707680] systemd-logind[2285]: New session 2 of user root.
[  671.601671] usb 2-1: USB disconnect, device number 3
[  671.613917] Unable to handle kernel paging request at virtual address 
ffe6
[  671.621545] pgd = c0004000
[  671.624400] [ffe6] *pgd=9fef6821, *pte=, *ppte=
[  671.631045] Internal error: Oops: 17 [#1] SMP ARM
[  671.635995] Modules linked in: usb_f_acm u_serial usb_f_ecm g_multi 
usb_f_mass_storage usb_f_rndis u_ether libcomposite rpcsec_gss_krb5 nfsd 
snd_usb_audio snd_usbmidi_lib snd_hwdep snd_seq_midi snd_seq_midi_event 
snd_rawmidi snd_pcm snd_seq snd_seq_device snd_timer omap_aes snd omap_sham 
soundcore ti_am335x_adc kfifo_buf industrialio rtc_omap uio_pdrv_genirq uio
[  671.670042] CPU: 0 PID: 19 Comm: khubd Not tainted 3.14.0-rc4-bone0 #3
[  671.676914] task: de0bf200 ti: de176000 task.ti: de176000
[  671.682622] PC is at musb_g_tx+0x9c/0x18c
[  671.686856] LR is at cppi41_trans_done+0x48/0x134
[  671.691814] pc : [c0515354]lr : [c05165c4]psr: a00f0193
[  671.691814] sp : de177c38  ip : 0019  fp : c0b0ca00
[  671.703880] r10: de01eef8  r9 : 200f0193  r8 : de01e010
[  671.709378] r7 : de01eeb0  r6 : 3400  r5 : e0878de0  r4 : ffcc
[  671.716242] r3 :   r2 : 0001  r1 : e0878de2  r0 : de01e010
[  671.723109] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment 
kernel
[  671.730887] Control: 10c5387d  Table: 9e7a0019  DAC: 0015
[  671.736931] Process khubd (pid: 19, stack limit = 0xde176248)
[  671.742976] Stack: (0xde177c38 to 0xde178000)
[  671.747567] 7c20:   
de027944 de01ee84
[  671.756179] 7c40: dd281000 de01e010 0080 200f0193 008a c05165c4 
 0003
[  671.764790] 7c60: 0001 c0166368 800f0093 dd399790 dd3a2b38 de027944 
de01ee84 dd281000
[  671.773401] 7c80: de01e010 0080 200f0193 c0516c44 de58ea80 c0074280 
dd554580 00029903
[  671.782009] 7ca0: 00029903   0004 dd281000 9e841720 
0080 0001
[  671.790620] 7cc0: 008a c040ad88 dd2a2e80 de005900 0021  
 
[  671.799230] 7ce0: a00f0013 c008037c de005900 dd2a2e80 1f065000 de005900 
c0a741e4 
[  671.807842] 7d00: c0b11be4 0001  a00f0013 dd39 c0080550 
0002 de005900
[  671.816452] 7d20: c0a741e4 c0082fcc 0021 c007fbe4 0021 c000e244 
fa20 de177d60
[  671.825064] 7d40: 0021 c0008578 c0511c6c c06df880 a00f0013  
de177d94 c06dffc0
[  671.833675] 7d60: de01e010 a00f0013 34a6 747e de590080 de5a8800 
de01e010 8300
[  671.842286] 7d80: 0001  a00f0013 dd39 e0878de2 de177da8 
c0511c6c c06df880
[  671.850897] 7da0: a00f0013   de5a8800 ff98 a00f0013 
de6ed3ec de6ed3f0
[  671.859508] 7dc0: de62a800 c04f9d10 de26c200  de6ec000 de6ec000 
13e8 bf0cc4bc
[  671.868118] 7de0: 

[PATCH 1/1] xhci: add the meaningful IRQ description if it is empty

2014-02-27 Thread Adrian Huang12
When some xHCI host controllers fall back to use the legacy IRQ,
the member irq_descr of the usb_hcd structure will be empty. This
leads to the empty string of the xHCI host controller in
/proc/interrupts. Here is the example (The irq 19 is the xHCI host
controller):

   CPU0
  0: 91 IO-APIC-edgetimer
  8:  1 IO-APIC-edgertc0
  9:   7191 IO-APIC-fasteoi acpi
 18:104 IR-IO-APIC-fasteoi  ehci_hcd:usb1, ehci_hcd:usb2
 19:473 IR-IO-APIC-fasteoi

After applying the patch, the name of the registered xHCI host
controller can be displayed correctly. Here is the example:

   CPU0
  0: 91 IO-APIC-edgetimer
  8:  1 IO-APIC-edgertc0
  9:   7191 IO-APIC-fasteoi acpi
 18:104 IR-IO-APIC-fasteoi  ehci_hcd:usb1, ehci_hcd:usb2
 19:473 IR-IO-APIC-fasteoi  xhci_hcd:usb3

Tested on v3.14-rc4.

Signed-off-by: Adrian Huang ahuan...@lenovo.com
Reviewed-by: Nagananda Chumbalkar nchumbal...@lenovo.com
---
 drivers/usb/host/xhci.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 6fe577d..e8e8dae 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -390,6 +390,10 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
}
 
  legacy_irq:
+   if (!strlen(hcd-irq_descr))
+   snprintf(hcd-irq_descr, sizeof(hcd-irq_descr), %s:usb%d,
+hcd-driver-description, hcd-self.busnum);
+
/* fall back to legacy interrupt*/
ret = request_irq(pdev-irq, usb_hcd_irq, IRQF_SHARED,
hcd-irq_descr, hcd);
-- 
1.8.1.2




[PATCH] staging: usbip: Fix format string mismatch in usbip_vhci_attach_device2

2014-02-27 Thread Masanari Iida
Argument type of sockfd is set as int, but format string
is set as unsigned int. Fix the mismatch.

Signed-off-by: Masanari Iida standby2...@gmail.com
---
 drivers/staging/usbip/userspace/libsrc/vhci_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/vhci_driver.c 
b/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
index f4bfefe..d80d37c 100644
--- a/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/vhci_driver.c
@@ -545,7 +545,7 @@ int usbip_vhci_attach_device2(uint8_t port, int sockfd, 
uint32_t devid,
return -1;
}
 
-   snprintf(buff, sizeof(buff), %u %u %u %u,
+   snprintf(buff, sizeof(buff), %u %d %u %u,
port, sockfd, devid, speed);
dbg(writing: %s, buff);
 
-- 
1.9.0

--
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: HSIC on imx6

2014-02-27 Thread Rolf Evers-Fischer

Hi Christian

 Christian Gmeiner christian.gmei...@gmail.com hat am 26. Februar 2014 um
 20:15 geschrieben:


 Hi Rolf

 2014-02-26 15:48 GMT+01:00 Rolf Evers-Fischer embedde...@evers-fischer.de:
  Hi Christian,
 
  Peter Chen peter.c...@freescale.com hat am 26. Februar 2014 um 03:05
  geschrieben:
 
 
 
 patches. I am working some days on this topic but without much
 success and I am running out of time :/


 Will keep you posted.

   
Hope you soon will find some time.
   
   
Since some chipidea code needs to change before adapting HSIC support,
I submit a temp version at my git, it is not suitable for upstream,
but can let the hsic work.
   
github.com/hzpeterchen/linux-usb.git
branch: fsl-hsic-support
   
  
   I did backport those patches to 3.13.4 but it does not work. Here you can
   find a log http://dpaste.com/hold/1656798/ generated by this dts:
  
   usdhc3 {
   pinctrl-names = default;
   pinctrl-0 = pinctrl_usdhc3_1;
   bus-width = 8;
   non-removable;
   status = okay;
   };
  
   usbh1 {
   status = okay;
   };
  
   usbh2 {
   pinctrl-names = idle, active;
   pinctrl-0 = pinctrl_usbh2_1;
   pinctrl-1 = pinctrl_usbh2_2;
   osc-clkgate-delay = 0x3;
   status = okay;
   };
  
   usbh3 {
   pinctrl-names = idle, active;
   pinctrl-0 = pinctrl_usbh3_1;
   pinctrl-1 = pinctrl_usbh3_2;
   osc-clkgate-delay = 0x3;
   status = okay;
   };
  
   fec {
   pinctrl-names = default;
   pinctrl-0 = pinctrl_enet_4;
   phy-mode = mii;
   status = okay;
   };
  
   greets
   --
   Christian Gmeiner, MSc
  
   https://soundcloud.com/christian-gmeiner
  
 
  try to cherry-pick
  https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=73de93440186c595a031046e266f6caaac106aa0
 
  were you successful with this patch?
  If not: Have you already tried to disable the fec? I'm asking, because I
  saw
  this comment from Peter Chen:
  Since hsic has pin conflict with ethernet, we disable ethernet at this
  dts
 
  I can also offer you to upload a bootlog of our IMX6Q board with HSIC
  working on
  Bus 003, if it helps.

 That would be awesome. Could you enable regulator and chipidea debug
 in the kernel. Would it be a problem to get the used
 kernel configuration too?


Here is the bootlog:
http://dpaste.com/hold/1665533/

And here is my kernelconfig for 3.13:
http://dpaste.com/hold/1665559/


 
  By the way: I was using the patch from
  http://www.spinics.net/lists/arm-kernel/msg303287.html for my board in
  previous
  kernel versions.
 

 That did not work

Well, it's not the only patch that we were using in 3.10 kernel: We had 30
chipidea patches on the 3.10 kernel. Fortunately a lot of them have been
integrated into the mainline, but 4 of them are still remaining. Currently I
don't know, if they are necessary for proper HSIC function.

 - maybe its a hw problem in the design.


As you can see from the bootlog, we have connected a SMSC USB4640 HSIC hub to
the I.MX. with pin 43 (HSIC_STROBE) connected to pin C23 (RGMII_TX_CTL) of
the IMX  and pin 42 (HSIC_DAT) connected to pin D21 (RGMII_TXC) of the IMX.
It seems that pin 39 (HSIC_IMP) of the SMSC chip is set to high (= approx.
50 Ohm impedance, according to the USB4640 datasheet).


Kind regards,
 Rolf
--
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: phy: am335x: Use SIMPLE_DEV_PM_OPS macro

2014-02-27 Thread Jingoo Han
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.

Signed-off-by: Jingoo Han jg1@samsung.com
---
 drivers/usb/phy/phy-am335x.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c
index 12fc346..ebf8373 100644
--- a/drivers/usb/phy/phy-am335x.c
+++ b/drivers/usb/phy/phy-am335x.c
@@ -123,9 +123,7 @@ static int am335x_phy_resume(struct device *dev)
return 0;
 }
 
-static const struct dev_pm_ops am335x_pm_ops = {
-   SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume)
-};
+static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume);
 
 #define DEV_PM_OPS (am335x_pm_ops)
 #else
-- 
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


Re: [PATCH] usb: gadget: return the right length in ffs_epfile_io()

2014-02-27 Thread Michal Nazarewicz
On Thu, Feb 27 2014, Chuansheng Liu chuansheng@intel.com wrote:
 When the request length is aligned to maxpacketsize, sometimes
 the return length ret  the user space requested len.

 At that time, we will use min_t(size_t, ret, len) to limit the
 size in case of user data buffer overflow.

 But we need return the min_t(size_t, ret, len) to tell the user
 space rightly also.

 Signed-off-by: Chuansheng Liu chuansheng@intel.com

Acked-by: Michal Nazarewicz min...@mina86.com

 ---
  drivers/usb/gadget/f_fs.c | 10 ++
  1 file changed, 6 insertions(+), 4 deletions(-)

 diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
 index 2b43343..31ee7af 100644
 --- a/drivers/usb/gadget/f_fs.c
 +++ b/drivers/usb/gadget/f_fs.c
 @@ -687,10 +687,12 @@ static ssize_t ffs_epfile_io(struct file *file,
* space for.
*/
   ret = ep-status;
 - if (read  ret  0 
 - unlikely(copy_to_user(buf, data,
 -   min_t(size_t, ret, len
 - ret = -EFAULT;
 + if (read  ret  0) {
 + ret = min_t(size_t, ret, len);
 +
 + if (unlikely(copy_to_user(buf, data, ret)))
 + ret = -EFAULT;
 + }
   }
   }
  
 -- 
 1.9.rc0


-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +--m...@google.com--xmpp:min...@jabber.org--ooO--(_)--Ooo--


signature.asc
Description: PGP signature


ASSISTANCE

2014-02-27 Thread Abu Bakr


-- 
Good day,

Looking for assistance!!

I am Abu Bakr, a rebel leader here in Aleppo Syria, I and my 

second in command came across some money that was parked in a 

trunk box, worth over $ 15 million,
In President Bashar al-Assad's allies house,
we moved the trunk box out of the war zone to the United 

Nations office as medical equipment,
But we are looking for reliable person, we can save this money 

on his/her custody pending when we are going to finish the 

fight here in my country Syria.
If you can be of a help,
kindly get back to us through this 
private e-mail: abubakr...@yahoo.co.jp

Yours sincerely 

Abu Bakr
--
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] phy-rcar-gen2-usb: add device tree support

2014-02-27 Thread Ben Dooks

On 27/02/14 00:12, Sergei Shtylyov wrote:

Add support of the device tree probing for the Renesas R-Car generation 2 SoCs
documenting the device tree binding as necessary.


So what happened w.r.t to my last set of patches for this?

--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
--
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: request for pointer to documentation on WUSB

2014-02-27 Thread Oliver Neukum
On Tue, 2014-02-25 at 14:26 -0600, Thomas Pugliese wrote:

 Hi Oliver,
 There is some documentation for WUSB scattered across the files below but 
 it is not very detailed.
 
 Documentation/usb/wusb-cbaf
 Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
 Documentation/ABI/testing/sysfs-wusb_cbaf
 Documentation/ABI/testing/sysfs-bus-usb
 
 The basic set of steps to set up a WUSB connection are:

Thank you, there is some documentation. I am trying to get
my head around it.

Thanks
Oliver

 1.  Start the wireless channel by storing a CHID value to the host 
 controller's wusb_chid sysfs attribute.

That unfortunately fails:
[66488.705043] usb 1-1.2: new high-speed USB device number 9 using
ehci-pci
[66488.791581] usb 1-1.2: New USB device found, idVendor=13cf,
idProduct=1200
[66488.791587] usb 1-1.2: New USB device strings: Mfr=2, Product=1,
SerialNumber=3
[66488.791599] usb 1-1.2: Product: Wireless USB Dongle
[66488.791601] usb 1-1.2: Manufacturer:  
[66488.791603] usb 1-1.2: SerialNumber: 123456789
[66489.947323] usb 1-1.2: supported encryption types: CCM-1 (0x01) 
[66489.947347] hwa-hc 1-1.2:1.0: Wireless USB HWA host controller
[66489.947355] hwa-hc 1-1.2:1.0: new USB bus registered, assigned bus
number 5
[66490.000964] hwa-hc 1-1.2:1.0: Wireless USB Cluster ID set to 0xfe
[66490.001146] usb usb5: New USB device found, idVendor=1d6b,
idProduct=0002
[66490.001150] usb usb5: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[66490.001152] usb usb5: Product: Wireless USB HWA host controller
[66490.001154] usb usb5: Manufacturer: Linux 3.14.0-rc1-12-desktop+
hwa-hcd
[66490.001156] usb usb5: SerialNumber: wusb-hwa
[66490.001346] hub 5-0:1.0: USB hub found
[66490.001378] hub 5-0:1.0: 5 ports detected
[66490.004861] uwb_rc uwb0: new uwb radio controller (mac
03:00:00:00:1c:af dev 70:b6) on usb 1-1.2:1.1

[66571.177082] uwb_rc uwb0: Cannot set new IE on device: -110


 
 2.  As child devices connect, verify that the value read from their 
 wusb_cdid sysfs attribute matches a known device.
 
 3.  If the device is known, set the device's wusb_ck attribute to the 
 private CKEY value for that device in order to authenticate it.
 
 4.  Once authenticated, set the authorized attribute to 1 to allow the usb 
 core to enumerate the device.
 
 Once that is done, the device should look like any other USB device in the 
 system.
 
 Hope this helps,
 
 Thomas
 --
 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



--
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: hub: usb_ext_cap_descriptor.bmAttributes is le32

2014-02-27 Thread Bjørn Mork
Better check the correct bit on big endian systems too. Shuts
up the following sparse __CHECK_ENDIAN__ warning:

  .../hub.c:3965:32: warning: restricted __le32 degrades to integer

Signed-off-by: Bjørn Mork bj...@mork.no
---
 drivers/usb/core/hub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 519f2c3594b2..33c920104776 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3962,7 +3962,7 @@ static void hub_set_initial_usb2_lpm_policy(struct 
usb_device *udev)
connect_type = usb_get_hub_port_connect_type(udev-parent,
udev-portnum);
 
-   if ((udev-bos-ext_cap-bmAttributes  USB_BESL_SUPPORT) ||
+   if ((udev-bos-ext_cap-bmAttributes  cpu_to_le32(USB_BESL_SUPPORT)) 
||
connect_type == USB_PORT_CONNECT_TYPE_HARD_WIRED) {
udev-usb2_hw_lpm_allowed = 1;
usb_set_usb2_hardware_lpm(udev, 1);
-- 
1.9.0

--
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/1] Memory leak in usbip_exported_device_new

2014-02-27 Thread xypron . glpk
From: Heinrich Schuchardt xypron.g...@gmx.de

Memory was leaked and a device not closed.

Signed-off-by: Heinrich Schuchardt xypron.g...@gmx.de
---
 drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c 
b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
index 71a449c..6a92f0f 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c
@@ -102,6 +102,7 @@ static int32_t read_attr_usbip_status(struct 
usbip_usb_device *udev)
 static struct usbip_exported_device *usbip_exported_device_new(char *sdevpath)
 {
struct usbip_exported_device *edev = NULL;
+   struct usbip_exported_device *edev_old;
size_t size;
int i;
 
@@ -127,8 +128,10 @@ static struct usbip_exported_device 
*usbip_exported_device_new(char *sdevpath)
size = sizeof(*edev) + edev-udev.bNumInterfaces *
sizeof(struct usbip_usb_interface);
 
+   edev_old = edev;
edev = realloc(edev, size);
if (!edev) {
+   edev = edev_old;
dbg(realloc failed);
goto err;
}
-- 
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


Re: request for pointer to documentation on WUSB

2014-02-27 Thread Thomas Pugliese


On Thu, 27 Feb 2014, Oliver Neukum wrote:

 On Tue, 2014-02-25 at 14:26 -0600, Thomas Pugliese wrote:
 
  Hi Oliver,
 
  1.  Start the wireless channel by storing a CHID value to the host 
  controller's wusb_chid sysfs attribute.
 
 That unfortunately fails:
 [66488.705043] usb 1-1.2: new high-speed USB device number 9 using
 ehci-pci
 [66488.791581] usb 1-1.2: New USB device found, idVendor=13cf,
 idProduct=1200
 [66488.791587] usb 1-1.2: New USB device strings: Mfr=2, Product=1,
 SerialNumber=3
 [66488.791599] usb 1-1.2: Product: Wireless USB Dongle
 [66488.791601] usb 1-1.2: Manufacturer:  
 [66488.791603] usb 1-1.2: SerialNumber: 123456789
 [66489.947323] usb 1-1.2: supported encryption types: CCM-1 (0x01) 
 [66489.947347] hwa-hc 1-1.2:1.0: Wireless USB HWA host controller
 [66489.947355] hwa-hc 1-1.2:1.0: new USB bus registered, assigned bus
 number 5
 [66490.000964] hwa-hc 1-1.2:1.0: Wireless USB Cluster ID set to 0xfe
 [66490.001146] usb usb5: New USB device found, idVendor=1d6b,
 idProduct=0002
 [66490.001150] usb usb5: New USB device strings: Mfr=3, Product=2,
 SerialNumber=1
 [66490.001152] usb usb5: Product: Wireless USB HWA host controller
 [66490.001154] usb usb5: Manufacturer: Linux 3.14.0-rc1-12-desktop+
 hwa-hcd
 [66490.001156] usb usb5: SerialNumber: wusb-hwa
 [66490.001346] hub 5-0:1.0: USB hub found
 [66490.001378] hub 5-0:1.0: 5 ports detected
 [66490.004861] uwb_rc uwb0: new uwb radio controller (mac
 03:00:00:00:1c:af dev 70:b6) on usb 1-1.2:1.1
 
 [66571.177082] uwb_rc uwb0: Cannot set new IE on device: -110
 
 

I believe that device is based on an older Alereon chipset which along 
with most other HWAs uses the updated WHCI protocol for UWB/URC commands.  
Try this patch and see if it helps.

Thomas


diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
index 0257f35..645789e 100644
--- a/drivers/uwb/hwa-rc.c
+++ b/drivers/uwb/hwa-rc.c
@@ -920,6 +920,9 @@ static const struct usb_device_id hwarc_id_table[] = {
/* Alereon 5611 */
{ USB_DEVICE_AND_INTERFACE_INFO(0x13dc, 0x5611, 0xe0, 0x01, 0x02),
  .driver_info = WUSB_QUIRK_WHCI_CMD_EVT },
+   /* IOGear 1200 */
+   { USB_DEVICE_AND_INTERFACE_INFO(0x13cf, 0x1200, 0xe0, 0x01, 0x02),
+ .driver_info = WUSB_QUIRK_WHCI_CMD_EVT },
/* Generic match for the Radio Control interface */
{ USB_INTERFACE_INFO(0xe0, 0x01, 0x02), },
{ },
--
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 v9 0/9] USB Host support for OMAP5 uEVM

2014-02-27 Thread Roger Quadros
Hi,

This patchset brings up USB Host ports and Ethernet port on
the OMAP5 uEVM board.

It also does some cleanup with respect to DT clock binding
for the mfd/omap-usb-host driver.

Please queue these for -next.

Lee,

I've folded some platform data dependent patches with mfd patches
so that they don't break functionality when applied individually.
You can safely pull in all MFD patches (1 to 6).

Tony  Benoit,

Can you please accept patches 7, 8 and 9?

Thanks.

Tested on:
 - OMAP5 uEVM
 - Pandaboard ES Rev. B1
 - Beagleboard-XM Rev C2 (DT + Legacy)
 - Beagleboard Rev C4 (DT + Legacy)

Changelog:

v9:
- Folded dependent platform data patches into MFD patches.

v8:
- Addressed review comments and split patch
  mfd: omap-usb-host: Get clocks based on hardware revision
- Removed unnecessary usb host dummy clocks on OMAP3
- Removed unnecessary clock alias ehci_logic_fck for OMAP3
- Rebased on 3.14-rc3

v7:
- Rebased on 3.14-rc2
- Removed incompatible ids from DT files and examples

v6:
- Initialized clocks to -ENODEV and split patch 3.

v5:
- Expose all clocks in the DT binding document for mfd:omap-usb-host
and mfd:omap-usb-tll

v4:
- Updated DT binding document for clock binding

v3:
- Rebased on top of 3.13-rc7

cheers,
-roger

---
Roger Quadros (9):
  mfd: omap-usb-host: Get clocks based on hardware revision
  mfd: omap-usb-host: Always fail on clk_get() error
  mfd: omap-usb-host: Use proper clock name instead of alias
  mfd: omap-usb-host: Use clock names as per function for reference
clocks
  mfd: omap-usb-host: Update DT clock binding information
  mfd: omap-usb-tll: Update DT clock binding information
  ARM: OMAP2+: Remove legacy_init_ehci_clk()
  ARM: dts: OMAP2+: Get rid of incompatible ids for USB host nodes
  usb: omap: dts: Update DT binding example usage

 .../devicetree/bindings/mfd/omap-usb-host.txt  |  23 
 .../devicetree/bindings/mfd/omap-usb-tll.txt   |  10 ++
 .../devicetree/bindings/usb/ehci-omap.txt  |   2 +-
 .../devicetree/bindings/usb/ohci-omap3.txt |   2 +-
 arch/arm/boot/dts/omap3.dtsi   |   4 +-
 arch/arm/boot/dts/omap4-panda-common.dtsi  |   8 +-
 arch/arm/boot/dts/omap4.dtsi   |  10 +-
 arch/arm/boot/dts/omap5-uevm.dts   |   8 +-
 arch/arm/boot/dts/omap5.dtsi   |  10 +-
 arch/arm/mach-omap2/cclock3xxx_data.c  |   4 -
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   6 --
 arch/arm/mach-omap2/pdata-quirks.c |  16 ---
 drivers/clk/ti/clk-3xxx.c  |   4 -
 drivers/mfd/omap-usb-host.c| 116 ++---
 14 files changed, 135 insertions(+), 88 deletions(-)

-- 
1.8.3.2

--
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 v9 5/9] mfd: omap-usb-host: Update DT clock binding information

2014-02-27 Thread Roger Quadros
The omap-usb-host driver expects certained named clocks.
Add this information to the DT binding document.

CC: Lee Jones lee.jo...@linaro.org
CC: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 .../devicetree/bindings/mfd/omap-usb-host.txt  | 23 ++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt 
b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
index b381fa6..4721b2d 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt
@@ -32,6 +32,29 @@ Optional properties:
 - single-ulpi-bypass: Must be present if the controller contains a single
   ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1
 
+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+  clock-names.
+
+- clock-names: should include:
+  For OMAP3
+  * usbhost_120m_fck - 120MHz Functional clock.
+
+  For OMAP4+
+  * refclk_60m_int - 60MHz internal reference clock for UTMI clock mux
+  * refclk_60m_ext_p1 - 60MHz external ref. clock for Port 1's UTMI clock 
mux.
+  * refclk_60m_ext_p2 - 60MHz external ref. clock for Port 2's UTMI clock mux
+  * utmi_p1_gfclk - Port 1 UTMI clock mux.
+  * utmi_p2_gfclk - Port 2 UTMI clock mux.
+  * usb_host_hs_utmi_p1_clk - Port 1 UTMI clock gate.
+  * usb_host_hs_utmi_p2_clk - Port 2 UTMI clock gate.
+  * usb_host_hs_utmi_p3_clk - Port 3 UTMI clock gate.
+  * usb_host_hs_hsic480m_p1_clk - Port 1 480MHz HSIC clock gate.
+  * usb_host_hs_hsic480m_p2_clk - Port 2 480MHz HSIC clock gate.
+  * usb_host_hs_hsic480m_p3_clk - Port 3 480MHz HSIC clock gate.
+  * usb_host_hs_hsic60m_p1_clk - Port 1 60MHz HSIC clock gate.
+  * usb_host_hs_hsic60m_p2_clk - Port 2 60MHz HSIC clock gate.
+  * usb_host_hs_hsic60m_p3_clk - Port 3 60MHz HSIC clock gate.
+
 Required properties if child node exists:
 
 - #address-cells: Must be 1
-- 
1.8.3.2

--
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 v9 3/9] mfd: omap-usb-host: Use proper clock name instead of alias

2014-02-27 Thread Roger Quadros
Use the proper clock name 'usbhost_120m_fck' instead of the
alias 'ehci_logic_fck'

Get rid of the 'ehci_logic_fck' alias from the OMAP3 hwmod data
as well.

CC: Paul Walmsley p...@pwsan.com
CC: Lee Jones lee.jo...@linaro.org
CC: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 6 --
 drivers/mfd/omap-usb-host.c| 5 +++--
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4c3b1e6..ad87f46 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1955,10 +1955,6 @@ static struct omap_hwmod_class 
omap3xxx_usb_host_hs_hwmod_class = {
.sysc = omap3xxx_usb_host_hs_sysc,
 };
 
-static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
- { .role = ehci_logic_fck, .clk = usbhost_120m_fck, },
-};
-
 static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
{ .name = ohci-irq, .irq = 76 + OMAP_INTC_START, },
{ .name = ehci-irq, .irq = 77 + OMAP_INTC_START, },
@@ -1981,8 +1977,6 @@ static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
.idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
},
},
-   .opt_clks   = omap3xxx_usb_host_hs_opt_clks,
-   .opt_clks_cnt   = ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks),
 
/*
 * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index c31baa7..865c276 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -692,10 +692,11 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 
if (need_logic_fck) {
omap-ehci_logic_fck = devm_clk_get(dev,
-   ehci_logic_fck);
+   usbhost_120m_fck);
if (IS_ERR(omap-ehci_logic_fck)) {
ret = PTR_ERR(omap-ehci_logic_fck);
-   dev_err(dev, ehci_logic_fck failed:%d\n, ret);
+   dev_err(dev, usbhost_120m_fck failed:%d\n,
+   ret);
goto err_mem;
}
}
-- 
1.8.3.2

--
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 v9 4/9] mfd: omap-usb-host: Use clock names as per function for reference clocks

2014-02-27 Thread Roger Quadros
Use a meaningful name for the reference clocks so that it indicates the 
function.

Update the OMAP4+ USB Host node as well to be in sync with the changes.

CC: Benoît Cousson bcous...@baylibre.com
CC: Lee Jones lee.jo...@linaro.org
CC: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap4.dtsi |  6 ++
 arch/arm/boot/dts/omap5.dtsi |  6 ++
 drivers/mfd/omap-usb-host.c  | 12 ++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index d3f8a6e..39a05ce 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -697,6 +697,12 @@
#address-cells = 1;
#size-cells = 1;
ranges;
+   clocks = init_60m_fclk,
+xclk60mhsp1_ck,
+xclk60mhsp2_ck;
+   clock-names = refclk_60m_int,
+ refclk_60m_ext_p1,
+ refclk_60m_ext_p2;
 
usbhsohci: ohci@4a064800 {
compatible = ti,ohci-omap3, usb-ohci;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index a72813a..d4dae48 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -775,6 +775,12 @@
#address-cells = 1;
#size-cells = 1;
ranges;
+   clocks = l3init_60m_fclk,
+xclk60mhsp1_ck,
+xclk60mhsp2_ck;
+   clock-names = refclk_60m_int,
+ refclk_60m_ext_p1,
+ refclk_60m_ext_p2;
 
usbhsohci: ohci@4a064800 {
compatible = ti,ohci-omap3, usb-ohci;
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 865c276..651e249 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -718,24 +718,24 @@ static int usbhs_omap_probe(struct platform_device *pdev)
goto err_mem;
}
 
-   omap-xclk60mhsp1_ck = devm_clk_get(dev, xclk60mhsp1_ck);
+   omap-xclk60mhsp1_ck = devm_clk_get(dev, refclk_60m_ext_p1);
if (IS_ERR(omap-xclk60mhsp1_ck)) {
ret = PTR_ERR(omap-xclk60mhsp1_ck);
-   dev_err(dev, xclk60mhsp1_ck failed error:%d\n, ret);
+   dev_err(dev, refclk_60m_ext_p1 failed error:%d\n, ret);
goto err_mem;
}
 
-   omap-xclk60mhsp2_ck = devm_clk_get(dev, xclk60mhsp2_ck);
+   omap-xclk60mhsp2_ck = devm_clk_get(dev, refclk_60m_ext_p2);
if (IS_ERR(omap-xclk60mhsp2_ck)) {
ret = PTR_ERR(omap-xclk60mhsp2_ck);
-   dev_err(dev, xclk60mhsp2_ck failed error:%d\n, ret);
+   dev_err(dev, refclk_60m_ext_p2 failed error:%d\n, ret);
goto err_mem;
}
 
-   omap-init_60m_fclk = devm_clk_get(dev, init_60m_fclk);
+   omap-init_60m_fclk = devm_clk_get(dev, refclk_60m_int);
if (IS_ERR(omap-init_60m_fclk)) {
ret = PTR_ERR(omap-init_60m_fclk);
-   dev_err(dev, init_60m_fclk failed error:%d\n, ret);
+   dev_err(dev, refclk_60m_int failed error:%d\n, ret);
goto err_mem;
}
 
-- 
1.8.3.2

--
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 v9 6/9] mfd: omap-usb-tll: Update DT clock binding information

2014-02-27 Thread Roger Quadros
The omap-usb-tll driver needs one clock for each TLL channel.
Add this information to the DT binding document.

CC: Lee Jones lee.jo...@linaro.org
CC: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt 
b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
index 62fe697..c58d704 100644
--- a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
+++ b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
@@ -7,6 +7,16 @@ Required properties:
 - interrupts : should contain the TLL module's interrupt
 - ti,hwmod : must contain usb_tll_hs
 
+Optional properties:
+
+- clocks: a list of phandles and clock-specifier pairs, one for each entry in
+  clock-names.
+
+- clock-names: should include:
+  * usb_tll_hs_usb_ch0_clk - USB TLL channel 0 clock
+  * usb_tll_hs_usb_ch1_clk - USB TLL channel 1 clock
+  * usb_tll_hs_usb_ch2_clk - USB TLL channel 2 clock
+
 Example:
 
usbhstll: usbhstll@4a062000 {
-- 
1.8.3.2

--
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 v9 8/9] ARM: dts: OMAP2+: Get rid of incompatible ids for USB host nodes

2014-02-27 Thread Roger Quadros
The OMAP EHCI and OHCI controllers are not compatible with drivers
other than ti,ehci-omap and ti,ohci-omap3 respectively, so get
rid of the incompatible ids.

CC: Alan Stern st...@rowland.harvard.edu
CC: Nishant Menon n...@ti.com
CC: Kevin Hilman khil...@linaro.org
Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap3.dtsi | 4 ++--
 arch/arm/boot/dts/omap4.dtsi | 4 ++--
 arch/arm/boot/dts/omap5.dtsi | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index a5fc83b..8e7de9e 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -634,14 +634,14 @@
ranges;
 
usbhsohci: ohci@48064400 {
-   compatible = ti,ohci-omap3, usb-ohci;
+   compatible = ti,ohci-omap3;
reg = 0x48064400 0x400;
interrupt-parent = intc;
interrupts = 76;
};
 
usbhsehci: ehci@48064800 {
-   compatible = ti,ehci-omap, usb-ehci;
+   compatible = ti,ehci-omap;
reg = 0x48064800 0x400;
interrupt-parent = intc;
interrupts = 77;
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 39a05ce..ff1b057 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -705,14 +705,14 @@
  refclk_60m_ext_p2;
 
usbhsohci: ohci@4a064800 {
-   compatible = ti,ohci-omap3, usb-ohci;
+   compatible = ti,ohci-omap3;
reg = 0x4a064800 0x400;
interrupt-parent = gic;
interrupts = GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH;
};
 
usbhsehci: ehci@4a064c00 {
-   compatible = ti,ehci-omap, usb-ehci;
+   compatible = ti,ehci-omap;
reg = 0x4a064c00 0x400;
interrupt-parent = gic;
interrupts = GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index d4dae48..f65aa65 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -783,14 +783,14 @@
  refclk_60m_ext_p2;
 
usbhsohci: ohci@4a064800 {
-   compatible = ti,ohci-omap3, usb-ohci;
+   compatible = ti,ohci-omap3;
reg = 0x4a064800 0x400;
interrupt-parent = gic;
interrupts = GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH;
};
 
usbhsehci: ehci@4a064c00 {
-   compatible = ti,ehci-omap, usb-ehci;
+   compatible = ti,ehci-omap;
reg = 0x4a064c00 0x400;
interrupt-parent = gic;
interrupts = GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH;
-- 
1.8.3.2

--
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 v9 7/9] ARM: OMAP2+: Remove legacy_init_ehci_clk()

2014-02-27 Thread Roger Quadros
The necessary clock phandle for the EHCI clock is now provided
via device tree so we no longer need this legacy method.

Update the omap4-panda and omap5-uevm board DTS to provide the
necessary EHCI PHY clock information.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap4-panda-common.dtsi |  8 ++--
 arch/arm/boot/dts/omap5-uevm.dts  |  8 ++--
 arch/arm/mach-omap2/pdata-quirks.c| 16 
 3 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi 
b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 88c6a05..50b72966 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -83,12 +83,8 @@
compatible = usb-nop-xceiv;
reset-gpios = gpio2 30 GPIO_ACTIVE_LOW;   /* gpio_62 */
vcc-supply = hsusb1_power;
-   /**
-* FIXME:
-* put the right clock phandle here when available
-*  clocks = auxclk3;
-*  clock-names = main_clk;
-*/
+   clocks = auxclk3_ck;
+   clock-names = main_clk;
clock-frequency = 1920;
};
 
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 002fa70..3b99ec2 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -31,12 +31,8 @@
hsusb2_phy: hsusb2_phy {
compatible = usb-nop-xceiv;
reset-gpios = gpio3 16 GPIO_ACTIVE_LOW; /* gpio3_80 
HUB_NRESET */
-   /**
- * FIXME
- * Put the right clock phandle here when available
- * clocks = auxclk1;
- * clock-names = main_clk;
- */
+   clocks = auxclk1_ck;
+   clock-names = main_clk;
clock-frequency = 1920;
};
 
diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 3d5b24d..f1ecd86 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -31,20 +31,6 @@ struct pdata_init {
 struct of_dev_auxdata omap_auxdata_lookup[];
 static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
-/*
- * Create alias for USB host PHY clock.
- * Remove this when clock phandle can be provided via DT
- */
-static void __init __used legacy_init_ehci_clk(char *clkname)
-{
-   int ret;
-
-   ret = clk_add_alias(main_clk, NULL, clkname, NULL);
-   if (ret)
-   pr_err(%s:Failed to add main_clk alias to %s :%d\n,
-  __func__, clkname, ret);
-}
-
 #if IS_ENABLED(CONFIG_WL12XX)
 
 static struct wl12xx_platform_data wl12xx __initdata;
@@ -182,7 +168,6 @@ static void __init omap4_sdp_legacy_init(void)
 static void __init omap4_panda_legacy_init(void)
 {
omap4_panda_display_init_of();
-   legacy_init_ehci_clk(auxclk3_ck);
legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
 }
 #endif
@@ -190,7 +175,6 @@ static void __init omap4_panda_legacy_init(void)
 #ifdef CONFIG_SOC_OMAP5
 static void __init omap5_uevm_legacy_init(void)
 {
-   legacy_init_ehci_clk(auxclk1_ck);
 }
 #endif
 
-- 
1.8.3.2

--
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: HSIC on imx6

2014-02-27 Thread Rolf Evers-Fischer
 Rolf Evers-Fischer embedde...@evers-fischer.de hat am 27. Februar 2014 um
 12:43 geschrieben:

 Well, it's not the only patch that we were using in 3.10 kernel: We had 30
 chipidea patches on the 3.10 kernel. Fortunately a lot of them have been
 integrated into the mainline, but 4 of them are still remaining. Currently I
 don't know, if they are necessary for proper HSIC function.


I've just removed the 4 chipidea patches that I mentioned in my previous mail -
and HSIC still works.
It seems that these patches have no impact on the HSIC function!
--
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 v9 2/9] mfd: omap-usb-host: Always fail on clk_get() error

2014-02-27 Thread Roger Quadros
Be more strict and always fail on clk_get() error.

CC: Lee Jones lee.jo...@linaro.org
CC: Samuel Ortiz sa...@linux.intel.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 drivers/mfd/omap-usb-host.c | 62 +
 1 file changed, 40 insertions(+), 22 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index c63bfdf..c31baa7 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -695,7 +695,8 @@ static int usbhs_omap_probe(struct platform_device *pdev)
ehci_logic_fck);
if (IS_ERR(omap-ehci_logic_fck)) {
ret = PTR_ERR(omap-ehci_logic_fck);
-   dev_dbg(dev, ehci_logic_fck failed:%d\n, ret);
+   dev_err(dev, ehci_logic_fck failed:%d\n, ret);
+   goto err_mem;
}
}
goto initialize;
@@ -749,51 +750,68 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 * them
 */
omap-utmi_clk[i] = devm_clk_get(dev, clkname);
-   if (IS_ERR(omap-utmi_clk[i]))
-   dev_dbg(dev, Failed to get clock : %s : %ld\n,
-   clkname, PTR_ERR(omap-utmi_clk[i]));
+   if (IS_ERR(omap-utmi_clk[i])) {
+   ret = PTR_ERR(omap-utmi_clk[i]);
+   dev_err(dev, Failed to get clock : %s : %d\n,
+   clkname, ret);
+   goto err_mem;
+   }
 
snprintf(clkname, sizeof(clkname),
usb_host_hs_hsic480m_p%d_clk, i + 1);
omap-hsic480m_clk[i] = devm_clk_get(dev, clkname);
-   if (IS_ERR(omap-hsic480m_clk[i]))
-   dev_dbg(dev, Failed to get clock : %s : %ld\n,
-   clkname, PTR_ERR(omap-hsic480m_clk[i]));
+   if (IS_ERR(omap-hsic480m_clk[i])) {
+   ret = PTR_ERR(omap-hsic480m_clk[i]);
+   dev_err(dev, Failed to get clock : %s : %d\n,
+   clkname, ret);
+   goto err_mem;
+   }
 
snprintf(clkname, sizeof(clkname),
usb_host_hs_hsic60m_p%d_clk, i + 1);
omap-hsic60m_clk[i] = devm_clk_get(dev, clkname);
-   if (IS_ERR(omap-hsic60m_clk[i]))
-   dev_dbg(dev, Failed to get clock : %s : %ld\n,
-   clkname, PTR_ERR(omap-hsic60m_clk[i]));
+   if (IS_ERR(omap-hsic60m_clk[i])) {
+   ret = PTR_ERR(omap-hsic60m_clk[i]);
+   dev_err(dev, Failed to get clock : %s : %d\n,
+   clkname, ret);
+   goto err_mem;
+   }
}
 
if (is_ehci_phy_mode(pdata-port_mode[0])) {
ret = clk_set_parent(omap-utmi_p1_gfclk,
omap-xclk60mhsp1_ck);
-   if (ret != 0)
-   dev_dbg(dev, xclk60mhsp1_ck set parent failed: %d\n,
-   ret);
+   if (ret != 0) {
+   dev_err(dev, xclk60mhsp1_ck set parent failed: %d\n,
+   ret);
+   goto err_mem;
+   }
} else if (is_ehci_tll_mode(pdata-port_mode[0])) {
ret = clk_set_parent(omap-utmi_p1_gfclk,
omap-init_60m_fclk);
-   if (ret != 0)
-   dev_dbg(dev, P0 init_60m_fclk set parent failed: %d\n,
-   ret);
+   if (ret != 0) {
+   dev_err(dev, P0 init_60m_fclk set parent failed: %d\n,
+   ret);
+   goto err_mem;
+   }
}
 
if (is_ehci_phy_mode(pdata-port_mode[1])) {
ret = clk_set_parent(omap-utmi_p2_gfclk,
omap-xclk60mhsp2_ck);
-   if (ret != 0)
-   dev_dbg(dev, xclk60mhsp2_ck set parent failed: %d\n,
-   ret);
+   if (ret != 0) {
+   dev_err(dev, xclk60mhsp2_ck set parent failed: %d\n,
+   ret);
+   goto err_mem;
+   }
} else if (is_ehci_tll_mode(pdata-port_mode[1])) {
ret = clk_set_parent(omap-utmi_p2_gfclk,
omap-init_60m_fclk);
-   if (ret != 0)
-   dev_dbg(dev, P1 init_60m_fclk set parent failed: %d\n,
-   ret);
+   if 

[PATCH v9 9/9] usb: omap: dts: Update DT binding example usage

2014-02-27 Thread Roger Quadros
Remove non-compatible id from examples.

CC: Alan Stern st...@rowland.harvard.edu
CC: Nishant Menon n...@ti.com
CC: Kevin Hilman khil...@linaro.org
Signed-off-by: Roger Quadros rog...@ti.com
---
 Documentation/devicetree/bindings/usb/ehci-omap.txt  | 2 +-
 Documentation/devicetree/bindings/usb/ohci-omap3.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/ehci-omap.txt 
b/Documentation/devicetree/bindings/usb/ehci-omap.txt
index 485a9a1..3dc231c 100644
--- a/Documentation/devicetree/bindings/usb/ehci-omap.txt
+++ b/Documentation/devicetree/bindings/usb/ehci-omap.txt
@@ -21,7 +21,7 @@ Documentation/devicetree/bindings/mfd/omap-usb-host.txt
 Example for OMAP4:
 
 usbhsehci: ehci@4a064c00 {
-   compatible = ti,ehci-omap, usb-ehci;
+   compatible = ti,ehci-omap;
reg = 0x4a064c00 0x400;
interrupts = 0 77 0x4;
 };
diff --git a/Documentation/devicetree/bindings/usb/ohci-omap3.txt 
b/Documentation/devicetree/bindings/usb/ohci-omap3.txt
index 14ab428..ce8c47cff 100644
--- a/Documentation/devicetree/bindings/usb/ohci-omap3.txt
+++ b/Documentation/devicetree/bindings/usb/ohci-omap3.txt
@@ -9,7 +9,7 @@ Required properties:
 Example for OMAP4:
 
 usbhsohci: ohci@4a064800 {
-   compatible = ti,ohci-omap3, usb-ohci;
+   compatible = ti,ohci-omap3;
reg = 0x4a064800 0x400;
interrupts = 0 76 0x4;
 };
-- 
1.8.3.2

--
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: HSIC on imx6

2014-02-27 Thread Christian Gmeiner
Hi Rolf

2014-02-27 15:19 GMT+01:00 Rolf Evers-Fischer embedde...@evers-fischer.de:
 Rolf Evers-Fischer embedde...@evers-fischer.de hat am 27. Februar 2014 um
 12:43 geschrieben:

 Well, it's not the only patch that we were using in 3.10 kernel: We had 30
 chipidea patches on the 3.10 kernel. Fortunately a lot of them have been
 integrated into the mainline, but 4 of them are still remaining. Currently I
 don't know, if they are necessary for proper HSIC function.


 I've just removed the 4 chipidea patches that I mentioned in my previous mail 
 -
 and HSIC still works.
 It seems that these patches have no impact on the HSIC function!

I am using a handfull of hsic patches on top of 3.13.5 kernel - see
https://drive.google.com/folderview?id=0B_fznDimUHVuS1BTTVRRSDFxTFUusp=sharing

I am running out of ideas right now - it may be time to connect a
oscilloscope and call the hw guy.

greets
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner
--
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] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro

2014-02-27 Thread Roger Quadros
Hi,

On 02/27/2014 01:47 PM, Jingoo Han wrote:
 Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
 
 Signed-off-by: Jingoo Han jg1@samsung.com
 ---
  drivers/usb/phy/phy-am335x.c |4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c
 index 12fc346..ebf8373 100644
 --- a/drivers/usb/phy/phy-am335x.c
 +++ b/drivers/usb/phy/phy-am335x.c
 @@ -123,9 +123,7 @@ static int am335x_phy_resume(struct device *dev)
   return 0;
  }
  
 -static const struct dev_pm_ops am335x_pm_ops = {
 - SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume)
 -};
 +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, 
 am335x_phy_resume);

You need to move this outside the #ifdef CONFIG_PM_SLEEP condition and get rid
of the DEV_PM_OPS macro below as well.

  
  #define DEV_PM_OPS (am335x_pm_ops)
  #else
 

cheers,
-roger
--
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: gadget: atmel_usba: fix crash when no endpoint are specified

2014-02-27 Thread Alexandre Belloni
If no endpoints are present in the device tree, the kernel will cras hwith the
following error:

Unable to handle kernel paging request at virtual address 00101008
[...]
[c0222ff4] (composite_dev_prepare) from [c022326c] 
(composite_bind+0x5c/0x190)
[c022326c] (composite_bind) from [c021ff8c] (udc_bind_to_driver+0x48/0xf0)
[c021ff8c] (udc_bind_to_driver) from [c02208e0] 
(usb_gadget_probe_driver+0x7c/0xa0)
[c02208e0] (usb_gadget_probe_driver) from [c0008970] 
(do_one_initcall+0x94/0x140)
[c0008970] (do_one_initcall) from [c04b4b50] 
(kernel_init_freeable+0xec/0x1b4)
[c04b4b50] (kernel_init_freeable) from [c0376cc4] (kernel_init+0x8/0xe4)
[c0376cc4] (kernel_init) from [c0009590] (ret_from_fork+0x14/0x24)
Code: e5950014 e1a04001 e5902008 e3a010d0 (e5922008)
---[ end trace 35c74bdd89b373d0 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b

This checks for that case and returns an error, not allowing the driver to be
loaded with no endpoints.

Signed-off-by: Alexandre Belloni alexandre.bell...@free-electrons.com
---
 drivers/usb/gadget/atmel_usba_udc.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c 
b/drivers/usb/gadget/atmel_usba_udc.c
index 52771d4c44bc..e3e0c8ff242e 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1914,6 +1914,12 @@ static struct usba_ep * atmel_udc_of_init(struct 
platform_device *pdev,
i++;
}
 
+   if (i == 0) {
+   dev_err(pdev-dev, of_probe: no endpoint specified\n);
+   ret = -EINVAL;
+   goto err;
+   }
+
return eps;
 err:
return ERR_PTR(ret);
-- 
1.8.3.2

--
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] phy-rcar-gen2-usb: add device tree support

2014-02-27 Thread Sergei Shtylyov

Hello.

On 27-02-2014 16:57, Ben Dooks wrote:


Add support of the device tree probing for the Renesas R-Car generation 2 SoCs
documenting the device tree binding as necessary.



So what happened w.r.t to my last set of patches for this?


   Hm, I forgot you've posted the OF patch already (and I was tasked with the 
PHY driver OF support). I have re-read the thread now, and the issue was that 
Felipe wanted an ACK from one of DT maintainers. I had issues with the 
compatible props the driver reacts on. Also, I didn't see your bindings doc 
patch the last time you posted the driver patch. I have one more issue now and 
will follow up to the patch with it...


WBR, Sergei

--
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: HSIC on imx6

2014-02-27 Thread Rolf Evers-Fischer
Hi Christian

 Christian Gmeiner christian.gmei...@gmail.com hat am 27. Februar 2014 um
 15:31 geschrieben:


 Hi Rolf

 2014-02-27 15:19 GMT+01:00 Rolf Evers-Fischer embedde...@evers-fischer.de:
  Rolf Evers-Fischer embedde...@evers-fischer.de hat am 27. Februar 2014 um
  12:43 geschrieben:
 
  Well, it's not the only patch that we were using in 3.10 kernel: We had 30
  chipidea patches on the 3.10 kernel. Fortunately a lot of them have been
  integrated into the mainline, but 4 of them are still remaining. Currently
  I
  don't know, if they are necessary for proper HSIC function.
 
 
  I've just removed the 4 chipidea patches that I mentioned in my previous
  mail -
  and HSIC still works.
  It seems that these patches have no impact on the HSIC function!

 I am using a handfull of hsic patches on top of 3.13.5 kernel - see
 https://drive.google.com/folderview?id=0B_fznDimUHVuS1BTTVRRSDFxTFUusp=sharing

Thank you for sharing your chipidea patches.

I'm only using 10 chipidea patches for 3.13:
 3 of them have been added to 3.13.5
 1 of them is for documentation only and shouldn't impact the functionality
 The remaining 6 patches are (using your filenames):
  - 0001.patch
  - 7a92...patch
  - 6e0b...patch
  - 555e...patch
  - 54e4...patch
  - bfb5...patch

 I am running out of ideas right now - it may be time to connect a
 oscilloscope and call the hw guy.


This is, what I did yesterday ;-)
If you are not successful, you may try to rebuild your kernel, using only the 6
patches, that I mentioned above.

I assume that you are still using your modified dts from this comment:
   http://article.gmane.org/gmane.linux.usb.general/103757
aren't you?

Ah! One more idea: Are you using spaces or tabs in your dts file? A lot of
devicetrees are using tabs for the first indentation, but maybe it's no matter,
what we are using.

Kind regards,
 Rolf
--
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] phy-rcar-gen2-usb: add device tree support

2014-02-27 Thread Mark Rutland
On Thu, Feb 27, 2014 at 12:12:50AM +, Sergei Shtylyov wrote:
 Add support of the device tree probing for the Renesas R-Car generation 2 SoCs
 documenting the device tree binding as necessary.
 
 Signed-off-by: Sergei Shtylyov sergei.shtyl...@cogentembedded.com
 
 ---
 This patch is against the 'next' branch of Felipe Balbi's 'usb.git' repo.
 
  Documentation/devicetree/bindings/usb/rcar-gen2-phy.txt |   29 +++
  drivers/usb/phy/phy-rcar-gen2-usb.c |   64 
 ++--
  2 files changed, 85 insertions(+), 8 deletions(-)
 
 Index: usb/Documentation/devicetree/bindings/usb/rcar-gen2-phy.txt
 ===
 --- /dev/null
 +++ usb/Documentation/devicetree/bindings/usb/rcar-gen2-phy.txt
 @@ -0,0 +1,29 @@
 +* Renesas R-Car generation 2 USB PHY
 +
 +This file provides information on what the device node for the R-Car 
 generation
 +2 USB PHY contains.
 +
 +Required properties:
 +- compatible: renesas,usb-phy-r8a7790 if the device is a part of R8A7790 
 SoC.
 +   renesas,usb-phy-r8a7791 if the device is a part of R8A7791 SoC.

Is the r8a7791's USB PHY known to be different to that of the r8a7790?

If this is just to possibly handle the two differently in future, why
not have renesas,usb-phy-r8a7790 as a fallback in the compatible list?
That was you only need it in the driver for now.

 +- reg: offset and length of the register block.
 +- clocks: clock phandle and specifier pair.
 +- clock-names: string, clock input name, must be usbhs.
 +
 +Optional properties:
 +- renesas,channel0-pci: boolean, specify when USB channel 0 should be 
 connected
 + to PCI EHCI/OHCI; otherwise, it will be connected to the
 + USBHS controller.
 +- renesas,channel2-pci: boolean, specify when USB channel 2 should be 
 connected
 + to PCI EHCI/OHCI; otherwise, it will be connected to the
 + USBSS controller (xHCI).

When would you want this to connect to PCI, and when would you not? Why
is this not a run-time decision?

 +
 +Example (Lager board):
 +
 + usb-phy@e6590100 {
 + compatible = renesas,usb-phy-r8a7790;
 + reg = 0 0xe6590100 0 0x100;
 + clocks = mstp7_clks R8A7790_CLK_HSUSB;
 + clock-names = usbhs;
 + renesas,channel2-pci;
 + };

We're not using the generic phy bindings? How is the linkage to the host
controller expressed?

[...]

 - clk = devm_clk_get(dev, usbhs);
 + if (np)
 + clk = of_clk_get_by_name(np, usbhs);
 + else
 + clk = clk_get(dev, usbhs);

Doesn't clk_get (and hence devm_clk_get) call of_clk_get_by_name?

Cheers,
Mark.
--
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] phy-rcar-gen2-usb: add device tree support

2014-02-27 Thread Ben Dooks

On 27/02/14 00:12, Sergei Shtylyov wrote:

Add support of the device tree probing for the Renesas R-Car generation 2 SoCs
documenting the device tree binding as necessary.


You've popped in some fixes for the driver probe in here as well.

Could you do the fixes as a patch and send those before the devicetree
code is done?


+
  static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
  {
struct device *dev = pdev-dev;
+   struct device_node *np = dev-of_node;
struct rcar_gen2_phy_platform_data *pdata;
struct rcar_gen2_usb_phy_priv *priv;
struct resource *res;
@@ -177,13 +210,19 @@ static int rcar_gen2_usb_phy_probe(struc
struct clk *clk;
int retval;

-   pdata = dev_get_platdata(dev);
+   if (np)
+   pdata = rcar_gen2_usb_phy_parse_dt(dev);
+   else
+   pdata = dev_get_platdata(dev);
if (!pdata) {
dev_err(dev, No platform data\n);
return -EINVAL;
}

-   clk = devm_clk_get(dev, usbhs);
+   if (np)
+   clk = of_clk_get_by_name(np, usbhs);
+   else
+   clk = clk_get(dev, usbhs);


Can be removed, just add a clock-name of usbhs in the device node.


if (IS_ERR(clk)) {
dev_err(dev, Can't get the clock\n);
return PTR_ERR(clk);
@@ -191,13 +230,16 @@ static int rcar_gen2_usb_phy_probe(struc

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res);
-   if (IS_ERR(base))
-   return PTR_ERR(base);
+   if (IS_ERR(base)) {
+   retval = PTR_ERR(base);
+   goto error;
+   }

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(dev, Memory allocation failed\n);
-   return -ENOMEM;
+   retval = -ENOMEM;
+   goto error;
}


Probably should be separate patch to fix probe issues.




spin_lock_init(priv-lock);
@@ -216,12 +258,16 @@ static int rcar_gen2_usb_phy_probe(struc
retval = usb_add_phy_dev(priv-phy);
if (retval  0) {
dev_err(dev, Failed to add USB phy\n);
-   return retval;
+   goto error;
}

platform_set_drvdata(pdev, priv);

return retval;
+
+error:
+   clk_put(clk);
+   return retval;
  }


Again, should have been rolled into fix patch.



--
Ben Dooks   http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
--
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: request for pointer to documentation on WUSB

2014-02-27 Thread Oliver Neukum
On Thu, 2014-02-27 at 08:05 -0600, Thomas Pugliese wrote:
 
 On Thu, 27 Feb 2014, Oliver Neukum wrote:
 
  On Tue, 2014-02-25 at 14:26 -0600, Thomas Pugliese wrote:

Hi,

  
   Hi Oliver,
  
   1.  Start the wireless channel by storing a CHID value to the host 
   controller's wusb_chid sysfs attribute.
  
  That unfortunately fails:
  [66488.705043] usb 1-1.2: new high-speed USB device number 9 using
  ehci-pci
  [66488.791581] usb 1-1.2: New USB device found, idVendor=13cf,
  idProduct=1200
  [66488.791587] usb 1-1.2: New USB device strings: Mfr=2, Product=1,
  SerialNumber=3
  [66488.791599] usb 1-1.2: Product: Wireless USB Dongle
  [66488.791601] usb 1-1.2: Manufacturer:  
  [66488.791603] usb 1-1.2: SerialNumber: 123456789
  [66489.947323] usb 1-1.2: supported encryption types: CCM-1 (0x01) 
  [66489.947347] hwa-hc 1-1.2:1.0: Wireless USB HWA host controller
  [66489.947355] hwa-hc 1-1.2:1.0: new USB bus registered, assigned bus
  number 5
  [66490.000964] hwa-hc 1-1.2:1.0: Wireless USB Cluster ID set to 0xfe
  [66490.001146] usb usb5: New USB device found, idVendor=1d6b,
  idProduct=0002
  [66490.001150] usb usb5: New USB device strings: Mfr=3, Product=2,
  SerialNumber=1
  [66490.001152] usb usb5: Product: Wireless USB HWA host controller
  [66490.001154] usb usb5: Manufacturer: Linux 3.14.0-rc1-12-desktop+
  hwa-hcd
  [66490.001156] usb usb5: SerialNumber: wusb-hwa
  [66490.001346] hub 5-0:1.0: USB hub found
  [66490.001378] hub 5-0:1.0: 5 ports detected
  [66490.004861] uwb_rc uwb0: new uwb radio controller (mac
  03:00:00:00:1c:af dev 70:b6) on usb 1-1.2:1.1
  
  [66571.177082] uwb_rc uwb0: Cannot set new IE on device: -110
  
  
 
 I believe that device is based on an older Alereon chipset which along 
 with most other HWAs uses the updated WHCI protocol for UWB/URC commands.  
 Try this patch and see if it helps.

I am afraid it does not help.

Regards
Oliver

[  885.978133] usb 1-1.2: new high-speed USB device number 5 using
ehci-pci
[  886.064733] usb 1-1.2: New USB device found, idVendor=13cf,
idProduct=1200
[  886.064741] usb 1-1.2: New USB device strings: Mfr=2, Product=1,
SerialNumber=3
[  886.064745] usb 1-1.2: Product: Wireless USB Dongle
[  886.064748] usb 1-1.2: Manufacturer:  
[  886.064750] usb 1-1.2: SerialNumber: 123456789
[  887.251811] uwb_rc uwb0: new uwb radio controller (mac
03:00:00:00:1c:af dev 9d:7b) on usb 1-1.2:1.1
[  887.251846] usbcore: registered new interface driver hwa-rc
[  887.271700] usb 1-1.2: supported encryption types: CCM-1 (0x01) 
[  887.271738] hwa-hc 1-1.2:1.0: Wireless USB HWA host controller
[  887.271751] hwa-hc 1-1.2:1.0: new USB bus registered, assigned bus
number 5
[  887.325053] hwa-hc 1-1.2:1.0: Wireless USB Cluster ID set to 0xfe
[  887.325112] usb usb5: New USB device found, idVendor=1d6b,
idProduct=0002
[  887.325116] usb usb5: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[  887.325120] usb usb5: Product: Wireless USB HWA host controller
[  887.325123] usb usb5: Manufacturer: Linux 3.14.0-rc3-12-desktop+
hwa-hcd
[  887.325126] usb usb5: SerialNumber: wusb-hwa
[  887.325390] hub 5-0:1.0: USB hub found
[  887.325403] hub 5-0:1.0: 5 ports detected
[  887.326799] usbcore: registered new interface driver hwa-hc
[ 1042.153236] uwb_rc uwb0: Cannot set new IE on device: -110

 Thomas
 
 
 diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
 index 0257f35..645789e 100644
 --- a/drivers/uwb/hwa-rc.c
 +++ b/drivers/uwb/hwa-rc.c
 @@ -920,6 +920,9 @@ static const struct usb_device_id hwarc_id_table[] = {
   /* Alereon 5611 */
   { USB_DEVICE_AND_INTERFACE_INFO(0x13dc, 0x5611, 0xe0, 0x01, 0x02),
 .driver_info = WUSB_QUIRK_WHCI_CMD_EVT },
 + /* IOGear 1200 */
 + { USB_DEVICE_AND_INTERFACE_INFO(0x13cf, 0x1200, 0xe0, 0x01, 0x02),
 +   .driver_info = WUSB_QUIRK_WHCI_CMD_EVT },
   /* Generic match for the Radio Control interface */
   { USB_INTERFACE_INFO(0xe0, 0x01, 0x02), },
   { },



--
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


[3.14-rc4 xHCI] Regression haswell B85 with xHCI on

2014-02-27 Thread Otto Meier
I migrated my system from H77 Ivy-bridge to a haswell Platform
B85 i3-4330.

The system has three dvb-c usb receivers connected. On the Ivy
Platform everything runs fine with xHCI. On the haswell Platform
xHCI explodes with  following messages:

2014-02-27T16:45:53.518332+01:00 vnas kernel: [  222.218703] xhci_hcd
:00:14.0: xHCI host not responding to stop endpoint command.
2014-02-27T16:45:53.518342+01:00 vnas kernel: [  222.218712] xhci_hcd
:00:14.0: Assuming host is dying, halting host.
2014-02-27T16:45:53.518346+01:00 vnas kernel: [  222.218808] xhci_hcd
:00:14.0: HC died; cleaning up
2014-02-27T16:45:53.518349+01:00 vnas kernel: [  222.218870] usb 1-1:
USB disconnect, device number 2
2014-02-27T16:45:53.518351+01:00 vnas kernel: [  222.218880] usb 1-1.2:
USB disconnect, device number 7
2014-02-27T16:45:53.518353+01:00 vnas kernel: [  222.218979] em2884 #0:
writing to i2c device at 0x52 failed (error=-19)
2014-02-27T16:45:53.518356+01:00 vnas kernel: [  222.218988] drxk: i2c
write error at addr 0x29
2014-02-27T16:45:53.518358+01:00 vnas kernel: [  222.218993] em2884 #2:
writing to i2c device at 0x52 failed (error=-19)
2014-02-27T16:45:53.518361+01:00 vnas kernel: [  222.218997] drxk: i2c
write error at addr 0x29
2014-02-27T16:45:53.518364+01:00 vnas kernel: [  222.219001] drxk:
write_block: i2c write error at addr 0x831ffd
2014-02-27T16:45:53.518366+01:00 vnas kernel: [  222.219006] drxk:
write_block: i2c write error at addr 0x831ffd
2014-02-27T16:45:53.518368+01:00 vnas kernel: [  222.219012] em2884 #1:
writing to i2c device at 0x52 failed (error=-19)
2014-02-27T16:45:53.518371+01:00 vnas kernel: [  222.219017] drxk: i2c
write error at addr 0x29
2014-02-27T16:45:53.518373+01:00 vnas kernel: [  222.219021] drxk:
write_block: i2c write error at addr 0x831ffd
2014-02-27T16:45:53.518375+01:00 vnas kernel: [  222.219070] em2884 #0:
Disconnecting em2884 #0
2014-02-27T16:45:53.518962+01:00 vnas kernel: [  222.219076] em2884 #0:
Closing audio extension

This happens when more then one DVB-C receiver is connected.
With only one it works.

If I disable xHCI Mode in Bios and run only with EHCI.
Everything is running fine either.

lsusb:

Bus 001 Device 002: ID 8087:8008 Intel
Corp.   

   

Bus 002 Device 002: ID 8087:8000 Intel
Corp.   

   

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root
hub  
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root
hub 


Bus 002 Device 003: ID
2109:2811   


Bus 002 Device 004: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
UART Bridge / myAVR mySmartUSB light
Bus 002 Device 005: ID 03eb:201l3 Atmel Corp.
Bus 002 Device 006: ID
9e88:9e8f   


Bus 002 Device 007: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 002 Device 008: ID 2040:1605
Hauppauge 
Bus 002 Device 009: ID 2040:1605
Hauppauge   
 

Bus 002 Device 010: ID 2040:1605 Hauppauge
Bus 002 Device 011: ID 04e6:5116 SCM Microsystems, Inc. SCR331-LC1 /
SCR3310 SmartCard Reader
Bus 002 Device 012: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth
Dongle (HCI mode)
Bus 002 Device 013: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
UART Bridge / myAVR mySmartUSB light
Bus 002 Device 014: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x
UART Bridge / myAVR mySmartUSB light

lspci: xHCI disabled:

00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM
Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th
Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core
Processor HD Audio Controller (rev 06)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series
Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset
Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset
High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset
Family PCI Express Root Port #1 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset

Re: [PATCH] phy-rcar-gen2-usb: add device tree support

2014-02-27 Thread Sergei Shtylyov

On 27-02-2014 20:06, Ben Dooks wrote:


Add support of the device tree probing for the Renesas R-Car generation 2 SoCs
documenting the device tree binding as necessary.



You've popped in some fixes for the driver probe in here as well.


   No, I didn't -- it's all the result of not using devm_clk_get().

[...]

@@ -177,13 +210,19 @@ static int rcar_gen2_usb_phy_probe(struc

[...]

-clk = devm_clk_get(dev, usbhs);
+if (np)
+clk = of_clk_get_by_name(np, usbhs);
+else
+clk = clk_get(dev, usbhs);



Can be removed, just add a clock-name of usbhs in the device node.


   Ah, I haven't figured out I should check clk_get() first... Yes, I'm 
adding the clock-names prop.


WBR, Sergei

--
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 2/3] USB: hub: handle -ETIMEDOUT during enumeration

2014-02-27 Thread Alan Stern
On Thu, 27 Feb 2014 oli...@neukum.org wrote:

 From: Oliver Neukum oneu...@suse.de
 
 I have a device that times out if enumerated after being
 switched on while connected. Increasing timeouts or retries
 doesn't help. The device needs an additional reset.
 
 Signed-off-by: Oliver Neukum oli...@neukum.org
 ---
  drivers/usb/core/hub.c | 15 +++
  1 file changed, 15 insertions(+)
 
 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
 index 3489bf1..cf992de 100644
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
 @@ -4005,6 +4005,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device 
 *udev, int port1,
   enum usb_device_speed   oldspeed = udev-speed;
   const char  *speed;
   int devnum = udev-devnum;
 + boolsecond_reset = false;
  
   /* root hub ports have a slightly longer reset period
* (from USB 2.0 spec, section 7.1.7.5)
 @@ -4136,6 +4137,20 @@ hub_port_init (struct usb_hub *hub, struct usb_device 
 *udev, int port1,
   USB_DT_DEVICE  8, 0,
   buf, GET_DESCRIPTOR_BUFSIZE,
   initial_descriptor_timeout);
 +
 + /*
 +  * Some devices time out if they are powered on
 +  * when already connected. They need a second
 +  * reset.
 +  */
 + if (r == -ETIMEDOUT  !second_reset) {
 + retval = hub_port_reset(hub, port1, 
 udev, delay, false);
 + second_reset = true;
 + if (retval  0)
 + dev_err(udev-dev,
 + recovery from timeout 
 failed, error %d\n,
 + retval);
 + }
   switch (buf-bMaxPacketSize0) {
   case 8: case 16: case 32: case 64: case 255:
   if (buf-bDescriptorType ==

You shouldn't need all this stuff.  Just break out of the j loop early 
if r is -ETIMEDOUT.  That is, a few lines below all this, do

-   if (r == 0)
+   if (r == 0 || r == -EDTIMEDOUT)
break;

The code that follows already does a reset.

Alan Stern

--
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 04/11] usb: dwc3: gadget: implement dwc3_gadget_get_link_state

2014-02-27 Thread Felipe Balbi
Hi,


On Wed, Feb 26, 2014 at 11:00:33PM +, Paul Zimmerman wrote:
 Hi Felipe,
 
 Can you drop the part that checks the DCNRD bit, please? I made a
 mistake when I originally submitted this. It is not necessary to check
 the DCNRD bit every time before reading the link state, it should only
 be checked the first time after coming out of hibernation. Doing it
 every time is unnecessary overhead, and can even cause problems with a
 hibernation-enabled controller.
 
 So for now maybe just drop the entire patch, and instead call
 DWC3_DSTS_USBLNKST() directly?

I removed the DCNRD check but kept the function around. updated patch
pushed to dwc3-hibernation

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/6] usb: gadget: mv_udc: disable HW zlt for ep0

2014-02-27 Thread Felipe Balbi
On Thu, Feb 27, 2014 at 03:30:03AM +, Peter Chen wrote:
  
 
  Chipidea bug too? Does it follow ch 8.5.3.2 Variable-length Data
  Stage, USB
 2.0 spec?

 wait, this is a chipidea core ? Why aren't you guys using the
 chipidea driver yet ? You need to switch over to that driver dude,
 we can't have duplicated code in the tree.

 I'm sorry, but I won't be taking this series, please use chipidea
 driver, it should be very simple to add a glue layer for your core
 to
the chipidea driver.

   
Yes, it use chipidea IP.
But the driver is earlier than the chipidea one and we use it for
our products.
So it may be not that easy to switch to chipidea driver due to the
stability.
   
  
   Freescale i.mx SoC used fsl_udc_core.c before which was the one of the
  
  btw, when can I remove fsl_udc_core.c from the tree ?
  
 
 Freescale has other processor group (PowerPC, etc) has used this code
 now.

Can we move those to chipidea too ? It would be real nice to remove the
duplicated driver by 3.16.

-- 
balbi


signature.asc
Description: Digital signature


Re: request for pointer to documentation on WUSB

2014-02-27 Thread Thomas Pugliese


On Thu, 27 Feb 2014, Oliver Neukum wrote:

 On Thu, 2014-02-27 at 08:05 -0600, Thomas Pugliese wrote:
  
  On Thu, 27 Feb 2014, Oliver Neukum wrote:
   
   
  
  I believe that device is based on an older Alereon chipset which along 
  with most other HWAs uses the updated WHCI protocol for UWB/URC commands.  
  Try this patch and see if it helps.
 
 I am afraid it does not help.
 
   Regards
   Oliver
 
 [  885.978133] usb 1-1.2: new high-speed USB device number 5 using
 ehci-pci
 [  886.064733] usb 1-1.2: New USB device found, idVendor=13cf,
 idProduct=1200
 [  886.064741] usb 1-1.2: New USB device strings: Mfr=2, Product=1,
 SerialNumber=3
 [  886.064745] usb 1-1.2: Product: Wireless USB Dongle
 [  886.064748] usb 1-1.2: Manufacturer:  
 [  886.064750] usb 1-1.2: SerialNumber: 123456789
 [  887.251811] uwb_rc uwb0: new uwb radio controller (mac
 03:00:00:00:1c:af dev 9d:7b) on usb 1-1.2:1.1
 [  887.251846] usbcore: registered new interface driver hwa-rc
 [  887.271700] usb 1-1.2: supported encryption types: CCM-1 (0x01) 
 [  887.271738] hwa-hc 1-1.2:1.0: Wireless USB HWA host controller
 [  887.271751] hwa-hc 1-1.2:1.0: new USB bus registered, assigned bus
 number 5
 [  887.325053] hwa-hc 1-1.2:1.0: Wireless USB Cluster ID set to 0xfe
 [  887.325112] usb usb5: New USB device found, idVendor=1d6b,
 idProduct=0002
 [  887.325116] usb usb5: New USB device strings: Mfr=3, Product=2,
 SerialNumber=1
 [  887.325120] usb usb5: Product: Wireless USB HWA host controller
 [  887.325123] usb usb5: Manufacturer: Linux 3.14.0-rc3-12-desktop+
 hwa-hcd
 [  887.325126] usb usb5: SerialNumber: wusb-hwa
 [  887.325390] hub 5-0:1.0: USB hub found
 [  887.325403] hub 5-0:1.0: 5 ports detected
 [  887.326799] usbcore: registered new interface driver hwa-hc
 [ 1042.153236] uwb_rc uwb0: Cannot set new IE on device: -110


I could be wrong about the chipset.  If I recall correctly, IOGear has 
used multiple chipset vendors across different products.  Do you have a 
link to the product page for the device?

Another possiblity is that the HWA is in DFU mode and it will need a 
firmware image downloaded before it will function properly.  I am actually 
working on a user service to download firmware images for devices based on 
the Alereon chipset but I don't have an estimate on the completion date.

Regards,
Thomas
--
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: request for pointer to documentation on WUSB

2014-02-27 Thread Oliver Neukum
On Thu, 2014-02-27 at 10:46 -0600, Thomas Pugliese wrote:

 I could be wrong about the chipset.  If I recall correctly, IOGear has 
 used multiple chipset vendors across different products.  Do you have a 
 link to the product page for the device?

For what it is worth:
https://www.olidata.com/partners/?module=productstask=subcategoryid=5

 Another possiblity is that the HWA is in DFU mode and it will need a 
 firmware image downloaded before it will function properly.  I am actually 
 working on a user service to download firmware images for devices based on 
 the Alereon chipset but I don't have an estimate on the completion date.

There is no separate firmware on the CD, but the Win driver is huge
(11MB).

Regards
Oliver



--
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 v5 04/16] usb: find internal hub tier mismatch via acpi

2014-02-27 Thread Dan Williams
On Wed, Feb 26, 2014 at 2:07 PM, Alan Stern st...@rowland.harvard.edu wrote:
 On Wed, 26 Feb 2014, Dan Williams wrote:

  I've been thinking about this.  Maybe it isn't a problem, because now
  you don't set up the peer matching until after the port has been
  registered.  All you have to do is allow the ACPI data to prevent a
  default match if the location data values don't agree.
 
  That would simplify this patch an awful lot.

 Hm, interesting.  It relies on the fact that the firmware must
 identify both peers if it has location data for one, but I think that
 is a reasonable constraint.

 If the firmware doesn't have location data for both peers in a
 non-default matching (which presumably means there's a tier mismatch)
 then there's no way for us to match them up correctly anyhow.

 If a port has acpi data, don't permit a default matching... sounds good to 
 me!

 If the port's ACPI data agrees with the default matching, there's no
 issue.  But if they disagree, don't accept the default match.  That way
 you never have to correct a mistaken match.

So it turns out this simplifies the patch a bit, by getting rid of
invalidate_dependent_peers().  However, we still need
enumerate_dependent_peers() to handle cases where descendants are
registered prior to peering the parents via location data.  The big
complexity savings is killing the need for a solution like the one
proposed in [RFC PATCH v5 16/16] usb, xhci: flush initial hub
discovery to gate port power control

i went ahead and changed 'struct usb_port_location' to 'typedef u32
usb_port_location_t', and am preparing to release a v6 addressing the
current comments.
--
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: request for pointer to documentation on WUSB

2014-02-27 Thread Thomas Pugliese


On Thu, 27 Feb 2014, Oliver Neukum wrote:

 On Thu, 2014-02-27 at 10:46 -0600, Thomas Pugliese wrote:
 
  I could be wrong about the chipset.  If I recall correctly, IOGear has 
  used multiple chipset vendors across different products.  Do you have a 
  link to the product page for the device?
 
 For what it is worth:
 https://www.olidata.com/partners/?module=productstask=subcategoryid=5
 

Ah. That devices is based on the Wisair chipset.  I don't know anything 
about them other than the fact that they haven't made WUSB devices for 
several years and may be out of business.  It's possible that you could 
get it working but you would probably need to take a USB trace under 
windows and reverse engineer any quirks that are causing it to fail with 
the Linux driver.

  Another possiblity is that the HWA is in DFU mode and it will need a 
  firmware image downloaded before it will function properly.  I am actually 
  working on a user service to download firmware images for devices based on 
  the Alereon chipset but I don't have an estimate on the completion date.
 
 There is no separate firmware on the CD, but the Win driver is huge
 (11MB).
 
   Regards
   Oliver
 
--
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 2/6] usb: gadget: mv_udc: disable HW zlt for ep0

2014-02-27 Thread Fabio Estevam
On Thu, Feb 27, 2014 at 12:30 AM, Peter Chen peter.c...@freescale.com wrote:

 btw, when can I remove fsl_udc_core.c from the tree ?


 Freescale has other processor group (PowerPC, etc) has used this code now.

Not only PowerPC, but also the imx platforms that have not been
converted to device tree yet.
--
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 v5 04/16] usb: find internal hub tier mismatch via acpi

2014-02-27 Thread Alan Stern
On Thu, 27 Feb 2014, Dan Williams wrote:

  If the port's ACPI data agrees with the default matching, there's no
  issue.  But if they disagree, don't accept the default match.  That way
  you never have to correct a mistaken match.
 
 So it turns out this simplifies the patch a bit, by getting rid of
 invalidate_dependent_peers().  However, we still need
 enumerate_dependent_peers() to handle cases where descendants are
 registered prior to peering the parents via location data.  The big

How could that happen?

Suppose B is a child of A, and they both have been registered for some 
time but don't have any peers assigned yet.  Now along comes A', and 
the firmware location data tells us that A' and A are peers.

B still doesn't have a matching peer, though.  Not until B' (a child of
A') is registered.  At that time, B' will automatically be peered with
B, so no extra work is needed.

The main point is that the location data for A' is available before any
descendants of A' can be created.  Therefore descendants cannot be
registered prior to peering the parents via location data.

 complexity savings is killing the need for a solution like the one
 proposed in [RFC PATCH v5 16/16] usb, xhci: flush initial hub
 discovery to gate port power control
 
 i went ahead and changed 'struct usb_port_location' to 'typedef u32
 usb_port_location_t', and am preparing to release a v6 addressing the
 current comments.

Okay.  I suggest that when v6 is ready, you start by posting just the
equivalents to v5 patches 1-5 (or 1-6).  Once we agree on the details
of the peering, we'll move forward to consider synchronization of hub
and port PM operations.

BTW, after some more thought, I decided the right way to avoid races in 
the peer assignments is to do some of the work under hub.c's 
device_state_lock.  Add a usb_ prefix to the name and share it with 
port.c.  We already are guaranteed that all changes to port-child are 
protected by this lock, which is exactly what we need.

Alan Stern

--
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/3] hub: debug message for failing to enable device

2014-02-27 Thread Greg KH
On Thu, Feb 27, 2014 at 10:57:10AM +0100, oli...@neukum.org wrote:
 From: Oliver Neukum oneu...@suse.de
 
 This error case isn't reported during enumeration.
 
 Signed-off-by: Oliver Neukum oli...@neukum.org
 ---
  drivers/usb/core/hub.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

What happened to patch 3/3, I don't see it anywhere.

thanks,

greg k-h
--
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 3/3] usb: phy: msm: use ASSIGN_*_PM_OPS variants

2014-02-27 Thread Greg Kroah-Hartman
On Tue, Feb 25, 2014 at 12:33:36PM -0600, Felipe Balbi wrote:
 Hi,
 
 On Mon, Feb 24, 2014 at 11:08:27AM -0600, Josh Cartwright wrote:
  Use ASSIGN_SYSTEM_SLEEP_PM_OPS and ASSIGN_RUNTIME_PM_OPS in the
  initializer for msm_otg_dev_pm_ops.  Doing so allows us to eliminate
  preprocessor conditionals around the specified callbacks.
  
  Signed-off-by: Josh Cartwright jo...@codeaurora.org
  ---
   drivers/usb/phy/phy-msm-usb.c | 13 +++--
   1 file changed, 3 insertions(+), 10 deletions(-)
  
  diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
  index 5b37b81..c04f2e3 100644
  --- a/drivers/usb/phy/phy-msm-usb.c
  +++ b/drivers/usb/phy/phy-msm-usb.c
  @@ -414,8 +414,6 @@ static int msm_otg_reset(struct usb_phy *phy)
   #define PHY_SUSPEND_TIMEOUT_USEC   (500 * 1000)
   #define PHY_RESUME_TIMEOUT_USEC(100 * 1000)
   
  -#ifdef CONFIG_PM
  -
   #define USB_PHY_SUSP_DIG_VOL  50
   static int msm_hsusb_config_vddcx(int high)
   {
  @@ -609,7 +607,6 @@ skip_phy_resume:
   
  return 0;
   }
  -#endif
   
   static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)
   {
  @@ -1664,7 +1661,6 @@ static int msm_otg_remove(struct platform_device 
  *pdev)
  return 0;
   }
   
  -#ifdef CONFIG_PM_RUNTIME
   static int msm_otg_runtime_idle(struct device *dev)
   {
  struct msm_otg *motg = dev_get_drvdata(dev);
  @@ -1699,9 +1695,7 @@ static int msm_otg_runtime_resume(struct device *dev)
  dev_dbg(dev, OTG runtime resume\n);
  return msm_otg_resume(motg);
   }
  -#endif
   
  -#ifdef CONFIG_PM_SLEEP
   static int msm_otg_pm_suspend(struct device *dev)
   {
  struct msm_otg *motg = dev_get_drvdata(dev);
  @@ -1731,12 +1725,11 @@ static int msm_otg_pm_resume(struct device *dev)
   
  return 0;
   }
  -#endif
   
   static const struct dev_pm_ops msm_otg_dev_pm_ops = {
  -   SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
  -   SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume,
  -   msm_otg_runtime_idle)
  +   ASSIGN_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
  +   ASSIGN_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume,
  + msm_otg_runtime_idle)
 
 if the patch introducing assign_if() gets accepted, I'm ok with this
 patch.

I can't take that patch at this point in time, it's just too ugly...

As are those crazy SET_SYSTEM_SLEEP_PM_OPS() macros, ick, who made those
things?

What language are we trying to program in here people?

greg k-h
--
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 2/6] usb: gadget: mv_udc: disable HW zlt for ep0

2014-02-27 Thread Felipe Balbi
On Thu, Feb 27, 2014 at 03:05:14PM -0300, Fabio Estevam wrote:
 On Thu, Feb 27, 2014 at 12:30 AM, Peter Chen peter.c...@freescale.com wrote:
 
  btw, when can I remove fsl_udc_core.c from the tree ?
 
 
  Freescale has other processor group (PowerPC, etc) has used this code now.
 
 Not only PowerPC, but also the imx platforms that have not been
 converted to device tree yet.

hmm, but chipidea supports non-DT, right ? I would rather have pdata
added to your chipidea glue layer than maintaining the old driver in the
tree.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 7/8] usb: dwc3: core: remove DWC3_PM_OPS

2014-02-27 Thread Felipe Balbi
fix ifdefs around pm callbacks and remove
unnecessary DWC3_PM_OPS macro.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/core.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index a49217a..eca1868 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -717,19 +717,17 @@ static int dwc3_resume(struct device *dev)
 
return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops dwc3_dev_pm_ops = {
+#ifdef CONFIG_PM_SLEEP
.prepare= dwc3_prepare,
.complete   = dwc3_complete,
+#endif /* CONFIG_PM_SLEEP */
 
SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume)
 };
 
-#define DWC3_PM_OPS(dwc3_dev_pm_ops)
-#else
-#define DWC3_PM_OPSNULL
-#endif
-
 #ifdef CONFIG_OF
 static const struct of_device_id of_dwc3_match[] = {
{
@@ -749,7 +747,7 @@ static struct platform_driver dwc3_driver = {
.driver = {
.name   = dwc3,
.of_match_table = of_match_ptr(of_dwc3_match),
-   .pm = DWC3_PM_OPS,
+   .pm = dwc3_dev_pm_ops,
},
 };
 
-- 
1.9.0

--
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 8/8] usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers

2014-02-27 Thread Felipe Balbi
by setting IOC always, we can recycle TRBs a
lot sooner at the expense of some increased
CPU load.

The extra load seems to be quite minimal on
OMAP5 devices (instead of 1 IRQ for one MSC
transfer, we get
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS).

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/gadget.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 2da0a5a..9e878d9 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -771,9 +771,6 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
trb-ctrl = DWC3_TRBCTL_ISOCHRONOUS_FIRST;
else
trb-ctrl = DWC3_TRBCTL_ISOCHRONOUS;
-
-   if (!req-request.no_interrupt  !chain)
-   trb-ctrl |= DWC3_TRB_CTRL_IOC;
break;
 
case USB_ENDPOINT_XFER_BULK:
@@ -788,6 +785,9 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
BUG();
}
 
+   if (!req-request.no_interrupt  !chain)
+   trb-ctrl |= DWC3_TRB_CTRL_IOC;
+
if (usb_endpoint_xfer_isoc(dep-endpoint.desc)) {
trb-ctrl |= DWC3_TRB_CTRL_ISP_IMI;
trb-ctrl |= DWC3_TRB_CTRL_CSP;
@@ -1855,9 +1855,6 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, 
struct dwc3_ep *dep,
return 1;
}
 
-   if ((event-status  DEPEVT_STATUS_IOC) 
-   (trb-ctrl  DWC3_TRB_CTRL_IOC))
-   return 0;
return 1;
 }
 
-- 
1.9.0

--
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/8] usb: dwc3: omap: add basic pm_runtime support

2014-02-27 Thread Felipe Balbi
If we want to suspend/runtime in runtime, we
can do so, in OMAP's case at least, with the
same implementation we use for system pm.

This patch adds basic pm_runtime support with
that in mind.

While at that, also fix ifdeferry up.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c | 56 
 1 file changed, 46 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index b269dbd..558e1b5 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -600,7 +600,7 @@ static const struct of_device_id of_dwc3_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_dwc3_match);
 
-#ifdef CONFIG_PM_SLEEP
+#ifdef CONFIG_PM
 static int dwc3_omap_prepare(struct device *dev)
 {
struct dwc3_omap*omap = dev_get_drvdata(dev);
@@ -617,20 +617,39 @@ static void dwc3_omap_complete(struct device *dev)
dwc3_omap_enable_irqs(omap);
 }
 
+static int __dwc3_omap_suspend(struct dwc3_omap *omap)
+{
+   omap-utmi_otg_status = dwc3_omap_read_utmi_status(omap);
+
+   return 0;
+}
+
+static int __dwc3_omap_resume(struct dwc3_omap *omap)
+{
+   dwc3_omap_write_utmi_status(omap, omap-utmi_otg_status);
+
+   return 0;
+}
+
+#ifdef CONFIG_PM_SLEEP
 static int dwc3_omap_suspend(struct device *dev)
 {
struct dwc3_omap*omap = dev_get_drvdata(dev);
 
-   omap-utmi_otg_status = dwc3_omap_read_utmi_status(omap);
+   if (pm_runtime_suspended(dev))
+   return 0;
 
-   return 0;
+   return __dwc3_omap_suspend(omap);
 }
 
 static int dwc3_omap_resume(struct device *dev)
 {
struct dwc3_omap*omap = dev_get_drvdata(dev);
+   int ret;
 
-   dwc3_omap_write_utmi_status(omap, omap-utmi_otg_status);
+   ret = __dwc3_omap_resume(omap);
+   if (ret)
+   return ret;
 
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
@@ -638,26 +657,43 @@ static int dwc3_omap_resume(struct device *dev)
 
return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
+
+#ifdef CONFIG_PM_RUNTIME
+static int dwc3_omap_runtime_suspend(struct device *dev)
+{
+   struct dwc3_omap*omap = dev_get_drvdata(dev);
+
+   return __dwc3_omap_suspend(omap);
+}
+
+static int dwc3_omap_runtime_resume(struct device *dev)
+{
+   struct dwc3_omap*omap = dev_get_drvdata(dev);
+
+   return __dwc3_omap_resume(omap);
+}
+#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
+#ifdef CONFIG_PM
.prepare= dwc3_omap_prepare,
.complete   = dwc3_omap_complete,
+#endif
 
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
+   SET_RUNTIME_PM_OPS(dwc3_omap_runtime_suspend, dwc3_omap_runtime_resume,
+   NULL)
 };
 
-#define DEV_PM_OPS (dwc3_omap_dev_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
-
 static struct platform_driver dwc3_omap_driver = {
.probe  = dwc3_omap_probe,
.remove = dwc3_omap_remove,
.driver = {
.name   = omap-dwc3,
.of_match_table = of_dwc3_match,
-   .pm = DEV_PM_OPS,
+   .pm = dwc3_omap_dev_pm_ops,
},
 };
 
-- 
1.9.0

--
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/8] usb: dwc3: keystone: add basic PM support

2014-02-27 Thread Felipe Balbi
A bare-minimum PM implementation which will
serve as building block for more complex
PM implementation in the future.

At the very least we will not leave clocks on
unnecessarily when e.g. a user writes mem to
/sys/power/state.

Acked-by: Santosh Shilimkar santosh.shilim...@ti.com
Tested-by: WingMan Kwok w-kw...@ti.com
Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-keystone.c | 106 +--
 1 file changed, 103 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 1fad161..06aa543 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -21,6 +21,7 @@
 #include linux/interrupt.h
 #include linux/platform_device.h
 #include linux/dma-mapping.h
+#include linux/pm_runtime.h
 #include linux/io.h
 #include linux/of_platform.h
 
@@ -118,13 +119,22 @@ static int kdwc3_probe(struct platform_device *pdev)
 
kdwc-clk = devm_clk_get(kdwc-dev, usb);
 
-   error = clk_prepare_enable(kdwc-clk);
+   error = clk_prepare(kdwc-clk);
if (error  0) {
dev_dbg(kdwc-dev, unable to enable usb clock, err %d\n,
error);
return error;
}
 
+   pm_runtime_enable(dev);
+
+   error = pm_runtime_get_sync(dev);
+   if (error  0) {
+   dev_dbg(dev, unable to pm_runtime_get_sync(), err %d\n,
+   error);
+   goto err_irq;
+   }
+
irq = platform_get_irq(pdev, 0);
if (irq  0) {
dev_err(pdev-dev, missing irq\n);
@@ -151,8 +161,11 @@ static int kdwc3_probe(struct platform_device *pdev)
 
 err_core:
kdwc3_disable_irqs(kdwc);
+
 err_irq:
-   clk_disable_unprepare(kdwc-clk);
+   pm_runtime_put_sync(dev);
+   pm_runtime_disable(dev);
+   clk_unprepare(kdwc-clk);
 
return error;
 }
@@ -172,7 +185,9 @@ static int kdwc3_remove(struct platform_device *pdev)
 
kdwc3_disable_irqs(kdwc);
device_for_each_child(pdev-dev, NULL, kdwc3_remove_core);
-   clk_disable_unprepare(kdwc-clk);
+   pm_runtime_put_sync(pdev-dev);
+   pm_runtime_disable(pdev-dev);
+   clk_unprepare(kdwc-clk);
platform_set_drvdata(pdev, NULL);
 
return 0;
@@ -184,6 +199,90 @@ static const struct of_device_id kdwc3_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, kdwc3_of_match);
 
+#ifdef CONFIG_PM
+static int __kdwc3_suspend(struct dwc3_keystone *kdwc)
+{
+   clk_disable(kdwc-clk);
+
+   return 0;
+}
+
+static int __kdwc3_resume(struct dwc3_keystone *kdwc)
+{
+   return clk_enable(kdwc-clk);
+}
+
+static int kdwc3_prepare(struct device *dev)
+{
+   struct dwc3_keystone*kdwc = dev_get_drvdata(dev);
+
+   kdwc3_disable_irqs(kdwc);
+
+   return 0;
+}
+
+static void kdwc3_complete(struct device *dev)
+{
+   struct dwc3_keystone*kdwc = dev_get_drvdata(dev);
+
+   kdwc3_enable_irqs(kdwc);
+}
+
+#ifdef CONFIG_PM_SLEEP
+static int kdwc3_suspend(struct device *dev)
+{
+   struct dwc3_keystone*kdwc = dev_get_drvdata(dev);
+
+   if (pm_runtime_suspended(dev))
+   return 0;
+
+   return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_resume(struct device *dev)
+{
+   struct dwc3_keystone*kdwc = dev_get_drvdata(dev);
+   int ret;
+
+   ret = __kdwc3_resume(kdwc);
+   if (ret)
+   return ret;
+
+   pm_runtime_disable(dev);
+   pm_runtime_set_active(dev);
+   pm_runtime_enable(dev);
+
+   return 0;
+}
+#endif /* CONFIG_PM_SLEEP */
+
+#ifdef CONFIG_PM_RUNTIME
+static int kdwc3_runtime_suspend(struct device *dev)
+{
+   struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+   return __kdwc3_suspend(kdwc);
+}
+
+static int kdwc3_runtime_resume(struct device *dev)
+{
+   struct dwc3_keystone *kdwc = dev_get_drvdata(dev);
+
+   return __kdwc3_resume(kdwc);
+}
+#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops kdwc3_dev_pm_ops = {
+#ifdef CONFIG_PM
+   .prepare= kdwc3_prepare,
+   .complete   = kdwc3_complete,
+#endif /* CONFIG_PM */
+
+   SET_SYSTEM_SLEEP_PM_OPS(kdwc3_suspend, kdwc3_resume)
+   SET_RUNTIME_PM_OPS(kdwc3_runtime_suspend, kdwc3_runtime_resume, NULL)
+};
+
 static struct platform_driver kdwc3_driver = {
.probe  = kdwc3_probe,
.remove = kdwc3_remove,
@@ -191,6 +290,7 @@ static struct platform_driver kdwc3_driver = {
.name   = keystone-dwc3,
.owner  = THIS_MODULE,
.of_match_table = kdwc3_of_match,
+   .pm = kdwc3_dev_pm_ops,
},
 };
 
-- 
1.9.0

--
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/8] usb: dwc3: omap: fix order of pm_runtime vs child removal

2014-02-27 Thread Felipe Balbi
pm_runtime_put_sync() will kill dwc3's clocks and,
since dwc3 core accesses registers during removal,
we must make sure to unregister core before
disabling clocks and pm_runtime.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 1b086bb..513bb9d 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -580,9 +580,9 @@ static int dwc3_omap_remove(struct platform_device *pdev)
if (omap-extcon_id_dev.edev)
extcon_unregister_interest(omap-extcon_id_dev);
dwc3_omap_disable_irqs(omap);
+   device_for_each_child(pdev-dev, NULL, dwc3_omap_remove_core);
pm_runtime_put_sync(pdev-dev);
pm_runtime_disable(pdev-dev);
-   device_for_each_child(pdev-dev, NULL, dwc3_omap_remove_core);
 
return 0;
 }
-- 
1.9.0

--
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/8] usb: dwc3: pci: add pm_runtime support

2014-02-27 Thread Felipe Balbi
teach the PCI glue about pm_runtime so that
it's easier to teach dwc3 core about it
later.

No functional changes otherwise.

Tested-by: David Cohen david.a.co...@linux.intel.com
Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-pci.c | 73 -
 1 file changed, 59 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index f393c18..3ae1c84 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -110,18 +110,17 @@ static int dwc3_pci_probe(struct pci_dev *pci,
 
glue-dev = dev;
 
-   ret = pci_enable_device(pci);
+   pm_runtime_enable(dev);
+   ret = pm_runtime_get_sync(dev);
if (ret) {
dev_err(dev, failed to enable pci device\n);
return -ENODEV;
}
 
-   pci_set_master(pci);
-
ret = dwc3_pci_register_phys(glue);
if (ret) {
dev_err(dev, couldn't register PHYs\n);
-   return ret;
+   goto err1;
}
 
dwc3 = platform_device_alloc(dwc3, PLATFORM_DEVID_AUTO);
@@ -168,7 +167,8 @@ static int dwc3_pci_probe(struct pci_dev *pci,
 err3:
platform_device_put(dwc3);
 err1:
-   pci_disable_device(pci);
+   pm_runtime_put_sync(dev);
+   pm_runtime_disable(dev);
 
return ret;
 }
@@ -176,11 +176,13 @@ err1:
 static void dwc3_pci_remove(struct pci_dev *pci)
 {
struct dwc3_pci *glue = pci_get_drvdata(pci);
+   struct device *dev = pci-dev;
 
platform_device_unregister(glue-dwc3);
platform_device_unregister(glue-usb2_phy);
platform_device_unregister(glue-usb3_phy);
-   pci_disable_device(pci);
+   pm_runtime_put_sync(dev);
+   pm_runtime_disable(dev);
 }
 
 static const struct pci_device_id dwc3_pci_id_table[] = {
@@ -194,24 +196,21 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
 };
 MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
 
-#ifdef CONFIG_PM_SLEEP
-static int dwc3_pci_suspend(struct device *dev)
+#ifdef CONFIG_PM
+static int __dwc3_pci_suspend(struct pci_dev *pci)
 {
-   struct pci_dev  *pci = to_pci_dev(dev);
-
pci_disable_device(pci);
 
return 0;
 }
 
-static int dwc3_pci_resume(struct device *dev)
+static int __dwc3_pci_resume(struct pci_dev *pci)
 {
-   struct pci_dev  *pci = to_pci_dev(dev);
-   int ret;
+   int ret;
 
ret = pci_enable_device(pci);
if (ret) {
-   dev_err(dev, can't re-enable device -- %d\n, ret);
+   dev_err(pci-dev, can't re-enable device -- %d\n, ret);
return ret;
}
 
@@ -219,10 +218,56 @@ static int dwc3_pci_resume(struct device *dev)
 
return 0;
 }
+
+#ifdef CONFIG_PM
+static int dwc3_pci_suspend(struct device *dev)
+{
+   struct pci_dev  *pci = to_pci_dev(dev);
+
+   if (pm_runtime_suspended(dev))
+   return 0;
+
+   return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_resume(struct device *dev)
+{
+   struct pci_dev  *pci = to_pci_dev(dev);
+   int ret;
+
+   ret = __dwc3_pci_resume(pci);
+   if (ret)
+   return ret;
+
+   pm_runtime_disable(dev);
+   pm_runtime_set_active(dev);
+   pm_runtime_disable(dev);
+
+   return 0;
+}
 #endif /* CONFIG_PM_SLEEP */
 
+#ifdef CONFIG_PM_RUNTIME
+static int dwc3_pci_runtime_suspend(struct device *dev)
+{
+   struct pci_dev  *pci = to_pci_dev(dev);
+
+   return __dwc3_pci_suspend(pci);
+}
+
+static int dwc3_pci_runtime_resume(struct device *dev)
+{
+   struct pci_dev  *pci = to_pci_dev(dev);
+
+   return __dwc3_pci_resume(pci);
+}
+#endif /* CONFIG_PM_RUNTIME */
+#endif /* CONFIG_PM */
+
 static const struct dev_pm_ops dwc3_pci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume)
+   SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_runtime_resume,
+   NULL)
 };
 
 static struct pci_driver dwc3_pci_driver = {
-- 
1.9.0

--
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/8] usb: dwc3: omap: fix pm_runtime usage

2014-02-27 Thread Felipe Balbi
even if pm_runtime_get*() fails, it still increments
pm usage counter, so we must pm_runtime_put*()
in that case too. Fix that observation in dwc3-omap.c.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/dwc3-omap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 558e1b5..1b086bb 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -451,7 +451,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(dev);
if (ret  0) {
dev_err(dev, get_sync failed with err %d\n, ret);
-   goto err0;
+   goto err1;
}
 
reg = dwc3_omap_readl(omap-base, USBOTGSS_REVISION);
@@ -566,8 +566,6 @@ err2:
 
 err1:
pm_runtime_put_sync(dev);
-
-err0:
pm_runtime_disable(dev);
 
return ret;
-- 
1.9.0

--
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 v2 1/2] usb: host: xhci-plat: Use module_platform_driver()

2014-02-27 Thread Fabio Estevam
On Wed, Feb 26, 2014 at 3:04 PM, Fabio Estevam feste...@gmail.com wrote:
 Hi Sarah,

 On Wed, Feb 26, 2014 at 2:39 PM, Sarah Sharp
 sarah.a.sh...@linux.intel.com wrote:

 Fabio, are you going to send a new version that fixes these build
 errors?

 Could you please discard this one and just apply 2/2 instead?

Nevermind, Sarah. I will rework the series.

Regards,

Fabio Estevam
--
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


Outlook gebruiker waarschuwing.

2014-02-27 Thread Karen Williams
Geachte Webmail Gebruiker,
Uw twee inkomende mails hangende toestand geplaatst als gevolg van de recente 
upgrade in onze database.

in volgorde te ontvangen uw berichten KLIK 
HIERhttp://goorsoicuesaeorusdoisda.webs.com/

Login met uw juiste Webmail informatie en wachten op antwoordt van onze data 
service.
Onze excuses voor het ongemak en waarderen uw begrip.

Exchange administrator
The Microsoft Account Team 2014.
--
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 3/3] usb: phy: msm: use ASSIGN_*_PM_OPS variants

2014-02-27 Thread David Cohen
On Thu, Feb 27, 2014 at 11:03:24AM -0800, Greg Kroah-Hartman wrote:
 On Tue, Feb 25, 2014 at 12:33:36PM -0600, Felipe Balbi wrote:
  Hi,
  
  On Mon, Feb 24, 2014 at 11:08:27AM -0600, Josh Cartwright wrote:
   Use ASSIGN_SYSTEM_SLEEP_PM_OPS and ASSIGN_RUNTIME_PM_OPS in the
   initializer for msm_otg_dev_pm_ops.  Doing so allows us to eliminate
   preprocessor conditionals around the specified callbacks.
   
   Signed-off-by: Josh Cartwright jo...@codeaurora.org
   ---
drivers/usb/phy/phy-msm-usb.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
   
   diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
   index 5b37b81..c04f2e3 100644
   --- a/drivers/usb/phy/phy-msm-usb.c
   +++ b/drivers/usb/phy/phy-msm-usb.c
   @@ -414,8 +414,6 @@ static int msm_otg_reset(struct usb_phy *phy)
#define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000)
#define PHY_RESUME_TIMEOUT_USEC  (100 * 1000)

   -#ifdef CONFIG_PM
   -
#define USB_PHY_SUSP_DIG_VOL  50
static int msm_hsusb_config_vddcx(int high)
{
   @@ -609,7 +607,6 @@ skip_phy_resume:

 return 0;
}
   -#endif

static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)
{
   @@ -1664,7 +1661,6 @@ static int msm_otg_remove(struct platform_device 
   *pdev)
 return 0;
}

   -#ifdef CONFIG_PM_RUNTIME
static int msm_otg_runtime_idle(struct device *dev)
{
 struct msm_otg *motg = dev_get_drvdata(dev);
   @@ -1699,9 +1695,7 @@ static int msm_otg_runtime_resume(struct device 
   *dev)
 dev_dbg(dev, OTG runtime resume\n);
 return msm_otg_resume(motg);
}
   -#endif

   -#ifdef CONFIG_PM_SLEEP
static int msm_otg_pm_suspend(struct device *dev)
{
 struct msm_otg *motg = dev_get_drvdata(dev);
   @@ -1731,12 +1725,11 @@ static int msm_otg_pm_resume(struct device *dev)

 return 0;
}
   -#endif

static const struct dev_pm_ops msm_otg_dev_pm_ops = {
   - SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
   - SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume,
   - msm_otg_runtime_idle)
   + ASSIGN_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
   + ASSIGN_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume,
   +   msm_otg_runtime_idle)
  
  if the patch introducing assign_if() gets accepted, I'm ok with this
  patch.
 
 I can't take that patch at this point in time, it's just too ugly...
 
 As are those crazy SET_SYSTEM_SLEEP_PM_OPS() macros, ick, who made those
 things?
 
 What language are we trying to program in here people?

Since we're discussing this topic here, I'd like point my RFC which gets
rid of same ifdeffery in a different way:
http://lkml.org/lkml/2013/12/13/4

Comments are welcome.

Br, David

 
 greg k-h
 --
 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
--
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] usb: gadget: return the right length in ffs_epfile_io()

2014-02-27 Thread David Cohen
On Thu, Feb 27, 2014 at 01:15:25PM +0100, Michal Nazarewicz wrote:
 On Thu, Feb 27 2014, Chuansheng Liu chuansheng@intel.com wrote:
  When the request length is aligned to maxpacketsize, sometimes
  the return length ret  the user space requested len.
 
  At that time, we will use min_t(size_t, ret, len) to limit the
  size in case of user data buffer overflow.
 
  But we need return the min_t(size_t, ret, len) to tell the user
  space rightly also.
 
  Signed-off-by: Chuansheng Liu chuansheng@intel.com
 
 Acked-by: Michal Nazarewicz min...@mina86.com

Reviewed-by: David Cohen david.a.co...@linux.intel.com

IMHO it makes sense to push this patch to 3.14-rc since it is an
extension of usb gadget's quick_ep_out_aligned_size merged on 3.14-rc1

Br, David Cohen
--
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 3/3] usb: phy: msm: use ASSIGN_*_PM_OPS variants

2014-02-27 Thread Greg Kroah-Hartman
On Thu, Feb 27, 2014 at 03:41:31PM -0800, David Cohen wrote:
 On Thu, Feb 27, 2014 at 11:03:24AM -0800, Greg Kroah-Hartman wrote:
  On Tue, Feb 25, 2014 at 12:33:36PM -0600, Felipe Balbi wrote:
   Hi,
   
   On Mon, Feb 24, 2014 at 11:08:27AM -0600, Josh Cartwright wrote:
Use ASSIGN_SYSTEM_SLEEP_PM_OPS and ASSIGN_RUNTIME_PM_OPS in the
initializer for msm_otg_dev_pm_ops.  Doing so allows us to eliminate
preprocessor conditionals around the specified callbacks.

Signed-off-by: Josh Cartwright jo...@codeaurora.org
---
 drivers/usb/phy/phy-msm-usb.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c 
b/drivers/usb/phy/phy-msm-usb.c
index 5b37b81..c04f2e3 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -414,8 +414,6 @@ static int msm_otg_reset(struct usb_phy *phy)
 #define PHY_SUSPEND_TIMEOUT_USEC   (500 * 1000)
 #define PHY_RESUME_TIMEOUT_USEC(100 * 1000)
 
-#ifdef CONFIG_PM
-
 #define USB_PHY_SUSP_DIG_VOL  50
 static int msm_hsusb_config_vddcx(int high)
 {
@@ -609,7 +607,6 @@ skip_phy_resume:
 
return 0;
 }
-#endif
 
 static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)
 {
@@ -1664,7 +1661,6 @@ static int msm_otg_remove(struct platform_device 
*pdev)
return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
 static int msm_otg_runtime_idle(struct device *dev)
 {
struct msm_otg *motg = dev_get_drvdata(dev);
@@ -1699,9 +1695,7 @@ static int msm_otg_runtime_resume(struct device 
*dev)
dev_dbg(dev, OTG runtime resume\n);
return msm_otg_resume(motg);
 }
-#endif
 
-#ifdef CONFIG_PM_SLEEP
 static int msm_otg_pm_suspend(struct device *dev)
 {
struct msm_otg *motg = dev_get_drvdata(dev);
@@ -1731,12 +1725,11 @@ static int msm_otg_pm_resume(struct device *dev)
 
return 0;
 }
-#endif
 
 static const struct dev_pm_ops msm_otg_dev_pm_ops = {
-   SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
-   SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, 
msm_otg_runtime_resume,
-   msm_otg_runtime_idle)
+   ASSIGN_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, 
msm_otg_pm_resume)
+   ASSIGN_RUNTIME_PM_OPS(msm_otg_runtime_suspend, 
msm_otg_runtime_resume,
+ msm_otg_runtime_idle)
   
   if the patch introducing assign_if() gets accepted, I'm ok with this
   patch.
  
  I can't take that patch at this point in time, it's just too ugly...
  
  As are those crazy SET_SYSTEM_SLEEP_PM_OPS() macros, ick, who made those
  things?
  
  What language are we trying to program in here people?
 
 Since we're discussing this topic here, I'd like point my RFC which gets
 rid of same ifdeffery in a different way:
 http://lkml.org/lkml/2013/12/13/4

Again, why can't we just always define these fields in the structure,
then we don't need any crazy, complicated mess for assigning the
function pointers?

Again, the odds that this config option is ever disabled in real
systems is so low these days, I have half a mind just to rip it out
entirely as the amount of work spent on compiler warnings and the like
in this area has proably offset any power savings the code was supposed
to save on systems :(

ick.

greg k-h
--
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 3/3] usb: phy: msm: use ASSIGN_*_PM_OPS variants

2014-02-27 Thread David Cohen
On Thu, Feb 27, 2014 at 03:44:25PM -0800, Greg Kroah-Hartman wrote:
 On Thu, Feb 27, 2014 at 03:41:31PM -0800, David Cohen wrote:
  On Thu, Feb 27, 2014 at 11:03:24AM -0800, Greg Kroah-Hartman wrote:
   On Tue, Feb 25, 2014 at 12:33:36PM -0600, Felipe Balbi wrote:
Hi,

On Mon, Feb 24, 2014 at 11:08:27AM -0600, Josh Cartwright wrote:
 Use ASSIGN_SYSTEM_SLEEP_PM_OPS and ASSIGN_RUNTIME_PM_OPS in the
 initializer for msm_otg_dev_pm_ops.  Doing so allows us to eliminate
 preprocessor conditionals around the specified callbacks.
 
 Signed-off-by: Josh Cartwright jo...@codeaurora.org
 ---
  drivers/usb/phy/phy-msm-usb.c | 13 +++--
  1 file changed, 3 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/usb/phy/phy-msm-usb.c 
 b/drivers/usb/phy/phy-msm-usb.c
 index 5b37b81..c04f2e3 100644
 --- a/drivers/usb/phy/phy-msm-usb.c
 +++ b/drivers/usb/phy/phy-msm-usb.c
 @@ -414,8 +414,6 @@ static int msm_otg_reset(struct usb_phy *phy)
  #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000)
  #define PHY_RESUME_TIMEOUT_USEC  (100 * 1000)
  
 -#ifdef CONFIG_PM
 -
  #define USB_PHY_SUSP_DIG_VOL  50
  static int msm_hsusb_config_vddcx(int high)
  {
 @@ -609,7 +607,6 @@ skip_phy_resume:
  
   return 0;
  }
 -#endif
  
  static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)
  {
 @@ -1664,7 +1661,6 @@ static int msm_otg_remove(struct 
 platform_device *pdev)
   return 0;
  }
  
 -#ifdef CONFIG_PM_RUNTIME
  static int msm_otg_runtime_idle(struct device *dev)
  {
   struct msm_otg *motg = dev_get_drvdata(dev);
 @@ -1699,9 +1695,7 @@ static int msm_otg_runtime_resume(struct device 
 *dev)
   dev_dbg(dev, OTG runtime resume\n);
   return msm_otg_resume(motg);
  }
 -#endif
  
 -#ifdef CONFIG_PM_SLEEP
  static int msm_otg_pm_suspend(struct device *dev)
  {
   struct msm_otg *motg = dev_get_drvdata(dev);
 @@ -1731,12 +1725,11 @@ static int msm_otg_pm_resume(struct device 
 *dev)
  
   return 0;
  }
 -#endif
  
  static const struct dev_pm_ops msm_otg_dev_pm_ops = {
 - SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume)
 - SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, 
 msm_otg_runtime_resume,
 - msm_otg_runtime_idle)
 + ASSIGN_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, 
 msm_otg_pm_resume)
 + ASSIGN_RUNTIME_PM_OPS(msm_otg_runtime_suspend, 
 msm_otg_runtime_resume,
 +   msm_otg_runtime_idle)

if the patch introducing assign_if() gets accepted, I'm ok with this
patch.
   
   I can't take that patch at this point in time, it's just too ugly...
   
   As are those crazy SET_SYSTEM_SLEEP_PM_OPS() macros, ick, who made those
   things?
   
   What language are we trying to program in here people?
  
  Since we're discussing this topic here, I'd like point my RFC which gets
  rid of same ifdeffery in a different way:
  http://lkml.org/lkml/2013/12/13/4
 
 Again, why can't we just always define these fields in the structure,
 then we don't need any crazy, complicated mess for assigning the
 function pointers?
 
 Again, the odds that this config option is ever disabled in real
 systems is so low these days, I have half a mind just to rip it out
 entirely as the amount of work spent on compiler warnings and the like
 in this area has proably offset any power savings the code was supposed
 to save on systems :(

That makes sense :)
Thanks for your feedback.

BR, David

 
 ick.
 
 greg k-h
 --
 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
--
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 v5 04/16] usb: find internal hub tier mismatch via acpi

2014-02-27 Thread Dan Williams
On Thu, Feb 27, 2014 at 10:48 AM, Alan Stern st...@rowland.harvard.edu wrote:
 On Thu, 27 Feb 2014, Dan Williams wrote:

  If the port's ACPI data agrees with the default matching, there's no
  issue.  But if they disagree, don't accept the default match.  That way
  you never have to correct a mistaken match.

 So it turns out this simplifies the patch a bit, by getting rid of
 invalidate_dependent_peers().  However, we still need
 enumerate_dependent_peers() to handle cases where descendants are
 registered prior to peering the parents via location data.  The big

 How could that happen?

 Suppose B is a child of A, and they both have been registered for some
 time but don't have any peers assigned yet.  Now along comes A', and
 the firmware location data tells us that A' and A are peers.

 B still doesn't have a matching peer, though.  Not until B' (a child of
 A') is registered.  At that time, B' will automatically be peered with
 B, so no extra work is needed.

 The main point is that the location data for A' is available before any
 descendants of A' can be created.  Therefore descendants cannot be
 registered prior to peering the parents via location data.

Ah, yes, there's no possible work for enumerate_dependent_peers() to
do because by definition if it could find a dependent peer, that same
peer would have done the same association in reverse via its default
mapping.  Ok, that code can die too.

 complexity savings is killing the need for a solution like the one
 proposed in [RFC PATCH v5 16/16] usb, xhci: flush initial hub
 discovery to gate port power control

 i went ahead and changed 'struct usb_port_location' to 'typedef u32
 usb_port_location_t', and am preparing to release a v6 addressing the
 current comments.

 Okay.  I suggest that when v6 is ready, you start by posting just the
 equivalents to v5 patches 1-5 (or 1-6).  Once we agree on the details
 of the peering, we'll move forward to consider synchronization of hub
 and port PM operations.

Will do.

 BTW, after some more thought, I decided the right way to avoid races in
 the peer assignments is to do some of the work under hub.c's
 device_state_lock.  Add a usb_ prefix to the name and share it with
 port.c.  We already are guaranteed that all changes to port-child are
 protected by this lock, which is exactly what we need.


I had wrapped locations that set port-child to NULL in the peer_lock,
but I'll look at just re-using the device_state_lock for that
scenario.  I'm still thinking the start of a disconnect operation
should flush in-flight peering operations.  Otherwise we'll need to
take a reference under the device_state_lock, but I'll give it more
thought.
--
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/3] staging/usbip: change usbip userspace to include new uapi usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. A new uapi usbip.h now defines the
usbip device status for kernel and userspace to use. Change usbip
userspace to include uapi usbip.h for usbip device status.

Signed-off-by: Shuah Khan shuah...@samsung.com
---
 .../staging/usbip/userspace/libsrc/usbip_common.h  |   20 +++-
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_common.h 
b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
index 2cb81b3..d336f14 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_common.h
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
@@ -15,6 +15,9 @@
 #include syslog.h
 #include unistd.h
 #include linux/usb/ch9.h
+/* this is temporary to build in tree, once usbip.h
+ *  appears under linux headers - change it to linux/usbip.h */
+#include ../../../../../include/uapi/linux/usbip.h
 
 #ifndef USBIDS_FILE
 #define USBIDS_FILE /usr/share/hwdata/usb.ids
@@ -77,23 +80,6 @@ extern int usbip_use_debug ;
abort();\
} while (0)
 
-/* FIXME: how to sync with drivers/usbip_common.h ? */
-enum usbip_device_status {
-   /* sdev is available. */
-   SDEV_ST_AVAILABLE = 0x01,
-   /* sdev is now used. */
-   SDEV_ST_USED,
-   /* sdev is unusable because of a fatal error. */
-   SDEV_ST_ERROR,
-
-   /* vdev does not connect a remote device. */
-   VDEV_ST_NULL,
-   /* vdev is used, but the USB address is not assigned yet */
-   VDEV_ST_NOTASSIGNED,
-   VDEV_ST_USED,
-   VDEV_ST_ERROR
-};
-
 struct usbip_usb_interface {
uint8_t bInterfaceClass;
uint8_t bInterfaceSubClass;
-- 
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


[PATCH 0/3] staging/usbip: add new uapi header usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. Adding an usbip uapi header file will
define the kernel - userspace interface for this device status.

Shuah Khan (3):
  staging/usbip: add uapi header to export usbip kernel interfaces
  staging/usbip: change usbip to include new uapi usbip.h
  staging/usbip: change usbip userspace to include new uapi usbip.h

 drivers/staging/usbip/usbip_common.h   |   19 ++
 .../staging/usbip/userspace/libsrc/usbip_common.h  |   20 +++
 include/uapi/linux/Kbuild  |1 +
 include/uapi/linux/usbip.h |   26 
 4 files changed, 32 insertions(+), 34 deletions(-)
 create mode 100644 include/uapi/linux/usbip.h

-- 
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


[PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. Adding an usbip uapi header file will
define the kernel - userspace interface for this device status.

Signed-off-by: Shuah Khan shuah...@samsung.com
---
 include/uapi/linux/Kbuild  |1 +
 include/uapi/linux/usbip.h |   26 ++
 2 files changed, 27 insertions(+)
 create mode 100644 include/uapi/linux/usbip.h

diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 3ce25b5..4fb4800 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -393,6 +393,7 @@ header-y += un.h
 header-y += unistd.h
 header-y += unix_diag.h
 header-y += usbdevice_fs.h
+header-y += usbip.h
 header-y += utime.h
 header-y += utsname.h
 header-y += uuid.h
diff --git a/include/uapi/linux/usbip.h b/include/uapi/linux/usbip.h
new file mode 100644
index 000..fa5db30
--- /dev/null
+++ b/include/uapi/linux/usbip.h
@@ -0,0 +1,26 @@
+/*
+ * usbip.h
+ *
+ * USBIP uapi defines and function prototypes etc.
+*/
+
+#ifndef _UAPI_LINUX_USBIP_H
+#define _UAPI_LINUX_USBIP_H
+
+/* usbip device status - exported in usbip device sysfs status */
+enum usbip_device_status {
+   /* sdev is available. */
+   SDEV_ST_AVAILABLE = 0x01,
+   /* sdev is now used. */
+   SDEV_ST_USED,
+   /* sdev is unusable because of a fatal error. */
+   SDEV_ST_ERROR,
+
+   /* vdev does not connect a remote device. */
+   VDEV_ST_NULL,
+   /* vdev is used, but the USB address is not assigned yet */
+   VDEV_ST_NOTASSIGNED,
+   VDEV_ST_USED,
+   VDEV_ST_ERROR
+};
+#endif /* _UAPI_LINUX_USBIP_H */
-- 
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


[PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h

2014-02-27 Thread Shuah Khan
usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. A new uapi usbip.h now defines the
usbip device status for kernel and userspace to use. Change usbip
kernel space to include uapi usbip.h for usbip device status.

Signed-off-by: Shuah Khan shuah...@samsung.com
---
 drivers/staging/usbip/usbip_common.h |   19 ++-
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/usbip/usbip_common.h 
b/drivers/staging/usbip/usbip_common.h
index 7e6c543..846ef5b 100644
--- a/drivers/staging/usbip/usbip_common.h
+++ b/drivers/staging/usbip/usbip_common.h
@@ -29,6 +29,7 @@
 #include linux/types.h
 #include linux/usb.h
 #include linux/wait.h
+#include uapi/linux/usbip.h
 
 #define USBIP_VERSION 1.0.0
 
@@ -235,22 +236,6 @@ enum usbip_side {
USBIP_STUB,
 };
 
-enum usbip_status {
-   /* sdev is available. */
-   SDEV_ST_AVAILABLE = 0x01,
-   /* sdev is now used. */
-   SDEV_ST_USED,
-   /* sdev is unusable because of a fatal error. */
-   SDEV_ST_ERROR,
-
-   /* vdev does not connect a remote device. */
-   VDEV_ST_NULL,
-   /* vdev is used, but the USB address is not assigned yet */
-   VDEV_ST_NOTASSIGNED,
-   VDEV_ST_USED,
-   VDEV_ST_ERROR
-};
-
 /* event handler */
 #define USBIP_EH_SHUTDOWN  (1  0)
 #define USBIP_EH_BYE   (1  1)
@@ -271,7 +256,7 @@ enum usbip_status {
 /* a common structure for stub_device and vhci_device */
 struct usbip_device {
enum usbip_side side;
-   enum usbip_status status;
+   enum usbip_device_status status;
 
/* lock for status */
spinlock_t lock;
-- 
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


Re: [PATCH] ARM: i.MX6: clk: Remove usbphy clock hacks

2014-02-27 Thread Peter Chen
On Thu, Feb 27, 2014 at 03:47:45PM +0100, Sascha Hauer wrote:
 On Thu, Feb 27, 2014 at 08:06:18PM +0800, Peter Chen wrote:
  On Thu, Feb 27, 2014 at 09:18:58AM +0100, Sascha Hauer wrote:
   Recently the chipidea got broken on i.MX6 when the phy_mode property
   is given in the devicetree. Since this commit:
   
   | commit cd0b42c2a6d2a74244f0053f8960f5dad5842278
   | Author: Chris Ruehl chris.ru...@gtsys.com.hk
   | Date:   Fri Jan 10 13:51:30 2014 +0800
   |
   | usb: chipidea: put hw_phymode_configure before ci_usb_phy_init
   |
   | hw_phymode_configure configures the PORTSC registers and allow the
   | following phy_inits to operate on the right parameters. This fix a 
   problem
   | where the UPLI (ISP1504) could not be detected, because the 
   Viewport was not
   | available and read the viewport return 0's only.
   |
   | Signed-off-by: Chris Ruehl chris.ru...@gtsys.com.hk
   | Signed-off-by: Peter Chen peter.c...@freescale.com
   | Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org
   
   the portsc register is configured before the phy clock is enabled. The CPU
   immediately hangs once the portsc register is written to with disabled phy
   clocks.
   
   The following patch added a hack to the i.MX6 clock support. Its purpose
   was to keep the usbphy clock gates enabled:
   
   | commit a5120e89e7e187a91852896f586876c7a2030804
   | Author: Peter Chen peter.c...@freescale.com
   | Date:   Fri Jan 18 10:38:05 2013 +0800
   |
   | ARM i.MX6: change mxs usbphy clock usage
   |
   | This mxs usbphy is only needs to be on after system boots
   | up, and software never needs to control it anymore.
   | Meanwhile, usbphy's parent needs to be notified if usb
   | is suspend or not. So we design below mxs usbphy usage:
   |
   | - usbphy1_gate and usbphy2_gate:
   | Their parents are dummy clock, we only needs to enable
   | it after system boots up.
   | - usbphy1 and usbphy2
   | Usage reserved bit for this clock, in that case, the refcount
   | will be updated, but without hardware changing.
   |
   | Signed-off-by: Peter Chen peter.c...@freescale.com
   | Signed-off-by: Shawn Guo shawn@linaro.org
   
   Now this patch indeed keeps the gates enabled, but it doesn't keep the 
   parents
   enabled, so the whole patch becomes a no-op once the parents get 
   disabled. This
   nowadays happens with more aggressive clock disabling for example in the 
   UART
   driver (which uses the same PLL as usbphy1).
   
   This patch reverts the reserved register bit hackery and instead enables
   the usbphy clocks when support for the mxsphy is enabled.
  
  It will cause pll3 is still on when no user has used it.
  
   
   Signed-off-by: Sascha Hauer s.ha...@pengutronix.de
   ---
   
   The above are my current state of observations. I think I still haven't 
   fully
   understood the purpose of the clock hacks introduced with a5120e89e7e187.
  
  usbphy1/usbphy2 are used to mark usbphy as pll3/pll7's child, once the
  usbphy is enabled, the pll should be enabled, if no other user for pll3,
  the pll3 should still be on since the usbphy is using.
  
  usbphy1_gate/usbphy2_gate are used to control usb gate for pll, due to
  special requirement from IC guys, these two bits are needed to open
  before any usb operations, and there two bits are never needed to change
  on the fly.
 
 Can you explain why the gates have to be turned on when the parent PLL
 is disabled?
 

It is requirement by IC guys, and this value is used at some RTL logic
which don't need software operation.

  The reason why we meet such issue?
  For internal phy(like UTMI), the phy clock is from internal pll,
  it is on/off on the fly, the access PORTSC.PTS will hang without
  phy clock. So, usb_phy_init needs to be called before
  hw_phymode_configure.
  
  For external PHY (like ulpi), the phy clock is from board, access
  PORTSC.PTS may not need clock or we need to enhance ulpi driver to
  support open and close external phy on the fly. It needs to config
  PORTSC.PTS prior to visit view-port which is needed at its phy_init.
  So, hw_phymode_configure is needed to be called before usb_phy_init.
  
 
 [...]
 
  -static void hw_phymode_configure(struct ci_hdrc *ci)
  +static int ci_usb_phy_init(struct ci_hdrc *ci)
   {
  u32 portsc, lpm, sts = 0;
  +   int ret = -ENODEV;
   
  switch (ci-platdata-phy_mode) {
  case USBPHY_INTERFACE_MODE_UTMI:
  +   ret = usb_phy_init(ci-transceiver);
  +   if (ret)
  +   return ret;
  portsc = PORTSC_PTS(PTS_UTMI);
  lpm = DEVLC_PTS(PTS_UTMI);
  break;
  case USBPHY_INTERFACE_MODE_UTMIW:
  +   ret = usb_phy_init(ci-transceiver);
  +   if (ret)
  +   return ret;
  portsc = PORTSC_PTS(PTS_UTMI) | PORTSC_PTW;
  lpm = DEVLC_PTS(PTS_UTMI) | DEVLC_PTW;
  break;
  case 

Re: [PATCH] usb: phy: am335x: Use SIMPLE_DEV_PM_OPS macro

2014-02-27 Thread Jingoo Han
On Thursday, February 27, 2014 11:41 PM, Roger Quadros wrote:
 On 02/27/2014 01:47 PM, Jingoo Han wrote:
  Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
 
  Signed-off-by: Jingoo Han jg1@samsung.com
  ---
   drivers/usb/phy/phy-am335x.c |4 +---
   1 file changed, 1 insertion(+), 3 deletions(-)
 
  diff --git a/drivers/usb/phy/phy-am335x.c b/drivers/usb/phy/phy-am335x.c
  index 12fc346..ebf8373 100644
  --- a/drivers/usb/phy/phy-am335x.c
  +++ b/drivers/usb/phy/phy-am335x.c
  @@ -123,9 +123,7 @@ static int am335x_phy_resume(struct device *dev)
  return 0;
   }
 
  -static const struct dev_pm_ops am335x_pm_ops = {
  -   SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume)
  -};
  +static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, 
  am335x_phy_resume);
 
 You need to move this outside the #ifdef CONFIG_PM_SLEEP condition and get rid
 of the DEV_PM_OPS macro below as well.

1. Your suggestion - Removing '#define DEV_PM_OPS NULL'

#ifdef CONFIG_PM_SLEEP
static int am335x_phy_suspend(struct device *dev)
static int am335x_phy_resume(struct device *dev)
#endif
static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume);

In this case, code can be simpler. However, a dev_pm_ops structure is
created, and it requires additional NULL checking by PM framework,
when CONFIG_PM_SLEEP=n  CONFIG_PM=y.

2. Current code - Keeping '#define DEV_PM_OPS NULL'

#ifdef CONFIG_PM_SLEEP
static int am335x_phy_suspend(struct device *dev)
static int am335x_phy_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume);
#define DEV_PM_OPS (am335x_pm_ops)
#else
#define DEV_PM_OPS NULL
#endif

In this case, code size is larger. However, a dev_pm_ops structure is
NOT created, and it does NOT require additional NULL checking by PM framework,
when CONFIG_PM_SLEEP=n  CONFIG_PM=y.

Personally, I prefer the first one. Additional NULL checking is not
crucial. Is there any other opinions?

Best regards,
Jingoo Han

 
 
   #define DEV_PM_OPS (am335x_pm_ops)
   #else
 


--
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: phy: move phy driver up for early initialization

2014-02-27 Thread Chanho Park
This patch moves initialization order of the phy driver ahead of
the dwc3 driver. The dwc3 driver needs phy driver when probing.
Of cource, the driver can be initialized later after the phy
driver is initialized. For efficiency, however, it would be better
to change the initialization order.

Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Signed-off-by: Chanho Park chanho61.p...@samsung.com
---
 drivers/usb/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 1ae2bf3..95ca10a 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -5,6 +5,7 @@
 # Object files in subdirectories
 
 obj-$(CONFIG_USB)  += core/
+obj-$(CONFIG_USB_SUPPORT)  += phy/
 
 obj-$(CONFIG_USB_DWC3) += dwc3/
 obj-$(CONFIG_USB_DWC2) += dwc2/
@@ -47,7 +48,6 @@ obj-$(CONFIG_USB_MICROTEK)+= image/
 obj-$(CONFIG_USB_SERIAL)   += serial/
 
 obj-$(CONFIG_USB)  += misc/
-obj-$(CONFIG_USB_SUPPORT)  += phy/
 obj-$(CONFIG_EARLY_PRINTK_DBGP)+= early/
 
 obj-$(CONFIG_USB_ATM)  += atm/
-- 
1.8.3.2

--
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] dma: cppi41: start tear down only if channel is busy

2014-02-27 Thread George Cherian

On 2/27/2014 2:17 PM, Shevchenko, Andriy wrote:

On Thu, 2014-02-27 at 10:44 +0530, George Cherian wrote:

Start the channel tear down only if the channel is busy, else just
bail out. In some cases its seen that by the time the tear down is
initiated the cppi completes the DMA, especially in ISOCH transfers.

Signed-off-by: George Cherian george.cher...@ti.com
---
  drivers/dma/cppi41.c | 7 +--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index c18aebf..d028f36 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -620,12 +620,15 @@ static int cppi41_stop_chan(struct dma_chan *chan)
u32 desc_phys;
int ret;
  
+	desc_phys = lower_32_bits(c-desc_phys);

+   desc_num = (desc_phys - cdd-descs_phys) / sizeof(struct cppi41_desc);
+   if (!cdd-chan_busy[desc_num])
+   return 0;
+
ret = cppi41_tear_down_chan(c);
if (ret)
return ret;
  
-	desc_phys = lower_32_bits(c-desc_phys);

-   desc_num = (desc_phys - cdd-descs_phys) / sizeof(struct cppi41_desc);
WARN_ON(!cdd-chan_busy[desc_num]);

Do you still need this WARN_ON?


Yes in some cases wherein the channel is busy and tear down didn't 
happen successfully.



cdd-chan_busy[desc_num] = NULL;
  





--
-George

--
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 v5 2/3] usb: gadget: epautoconf: check feature flags

2014-02-27 Thread Robert Baldyga
On 12/17/2013 02:23 AM, Felipe Balbi wrote:
 Start matching endpoints against feature flags,
 this will help us dropping the naming conventions
 currently used by the Gadget Framework.
 
 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
  drivers/usb/gadget/epautoconf.c | 30 --
  1 file changed, 28 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
 index feaaa7b..b362046 100644
 --- a/drivers/usb/gadget/epautoconf.c
 +++ b/drivers/usb/gadget/epautoconf.c
 @@ -62,6 +62,33 @@ ep_matches (
   if (USB_ENDPOINT_XFER_CONTROL == type)
   return 0;
  
 + /* first check feature flags */
 + if (usb_endpoint_dir_in(desc))
 + if (!ep-has_dir_in)
 + return 0;
 +
 + if (usb_endpoint_dir_out(desc))
 + if (!ep-has_dir_out)
 + return 0;

You should add support for this flags in UDC drivers, or make it usable
for drivers which don't support this. Gadget drivers cannot bind to UDC
if its driver have not set this flags. Currently the only UDC driver
which has support for this is dwc3. It's a big issue.

 +
 + switch (type) {
 + case USB_ENDPOINT_XFER_CONTROL:
 + /* only ep0 */
 + return 0;
 + case USB_ENDPOINT_XFER_BULK:
 + if (ep-has_bulk)
 + goto match;
 + break;
 + case USB_ENDPOINT_XFER_INT:
 + if (ep-has_interrupt)
 + goto match;
 + break;
 + case USB_ENDPOINT_XFER_ISOC:
 + if (ep-has_isochronous)
 + goto match;
 + break;
 + }
 +
   /* some other naming convention */
   if ('e' != ep-name[0])
   return 0;
 @@ -159,8 +186,7 @@ ep_matches (
   break;
   }
  
 - /* MATCH!! */
 -
 +match:
   /* report address */
   desc-bEndpointAddress = USB_DIR_IN;
   if (isdigit (ep-name [2])) {
 

Doing goto to this place you ignore maxpacket size check. It may cause
problems on handware with some maxpacket size limitations.

Best regards
Robert Baldyga
Samsung RD Institute Poland
--
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