summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorRazmik Karapetyan <razmik@synopsys.com>2018-01-19 14:41:42 +0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-13 10:47:41 +0200
commitd84845522d93f92e2278c082f195f83ebd7dfe26 (patch)
tree005a84f3f56925a011cb092db4a4269f5d2d3c97 /drivers/usb
parent689efb2619b58fa21da6c9b96b74f5d1fb8d2b46 (diff)
downloadblackbird-op-linux-d84845522d93f92e2278c082f195f83ebd7dfe26.tar.gz
blackbird-op-linux-d84845522d93f92e2278c082f195f83ebd7dfe26.zip
usb: dwc2: Update GINTSTS_GOUTNAKEFF interrupt handling
Disabled only unmasked endpoints based on DAINTMSK register. This will allow to minimize GINTSTS_GOUTNAKEFF interrupt handling. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Razmik Karapetyan <razmik@synopsys.com> Signed-off-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc2/gadget.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 2ffc380ddb62..4509b2eb3eca 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3628,8 +3628,11 @@ irq_retry:
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;
@@ -3638,9 +3641,13 @@ irq_retry:
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));
OpenPOWER on IntegriCloud