Re: TODO: drivers/pcmcia/ds.c: ds_read

2000-10-12 Thread manfred
Yong Chi wrote: > Hopefully this will do for SMP locks. =) You must not hold a spinlock across put_user - instead you must copy the get_queued_event(user) into a local variable, spinunlock and then copy it to userspace. Compare drivers/sbus/char/sunkbd.c, function kbd_read from 2.2 and 2.4: 2.2

Re: TODO: drivers/pcmcia/ds.c: ds_read & ds_write. SMP locks are missing fix - TAKE 2

2000-10-12 Thread Yong Chi
Take 2 based on semaphore -) Jan-Simon Pendry wrote: > holding a spin lock across a (potential) sleep is a bug - it can > lead to deadlock. > > jan-simon. > > Jakub Jelinek wrote: > > > > On Thu, Oct 12, 2000 at 11:38:11AM -0400, Yong Chi wrote: > > > Hopefully this will do for SMP locks. =) >

Re: TODO: drivers/pcmcia/ds.c: ds_read & ds_write. SMP locks are missing fix

2000-10-12 Thread Jan-Simon Pendry
holding a spin lock across a (potential) sleep is a bug - it can lead to deadlock. jan-simon. Jakub Jelinek wrote: > > On Thu, Oct 12, 2000 at 11:38:11AM -0400, Yong Chi wrote: > > Hopefully this will do for SMP locks. =) > > Holding a spinlock for this long (especially when you might sleep t

Re: TODO: drivers/pcmcia/ds.c: ds_read & ds_write. SMP locks are missing fix

2000-10-12 Thread Jakub Jelinek
On Thu, Oct 12, 2000 at 11:38:11AM -0400, Yong Chi wrote: > Hopefully this will do for SMP locks. =) Holding a spinlock for this long (especially when you might sleep there in two places (interruptible_sleep_on, put_user)) is basically a bad idea. spinlocks are designed to be holded only for sho