usx2y: prevent oops & dead keyboard on hot usb unplugging
Quoted 10 lines · --- Takashi Iwai
At Fri, 15 Apr 2005 16:28:54 +0200 (CEST),
Quoted 8 lines · karsten wiese
Quoted 5 lines · --- Takashi Iwai
At Fri, 15 Apr 2005 15:59:25 +0200 (CEST),
Quoted 3 lines · karsten wiese
--- Lee Revell <[email protected]> wrote:
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
On Thu, 2005-04-14 at 20:59 +0200, karsten wiese
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 3 lines
Hi Clemens & Takashi
Please commit the patch.
Is the ALSA in kernel 2.6.11 affected? If so,
this
Quoted 11 lines
Quoted 10 lines
Quoted 2 lines
Think so, yes. The keyboard dead effect + described
oops
Quoted 2 lines
has been around for quiet a long time. (There is a lkml mail from yesterday about an
usb-cellphone
Quoted 3 lines
setup,
where the same oops + dead keyboard happens also:
http://marc.theaimsgroup.com/?i=<20050414230621.49663f75.vsu%20()%20altlinux%20!%20ru>
Quoted 57 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
)
There is also an alsa-bug with snd-usb-audio in the bugbase.
Clemens seams not to be convinced about thisaproach
Quoted 6 lines
Quoted 6 lines
yet.
Quoted 5 lines
maybe 'cause the comment of
snd_card_free_in_threadexplicitly states that its the one to be called for hotplug:
/**
*snd_card_free_in_thread- callsnd_card_free()in
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
thread
* @card: soundcard structure
*
* This function schedules the call of
snd_card_free()Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
function in a
* work queue. When all devices are released(non-busy),
Quoted 4 lines
the work
* is woken up and callssnd_card_free(). *
* When a card can be disconnected at any time byQuoted 8 lines
Quoted 8 lines
hotplug
Quoted 2 lines
service,
* this function should be used in disconnect (ordetach)
Quoted 4 lines
callback
* instead of callingsnd_card_free()directly. *
* Returns - zero otherwise a negative error codeif
Quoted 7 lines
Quoted 7 lines
the
Quoted 4 lines
start of thread failed.
*/Also I remember , that
snd_card_freedidn't work okwhen i
Quoted 1 line
used it in the first implementations of
usx2y-module
Quoted 8 lines
Quoted 8 lines
some 2
Quoted 3 lines
years ago.
but that was on kernel 2.4.something....... maybe above comment is from kernel 2.4 also and thehotplug
Quoted 1 line
system has changed ? anybody?
Might be. To be sure, check whether the release fops
is
Quoted 6 lines
Quoted 2 lines
called
properly before you callingsnd_card_free().You mean
snd_card_disconnect()?
That's called with the same argument and beforesnd_card_free().
Quoted 7 lines
No, I mean
snd_card_free(), which you changed fromsnd_card_free_in_thread(). Someone has to release the files
(i.e. call release fops eventually) before clean up everything viasnd_card_free().
Erm, you mean the close (for snd_pcm_ops_t,snd_rawmidi_ops_t) and release (for snd_hwdep_ops_t) callbacks then? They should all be called before snd_card_free()?
in other words:
<snip>
int snd_card_free_in_thread(snd_card_t * card)
{
if (card->files == NULL) {
snd_card_free(card);
return 0;
}</snip>
the "(card->files == NULL)" MUST be true beforesnd_card_free() can be called safely?
Karsten
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click