kernel: split patches folder up into backport, pending and hack folders
[openwrt/staging/chunkeey.git] / target / linux / generic / pending-4.4 / 821-usb-Remove-annoying-warning-about-bogus-URB.patch
1 From f13ad28ba4280d2283ca2b49f0bd384bc51e6a68 Mon Sep 17 00:00:00 2001
2 From: Alexey Brodkin <abrodkin@synopsys.com>
3 Date: Tue, 5 Jul 2016 14:28:31 +0300
4 Subject: [PATCH] usb: Remove annoying warning about bogus URB
5
6 When ath9k-htc Wi-Fi dongle is used with generic OHCI controller
7 infinite stream of warnings appears in debug console like this:
8 -------------------------->8----------------------
9 usb 1-1: new full-speed USB device number 2 using ohci-platform
10 usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
11 usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size:
12 51008
13 ------------[ cut here ]------------
14 WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449
15 usb_submit_urb+0x1b4/0x498()
16 usb 1-1: BOGUS urb xfer, pipe 1 != type 3
17 Modules linked in:
18 CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted
19 4.4.0-rc4-00017-g00e2d79-dirty #3
20 Workqueue: events request_firmware_work_func
21
22 Stack Trace:
23 arc_unwind_core.constprop.1+0xa4/0x110
24 ---[ end trace 649ef8c342817fc2 ]---
25 ------------[ cut here ]------------
26 WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449
27 usb_submit_urb+0x1b4/0x498()
28 usb 1-1: BOGUS urb xfer, pipe 1 != type 3
29 Modules linked in:
30 CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W
31 4.4.0-rc4-00017-g00e2d79-dirty #3
32 Workqueue: events request_firmware_work_func
33
34 Stack Trace:
35 arc_unwind_core.constprop.1+0xa4/0x110
36 ---[ end trace 649ef8c342817fc3 ]---
37 ------------[ cut here ]------------
38 -------------------------->8----------------------
39
40 There're some discussions in mailing lists proposing to disable
41 that particular check alltogether and magically all seem to work
42 fine with muted warning.
43
44 Anyways new thread on that regard could be found here:
45 http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html
46
47 Let's see what comes out of that new discussion, hopefully patching
48 of generic USB stuff won't be required then.
49
50 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
51 ---
52 drivers/usb/core/urb.c | 5 -----
53 1 file changed, 5 deletions(-)
54
55 --- a/drivers/usb/core/urb.c
56 +++ b/drivers/usb/core/urb.c
57 @@ -323,9 +323,6 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb);
58 */
59 int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
60 {
61 - static int pipetypes[4] = {
62 - PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT
63 - };
64 int xfertype, max;
65 struct usb_device *dev;
66 struct usb_host_endpoint *ep;
67 @@ -443,11 +440,6 @@ int usb_submit_urb(struct urb *urb, gfp_
68 * cause problems in HCDs if they get it wrong.
69 */
70
71 - /* Check that the pipe's type matches the endpoint's type */
72 - if (usb_pipetype(urb->pipe) != pipetypes[xfertype])
73 - dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
74 - usb_pipetype(urb->pipe), pipetypes[xfertype]);
75 -
76 /* Check against a simple/standard policy */
77 allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK |
78 URB_FREE_BUFFER);