Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4477551rwb; Tue, 6 Sep 2022 08:05:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR485yRfBpbRtZYflzuzETQyFXewvrd5rLnWiB0uDF2Kti2zJc6nQSvalIbbwiU/M1i9U/wu X-Received: by 2002:a17:907:7207:b0:747:9297:94a with SMTP id dr7-20020a170907720700b007479297094amr17068400ejc.98.1662476706923; Tue, 06 Sep 2022 08:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476706; cv=none; d=google.com; s=arc-20160816; b=njJznrSuQl/rebyA+e+xWl+zU5PXfia0hX3SAxnm/tZCbIpyr2iozfrD102c/NtPPK OgEQcf19XrbiN125629StpRyQI0PK9+LuA2AOlSzJZp/AmCMAgoSx7DnsEt8imtDQujX iEVD4+oppq3v4dxG6EMEjGY48cWxXymtjAdEh3Zwh048K2guC/csxsR+9FtGH1rs2lAh zV2XK6u3U2Koh2XsZISECA3veyh8hOsHBDG8xR7tXScPTi6ILKbLBwFk09cwmFkdSnz1 j7csFUt554Wt7DPDBNCruBswN86s6ZDOQzQfTKjNu9pJmIlX/3sKr/EnEHj/QJzbQIVD LnAQ== 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=vebXj5QewcrsgKzksiGGfXx60gZlljuB716FjmFhVLg=; b=apx1/PGu1u2J6Itnm0vXl5amDK/u2078DK6hzfCzfPLfFHb+Ug5YG32dY03ECNQhCc PsXj+/GT9rSPaO04w/yNT9T0RMeWx4rC1GYvVf2V8Yxc9oSAn7S7p4LT6MJLsjCoEEF+ XaUIKHYTmuUN513uGzJL/ZXDPhmUoof+V97P6eNS/ppbqfzqEV6g8FhpOQM6Tel1QGSe i1FPmqWM4jO4xD1OFPKQ873q+qcgVb3pnjnNJtzJCW4kj95l4WQRUuwN5dIPOgC/j0M3 qgkavOJ574YhUNPlhugkYTkgNIE7p1+cCuemk6eiwNKEgHpQPUV6FXBiZCcGufqFKGgJ XZnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hz9vafWg; 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 t14-20020a170906a10e00b00741990286a5si6499694ejy.768.2022.09.06.08.04.39; Tue, 06 Sep 2022 08:05:06 -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=hz9vafWg; 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 S233058AbiIFNpc (ORCPT + 99 others); Tue, 6 Sep 2022 09:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238506AbiIFNnF (ORCPT ); Tue, 6 Sep 2022 09:43:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9929F7EFCB; Tue, 6 Sep 2022 06:37:58 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3C54261548; Tue, 6 Sep 2022 13:36:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B4B0C433D6; Tue, 6 Sep 2022 13:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471363; bh=3UcOXbWyeA5C56jtAvIiTnIveZqbtE8vO+hT19Hbj7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hz9vafWgl03zghHclU12JY4HR1eBhGN50bwHNsmvB/4gtCyxOhg+VOiNaN/9DHyZy sgi+C7igfa+QOphAIYcZzD6pEPtiYKi+Hh8+0Psdgor6jHd3MayHhkOR2EEoGje3eV IeQyHdvWu35fJtE95Nf6jTDADcBsdpuQccMx8JNQ= 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 5.10 57/80] usb: dwc2: fix wrong order of phy_power_on and phy_init Date: Tue, 6 Sep 2022 15:30:54 +0200 Message-Id: <20220906132819.443987276@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@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 @@ -154,9 +154,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; @@ -188,9 +188,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;