Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3040422pxb; Mon, 18 Oct 2021 07:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfNHh2RCjTbJNua1/Xog8ZAM3LElLIQnNskFwmwhyNFrpRYmVq7L9hcDRcanVa4qjFMgEZ X-Received: by 2002:a17:906:3510:: with SMTP id r16mr30894305eja.209.1634566061035; Mon, 18 Oct 2021 07:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634566061; cv=none; d=google.com; s=arc-20160816; b=oweT0lpJ9XvTrj1PAFjN2dYyfEZ+pvvqtCjizQeXk1KT2WUKhcedC19NpdcEB4zhkr FS0pqYA4PfE/k2qIlg6TmRZ9Xy7xymjxBv/9LazetcjkvgwcpkGHeroFnaoQCHBYYQkE f1/Dv89HmYDjumtpPSn9tDnBzkLVqnDzFLQU3mv15iZ5+3LCVUSZ1S/WflmuPBi5ycng fWXd0CfjKamraVNfOpyK4UkgeXeVQAmtY/LGsam8btOeAYarLT6nl8ceOB8HwxgZp3jP xeQTQ01I/un8HRlwr6/7umlW9Yo+mjDu9Le9d7jL3+yXBAWMZEQmbVp+PJzvZE/Hhs69 omvw== 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=bJ0d5WWjeUf8RKN2zcUrR0XX0WqBnAERAzqo2yYXVR8=; b=mj7vF4WqTSR0hpaQSMo1sB/eJTFJaVdVJ520RaKG6pEhsMOcYdVbd8jSW3KIXrwGZ5 h6pE4WUe0OpbIvwNO0pWgq3j/VcL9mdXT/GYPTWij128gHX2NMvkuW8LMnl47tTHbLgB JiEVjb4F2/s3Gf7qxbVcRG76K75U+YeHmOem4CE7rj9O0a7Z9PIEnwn633dSoo8l5HWd KOMn/HC10A2wlj2NEc6dXF38o6XbDsU/KXYM85xxDlXZc5KnfsdPjzw93Y8hjNGbxLtf yE9/PGYbgoJOgGr3pDv0WU4SB5xCYk8KWQqwJdBAu+CI3pV6IubAS6AF+cxbl+dNfTkv AwOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yS+q8MGK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga24si24241883ejc.153.2021.10.18.07.07.15; Mon, 18 Oct 2021 07:07:41 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yS+q8MGK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233293AbhJROF1 (ORCPT + 99 others); Mon, 18 Oct 2021 10:05:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:40796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234080AbhJROBz (ORCPT ); Mon, 18 Oct 2021 10:01:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B27B61A7B; Mon, 18 Oct 2021 13:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564573; bh=i06lt851+5FQNSM7U8SMu6Id/S2CxvzZdt3EVNDiM24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yS+q8MGKpTv1jhvanrpUfXRldRHd/7trf1ocU4cSxr6FQH5x5P9fnGerp0gvybMfP vUF7LFpiNUlS14mpUnzJB7QJsNZ13gQ+t7ItvHMcFmrtZDeIx7UUDc1t5VA8PPyZ+O 2x35eFJV1dvAa3EM6Y89PoQWDPRSivorcgT+qaKE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" Subject: [PATCH 5.14 108/151] net: phy: Do not shutdown PHYs in READY state Date: Mon, 18 Oct 2021 15:24:47 +0200 Message-Id: <20211018132344.185479077@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli commit f49823939e41121fdffada4d583e3e38d28336f9 upstream. In case a PHY device was probed thus in the PHY_READY state, but not configured and with no network device attached yet, we should not be trying to shut it down because it has been brought back into reset by phy_device_reset() towards the end of phy_probe() and anyway we have not configured the PHY yet. Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3112,6 +3112,9 @@ static void phy_shutdown(struct device * { struct phy_device *phydev = to_phy_device(dev); + if (phydev->state == PHY_READY || !phydev->attached_dev) + return; + phy_disable_interrupts(phydev); }