Re: I made a patch and would like feedback/testers (drivers/cdrom/aztcd.c)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/20/05, Arjan van de Ven <[email protected]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux