Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-12 Thread Hoang-Nam Nguyen
Hi, > > + if (my_cq->ownpid != cur_pid) { > > + ehca_err(device, "Invalid caller pid=%x ownpid=%x " > > +"cq_num=%x", > > +cur_pid, my_cq->ownpid, my_cq->cq_number); > > + return -EINVAL; > > +

Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-12 Thread Hoang-Nam Nguyen
Hi Roland! > > > spin_lock_irqsave(&ehca_cq_idr_lock, flags); > > > while (my_cq->nr_callbacks) > > > yield(); > > > Isn't that code outright buggy? Calling into the scheduler with a > > spinlock held and local interrupts disabled... > > Yes, absolutely --

Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-11 Thread Roland Dreier
> >spin_lock_irqsave(&ehca_cq_idr_lock, flags); > >while (my_cq->nr_callbacks) > >yield(); > Isn't that code outright buggy? Calling into the scheduler with a > spinlock held and local interrupts disabled... Yes, absolutely -- if nr_callbacks is ever nonzero then this wi

Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-11 Thread Christoph Hellwig
On Thu, Jan 11, 2007 at 01:40:54PM -0600, Nathan Lynch wrote: > Christoph Hellwig wrote: > > On Thu, Jan 11, 2007 at 08:08:36PM +0100, Hoang-Nam Nguyen wrote: > > > > > spin_lock_irqsave(&ehca_cq_idr_lock, flags); > > > while (my_cq->nr_callbacks) > > > yield(); > > > > Calling yiel

Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-11 Thread Nathan Lynch
Christoph Hellwig wrote: > On Thu, Jan 11, 2007 at 08:08:36PM +0100, Hoang-Nam Nguyen wrote: > > > spin_lock_irqsave(&ehca_cq_idr_lock, flags); > > while (my_cq->nr_callbacks) > > yield(); > > Calling yield is a very bad idea in general. You should probably > add a waitqueue

Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-11 Thread Christoph Hellwig
On Thu, Jan 11, 2007 at 08:08:36PM +0100, Hoang-Nam Nguyen wrote: > Hello Roland and Christoph H.! > This is a patch for ehca_cq.c. It removes all direct calls of > do_mmap()/munmap() > when creating and destroying a completion queue respectively. > Thanks > Nam This patch looks good, but there

[PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()

2007-01-11 Thread Hoang-Nam Nguyen
Hello Roland and Christoph H.! This is a patch for ehca_cq.c. It removes all direct calls of do_mmap()/munmap() when creating and destroying a completion queue respectively. Thanks Nam Signed-off-by Hoang-Nam Nguyen <[EMAIL PROTECTED]> --- ehca_cq.c | 65 +++-