From nobody Mon Sep 29 21:08:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AB56C25B0D for ; Tue, 16 Aug 2022 04:43:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231602AbiHPEn1 (ORCPT ); Tue, 16 Aug 2022 00:43:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231939AbiHPEkj (ORCPT ); Tue, 16 Aug 2022 00:40:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C919D1E1D; Mon, 15 Aug 2022 13:33:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C71E3B81197; Mon, 15 Aug 2022 20:33:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A111C433C1; Mon, 15 Aug 2022 20:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595599; bh=jmK2cpuZJgzfFUBDT4X/tT4K1ZIqlymHVLMD9MRYZTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xPLduvZRcHWT/K5p2Ba0G+tCWHtl42P3GuxpxBvjBczvDEVf5bBu1xAdlGmfpLzIG h6NFC6WQDJGPnIcLByFCbZ0x5po5XUwXCq1Dn5uURD940HtpjfYkXOfsp3xpFh9s8q eVit9G+y33DwZ3lefCEujZU2lQtJAzrjERhXyCfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Frank Wunderlich , Samuel Holland , Peter Geis , Vinod Koul , Sasha Levin Subject: [PATCH 5.19 0815/1157] phy: rockchip-inno-usb2: Ignore OTG IRQs in host mode Date: Mon, 15 Aug 2022 20:02:51 +0200 Message-Id: <20220815180512.092521896@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Samuel Holland [ Upstream commit fd7d47484125c7d04578de9294faa7fec6e5df0a ] When the OTG port is fixed to host mode, the driver does not request its IRQs, nor does it enable those IRQs in hardware. Similarly, the driver should ignore the OTG port IRQs when handling the shared interrupt. Otherwise, it would update the extcon based on an ID pin which may be in an undefined state, or try to queue a uninitialized work item. Fixes: 6a98df08ccd5 ("phy: rockchip-inno-usb2: Fix muxed interrupt support") Reported-by: Frank Wunderlich Signed-off-by: Samuel Holland Tested-by: Peter Geis Tested-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220708061434.38115-1-samuel@sholland.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/ro= ckchip/phy-rockchip-inno-usb2.c index 6e44069617df..5223d4c9afdf 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -978,7 +978,9 @@ static irqreturn_t rockchip_usb2phy_irq(int irq, void *= data) =20 switch (rport->port_id) { case USB2PHY_PORT_OTG: - ret |=3D rockchip_usb2phy_otg_mux_irq(irq, rport); + if (rport->mode !=3D USB_DR_MODE_HOST && + rport->mode !=3D USB_DR_MODE_UNKNOWN) + ret |=3D rockchip_usb2phy_otg_mux_irq(irq, rport); break; case USB2PHY_PORT_HOST: ret |=3D rockchip_usb2phy_linestate_irq(irq, rport); --=20 2.35.1