Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3089182rwa; Mon, 22 Aug 2022 21:15:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w5uJCFDTUQqBtjBI3nRqTwpFaE0xTCYT65+jcYEbqX5OVz2Oh5mh7xX+nd7SAPkaxAfHn X-Received: by 2002:a17:907:b02:b0:73d:a37b:2a2d with SMTP id h2-20020a1709070b0200b0073da37b2a2dmr151519ejl.111.1661228131189; Mon, 22 Aug 2022 21:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661228131; cv=none; d=google.com; s=arc-20160816; b=vC+uegAQMGudu3L4vZfNyN4mpoIy8ptf/IzAFCKb+u6oyIcvqmgzZFn8yjHEVCjU1z 9uCbctGIPWBmV1jcRPvYjVjsv6FEoAMp7BtE2o3PPp1XXYUeU0U9H/8xVzagji8HQIr6 dAuc32ecDmqVIlLwrigM6+7mDMQy1pGpE2mxLBkEHVGfCxkNlnXX+4+vIiYruayB840l FsKTMQLHle4uLD5YwThvVS2aYhV90GD6z9NyBKJe39EpHz4PWwBWyJDnAeelqAV+ovuc M7l8iDIzQcBW00mAdstdaLBoC+pUJZKwfsfuUsG0ERCGpXlFoMRcVjQF4NicIrD31yxM OJ1Q== 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=CMNLfcQRTj+R28UNum+p5/OqksTiYz6SjnJF3Y4QVwY=; b=bYOCWJlgpkv35Gy+pfOFOSCg5UEUe9WRbibt7C9PGwH7BaukA+aTWXsenMYhesO5sX DNz9zbQJwEUJtXOUnTnKRa26HEQ3s/oKWrdgM/UZ0JxgGINrlFCw+BtogjGfTZBir524 9SZIg6H5A9ICHnYEd1ewe/E5fKQObacckeludqyIc5NRTAyuWYuOetkjIgBawoxWa4Ik Entou19L0ycv+hZdTiYLVX92ZPWpr1bfZjgqtRicFfPUoaD3w2g9G3z+NwLeHz3TQiA8 gZAscet5xiTiBJRldVM18W6Z92ElcXMNB4pHrObp7HA7hrxP+0KD091OLjLvIVRGeqGO GTbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=giec6xGS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wdNcQ2x7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk24-20020a170907767800b00738346168dcsi11211970ejc.811.2022.08.22.21.15.04; Mon, 22 Aug 2022 21:15:31 -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=fm2 header.b=giec6xGS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wdNcQ2x7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240189AbiHWDlh (ORCPT + 99 others); Mon, 22 Aug 2022 23:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240187AbiHWDlf (ORCPT ); Mon, 22 Aug 2022 23:41:35 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73E005B07E for ; Mon, 22 Aug 2022 20:41:32 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A39315C0092; Mon, 22 Aug 2022 23:41:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 22 Aug 2022 23:41:31 -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=fm2; t=1661226091; x= 1661312491; bh=CMNLfcQRTj+R28UNum+p5/OqksTiYz6SjnJF3Y4QVwY=; b=g iec6xGS2SDGO/srHmwmwyqEY2qWm50F//hhHCnZXzxXMIHOcIw/ljny2ZZ5QMPQ6 clyI9zIih+F0xmKJ3n2j8Hac+S1onHhSNYYcMVqFXkhEC24/U7P4k4HUy6AAU1xe Y7xVIFcm4JK10TKcfnSavjae/5Nk+YdnI0rfuQIaiJpAaH2D4L5pdMxqITs6NPrP gSEl3P0jFQT2cP5/gapfAruXtMdWouuJLYr4427rpfyqrL67Ht7zuFtj0iIXN02a x9VIuchP8CYw3i4RV3cBGk6H+jxOliDJv9lj0cf2r2xuuCDcOr03c3lBHM7EaaV9 muHBBctmfM7n2xVlTbfiw== 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=fm1; t=1661226091; x= 1661312491; bh=CMNLfcQRTj+R28UNum+p5/OqksTiYz6SjnJF3Y4QVwY=; b=w dNcQ2x7HmD0yyo0TwNZVVB3qQKK4knWsAf4E3YA7svjT1orCPyKSM9uAdwMqTDsY xRcotgvTt5Eq7SHdNbpl60hLvOgBtpEBrlqfTDJkgLdkYDV8uWKh/0zH65aMmlnz ctuZps/Vwoi+mZ32D4V7dYd9Zf+mqNIhngWSwNx8a4OawHve+J5VT2Ol8Z+l1m98 J9zB2Aw+DRni5/75COJhDbZi0j3LBWPXz/gTCfzxNGP2N5SQDSNXxsJt8UbLHVmh cNysNe65zH2+ozWa69qLvVd9K5YISlMu6ZlwEEs55Uq7kHTCN9R4zL8+GDEKuFRW LmPOYMVNsjnKAGOmxJUjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeikedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvvehfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpefftdevkedvgeekueeutefgteffieelvedukeeuhfehledvhfei tdehudfhudehhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Aug 2022 23:41:30 -0400 (EDT) Subject: Re: [PATCH] phy: rockchip-inno-usb2: Return zero after otg sync To: Peter Geis , Heiko Stuebner , Kishon Vijay Abraham I , Vinod Koul 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 References: <20220822103219.3985075-1-pgwipeout@gmail.com> From: Samuel Holland Message-ID: <717fe4e0-ef9c-edef-80d1-caeeae1319b9@sholland.org> Date: Mon, 22 Aug 2022 22:41:27 -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: <20220822103219.3985075-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 8/22/22 5:32 AM, Peter Geis wrote: > 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 > Reported-by: Michael Riesch > Signed-off-by: Peter Geis > Tested-by: Michael Riesch > Tested-by: Markus Reichl > --- > 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; The bug was caused by the unexpected consequence of (mis|re)using the "ret" variable for a temporary value. Please introduce a new variable here, else the use of "ret" is even more confusing. This code also wipes out any error returned by devm_extcon_register_notifier(). Regards, Samuel