lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 015/339] phy: rockchip-inno-usb2: Fix muxed interrupt support
    Date
    From: Samuel Holland <samuel@sholland.org>

    [ Upstream commit 6a98df08ccd55e87947d253b19925691763e755c ]

    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: ed2b5a8e6b98 ("phy: phy-rockchip-inno-usb2: support muxed interrupts")
    Signed-off-by: Samuel Holland <samuel@sholland.org>
    Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
    Link: https://lore.kernel.org/r/20220414032258.40984-2-samuel@sholland.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
    index eca77e44a4c1..cba5c32cbaee 100644
    --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
    +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
    @@ -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;
    --
    2.35.1


    \
     
     \ /
      Last update: 2022-06-13 15:26    [W:4.144 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site