2
0

821-usb-Remove-annoying-warning-about-bogus-URB.patch 2.8 KB

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