From patchwork Tue Dec 5 23:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 13480871 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="NtGx2Njr" Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EBAA137 for ; Tue, 5 Dec 2023 15:42:36 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-77d84f8808dso401678085a.2 for ; Tue, 05 Dec 2023 15:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1701819755; x=1702424555; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=0XeB/3pigz5yACfgWNaMFOEibrs8a2YlQ2kjiEz6cME=; b=NtGx2NjrOQ+p5R1RqhP+1ZU4fZW4XjS9STjZGd2vomEhJZZVRu44qdE5Q3IAxRVrdL 8aTAu8Vszhe9uhvJW8Eu6KUpLzAcS/FfZBic6c74N2vwOQ6rcHM+hrowSs4MR92XXdzh hBJfr3yyrzdHME5qfILBFUQy/STAeqh++3q40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701819755; x=1702424555; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0XeB/3pigz5yACfgWNaMFOEibrs8a2YlQ2kjiEz6cME=; b=hJeKpClmuZpqVi472USYc79j5aE4LQ4Z5vZgHYUtp3SF7Z6iUOAvwqHcG2+1kDvrkC nK7JmfUii1MLe/kr0aNnrT3usv3LDdhf1tqpS8h2u8bioppc5SGSNTKm9vbjC6x/zitn 7NdEhVdchDjxjTmrJh3k3Tu3zxj8iCOHESt6GS/We4XH8ZZQUMmXwVvo11i0JKei2L9p WSWApzD2vV9ooaKHNV7lYoe9bYrbZ0HAXbXR8fDvq280uc54sJDOgoD6NhZxV0W/Xx/D xIY5ZRy1XtWDWGVPAoFfGiERwQ8cAaOyU1YymP1DlsOnYbVj5YHLbVy6zvltCB4KzilD wB9A== X-Gm-Message-State: AOJu0Yws9AkKPa3dqFUWjU+mv2QwnNa65+WJCnoGMKQ+1BKFVmGrfwmG 6W1/vnQ/fzfuzBLlzpR8/vnfg9J82dPcrMR1mN2dJhD26sWcaHCMr4/HqcqA9RkVrW2XgYzERyH hjexAbHscvYPEDgtKRDiSPyrGDfEwC+QO1zWHEPOrlX6M5wj5H8e4Cs2x5IAtwlfQcR0wr1jMmK 93bUsLbA== X-Google-Smtp-Source: AGHT+IG9BqZh6goRIqHC9Jjmb7s+2h8j0AI3sUlml6waB1yf8OPCHur1F/WkQnf3GubzYfzyCg1sFQ== X-Received: by 2002:a05:620a:4d97:b0:77f:2bad:99f3 with SMTP id uw23-20020a05620a4d9700b0077f2bad99f3mr16829qkn.113.1701819755133; Tue, 05 Dec 2023 15:42:35 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id de36-20020a05620a372400b00767b0c35c15sm5437125qkb.91.2023.12.05.15.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 15:42:34 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, florian.fainelli@broadcom.com, Justin Chen , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] net: phy: Only resume phy if it is suspended Date: Tue, 5 Dec 2023 15:42:29 -0800 Message-Id: <20231205234229.274601-1-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Resuming the phy can take quite a bit of time. Lets only resume the phy if it is suspended. Signed-off-by: Justin Chen --- drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 3376e58e2b88..7fbb21922d64 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1549,7 +1549,8 @@ void phy_start(struct phy_device *phydev) sfp_upstream_start(phydev->sfp_bus); /* if phy was suspended, bring the physical link up again */ - __phy_resume(phydev); + if (phydev->suspended) + __phy_resume(phydev); phydev->state = PHY_UP;