Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2519612rwb; Mon, 3 Oct 2022 01:50:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JhtGjSeJ+npAc97JGBv5wP7E3qVUOzejG0uMWaNfN9LngRsuR0DSO7UhhS0C8JPHi+/Dw X-Received: by 2002:a17:902:7b8e:b0:178:b9c9:97a1 with SMTP id w14-20020a1709027b8e00b00178b9c997a1mr21341313pll.111.1664787006744; Mon, 03 Oct 2022 01:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664787006; cv=none; d=google.com; s=arc-20160816; b=Go112AJogaFfT+dG9xrvHdOL8G1nnJRVM4saQ2tmmhtU4WQrN/paWyCodfvh3Z0TnM T/cVg/29A3wM0vxRxcv8Aidl+uwAdgjq+pbD3Nwc4L0HPeySQiWV2uIAAqeiPPuQHa3l AyliVzU46RRyBXFzwo4ZdvnM89sXvKtb6zGXicSdlMsh74ipzqwKCWIHeVdtFhThwY8x +0sxurLbhdmSkEeSusGSA8y/+ExKPwE6HEH1ujSzTe+2Z7BN9Tl0oLmz260qItOaN83j 5jtBWL1T+AHIpleFTrE6wdz+A/4Y7CHIygh/6AadeWRB53IY5Bl6FfqKl9uSw9mdKKaK xukA== 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=mTC/kq6iAZtoEj3mbzl21gIQdJuR2bfkEUjgQAxZjbg=; b=UbLEXTbTWy6NNqin1jR6ViMDYJatwGfJkyecONuyNJD6Q+Y5C9zU+D4W2By9OhRD+g hFaQd3Kp7xG2+N2aHZmbP20EXuhnIFIdsfxNiA3bKpisN/jt24DPi87BJhrq5Yo+bpM7 ybklFEx0gqKaD/+7M+EwubgOdiF4y8m+xcJNPScnBFyeUvdm497xkqdqQv1ABsAdRAek SFqszo1lsidukJXEtTEuTM1/cmb6HuiccRZ4YhSD0WsSWXJEbJaQzhvhRAdZWQsHeOjV CjeBZL93yhxVV+9RHi+0xbtvKKrpCT3NkeJg9rxqXAydIzPD/Num2o+7lSH+G1zOE5y4 2PKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qwNXsltO; 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 c2-20020aa781c2000000b0053bafb8e916si8784107pfn.162.2022.10.03.01.49.55; Mon, 03 Oct 2022 01:50: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=qwNXsltO; 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 S231487AbiJCHcW (ORCPT + 99 others); Mon, 3 Oct 2022 03:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbiJCHbm (ORCPT ); Mon, 3 Oct 2022 03:31:42 -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 665B51CB02; Mon, 3 Oct 2022 00:20:24 -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 0ADBC60FB6; Mon, 3 Oct 2022 07:20:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 217C4C433D6; Mon, 3 Oct 2022 07:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781623; bh=6BZmbZpXFKe+jJYKjPvyocQRtW+3xcRxtRgORGiOudk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwNXsltOPD9ucyNOylolYRuwp91RQpKmHysg7mZpKJqWEwrJkU+BW5c1Quy6Lyht9 8lUkUj/mJa9SpU2KBbS0yEnQ2DfOZftEJ6rrp4hPfDRp1smyvZsUlqAkxOzlNjUWk4 IBBoirmdUwmA6emVzCGHQny3IvxYwNp57EFxmMY4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Lukas Wunner , Florian Fainelli , Xiaolei Wang , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 63/83] net: phy: Dont WARN for PHY_UP state in mdio_bus_phy_resume() Date: Mon, 3 Oct 2022 09:11:28 +0200 Message-Id: <20221003070723.578840618@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070721.971297651@linuxfoundation.org> References: <20221003070721.971297651@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 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: Lukas Wunner [ Upstream commit ea64cdfad124922c931633e39287c5a31a9b14a1 ] Commit 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") introduced a WARN() on resume from system sleep if a PHY is not in PHY_HALTED state. Commit 6dbe852c379f ("net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()") added an exemption for PHY_READY state from the WARN(). It turns out PHY_UP state needs to be exempted as well because the following may happen on suspend: mdio_bus_phy_suspend() phy_stop_machine() phydev->state = PHY_UP # if (phydev->state >= PHY_UP) Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state") Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Link: https://lore.kernel.org/netdev/2b1a1588-505e-dff3-301d-bfc1fb14d685@samsung.com/ Signed-off-by: Lukas Wunner Acked-by: Florian Fainelli Cc: Xiaolei Wang Link: https://lore.kernel.org/r/8128fdb51eeebc9efbf3776a4097363a1317aaf1.1663905575.git.lukas@wunner.de Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/phy/phy_device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b616f55ea222..c5b92ffaffb9 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -315,11 +315,13 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev) phydev->suspended_by_mdio_bus = 0; - /* If we manged to get here with the PHY state machine in a state neither - * PHY_HALTED nor PHY_READY this is an indication that something went wrong - * and we should most likely be using MAC managed PM and we are not. + /* If we managed to get here with the PHY state machine in a state + * neither PHY_HALTED, PHY_READY nor PHY_UP, this is an indication + * that something went wrong and we should most likely be using + * MAC managed PM, but we are not. */ - WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY); + WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY && + phydev->state != PHY_UP); ret = phy_init_hw(phydev); if (ret < 0) -- 2.35.1