Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3772230pxu; Sun, 20 Dec 2020 15:25:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJy70OaI4kilG6sVEp+eQNdboHqVsCcEHkdQCkzVeIxoLmMIiOtxvnn9n9Ibdu0Uvtw7ezJ3 X-Received: by 2002:a05:6402:1d9a:: with SMTP id dk26mr13974775edb.283.1608506740008; Sun, 20 Dec 2020 15:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608506740; cv=none; d=google.com; s=arc-20160816; b=lTZ81BKd6ex9kTiXmL5hJ0XyIL6ZXo4GYdJUmaC/yq/p2JMVr4GlINQGMNGlHp0TM1 fbWnnaEs78l+jFb7kHVpK+oebPjvkBHWxfuYzuxf7ycV8emoeuY3Nt04kT2/02ziDhYC Hj3AznrQfwS1DvTtXpVH/mLRulRe6FJavtBGQNsONfOnI9iTMFeoJ/pL/tDyPzsM/Gd9 MX6J06EHoFF/KfrU+DHNHBitiBIR+LkYYuF3dCmSXSnvcilfK0+rj03VWDbqTaiUYHHm 5Wrjs2sL7Pm6rkHMff8o5mVv1DqMzvHYU6yagPyWWMjRXeA6vLNSWGkuA0cM97SlUxvm 3WfQ== 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 :mime-version:user-agent:date:message-id:cc:to:subject:from; bh=23SZ0mTTy6gHlui3WI9k5i791PV37OnSSZtBcyHyDnU=; b=sv/xxEcIp8fMkmSHMTL4G7FaJ80CEb4DlaERmQjutCMmcKk+2kvv82aD8lKtqKp0JT Hzzhq/chmjXrzs+7eVHbgaq9cfzNGeIrxCqLdESJqshzhVe+8kwKmPi+z2O/xrQHCrXd mqEVHY75nr+3HMqWBzDPCGmuekjzgvM0FG4bBT9KwYuI7EqHrEXfXsIQ6QI3W/fCPPLr 3jvZ/Idgkt0NC24gNl1y+BXJa++Dp8otYflmXGmKWfxt7p/PDg0//FBA2a9H2ghafqxJ s/RlWI3zk+Zams8ERFLgm3RQpDrU2hUwRYFsnJeI7By6pkVYQtNPdf/4qDaFh0jNSwpF 6DyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss22si6390020ejb.110.2020.12.20.15.25.17; Sun, 20 Dec 2020 15:25:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728364AbgLTXYb (ORCPT + 99 others); Sun, 20 Dec 2020 18:24:31 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:45117 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728042AbgLTXYa (ORCPT ); Sun, 20 Dec 2020 18:24:30 -0500 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1kr7ml-0003Dr-P1; Mon, 21 Dec 2020 00:06:43 +0100 From: Ahmad Fatoum Subject: Correct ordering of phy_init and phy_power_on To: Kishon Vijay Abraham I , Vinod Koul , Minas Harutyunyan , linux-usb@vger.kernel.org Cc: "linux-kernel@vger.kernel.org" , Pengutronix Kernel Team , linux-usb@vger.kernel.org, Jules Maselbas Message-ID: <6cd01e79-fdc0-3bd4-32b5-a85142533f8a@pengutronix.de> Date: Mon, 21 Dec 2020 00:06:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I just noticed that USB controller drivers differ in the order in which they do phy_init and phy_power_on. For example: __dwc2_lowlevel_hw_enable(): ret = phy_power_on(hsotg->phy); if (ret == 0) ret = phy_init(hsotg->phy); dwc3_core_init(): ret = dwc3_core_soft_reset(dwc); // internally does phy_init(dwc->usb2_generic_phy); /* [snip] */ ret = phy_power_on(dwc->usb2_generic_phy); My initial assumption has been init -> power_on, but at least the phy-stm32-usbphyc (used with dwc2) is written with the assumption that exit -> power_off (and therefore power_on -> init). If they are swapped, disabling fails. So how was it meant to be? Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |