On 2017-04-10 at 11:49 "Dan Cross (Gerrit)"
<[email protected]> wrote:
> spin_lock -> spin_lock_irqsave and matching unlock
> 
> I discovered a kernel panic when the mlx driver tried
> to spinlock an IRQ-saving lock.  Usage elsewhere in this
> file seems to be OK.  Spinlock debugging FTW.

i doubt this will be the last of these.  can you look for other
violations in the mlx4 code?  for instance, a quick grep for spin_lock
in k/d/n/mlx4 and mlx4u turn up a few that look bad.  e.g.

kern/drivers/net/mlx4u/srq.c:   spin_lock_init(&srq->lock);
kern/drivers/net/mlx4u/srq.c:   spin_lock(&srq->lock);

that's a linux-style init (meaning, irqsave) matched with a non-irqsave
lock.

or this one:

kern/drivers/net/mlx4/srq.c:    spin_lock(&srq_table->lock);
kern/drivers/net/mlx4/srq.c:    spin_lock_irqsave(&srq_table->lock);

same lock, two different mechanisms for locking it.  possibly wrong
(though it might not be if IRQs are disabled already for the first
spin_lock).

the whole #define spinlock stuff in mlx4u and udrvr is a source for
future bugs of this sort.

incidentally, gerrit gives me this error:

        Code Review - Error
        The page you requested was not found, or you do not have
        permission to view this page.

i can see other pages on gerrit, such as ron's recent
https://akaros-review.googlesource.com/#/c/3500/

barret

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to