Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1626157
| From | Razmik Karapetyan <Razmik.Karapetyan@synopsys.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 3/3] usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling |
| Date | 2017-04-19 16:30 +0200 |
| Message-ID | <txYMi-4vr-23@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Disabled only unmasked endpoints based on DAINTMSK register.
This will allow to minimize GINTSTS_GOUTNAKEFF interrupt handling.
Signed-off-by: Razmik Karapetyan <razmik@synopsys.com>
---
drivers/usb/dwc2/gadget.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 52f7db9..3c4eff6 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3662,8 +3662,11 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
u8 idx;
u32 epctrl;
u32 gintmsk;
+ u32 daintmsk;
struct dwc2_hsotg_ep *hs_ep;
+ daintmsk = dwc2_readl(hsotg->regs + DAINTMSK);
+ daintmsk >>= DAINT_OUTEP_SHIFT;
/* Mask this interrupt */
gintmsk = dwc2_readl(hsotg->regs + GINTMSK);
gintmsk &= ~GINTSTS_GOUTNAKEFF;
@@ -3672,9 +3675,13 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
dev_dbg(hsotg->dev, "GOUTNakEff triggered\n");
for (idx = 1; idx <= hsotg->num_of_eps; idx++) {
hs_ep = hsotg->eps_out[idx];
+ /* Proceed only unmasked ISOC EPs */
+ if (!hs_ep->isochronous || (BIT(idx) & ~daintmsk))
+ continue;
+
epctrl = dwc2_readl(hsotg->regs + DOEPCTL(idx));
- if ((epctrl & DXEPCTL_EPENA) && hs_ep->isochronous) {
+ if (epctrl & DXEPCTL_EPENA) {
epctrl |= DXEPCTL_SNAK;
epctrl |= DXEPCTL_EPDIS;
dwc2_writel(epctrl, hsotg->regs + DOEPCTL(idx));
--
2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH v2 3/3] usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling Razmik Karapetyan <Razmik.Karapetyan@synopsys.com> - 2017-04-19 16:30 +0200
csiph-web