]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: wwan: mhi_wwan_ctrl: Fix possible deadlock
authorLoic Poulain <loic.poulain@linaro.org>
Fri, 6 Aug 2021 10:35:09 +0000 (12:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Aug 2021 08:35:48 +0000 (09:35 +0100)
commit34737e1320db6d51f0d140d5c684b9eb32f0da76
treef068ad4f54db333014c758a47f5f66d979a5e4a5
parent47fac45600aafc5939d9620055c3c46f7135d316
net: wwan: mhi_wwan_ctrl: Fix possible deadlock

Lockdep detected possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&mhiwwan->rx_lock);
                               local_irq_disable();
                               lock(&mhi_cntrl->pm_lock);
                               lock(&mhiwwan->rx_lock);
   <Interrupt>
     lock(&mhi_cntrl->pm_lock);

  *** DEADLOCK ***

To prevent this we need to disable the soft-interrupts when taking
the rx_lock.

Cc: stable@vger.kernel.org
Fixes: fa588eba632d ("net: Add Qcom WWAN control driver")
Reported-by: Thomas Perrot <thomas.perrot@bootlin.com>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/mhi_wwan_ctrl.c