linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-inno-usb2: Return zero after otg sync
@ 2022-08-22 10:32 Peter Geis
  2022-08-23  3:41 ` Samuel Holland
  2022-08-23 11:26 ` Heiko Stübner
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Geis @ 2022-08-22 10:32 UTC (permalink / raw)
  To: Heiko Stuebner, Kishon Vijay Abraham I, Vinod Koul,
	Samuel Holland, Peter Geis
  Cc: Markus Reichl, Michael Riesch, linux-phy, linux-arm-kernel,
	linux-rockchip, linux-kernel

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. Fix this
by setting ret to zero after use.

Fixes: 8dc60f8da22f ("phy: rockchip-inno-usb2: Sync initial otg state")

Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Reported-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 0b1e9337ee8e..5fc7c374a6b4 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1169,6 +1169,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
 			/* 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);
+			ret = 0;
 		}
 	}
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-23 11:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-22 10:32 [PATCH] phy: rockchip-inno-usb2: Return zero after otg sync Peter Geis
2022-08-23  3:41 ` Samuel Holland
2022-08-23  5:46   ` Peter Geis
2022-08-23 11:26 ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).