Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6842425rwn; Tue, 13 Sep 2022 09:42:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Wkls9VJt1THAfLsoX+SFcoLxmNF1t/YoExzrO5XzxV+zix3vUT2l9PpY0csvQE3mKgZgV X-Received: by 2002:a05:6a00:1691:b0:53b:3f2c:3257 with SMTP id k17-20020a056a00169100b0053b3f2c3257mr33170364pfc.21.1663087363393; Tue, 13 Sep 2022 09:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663087363; cv=none; d=google.com; s=arc-20160816; b=DWgZRtaXyR/D4WyaBbfe+C7doCLZd7lhJ3v4wqVkqPdMrvtQm/KZpzopgRTFiN/TVb ZFEdwvX4TQ/tmzBx7/F/qtc3iGr4nfz158sMm24/GH7Dl083wQYC5HZ+ivd50XdMBG67 BGV/GtFNF1T533If4Ycl+ege4sEEdVo3aX9g+Hx/8cW4/Dn109/sR6T7jh7gUhusUp5h r8x7Rxw9DYvvAAsMHWjsalgEfceFKHJHOvgJEiRXFUAI0xgbu13HZEPrOgOKzFYHV1fw JT27jJfQ/AEDDnxGZQK/J2x8/uJO11oA8wR/QAAiuHh6VQ1/6esT/Dqx8zArkCiZHV0k GMJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=biiZePocQkALCBqw9O3H43NJpYkpMR0ygcwXNlfAyPg=; b=q5HxrYzIQJcfhXC//YUCD9YhJKYLWjS6so6G3Vy4Rmz/79Y30AaNO487hGAEfVB4TP DQ1vqAd1zMNT+ZRlfsBVWvh17FRaDoc5PygFK3UxMF61vT5nsbePpnrSoBDJY4I04Vc5 RRGsGpXVaMvqA04lojcrKetAN6K9DbLhdauPvF1/Sq77C5tYhwqTrtydsBVScdqmWayn oH3T4yY9fXmOdyAOMajBg0n55gqtYbhOJi0qxmMFOY+iQnT9Lz2FKvtGrUInveCGZr+j xL9x9CbP9Safgc5mcSm4474uUtMQz5VG9961M/6a43ShKASj3Ky9J9afosv8aB7kut9R HP+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZWOiE4qs; 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 v70-20020a638949000000b00434d167d0a7si271277pgd.174.2022.09.13.09.42.30; Tue, 13 Sep 2022 09:42:43 -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=@linuxfoundation.org header.s=korg header.b=ZWOiE4qs; 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 S231443AbiIMPWI (ORCPT + 99 others); Tue, 13 Sep 2022 11:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235783AbiIMPVG (ORCPT ); Tue, 13 Sep 2022 11:21:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6687B286; Tue, 13 Sep 2022 07:36:19 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 96067B80FF0; Tue, 13 Sep 2022 14:34:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01310C433D6; Tue, 13 Sep 2022 14:34:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079698; bh=M85DBPo+sC6ssrj+uPVSPX8PREwvyuTPkPj0UmY4iNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWOiE4qsNEo6uuatiFBaMnwQCNDj1wpNTdJD97ujP/tm1Bln/Rpgoys/dSArkIAWx mohIaUyPbTWBCUsoxtnoKLKXmnP3MAwYUXkZDh9v1kp6DXJWtOUjhFTxrQ49Vkm8ES Olx9bEHUdDqJqXH5W/g5cX8MlBeDGurzyBvIeIhw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minas Harutyunyan , Marek Szyprowski , Heiner Kallweit Subject: [PATCH 4.14 23/61] usb: dwc2: fix wrong order of phy_power_on and phy_init Date: Tue, 13 Sep 2022 16:07:25 +0200 Message-Id: <20220913140347.666168775@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140346.422813036@linuxfoundation.org> References: <20220913140346.422813036@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,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 From: Heiner Kallweit commit f9b995b49a07bd0d43b0e490f59be84415c745ae upstream. Since 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init") the driver complains. In my case (Amlogic SoC) the warning is: phy phy-fe03e000.phy.2: phy_power_on was called before phy_init So change the order of the two calls. The same change has to be done to the order of phy_exit() and phy_power_off(). Fixes: 09a75e857790 ("usb: dwc2: refactor common low-level hw code to platform.c") Cc: stable@vger.kernel.org Acked-by: Minas Harutyunyan Acked-by: Marek Szyprowski Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/dfcc6b40-2274-4e86-e73c-5c5e6aa3e046@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -141,9 +141,9 @@ static int __dwc2_lowlevel_hw_enable(str } else if (hsotg->plat && hsotg->plat->phy_init) { ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type); } else { - ret = phy_power_on(hsotg->phy); + ret = phy_init(hsotg->phy); if (ret == 0) - ret = phy_init(hsotg->phy); + ret = phy_power_on(hsotg->phy); } return ret; @@ -175,9 +175,9 @@ static int __dwc2_lowlevel_hw_disable(st } else if (hsotg->plat && hsotg->plat->phy_exit) { ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type); } else { - ret = phy_exit(hsotg->phy); + ret = phy_power_off(hsotg->phy); if (ret == 0) - ret = phy_power_off(hsotg->phy); + ret = phy_exit(hsotg->phy); } if (ret) return ret;