From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Johannes Stezenbach <js@sig21.net>,
Ivo van Doorn <IvDoorn@gmail.com>,
"John W. Linville" <linville@tuxdriver.com>,
Stanislaw Gruszka <sgruszka@redhat.com>
Subject: [14/87] rt2x00: fix hang when unplugging USB device in use
Date: Mon, 21 Mar 2011 16:06:13 -0700 [thread overview]
Message-ID: <20110321230710.609073464@clark.kroah.org> (raw)
In-Reply-To: <20110321230732.GA26510@kroah.com>
2.6.37-stable review patch. If anyone has any objections, please let us know.
------------------
From: Johannes Stezenbach <js@sig21.net>
commit d7bb5f845f437662296adbfeaab8fbfce1c32289 upstream.
When an rt2x00 USB device is unplugged while in use, it reliably
hangs the whole system. After some time the watchdog prints:
BUG: soft lockup - CPU#0 stuck for 64s! [kworker/u:0:5]
...
[<c01a88d8>] (usb_submit_urb+0x0/0x2ac) from [<bf0e752c>] (rt2x00usb_kick_rx_entry+0xb4/0xe8 [rt2x00usb])
[<bf0e7478>] (rt2x00usb_kick_rx_entry+0x0/0xe8 [rt2x00usb]) from [<bf0e7588>] (rt2x00usb_clear_entry+x28/0x2c [rt2x00usb])
[<bf0e7560>] (rt2x00usb_clear_entry+0x0/0x2c [rt2x00usb]) from [<bf0d5bc4>] (rt2x00lib_rxdone+0x2e0/0x2f8 [rt2x00lib])
[<bf0d58e4>] (rt2x00lib_rxdone+0x0/0x2f8 [rt2x00lib]) from [<bf0e7e00>] (rt2x00usb_work_rxdone+0x54/0x74 [rt2x00usb])
[<bf0e7dac>] (rt2x00usb_work_rxdone+0x0/0x74 [rt2x00usb]) from [<c00542b4>] (process_one_work+0x20c/0x35c)
Clear the DEVICE_STATE_PRESENT flag when usb_submit_urb()
returns -ENODEV to fix this.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/wireless/rt2x00/rt2x00usb.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -235,6 +235,7 @@ static void rt2x00usb_kick_tx_entry(stru
struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
u32 length;
+ int status;
if (!test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags))
return;
@@ -251,7 +252,10 @@ static void rt2x00usb_kick_tx_entry(stru
entry->skb->data, length,
rt2x00usb_interrupt_txdone, entry);
- if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
+ status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
+ if (status) {
+ if (status == -ENODEV)
+ clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
rt2x00lib_dmadone(entry);
}
@@ -450,6 +454,7 @@ void rt2x00usb_clear_entry(struct queue_
to_usb_device_intf(entry->queue->rt2x00dev->dev);
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
int pipe;
+ int status;
entry->flags = 0;
@@ -460,7 +465,12 @@ void rt2x00usb_clear_entry(struct queue_
rt2x00usb_interrupt_rxdone, entry);
set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
- if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
+
+ status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
+ if (status) {
+ if (status == -ENODEV)
+ clear_bit(DEVICE_STATE_PRESENT,
+ &entry->queue->rt2x00dev->flags);
set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
rt2x00lib_dmadone(entry);
}
next prev parent reply other threads:[~2011-03-21 23:51 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 23:07 [00/87] 2.6.37.5-stable review Greg KH
2011-03-21 23:06 ` [01/87] hwmon/f71882fg: Set platform drvdata to NULL later Greg KH
2011-03-21 23:06 ` [02/87] mtd: jedec_probe: Change variable name from cfi_p to cfi Greg KH
2011-03-21 23:06 ` [03/87] mtd: jedec_probe: initialise make sector erase command variable Greg KH
2011-03-21 23:06 ` [04/87] mtd: add "platform:" prefix for platform modalias Greg KH
2011-03-21 23:06 ` [05/87] mtd: mtd_blkdevs: fix double free on error path Greg KH
2011-03-21 23:06 ` [06/87] mtd: fix race in cfi_cmdset_0001 driver Greg KH
2011-03-21 23:06 ` [07/87] ASoC: Fix broken bitfield definitions in WM8978 Greg KH
2011-03-21 23:06 ` [08/87] sunrpc: Propagate errors from xs_bind() through xs_create_sock() Greg KH
2011-03-21 23:06 ` [09/87] NFS: NFSROOT should default to "proto=udp" Greg KH
2011-03-21 23:06 ` [10/87] Fix corrupted OSF partition table parsing Greg KH
2011-03-21 23:22 ` Linus Torvalds
2011-03-21 23:38 ` Greg KH
2011-03-21 23:06 ` [11/87] Btrfs: deal with short returns from copy_from_user Greg KH
2011-03-21 23:06 ` [12/87] netfilter: fix export secctx error handling Greg KH
2011-03-21 23:06 ` [13/87] rt2x00: Fix crash on USB unplug Greg KH
2011-03-21 23:06 ` Greg KH [this message]
2011-03-21 23:06 ` [15/87] drm/i915: Fix calculation of backlight value in combined mode Greg KH
2011-03-21 23:06 ` [16/87] block: fix mis-synchronisation in blkdev_issue_zeroout() Greg KH
2011-03-21 23:06 ` [17/87] nfs: fix compilation warning Greg KH
2011-03-21 23:06 ` [18/87] MIPS: MTX-1: Make au1000_eth probe all PHY addresses Greg KH
2011-03-21 23:06 ` [19/87] x86/mm: Fix pgd_lock deadlock Greg KH
2011-03-21 23:06 ` [20/87] x86: Dont check for BIOS corruption in first 64K when theres no need to Greg KH
2011-03-21 23:06 ` [21/87] x86/mm: Handle mm_fault_error() in kernel space Greg KH
2011-03-21 23:06 ` [22/87] ftrace: Fix memory leak with function graph and cpu hotplug Greg KH
2011-03-21 23:06 ` [23/87] x86: Fix panic when handling "mem={invalid}" param Greg KH
2011-03-21 23:06 ` [24/87] x86: Emit "mem=nopentium ignored" warning when not supported Greg KH
2011-03-21 23:06 ` [25/87] ahci: recognize Marvell 88se9125 PCIe SATA 6.0 Gb/s controller Greg KH
2011-03-21 23:06 ` [26/87] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Greg KH
2011-03-21 23:06 ` [27/87] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Greg KH
2011-03-21 23:06 ` [28/87] libata: fix hotplug for drivers which dont implement LPM Greg KH
2011-03-21 23:06 ` [29/87] RDMA/cma: Fix crash in request handlers Greg KH
2011-03-21 23:06 ` [30/87] Increase OSF partition limit from 8 to 18 Greg KH
2011-03-21 23:06 ` [31/87] IB/cm: Bump reference count on cm_id before invoking callback Greg KH
2011-03-21 23:06 ` [32/87] x86, quirk: Fix SB600 revision check Greg KH
2011-03-21 23:06 ` [33/87] microblaze: Fix /dev/zero corruption from __clear_user() Greg KH
2011-03-21 23:06 ` [34/87] x86: stop_machine_text_poke() should issue sync_core() Greg KH
2011-03-21 23:06 ` [35/87] TOMOYO: Fix memory leak upon file open Greg KH
2011-03-21 23:06 ` [36/87] drm: Hold the mode mutex whilst probing for sysfs status Greg KH
2011-03-21 23:06 ` [37/87] ath9k_hw: read and backup AR_WA register value even before chip reset on Greg KH
2011-03-21 23:06 ` [38/87] ath9k_hw: Fix incorrect macversion and macrev checks Greg KH
2011-03-21 23:06 ` [39/87] ath9k: remove support for the FIF_PROMISC_IN_BSS filter flag Greg KH
2011-03-21 23:06 ` [40/87] USB: serial drivers need to use larger bulk-in buffers Greg KH
2011-03-21 23:06 ` [41/87] USB: serial/kobil_sct, fix potential tty NULL dereference Greg KH
2011-03-21 23:06 ` [42/87] USB: serial: option: Apply OPTION_BLACKLIST_SENDSETUP also for ZTE MF626 Greg KH
2011-03-21 23:06 ` [43/87] USB: serial: ch341: add new id Greg KH
2011-03-21 23:06 ` [44/87] staging: winbond: needs <linux/delay.h> for msleep and friends Greg KH
2011-03-21 23:06 ` [45/87] staging: tidspbridge: protect dmm_map properly Greg KH
2011-03-21 23:06 ` [46/87] USB: isp1760: Implement solution for erratum 2 Greg KH
2011-03-21 23:06 ` [47/87] ehci: Check individual port status registers on resume Greg KH
2011-03-21 23:06 ` [48/87] USB: move usbcore away from hcd->state Greg KH
2011-03-21 23:06 ` [49/87] xhci: Update internal dequeue pointers after stalls Greg KH
2011-03-21 23:06 ` [50/87] xhci: Fix cycle bit calculation during stall handling Greg KH
2011-03-21 23:06 ` [51/87] USB: Add support for SuperSpeed isoc endpoints Greg KH
2011-03-21 23:06 ` [52/87] NFS: Fix a decoding problem in nfs3_decode_dirent Greg KH
2011-03-21 23:06 ` [53/87] ALSA: HDA: Realtek ALC88x: Do not over-initialize speakers and hp that are primary outputs Greg KH
2011-03-21 23:06 ` [54/87] ALSA: hda - fix digital mic selection in mixer on 92HD8X codecs Greg KH
2011-03-21 23:06 ` [55/87] ALSA: hda - Initialize special cases for input src in init phase Greg KH
2011-03-21 23:06 ` [56/87] HID: hid-magicmouse: Correct touch orientation direction Greg KH
2011-03-21 23:06 ` [57/87] HID: add support for Ortek PKB-1700 Greg KH
2011-03-21 23:06 ` [58/87] PCI: remove quirk for pre-production systems Greg KH
2011-03-21 23:06 ` [59/87] PCI: add more checking to ICH region quirks Greg KH
2011-03-21 23:06 ` [60/87] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Greg KH
2011-03-21 23:07 ` [61/87] PCI: sysfs: Fix failure path for addition of "vpd" attribute Greg KH
2011-03-21 23:07 ` [62/87] ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl Greg KH
2011-03-21 23:07 ` [63/87] ALSA: aloop - Fix possible IRQ lock inversion Greg KH
2011-03-21 23:07 ` [64/87] ALSA: ctxfi - Fix incorrect SPDIF status bit mask Greg KH
2011-03-21 23:07 ` [65/87] ALSA: ctxfi - Fix SPDIF status retrieval Greg KH
2011-03-21 23:07 ` [66/87] ALSA: ctxfi - Clear input settings before initialization Greg KH
2011-03-21 23:07 ` [67/87] [SCSI] scsi_dh_alua: fix deadlock in stpg_endio Greg KH
2011-03-21 23:07 ` [68/87] SUNRPC: Ensure we always run the tk_callback before tk_action Greg KH
2011-03-21 23:07 ` [69/87] RPC: killing RPC tasks races fixed Greg KH
2011-03-21 23:07 ` [70/87] perf: Fix the software events state check Greg KH
2011-03-21 23:07 ` [71/87] perf: Handle stopped state with tracepoints Greg KH
2011-03-21 23:07 ` [72/87] perf, powerpc: Handle events that raise an exception without overflowing Greg KH
2011-03-21 23:07 ` [73/87] perf tools: Version incorrect with some versions of grep Greg KH
2011-03-21 23:07 ` [74/87] ext3: Always set dx_nodes fake_dirent explicitly Greg KH
2011-03-21 23:07 ` [75/87] call_function_many: fix list delete vs add race Greg KH
2011-03-21 23:07 ` [76/87] call_function_many: add missing ordering Greg KH
2011-03-21 23:07 ` [77/87] smp_call_function_many: handle concurrent clearing of mask Greg KH
2011-03-21 23:07 ` [78/87] x86: Flush TLB if PGD entry is changed in i386 PAE mode Greg KH
2011-03-21 23:07 ` [79/87] ixgbe: limit VF access to network traffic Greg KH
2011-03-21 23:07 ` [80/87] ixgbe: work around for DDP last buffer size Greg KH
2011-03-21 23:07 ` [81/87] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Greg KH
2011-03-21 23:07 ` [82/87] i2c: Fix typo in instantiating-devices document Greg KH
2011-03-21 23:07 ` [83/87] mmc: sdhci: Add Ricoh e823 PCI ID Greg KH
2011-03-21 23:07 ` [84/87] mmc: sdio: remember new card RCA when redetecting card Greg KH
2011-03-21 23:07 ` [85/87] x86, binutils, xen: Fix another wrong size directive Greg KH
2011-03-21 23:07 ` [86/87] davinci: DM644x EVM: register MUSB device earlier Greg KH
2011-03-21 23:07 ` [87/87] hwmon: (sht15) Fix integer overflow in humidity calculation Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110321230710.609073464@clark.kroah.org \
--to=gregkh@suse.de \
--cc=IvDoorn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=js@sig21.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sgruszka@redhat.com \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®