[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3eb5ef65-1426-58d0-0f45-eb83cee6f7cc@gmail.com>
Date: Fri, 3 Aug 2018 23:39:02 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Tomas Winkler <tomas.winkler@...el.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/3] mei: Don't free irq when suspending
Usually it's not needed to free and re-request the interrupt in a
suspend / resume cycle, so remove this.
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
drivers/misc/mei/pci-me.c | 20 --------------------
drivers/misc/mei/pci-txe.c | 27 +--------------------------
2 files changed, 1 insertion(+), 46 deletions(-)
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index ea4e1522..55ba1c41 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -336,9 +336,6 @@ static int mei_me_pci_suspend(struct device *device)
mei_disable_interrupts(dev);
- free_irq(pdev->irq, dev);
- pci_disable_msi(pdev);
-
return 0;
}
@@ -346,29 +343,12 @@ static int mei_me_pci_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct mei_device *dev;
- unsigned int irqflags;
int err;
dev = pci_get_drvdata(pdev);
if (!dev)
return -ENODEV;
- pci_enable_msi(pdev);
-
- irqflags = pci_dev_msi_enabled(pdev) ? IRQF_ONESHOT : IRQF_SHARED;
-
- /* request and enable interrupt */
- err = request_threaded_irq(pdev->irq,
- mei_me_irq_quick_handler,
- mei_me_irq_thread_handler,
- irqflags, KBUILD_MODNAME, dev);
-
- if (err) {
- dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n",
- pdev->irq);
- return err;
- }
-
err = mei_restart(dev);
if (err)
return err;
diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c
index e1b90912..b8a49581 100644
--- a/drivers/misc/mei/pci-txe.c
+++ b/drivers/misc/mei/pci-txe.c
@@ -240,9 +240,6 @@ static int mei_txe_pci_suspend(struct device *device)
mei_disable_interrupts(dev);
- free_irq(pdev->irq, dev);
- pci_disable_msi(pdev);
-
return 0;
}
@@ -250,36 +247,14 @@ static int mei_txe_pci_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct mei_device *dev;
- int err;
dev = pci_get_drvdata(pdev);
if (!dev)
return -ENODEV;
- pci_enable_msi(pdev);
-
mei_clear_interrupts(dev);
- /* request and enable interrupt */
- if (pci_dev_msi_enabled(pdev))
- err = request_threaded_irq(pdev->irq,
- NULL,
- mei_txe_irq_thread_handler,
- IRQF_ONESHOT, KBUILD_MODNAME, dev);
- else
- err = request_threaded_irq(pdev->irq,
- mei_txe_irq_quick_handler,
- mei_txe_irq_thread_handler,
- IRQF_SHARED, KBUILD_MODNAME, dev);
- if (err) {
- dev_err(&pdev->dev, "request_threaded_irq failed: irq = %d.\n",
- pdev->irq);
- return err;
- }
-
- err = mei_restart(dev);
-
- return err;
+ return mei_restart(dev);
}
#endif /* CONFIG_PM_SLEEP */
--
2.18.0
Powered by blists - more mailing lists