Re: linux-kernel-digest V1 #1028

From: Al Borchers (alborchers@steinerpoint.com)
Date: Thu Jun 22 2000 - 12:39:10 EST


Pauline Middelink wrote:
> On Wed, 21 Jun 2000 around 18:47:33 +0100, Tigran Aivazian wrote:
> > On Sun, 18 Jun 2000, Andrew Morton wrote:
> > > BTW: CPU flags should always be saved and restored in the same function
> > > - it's not correct to pass the flags to another function and allow that
> > > function to restore them. Breaks on SPARC, apparently. Does Rusty's
> > > doc cover this??
> >
> > it maybe obvious (definitely is to most) but it may still be worth
> > mentioning that 'passing' flags to inline'd functions is ok, otherwise
> > people would get very confused when they look at
> > __schedule_tail()/reschedule_idle() interaction.

> Hmmm, than drivers/usb/serial/digi_acceleport.c
> cond_wait_interruptible_timeout_irqrestore() seems
> suspect. Its static but not explicitly inlined.

Thanks for pointing this out. I inlined the function.

> Also line 649/650 seems strange to me, shouldn't the
> second one be a normal spinlock() because we know the
> irq's are off? (and not overwrite flags)

Yes, this is a bug and the flags would be overwritten. I have changed the
code so the inner nested spin_locks use just spin_lock(). Thanks again.

I will send in a patch when I correct a couple other SMP/locking problems
pointed out by Rusty's doc at
http://www.samba.org/netfilter/unreliable-guides/kernel-locking/lklockingguide.html
Our code calls copy_from_user (which apparently can sleep) while holding a
spin_lock.

Are you using the Digi AccelePort USB 4 driver? If you see any other problems
with
the code or have any questions let me know.

-- Al Borchers

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:24 EST