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