From: Matthieu CASTET <matthieu.castet-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
To: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
Cc: USB list <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
ALSA devel <alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org>,
Greg KH
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Clemens Ladisch <clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
Subject: Re: usb audio race at disconnect time
Date: Thu, 18 Oct 2012 17:39:05 +0200 [thread overview]
Message-ID: <50802299.9080004@parrot.com> (raw)
In-Reply-To: <s5ha9vm4d46.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
Takashi Iwai a écrit :
> At Tue, 16 Oct 2012 18:01:13 +0200,
> Matthieu CASTET wrote:
>> Takashi Iwai a écrit :
>>> At Mon, 15 Oct 2012 19:41:40 +0200,
>>> Matthieu CASTET wrote:
>>>> Hi Takashi,
>>>>
>>>> But I believe I found other races in the alsa char device handling. With the
>>>> attached patch, if you disconnect the usb audio device between "msleep o" and
>>>> "msleep o+", you will free the card resource (snd_card_do_free) and then use it [1].
>>>>
>>>> I did in in snd_ctl_open, but the same thing could be done in snd_pcm_open, ...
>>> OK, we'd need a generic open/close protection.
>>> For PCM, there is already a fix in my last patchset, so it should
>>> work, but for other devices, the paths are still uncovered.
>>>
>> I don't think it will work for pcm : the begin of snd_pcm_open is not protected
>> by any lock even with your patch
>> In snd_open we release sound_mutex before calling file->f_op->open.
>>
>> The snd_lookup_minor_data and snd_card_file_add should be protected by a lock.
>> Attached a patch (pcm.crash) that help to trigger [1].
>
> Check out my latest patches in topic/usb-disconnect-fix branch.
> It's been fixed there.
>
Thanks,
the first tests seems ok.
We will do more strees test.
Matthieu
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-10-18 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 15:17 usb audio race at disconnect time Matthieu CASTET
[not found] ` <5076E327.5030503-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-11 16:01 ` Alan Stern
2012-10-11 16:41 ` Takashi Iwai
[not found] ` <s5hvceh9d0v.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-10-12 14:31 ` [alsa-devel] " Takashi Iwai
2012-10-12 15:42 ` Matthieu CASTET
[not found] ` <50783A5B.9090009-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-13 8:31 ` Takashi Iwai
[not found] ` <s5h626eixid.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-10-15 17:41 ` Matthieu CASTET
[not found] ` <507C4AD4.2090400-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-15 18:45 ` Takashi Iwai
[not found] ` <s5hwqyrh8vb.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-10-16 15:16 ` Takashi Iwai
2012-10-16 16:01 ` Matthieu CASTET
[not found] ` <507D84C9.9070405-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-16 16:04 ` Takashi Iwai
[not found] ` <s5ha9vm4d46.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-10-18 15:39 ` Matthieu CASTET [this message]
[not found] ` <50802299.9080004-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-19 20:57 ` Takashi Iwai
2012-10-29 14:17 ` Takashi Iwai
[not found] ` <s5h4nlduzvc.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2012-10-30 10:52 ` Matthieu CASTET
[not found] ` <508FB171.7030007-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2012-10-30 11:02 ` Takashi Iwai
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=50802299.9080004@parrot.com \
--to=matthieu.castet-itf29qwbsa/qt0dzr+alfa@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.org \
--cc=zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.