Re: [PATCH] irda: ali-ircc: Fix deadlock in ali_ircc_sir_change_speed()

From: David Miller
Date: Fri Sep 11 2015 - 19:19:10 EST


From: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>
Date: Sat, 12 Sep 2015 00:34:48 +0300

> ali_ircc_sir_change_speed() is always called with self->lock held,
> so acquiring the lock inside it leads to unavoidable deadlock.
>
> Call graph:
> ali_ircc_sir_change_speed() is called from ali_ircc_change_speed()
> ali_ircc_fir_hard_xmit() under spin_lock_irqsave(&self->lock, flags);
> ali_ircc_sir_hard_xmit() under spin_lock_irqsave(&self->lock, flags);
> ali_ircc_net_ioctl() under spin_lock_irqsave(&self->lock, flags);
> ali_ircc_dma_xmit_complete()
> ali_ircc_fir_interrupt()
> ali_ircc_interrupt() under spin_lock(&self->lock);
> ali_ircc_sir_write_wakeup()
> ali_ircc_sir_interrupt()
> ali_ircc_interrupt() under spin_lock(&self->lock);
>
> The patch removes spin_lock/unlock from ali_ircc_sir_change_speed().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>

Looks good, applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/