Skip to content

Commit

Permalink
phy: rockchip-inno-usb2: Fix muxed interrupt support
Browse files Browse the repository at this point in the history
This commit fixes two issues with the muxed interrupt handler. First,
the OTG port has the "bvalid" interrupt enabled, not "linestate". Since
only the linestate interrupt was handled, and not the bvalid interrupt,
plugging in a cable to the OTG port caused an interrupt storm.

Second, the return values from the individual port IRQ handlers need to
be OR-ed together. Otherwise, the lack of an interrupt from the last
port would cause the handler to erroneously return IRQ_NONE.

Fixes: ed2b5a8 ("phy: phy-rockchip-inno-usb2: support muxed interrupts")
Signed-off-by: Samuel Holland <[email protected]>
Tested-by: Michael Riesch <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
smaeul authored and vinodkoul committed Apr 20, 2022
1 parent 74d0cd4 commit 6a98df0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/phy/rockchip/phy-rockchip-inno-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,14 @@ static irqreturn_t rockchip_usb2phy_irq(int irq, void *data)
if (!rport->phy)
continue;

/* Handle linestate irq for both otg port and host port */
ret = rockchip_usb2phy_linestate_irq(irq, rport);
switch (rport->port_id) {
case USB2PHY_PORT_OTG:
ret |= rockchip_usb2phy_otg_mux_irq(irq, rport);
break;
case USB2PHY_PORT_HOST:
ret |= rockchip_usb2phy_linestate_irq(irq, rport);
break;
}
}

return ret;
Expand Down

0 comments on commit 6a98df0

Please sign in to comment.