From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C16DC32789 for ; Tue, 23 Aug 2022 18:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6RAYGxuoskj4ywVCVTbhX01476/t8NztYlFYhYcPvlU=; b=hb+Ku36lfBz3kE 47uEvSPRbNjQlRWeGNwHcwPdO4eSjhfxAJZ2vyCW6HrJb/QRj+v16aox1zH0wNG1SUM03cKuwQc4A h4fk4vBReoVQpTvipSIMWy+6AUXIIRd3mQqtF9z0ERIIf72WsJKUbhlg2sES943o14yhgGk4w+QJk vtE2yHQOaju/XtlDOMxG98/WcM+RGKwEw71+yj3ORuQIRrb0QQsE/o1hFryDSkRej4GwZkyQQmSw2 O6JzDg1BoOW5e/4pPYb8J2ab+6EmwmuGDsgMIZ3SY7V3jM9WWF9ftMTf2LYR385M4bLreKg11Vj80 yolszkp+DOnUyEqq2xjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQYxY-008FZK-UT; Tue, 23 Aug 2022 18:49:09 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQYxV-008FV8-7L; Tue, 23 Aug 2022 18:49:06 +0000 Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oQYxM-0006cy-NL; Tue, 23 Aug 2022 20:48:56 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Kishon Vijay Abraham I , Vinod Koul , Peter Geis , Samuel Holland , Peter Geis Cc: Markus Reichl , Michael Riesch , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] phy: rockchip-inno-usb2: Return zero after otg sync Date: Tue, 23 Aug 2022 20:48:55 +0200 Message-ID: <2872516.OBFZWjSADL@diego> In-Reply-To: <20220823144728.47068-1-pgwipeout@gmail.com> References: <20220823144728.47068-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_114905_294766_DD653FA2 X-CRM114-Status: GOOD ( 18.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Dienstag, 23. August 2022, 16:47:28 CEST schrieb Peter Geis: > The otg sync state patch reuses the ret variable, but fails to set it to > zero after use. This leads to a situation when the otg port is in > peripheral mode where the otg phy aborts halfway through setup. It also > fails to account for a failure to register the extcon notifier. Fix this > by using our own variable and skipping otg sync in case of failure. > > Fixes: 8dc60f8da22f ("phy: rockchip-inno-usb2: Sync initial otg state") > > Reported-by: Markus Reichl > Reported-by: Michael Riesch > Signed-off-by: Peter Geis > Tested-by: Michael Riesch > Tested-by: Markus Reichl Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner > --- > drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > index 0b1e9337ee8e..d579a22c61df 100644 > --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > @@ -1124,7 +1124,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, > struct rockchip_usb2phy_port *rport, > struct device_node *child_np) > { > - int ret; > + int ret, id; > > rport->port_id = USB2PHY_PORT_OTG; > rport->port_cfg = &rphy->phy_cfg->port_cfgs[USB2PHY_PORT_OTG]; > @@ -1164,11 +1164,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, > EXTCON_USB_HOST, &rport->event_nb); > if (ret) > dev_err(rphy->dev, "register USB HOST notifier failed\n"); > + goto out; > > if (!of_property_read_bool(rphy->dev->of_node, "extcon")) { > /* do initial sync of usb state */ > - ret = property_enabled(rphy->grf, &rport->port_cfg->utmi_id); > - extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !ret); > + id = property_enabled(rphy->grf, &rport->port_cfg->utmi_id); > + extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !id); > } > } > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel