Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4917C433F5 for ; Wed, 24 Nov 2021 13:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349157AbhKXNlZ (ORCPT ); Wed, 24 Nov 2021 08:41:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:33718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353007AbhKXNir (ORCPT ); Wed, 24 Nov 2021 08:38:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B6E8617E5; Wed, 24 Nov 2021 12:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758584; bh=A/iPSYYNvU4GKF5Bd17Q+I5mQpN+x5d4con1NK7xMFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dc+phTbiEa1Ab+hYpgLZFXtD8sPMrFiJwTVZqvvDyZw3Ytb/nFycd+3tW5FVYad7P GWiu3EDmsDmFdawX1lXIUj2E++BnSEONzWANXP449KHjF5v01P6n0Y+x6McqXsHD9o wTxI/jTToHgTWqmFCBEh4oRhc938S894bQRRjMpM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiko Stuebner , Punit Agrawal , Michael Riesch , Jakub Kicinski Subject: [PATCH 5.10 118/154] net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices Date: Wed, 24 Nov 2021 12:58:34 +0100 Message-Id: <20211124115706.097197178@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115702.361983534@linuxfoundation.org> References: <20211124115702.361983534@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: Punit Agrawal commit aec3f415f7244b7747a7952596971adb0df2f568 upstream. Commit 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") while getting rid of a runtime PM warning ended up breaking ethernet on rk3399 based devices. By dropping an extra reference to the device, the commit ends up enabling suspend / resume of the ethernet device - which appears to be broken. While the issue with runtime pm is being investigated, partially revert commit 2d26f6e39afb to restore the network on rk3399. Fixes: 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") Suggested-by: Heiko Stuebner Signed-off-by: Punit Agrawal Cc: Michael Riesch Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20210929135049.3426058-1-punitagrawal@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "stmmac_platform.h" @@ -1335,6 +1336,8 @@ static int rk_gmac_powerup(struct rk_pri return ret; } + pm_runtime_get_sync(dev); + if (bsp_priv->integrated_phy) rk_gmac_integrated_phy_powerup(bsp_priv); @@ -1346,6 +1349,8 @@ static void rk_gmac_powerdown(struct rk_ if (gmac->integrated_phy) rk_gmac_integrated_phy_powerdown(gmac); + pm_runtime_put_sync(&gmac->pdev->dev); + phy_power_on(gmac, false); gmac_clk_enable(gmac, false); }