static irqreturn_t tegra_ehci_irq(struct usb_hcd *hcd) { struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); struct ehci_hcd *ehci = hcd_to_ehci(hcd); irqreturn_t irq_status; spin_lock(&ehci->lock); irq_status = tegra_usb_phy_irq(tegra->phy); if (irq_status == IRQ_NONE) { spin_unlock(&ehci->lock); return irq_status; } if (tegra_usb_phy_pmc_wakeup(tegra->phy)) { ehci_dbg(ehci, "pmc wakeup detected\n"); usb_hcd_resume_root_hub(hcd); spin_unlock(&ehci->lock); return irq_status; } spin_unlock(&ehci->lock); EHCI_DBG("%s() cmd = 0x%x, int_sts = 0x%x, portsc = 0x%x\n", __func__, ehci_readl(ehci, &ehci->regs->command), ehci_readl(ehci, &ehci->regs->status), ehci_readl(ehci, &ehci->regs->port_status[0])); irq_status = ehci_irq(hcd); if (ehci->controller_remote_wakeup) { ehci->controller_remote_wakeup = false; tegra_usb_phy_pre_resume(tegra->phy, true); tegra->port_resuming = 1; } return irq_status; }
static irqreturn_t tegra_ehci_irq(struct usb_hcd *hcd) { struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); struct ehci_hcd *ehci = hcd_to_ehci(hcd); irqreturn_t irq_status; bool pmc_remote_wakeup = false; struct platform_device *pdev = container_of(hcd->self.controller, struct platform_device, dev); int ehci_id = pdev->id; spin_lock(&ehci->lock); irq_status = tegra_usb_phy_irq(tegra->phy); if (irq_status == IRQ_NONE) { spin_unlock(&ehci->lock); return irq_status; } if (tegra_usb_phy_remote_wakeup(tegra->phy)) { ehci_info(ehci, "remote wakeup detected on controller.%d\n", ehci_id); /* +SSD_RIL: workaround for remote wake AT timeout. */ if (Modem_is_IMC() && ehci_id == MODEM_EHCI_ID) { debug_gpio_dump(); //trigger_radio_fatal_get_coredump("remote wakeup in PMC"); } else { pmc_remote_wakeup = true; usb_hcd_resume_root_hub(hcd); } /* -SSD_RIL: workaround for remote wake AT timeout. */ spin_unlock(&ehci->lock); return irq_status; } spin_unlock(&ehci->lock); // EHCI_DBG("%s() cmd = 0x%x, int_sts = 0x%x, portsc = 0x%x\n", __func__, // ehci_readl(ehci, &ehci->regs->command), // ehci_readl(ehci, &ehci->regs->status), // ehci_readl(ehci, &ehci->regs->port_status[0])); irq_status = ehci_irq(hcd); if (pmc_remote_wakeup) { ehci->controller_remote_wakeup = false; } if (ehci->controller_remote_wakeup) { ehci->controller_remote_wakeup = false; /* +SSD_RIL: workaround for remote wake hang. */ if (Modem_is_IMC() && ehci_id == MODEM_EHCI_ID) { ehci_info(ehci, "controller.%d remote wakeup detected", ehci_id); debug_gpio_dump(); //trigger_radio_fatal_get_coredump("remote wakeup in controller"); } else { tegra_usb_phy_pre_resume(tegra->phy, true); tegra->port_resuming = 1; } /* -SSD_RIL: workaround for remote wake hang. */ } return irq_status; }