From: Thomas Gleixner Date: Mon, 2 Dec 2013 11:20:36 +0000 (+0100) Subject: mfd: rtsx_pcr: Disable interrupts before cancelling delayed works X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=033795785f03230ca660a37a428db3ab096dd659;p=linux-edison.git mfd: rtsx_pcr: Disable interrupts before cancelling delayed works commit 73beb63d290f961c299526852884846b0d868840 upstream. This fixes a kernel panic when resuming from suspend to RAM. Without this fix an interrupt hits after the delayed work is canceled and thus requeues it. So we end up freeing an armed timer. Signed-off-by: Thomas Gleixner Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c index e968c01ca2a..45f26be359e 100644 --- a/drivers/mfd/rtsx_pcr.c +++ b/drivers/mfd/rtsx_pcr.c @@ -1195,8 +1195,14 @@ static void rtsx_pci_remove(struct pci_dev *pcidev) pcr->remove_pci = true; - cancel_delayed_work(&pcr->carddet_work); - cancel_delayed_work(&pcr->idle_work); + /* Disable interrupts at the pcr level */ + spin_lock_irq(&pcr->lock); + rtsx_pci_writel(pcr, RTSX_BIER, 0); + pcr->bier = 0; + spin_unlock_irq(&pcr->lock); + + cancel_delayed_work_sync(&pcr->carddet_work); + cancel_delayed_work_sync(&pcr->idle_work); mfd_remove_devices(&pcidev->dev);