From: Takashi Iwai <tiwai@suse.de>
To: Karsten Wiese <annabellesgarden@yahoo.de>
Cc: alsa-devel@lists.sourceforge.net, Rui Nuno Capela <rncbc@rncbc.org>
Subject: Re: [PATCH]snd-usb-usx2y 0.8.1 against alsa-kernel cvshead: OHCI doesn't crash anymore
Date: Tue, 19 Oct 2004 15:33:44 +0200 [thread overview]
Message-ID: <s5hlle2j0hz.wl@alsa2.suse.de> (raw)
In-Reply-To: <200410181406.43903.annabellesgarden@yahoo.de>
At Mon, 18 Oct 2004 14:06:43 +0200,
Karsten Wiese wrote:
>
> [1 <text/plain; iso-8859-1 (7bit)>]
> Am Montag 04 Oktober 2004 18:22 schrieb Takashi Iwai:
> > At Sun, 3 Oct 2004 00:38:04 +0200,
> >
> > Karsten Wiese wrote:
> > > > One thing I'm not sure is that the possible race of usX2Y_urbs_start()
> > > > and usX2Y_subs_startup_finish(). Better to use complete handler?
> > >
> > > did I care for any possible racing now?
> >
> > You need to call spin_lock(&usX2Y->prepare_lock) before checking
> > subs->prepared in usX2Y_urbs_start(). In this kind of implementation,
> > all the access to subs->prepared should be protected in the spinlock
> > to avoid races.
> >
> > Also, the spin_lock(&usX2Y->prepare_lock) in usX2Y_urbs_start() may
> > cause deadlock. Use spin_lock_irq(&usX2y->prepare_lock) instead.
> >
> Hi Takashi
>
> No spinlock no more. atomic_t instead. Please check.
I'm afraid it's still racy.
In usX2Y_urbs_start(), the complete callback may be called between
usb_submit_urb() and the loop of schedule_timeout().
So, the loop should check at first the condition before sleeping like
below:
while (atomic_read(&subs->state) != state_PREPARED) {
timeout = schedule_timeout(timeout);
if (signal_pending(current))
...
if (! timeout)
...
}
Regarding the new config stuff:
Let's kill CONFIG_SND_USB_USX2Y_NRPACKS_VARIABLE option.
No one will want to disable such a module option.
Also, please avoid the Kconfig int value as much as possible if you
want to support the driver for 2.2/2.4 kernels, too. I believe it's
ok to put a hardcoded value 4 like usbaudio.c if you describe the
module option properly in the document.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
next prev parent reply other threads:[~2004-10-19 13:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-30 18:46 [PATCH]snd-usb-usx2y 0.8.0 against alsa-kernel cvshead: OHCI doesn't crash anymore Karsten Wiese
2004-10-01 13:50 ` Takashi Iwai
2004-10-01 16:28 ` Karsten Wiese
2004-10-01 17:34 ` Takashi Iwai
2004-10-02 22:38 ` [PATCH]snd-usb-usx2y 0.8.1 " Karsten Wiese
2004-10-04 16:22 ` Takashi Iwai
2004-10-18 12:06 ` Karsten Wiese
2004-10-19 13:33 ` Takashi Iwai [this message]
2004-10-20 0:28 ` Karsten Wiese
2004-10-20 9:35 ` Takashi Iwai
2004-10-21 18:21 ` Karsten Wiese
2004-10-25 22:10 ` snd-usb-usx2y 0.8.5 " Rui Nuno Capela
2004-10-26 8:15 ` Jaroslav Kysela
2004-10-26 9:11 ` karsten wiese
2004-10-26 9:13 ` Rui Nuno Capela
2004-10-26 9:53 ` Karsten Wiese
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=s5hlle2j0hz.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=annabellesgarden@yahoo.de \
--cc=rncbc@rncbc.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