lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/3] mei: Don't free irq when suspending
From
Date
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@gmail.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

\
 
 \ /
  Last update: 2018-08-03 23:43    [W:0.044 / U:2.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site