From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] set_current_state usage in oss/
Date: Wed, 03 Jan 2007 04:29:34 +0000 [thread overview]
Message-ID: <20070103042934.GH14048@us.ibm.com> (raw)
In-Reply-To: <1167089629.11578.2.camel@alice>
On 03.01.2007 [00:23:26 +0100], Eric Sesterhenn wrote:
> hi,
>
> thanks for your comments, i am sorry i
> didnt have time to look at this again until now
>
> > > }
> > > mutex_unlock(&bta->lock);
> > > - current->state = TASK_INTERRUPTIBLE;
> > > + __set_current_state(TASK_INTERRUPTIBLE);
> > > schedule();
> > > mutex_lock(&bta->lock);
> > > if(signal_pending(current)) {
> > > @@ -608,7 +608,7 @@ static ssize_t btaudio_dsp_read(struct f
> > > }
> > > mutex_unlock(&bta->lock);
> > > remove_wait_queue(&bta->readq, &wait);
> > > - current->state = TASK_RUNNING;
> > > + __set_current_state(TASK_RUNNING);
> >
> > Both lines might be replaced with something like finish_wait().
>
> care to explain the first one?
>
>
> > > --- linux-2.6.20-rc2/sound/oss/cs46xx.c.orig 2006-12-26 00:04:05.000000000 +0100
> > > +++ linux-2.6.20-rc2/sound/oss/cs46xx.c 2006-12-26 00:04:06.000000000 +0100
> > > @@ -1435,7 +1435,7 @@ static int drain_dac(struct cs_state *st
> > > for (;;) {
> > > /* It seems that we have to set the current state to TASK_INTERRUPTIBLE
> > > every time to make the process really go to sleep */
> > > - current->state = TASK_INTERRUPTIBLE;
> > > + __set_current_state(TASK_INTERRUPTIBLE);
> > >
> > > spin_lock_irqsave(&state->card->lock, flags);
> > > count = dmabuf->count;
> > > @@ -1449,7 +1449,7 @@ static int drain_dac(struct cs_state *st
> > >
> > > if (nonblock) {
> > > remove_wait_queue(&dmabuf->wait, &wait);
> > > - current->state = TASK_RUNNING;
> > > + __set_current_state(TASK_RUNNING);
> >
> > finish_wait()
>
> same here, the second one is clear
Sorry, in both these cases, I just forgot to snip the earlier bits, new
patch looks much better. Note, that in the case of several OSS drivers,
they are already replaced by ALSA ones -- and the ALSA ones are much
better maintained. A lot of the wait-queue bits in OSS seem to be poorly
done, or more obfuscated than necessary.
Oh well.
Thanks,
Nish
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
prev parent reply other threads:[~2007-01-03 4:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-25 23:33 [PATCH] set_current_state usage in oss/ Eric Sesterhenn
2006-12-26 19:35 ` [KJ] " Nishanth Aravamudan
2007-01-02 23:23 ` Eric Sesterhenn
2007-01-03 4:29 ` Nishanth Aravamudan [this message]
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=20070103042934.GH14048@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@vger.kernel.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