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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B266C4332F for ; Thu, 8 Dec 2022 15:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiLHPxU (ORCPT ); Thu, 8 Dec 2022 10:53:20 -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> 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