Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1349485rwb; Thu, 8 Dec 2022 09:29:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5MVXytAYYNKPtveeAs0gLOqkca0mjxTIbu19JVW7QIYspxbtnww0KtNpTU9GmaLjYfnULw X-Received: by 2002:a17:906:a1cb:b0:781:fcf6:e73a with SMTP id bx11-20020a170906a1cb00b00781fcf6e73amr649652ejb.352.1670520582084; Thu, 08 Dec 2022 09:29:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670520582; cv=none; d=google.com; s=arc-20160816; b=D2tpjyoHN4oFiZMUE+EOZnr2GQrzPbwYjyiEYw+xSrwcvEYzmu50TKZPtRZl82FI5a K3M5p4YxwBK6w74ZjM73+DYBrvnFbVyDPQJxOKwV8v4Gd6WdlJUZGdXVZgQJ5PsLeoSN IPJi+sYfOZvJg6q0qt0UKdqFaaNtV0sRjaXBuM+gFgGtbZx6GGYucBYQFX1Kbd68ZFeg Jc2GPswQfJH0yAZCiMfoV6lzqZCEAIgthS5ofwc8mj/h1/aYC+8KcVQREVn1P821bkOI Lol8hhsttNRLcKRJXOSjctAEPsupKLkxk0re3ogVEHNMq8+/FbyfVMcyNWVbpi9BUmDg 26nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+lR3681dp5lQKJbdqH33CPqbIm3Ak6gEZxvNcBOzXDM=; b=yR0/l3fdJyu2AuSXmh8agIthRiGw3uIyDjbpdmOBoOq+HLJcFYkZt8rXjOy7dZM3at yE75Sir33M7eTwuuc5QDYjaUj+f8+ABSN2mpFbu13REdWkh6lzA4oGX5Y+Sp/1ZDcGIf zKY+wcFyWuwrlBigey/uRN/pdgFVOMNOhC2jXr2muoVRuadGj04RCKi6fitPNcFBPqve rFgbOvGb9bBZZhQkiXRry+IJgWbT8Lsf1yubZeq2oMC5Gbv4UN/1vcLvvmQTL8CXKUSY v27gzh13BWUHe2b8LNziaizIJ6/NmRjs/e8DMay9hI9Nw2At84YqYmaTTJ7PdT66usDI EjiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nJ8o2nZM; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a05640227c700b00458d1c48708si7516468ede.303.2022.12.08.09.29.24; Thu, 08 Dec 2022 09:29:42 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=nJ8o2nZM; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbiLHPxT (ORCPT + 72 others); Thu, 8 Dec 2022 10:53:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiLHPxS (ORCPT ); Thu, 8 Dec 2022 10:53:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7572A4E6B7; Thu, 8 Dec 2022 07:53:17 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 100D061F90; Thu, 8 Dec 2022 15:53:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AC74C433C1; Thu, 8 Dec 2022 15:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670514796; bh=5YewCq0R8sHcelmq+wc5N2jUev3qPGCtH8YJWDhnGL0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nJ8o2nZMwFp0Hcfh0aoKihq8/YCm6OKOICKIu7oISU/ftkXPkMC+pR4X1f/9zmWIM Fxwm0LqSShV5LnE+y/KJ0epGGnwZZ2BqHbLVHu+fVT+7cOjpN7SGu2Wv+7XEgWrtFh 0DJlBfIhbgHga2yxou6XyDuIb8d1AVDRnHiJcDN8= Date: Thu, 8 Dec 2022 16:53:13 +0100 From: Greg Kroah-Hartman To: Quentin Schulz Cc: Minas Harutyunyan , Quentin Schulz , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, William Wu , Bin Yang , Frank Wang Subject: Re: [PATCH 3/3] usb: dwc2: prevent core phy initialisation Message-ID: References: <20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com> <20221206-dwc2-gadget-dual-role-v1-3-36515e1092cd@theobroma-systems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221206-dwc2-gadget-dual-role-v1-3-36515e1092cd@theobroma-systems.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Wed, Dec 07, 2022 at 02:19:18PM +0100, Quentin Schulz wrote: > From: Bin Yang > > The usb phys need to be controlled dynamically on some Rockchip SoCs. > So set the new HCD flag which prevents USB core from trying to manage > our phys. > > Signed-off-by: Bin Yang > Signed-off-by: Frank Wang > Signed-off-by: Quentin Schulz > --- > drivers/usb/dwc2/hcd.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c > index 657f1f659ffaf..757a66fa32fa8 100644 > --- a/drivers/usb/dwc2/hcd.c > +++ b/drivers/usb/dwc2/hcd.c > @@ -5315,6 +5315,13 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) > if (!IS_ERR_OR_NULL(hsotg->uphy)) > otg_set_host(hsotg->uphy->otg, &hcd->self); > > + /* > + * do not manage the PHY state in the HCD core, instead let the driver > + * handle this (for example if the PHY can only be turned on after a > + * specific event) > + */ > + hcd->skip_phy_initialization = 1; Wait, doesn't this mess with the phy logic for all other chips that use this IP block? Have you tested this on other systems? I'd like some verification first before taking this change as it seems very specific-platform. thanks, greg k-h