mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nish Aravamudan <nish.aravamudan@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: "Daniel Marjamäki" <daniel.marjamaki@comhem.se>,
	linux-kernel@vger.kernel.org
Subject: Re: I made a patch and would like feedback/testers (drivers/cdrom/aztcd.c)
Date: Sun, 20 Nov 2005 13:04:35 -0800	[thread overview]
Message-ID: <29495f1d0511201304p4b5bd863p4c8fccab6f5ef8d6@mail.gmail.com> (raw)
In-Reply-To: <1132501080.2857.3.camel@laptopd505.fenrus.org>

On 11/20/05, Arjan van de Ven <arjan@infradead.org> wrote:
> >   static void op_ok(void)
> >   {
> > -     aztTimeOutCount = 0;
> > +     aztTimeOut = jiffies + 2;
> >       do {
> >               aztIndatum = inb(DATA_PORT);
> > -             aztTimeOutCount++;
> > -             if (aztTimeOutCount >= AZT_TIMEOUT) {
> > +             if (time_after(jiffies, aztTimeOut)) {
> >                       printk("aztcd: Error Wait OP_OK\n");
> >                       break;
> >               }
> > +             schedule_timeout_interruptible(1);
>
> this I think is not quite right; schedule_timeout_*() doesn't do
> anything unless you set current->state to something. And at that point
> you might as well start using msleep()!

Not true, as Thomas points out. You are right for schedule_timeout(),
but that's why we introduced the _interruptible() and
_uninterruptible(). And there are reasons to use schedule_timeout_*()
instead of msleep() [not necessarily in this case, but in general],
specifically the presence of wait-queues.

> but what you're doing is generally a good idea; busy waits as the
> original code did is quite wrong...

I agree, and I recommend Daniel post to LKML to get some testing / see
if anyone actually uses this driver :)

Thanks,
Nish

  parent reply	other threads:[~2005-11-20 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-20 15:29 Daniel Marjamäki
2005-11-20 15:38 ` Arjan van de Ven
2005-11-20 17:15   ` Thomas Gleixner
2005-11-20 21:04   ` Nish Aravamudan [this message]
     [not found] <5aZsv-3CJ-17@gated-at.bofh.it>
2005-11-20 20:58 ` Bodo Eggert
2005-11-20 21:07   ` Nish Aravamudan
2005-11-21  8:09   ` Daniel Marjamäki
2005-11-21  8:19     ` Con Kolivas
2005-11-21  8:42       ` Daniel Marjamäki
2005-11-21  9:11         ` Con Kolivas
2005-11-21 10:47           ` Nick Piggin
2005-11-21 15:08             ` Nish Aravamudan
2005-11-21 16:33       ` Bodo Eggert

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=29495f1d0511201304p4b5bd863p4c8fccab6f5ef8d6@mail.gmail.com \
    --to=nish.aravamudan@gmail.com \
    --cc=arjan@infradead.org \
    --cc=daniel.marjamaki@comhem.se \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®