diff options
author | Karsten Wiese <annabellesgarden@yahoo.de> | 2005-06-14 12:56:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-14 14:05:13 -0400 |
commit | dcf78d80a6c2de829ec08c8e663a3370e982d616 (patch) | |
tree | 77b572ad1e4dcda54f876ac721f54f1e8c8f117e /sound/usb | |
parent | efa93dbedd0e2eacf49ea6fff1fe4397d520cf61 (diff) |
[PATCH] usbusx2y: prevent oops & dead keyboard on usb unplugging while the device is being used
Without this patch, some usb kobjects, which are parents to the usx2y's
kobjects can be freed before the usx2y's. This led to an oops in
get_kobj_path_length() and a dead keyboard, when the usx2y's kobjects
were freed. The patch ensures the correct sequence. Tested ok on
kernel 2.6.12-rc2.
Present in ALSA cvs
Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index b06a267e5dac..89ee8b732013 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -1,6 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * usbusy2y.c - ALSA USB US-428 Driver | 2 | * usbusy2y.c - ALSA USB US-428 Driver |
3 | * | 3 | * |
4 | 2005-04-14 Karsten Wiese | ||
5 | Version 0.8.7.2: | ||
6 | Call snd_card_free() instead of snd_card_free_in_thread() to prevent oops with dead keyboard symptom. | ||
7 | Tested ok with kernel 2.6.12-rc2. | ||
8 | |||
4 | 2004-12-14 Karsten Wiese | 9 | 2004-12-14 Karsten Wiese |
5 | Version 0.8.7.1: | 10 | Version 0.8.7.1: |
6 | snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called without rawusb's hwdep device being open. | 11 | snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called without rawusb's hwdep device being open. |
@@ -143,7 +148,7 @@ | |||
143 | 148 | ||
144 | 149 | ||
145 | MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>"); | 150 | MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>"); |
146 | MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.1"); | 151 | MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2"); |
147 | MODULE_LICENSE("GPL"); | 152 | MODULE_LICENSE("GPL"); |
148 | MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}"); | 153 | MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}"); |
149 | 154 | ||
@@ -430,8 +435,6 @@ static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr) | |||
430 | if (ptr) { | 435 | if (ptr) { |
431 | usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr); | 436 | usX2Ydev_t* usX2Y = usX2Y((snd_card_t*)ptr); |
432 | struct list_head* p; | 437 | struct list_head* p; |
433 | if (usX2Y->chip_status == USX2Y_STAT_CHIP_HUP) // on 2.6.1 kernel snd_usbmidi_disconnect() | ||
434 | return; // calls us back. better leave :-) . | ||
435 | usX2Y->chip.shutdown = 1; | 438 | usX2Y->chip.shutdown = 1; |
436 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; | 439 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; |
437 | usX2Y_unlinkSeq(&usX2Y->AS04); | 440 | usX2Y_unlinkSeq(&usX2Y->AS04); |
@@ -443,7 +446,7 @@ static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr) | |||
443 | } | 446 | } |
444 | if (usX2Y->us428ctls_sharedmem) | 447 | if (usX2Y->us428ctls_sharedmem) |
445 | wake_up(&usX2Y->us428ctls_wait_queue_head); | 448 | wake_up(&usX2Y->us428ctls_wait_queue_head); |
446 | snd_card_free_in_thread((snd_card_t*)ptr); | 449 | snd_card_free((snd_card_t*)ptr); |
447 | } | 450 | } |
448 | } | 451 | } |
449 | 452 | ||