This reverts commit 15075de4c71a6a48bedf7b2130dd3155d0e3497a.

When OTG controller is in d0i2/clockgated, if an interrupt comes in
we must undo clockgating before touching the otg controller registers.
Otherwise, it would cause fabric error and system hang.

Undo clock gating in the kernel is less optimal than doing it in the
SCU FW. The reason is that the periperhal side of the interrupts come
into SCU from PMIC first, matching OTG controller interrupts will not
be generated until SCU FW programs OTGCFG register (in SRAM) then
propogate to the equivalent bits in the OTG controller registers, such
as OTGSC. Since SCU has to undo clock-gating for OTG anyway, we should
let SCU FW perform such duty.

On the other side, doing d0<->d3 check and transition in otg/udc/ehci isr
has a performance penalty to pay in that the interrupts are shared by
two drivers at a time and there is no guarantee of ordering. It may
also burden runtime pm wq under certain cases.

SCU FW with otg irq fix must be used after reverting this patch.

Signed-off-by: Jacob Pan <[email protected]>
---
 drivers/usb/otg/langwell_otg.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
index 7f5d0bf..ae7a51f 100644
--- a/drivers/usb/otg/langwell_otg.c
+++ b/drivers/usb/otg/langwell_otg.c
@@ -784,15 +784,11 @@ static irqreturn_t otg_irq(int irq, void *_dev)
        u32                             int_mask = 0;
        int                             flag = 0;
 
-       pm_runtime_get_sync(lnw->dev);
-
        int_sts = readl(lnw->iotg.base + CI_OTGSC);
        int_en = (int_sts & OTGSC_INTEN_MASK) >> 8;
        int_mask = int_sts & int_en;
-       if (int_mask == 0) {
-               pm_runtime_put(lnw->dev);
+       if (int_mask == 0)
                return IRQ_NONE;
-       }
 
        if (int_mask & OTGSC_IDIS) {
                dev_dbg(lnw->dev, "%s: id change int\n", __func__);
@@ -842,8 +838,6 @@ static irqreturn_t otg_irq(int irq, void *_dev)
        if (flag)
                langwell_update_transceiver();
 
-       pm_runtime_put(lnw->dev);
-
        return IRQ_HANDLED;
 }
 
@@ -2099,7 +2093,7 @@ static int langwell_otg_probe(struct pci_dev *pdev,
                goto err;
        }
 
-       if (request_threaded_irq(pdev->irq, NULL, &otg_irq, IRQF_SHARED,
+       if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
                                driver_name, lnw) != 0) {
                dev_dbg(lnw->dev, "request interrupt %d failed\n", pdev->irq);
                retval = -EBUSY;
@@ -2343,7 +2337,7 @@ static int langwell_otg_resume(struct pci_dev *pdev)
                goto error;
        }
 
-       if (request_threaded_irq(pdev->irq, NULL, otg_irq, IRQF_SHARED,
+       if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
                                driver_name, lnw) != 0) {
                dev_dbg(&pdev->dev, "request interrupt %d failed\n", pdev->irq);
                ret = -EBUSY;
-- 
1.7.1

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to