[ldv-project] Deadlock in grgpio_irq_unmap()

Alexandre Courbot gnurou at gmail.com
Mon Aug 17 11:24:19 MSK 2015


On Mon, Aug 3, 2015 at 1:15 AM, Alexey Khoroshilov
<khoroshilov at ispras.ru> wrote:
> Dear colleagus,
>
> grgpio_irq_unmap() code looks quite suspicious regarding usage of
> priv->bgc.lock spinlock.
>
> It locks the spinlock in line 310:
>         spin_lock_irqsave(&priv->bgc.lock, flags);
> and then it can call grgpio_set_imask() in line 317:
>         grgpio_set_imask(priv, i, 0);
>
> But grgpio_set_imask() unconditionally locks the spinlock by itself.

Indeed, this looks plain wrong. I have sent a fix that moves the
spinlock acquisition outside of grgpio_set_imask().



More information about the ldv-project mailing list