Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4479797iog; Tue, 21 Jun 2022 22:26:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sk2TV18v0uo9XhNoVZ1iiGKBV70+bM+8+lWWigZT7Q3J8lZ0bU04GEOx6nYTOUl0s1lYX6 X-Received: by 2002:a05:6402:5cb:b0:434:eb48:754f with SMTP id n11-20020a05640205cb00b00434eb48754fmr2042400edx.421.1655875568141; Tue, 21 Jun 2022 22:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655875568; cv=none; d=google.com; s=arc-20160816; b=K0O66Gg09JwFf5zcUs5eyMQsU+x+TYR/mo6sJFbuL2tnTy0q7RapIqIkinniL01yih d1c44DXTqY1cZQeadozR4cVsrb9UtOVhdNI42+suVc36F11G3jt71q5OIkkP52zepO5n O2hL9FRgAeN9NPtDOkXfjrBp1infwIA3y6xiKGj8zn+gGAvqmfQBOY6zWWw4199xHCQR G3W7CdOvB2M1BAxHecamlLrc2qB11luRMQPchd7DQ381YYD5V0VCw7+qLyS6rnlX15vD cG8g+Hqz11buj4YkSUZwqH6klf/fqevOx68CVrTuzjXxoMCiFeqUtcSKpNc5bqkf2Ct3 5L/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:feedback-id:dkim-signature:dkim-signature; bh=raNbZ5XrTaJju1j0bn9K1zUDHO3TU92MxD3fSTWP0rs=; b=FIizZVfV1sfTSStLoAuCXXQ33kabWNSdtD9vbjh5JTn/D3Ex6xOhis1tf1n+/zcy6X ebjYK5kwrr5nRZzBHIT9nUDYoJ3EVGE5BOxCzQPGcu8CPjok8UvkZRkE2p0dPAJuajxG pdfPsTioFAyN9/knUHvDpWM+V1YTxYklAJxOaFQ1jL649Lt38K6xzKMSK1mW9CPymcH3 lGTykXiO2e38/LDidroXc5GSSN+yiADOCzRCQgFWVBlVmsIGoSt4Q2HHsNrzIizZq5xR lDTZKxUK2xhW993Fx+ndWLRzhzRefNs3mZ/2OX5kUa0tqFUoIJDpNtUcDwboMa2vwLN9 OgMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=qvdtq3Wj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=xWhshayp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16-20020a05640250d000b00435a2bfe481si2674012edb.597.2022.06.21.22.25.42; Tue, 21 Jun 2022 22:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=qvdtq3Wj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=xWhshayp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356838AbiFVFQV (ORCPT + 99 others); Wed, 22 Jun 2022 01:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237181AbiFVFQS (ORCPT ); Wed, 22 Jun 2022 01:16:18 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21E2636145 for ; Tue, 21 Jun 2022 22:16:18 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 713ED5C0085; Wed, 22 Jun 2022 01:16:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 22 Jun 2022 01:16:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1655874977; x= 1655961377; bh=raNbZ5XrTaJju1j0bn9K1zUDHO3TU92MxD3fSTWP0rs=; b=q vdtq3WjDZiEK5YG9tchH647p/Iw/Y5Zs7hMfLZkyFMvl+ffhtGzPt/ILO9t/J4pY aVh6OCUixEJv78Ux+OHNZvJwyAK5CgKVQxx1AiHax5x5K8xTi8IbgCNWVvn2OOX/ 4p+2g7+hhbEgfpbb/QUIf/61BGVvunohHXeGWVNq24IKYBn9+QRYAGHG17Tf3jgl CYCvRfQqKUPXN6YBCDs3epBhPSd2GHdO2hpHdWBimj8pV8IC26DcQLR6w0Rb51DO ngUg5fwmsSj9LTy6HcxGB/vnOXMk6E1YC4VvC3Xl2lqbgZd3FcR5lJbJ4JgPly51 iSeHDn5HYcj8ghd8WJqXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1655874977; x= 1655961377; bh=raNbZ5XrTaJju1j0bn9K1zUDHO3TU92MxD3fSTWP0rs=; b=x WhshaypefrwmpT1bwf3HCZBvc4U7xKpYZ/Tgu8AyTFwK74d1VX3NPQNHFDf42WsS tMP4C8joE2oEk6zKYmJOSpa7DCkVyaEX9RtGiUEq26y48T5p+qf3GNmFxR2WHpG/ BZeESjon+nMKiXRkikeVNcqnPOFtwJ1G4qH8lktmfFIE3Dhy/0F0hH4Yw9dy0fRT ZIv9LM1+63kg1/pNjNRt89GFHgIoGBTFYkDaFdXZJXKKp5qd1OrzW9u1tB3vg2Qj /MpHOCjqiiUW2qXYwrtZdz1idZIvZgPAYf8sHYcuFvoONwzjPMkvOlytjvSuwjXx OSpuKtY/7vIc1ANK/i/Xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvvehfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpefftdevkedvgeekueeutefgteffieelvedukeeuhfehledvhfei tdehudfhudehhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Jun 2022 01:16:16 -0400 (EDT) Subject: Re: [PATCH] phy: rockchip-inno-usb2: Sync initial otg state To: Peter Geis , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul Cc: linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220622003140.30365-1-pgwipeout@gmail.com> From: Samuel Holland Message-ID: Date: Wed, 22 Jun 2022 00:16:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20220622003140.30365-1-pgwipeout@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/21/22 7:31 PM, Peter Geis wrote: > The initial otg state for the phy defaults to device mode. The actual > state isn't detected until an ID IRQ fires. Fix this by syncing the ID > state during initialization. > > Fixes: 51a9b2c03dd3 ("phy: rockchip-inno-usb2: Handle ID IRQ") > Signed-off-by: Peter Geis One comment below. Either way it fixes a bug, so: Reviewed-by: Samuel Holland > --- > drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > index 6711659f727c..6e44069617df 100644 > --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > @@ -1162,6 +1162,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"); > + > + if (!of_property_read_bool(rphy->dev->of_node, "extcon")) { Currently the IRQ handler does not care who created the extcon. We should at least be consistent between here and there. Regards, Samuel > + /* 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); > + } > } > > out: >