Commit 3be99cd0 authored by Gregory Herrero's avatar Gregory Herrero Committed by Felipe Balbi

usb: dwc2: gadget: don't overwrite DCTL register on NAKEFF interrupts

When receiving GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF interrupt,
DCTL will be overwritten with DCTL_CGOUTNAK or DCTL_CGNPINNAK values.
Instead of overwriting it, write only needed bits.

It could cause an issue if GINTSTS_GINNAKEFF or GINTSTS_GOUTNAKEFF
interrupt is received after dwc2 disabled pullup by writing
DCTL_SFTDISCON bit.
Pullup will then be re-enabled whereas it should not.
Acked-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarGregory Herrero <gregory.herrero@intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 0676c7e7
...@@ -2585,7 +2585,7 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw) ...@@ -2585,7 +2585,7 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
if (gintsts & GINTSTS_GOUTNAKEFF) { if (gintsts & GINTSTS_GOUTNAKEFF) {
dev_info(hsotg->dev, "GOUTNakEff triggered\n"); dev_info(hsotg->dev, "GOUTNakEff triggered\n");
dwc2_writel(DCTL_CGOUTNAK, hsotg->regs + DCTL); __orr32(hsotg->regs + DCTL, DCTL_CGOUTNAK);
dwc2_hsotg_dump(hsotg); dwc2_hsotg_dump(hsotg);
} }
...@@ -2593,7 +2593,7 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw) ...@@ -2593,7 +2593,7 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
if (gintsts & GINTSTS_GINNAKEFF) { if (gintsts & GINTSTS_GINNAKEFF) {
dev_info(hsotg->dev, "GINNakEff triggered\n"); dev_info(hsotg->dev, "GINNakEff triggered\n");
dwc2_writel(DCTL_CGNPINNAK, hsotg->regs + DCTL); __orr32(hsotg->regs + DCTL, DCTL_CGNPINNAK);
dwc2_hsotg_dump(hsotg); dwc2_hsotg_dump(hsotg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment