020-02-rt2x00usb-do-not-anchor-rx-and-tx-urb-s.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From 93c7018ec16bb83399dd4db61c361a6d6aba0d5a Mon Sep 17 00:00:00 2001
  2. From: Stanislaw Gruszka <sgruszka@redhat.com>
  3. Date: Wed, 8 Feb 2017 12:18:09 +0100
  4. Subject: [PATCH 02/19] rt2x00usb: do not anchor rx and tx urb's
  5. We might kill TX or RX urb during rt2x00usb_flush_entry(), what can
  6. cause anchor list corruption like shown below:
  7. [ 2074.035633] WARNING: CPU: 2 PID: 14480 at lib/list_debug.c:33 __list_add+0xac/0xc0
  8. [ 2074.035634] list_add corruption. prev->next should be next (ffff88020f362c28), but was dead000000000100. (prev=ffff8801d161bb70).
  9. <snip>
  10. [ 2074.035670] Call Trace:
  11. [ 2074.035672] [<ffffffff813bde47>] dump_stack+0x63/0x8c
  12. [ 2074.035674] [<ffffffff810a2231>] __warn+0xd1/0xf0
  13. [ 2074.035676] [<ffffffff810a22af>] warn_slowpath_fmt+0x5f/0x80
  14. [ 2074.035678] [<ffffffffa073855d>] ? rt2x00usb_register_write_lock+0x3d/0x60 [rt2800usb]
  15. [ 2074.035679] [<ffffffff813dbe4c>] __list_add+0xac/0xc0
  16. [ 2074.035681] [<ffffffff81591c6c>] usb_anchor_urb+0x4c/0xa0
  17. [ 2074.035683] [<ffffffffa07322af>] rt2x00usb_kick_rx_entry+0xaf/0x100 [rt2x00usb]
  18. [ 2074.035684] [<ffffffffa0732322>] rt2x00usb_clear_entry+0x22/0x30 [rt2x00usb]
  19. To fix do not anchor TX and RX urb's, it is not needed as during
  20. shutdown we kill those urbs in rt2x00usb_free_entries().
  21. Cc: Vishal Thanki <vishalthanki@gmail.com>
  22. Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
  23. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
  24. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  25. ---
  26. drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 ----
  27. 1 file changed, 4 deletions(-)
  28. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
  29. index 5a2bf9f63cd7..fe13dd07cc2a 100644
  30. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
  31. +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
  32. @@ -319,10 +319,8 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void *data)
  33. entry->skb->data, length,
  34. rt2x00usb_interrupt_txdone, entry);
  35. - usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor);
  36. status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
  37. if (status) {
  38. - usb_unanchor_urb(entry_priv->urb);
  39. if (status == -ENODEV)
  40. clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
  41. set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
  42. @@ -410,10 +408,8 @@ static bool rt2x00usb_kick_rx_entry(struct queue_entry *entry, void *data)
  43. entry->skb->data, entry->skb->len,
  44. rt2x00usb_interrupt_rxdone, entry);
  45. - usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor);
  46. status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
  47. if (status) {
  48. - usb_unanchor_urb(entry_priv->urb);
  49. if (status == -ENODEV)
  50. clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
  51. set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
  52. --
  53. 2.12.1