From patchwork Wed Sep 29 13:50:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 12525617 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1229C433F5 for ; Wed, 29 Sep 2021 13:53:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69D73613A9 for ; Wed, 29 Sep 2021 13:53:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 69D73613A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iqDpQosvWXicyfsmb/ujfWHAslpIqMtBs6FHxP2BSDk=; b=MWs4X/WcES02Kb WNc437sTL978stlYKEbV5RpNhmk3CFCPHlUaOg7JJTqFf8lBE7dDwF8isXczYEjEIN9OrDxaeq+6f aH/8Fh/4Pw8AJJtFD8A9AIcpeTuEb7RLBB8UoI+rhVxbtHcOdWMNOIR8nsFowfkZ5CjZytLJtJb/4 4/Pr7wkK+P3RtsN4lYPhqXWRGlQNZmIN4/qwL+j+wceXW/pKC+W7jwNXKYvFUR7xDO/Kh67Vw9W07 LzjN7gKDragvoKrBkZDvEOwxJ5BFjwoIKP2lE/VtXSTeq7U7fOzQG2nDlq7fniK9X4pJH7ZhyDULI Yh4MZ3INOV4o00l7fyvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVZzG-00BDPG-UA; Wed, 29 Sep 2021 13:51:07 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVZzB-00BDNw-Rs; Wed, 29 Sep 2021 13:51:03 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 17so2799317pgp.4; Wed, 29 Sep 2021 06:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zSV4Z8mFbXMexrERVcO1h1NELPo9dMflMbt5n8Sf4Hk=; b=GezhHAWl6KBwmxXp8d37b+xMBu7zNaV/TIIRGw+bwSGRrZ0yFEW1EBxzxMW3nyG1/7 be5ISkux+HWW7aE1US/KtGHFa04Tj7C50QiZfVphVkGIf2ZChrMonXAj5ZQCRFowl16m QG+y/Xdr61Zh47YsZHBqrPA+Y6iRkUam69Lkvkc0upjdrqyT6P7ku/i1fW4PSN74GtG1 wBrqLB/AYv5Vr05uI9J4UlxhHsnjV8321q8/ycCyPiKJ0hHXF29EjQs5+IVUAgPkySrQ m7lO77C0f2MCEacicjcv0AoXqx/EsxR81S3U4xI2CtpaAt2kV38V6M5GcAaSSTGz4fcE 3Eiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zSV4Z8mFbXMexrERVcO1h1NELPo9dMflMbt5n8Sf4Hk=; b=5rTKBbDrhEvro5xQCy9zrgof8cOOMNOTgX17xayRLSdHDFIxy5koFgau9m5ZWwtc+u IKJcDt9inqEoJIGFp7QnIP5/uzIKL0mWqPE6PKPjcaF955FC66uznHI9TWeQP99aUVED uEcFffDrIosarP/lg2hvXW3t0zFA17d6zxCHPRCf4NvlFRklvuLRkihQ2kWrMQ1cHYBJ 5/0OabJh4iwg4FWd2m/KCKnDnFmVL6mMnzXOau6qAo0dRVTWJR+kg8ggaeSGq8i/3f1l E7yX7tsTVHoMkgEPEo7VZRs8Avmi4KZxe51UdZS4ZgOg80gUi22Jg+d6C2QlMkqL5Nn2 VTZg== X-Gm-Message-State: AOAM532wsikGtfk+v+O4XIAcojj+auWoFBNby18Iizluqd1OO7hJaI0H scu1oJacvTvZHfcvtSDTPpM= X-Google-Smtp-Source: ABdhPJwTtBcWbQKX/t61k/60uGU8jY/HnsHddE0T7ZQtDMgWl9mXtD2SzfRTWAYlTkhii00IZzvPKw== X-Received: by 2002:a63:2d02:: with SMTP id t2mr83323pgt.1.1632923458516; Wed, 29 Sep 2021 06:50:58 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id f205sm2786218pfa.92.2021.09.29.06.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 06:50:57 -0700 (PDT) From: Punit Agrawal To: netdev@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, davem@davemloft.net, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, kuba@kernel.org, Punit Agrawal , Heiko Stuebner , Michael Riesch Subject: [PATCH] net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices Date: Wed, 29 Sep 2021 22:50:49 +0900 Message-Id: <20210929135049.3426058-1-punitagrawal@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_065101_944263_91467489 X-CRM114-Status: GOOD ( 14.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Hi, There's been a few reports of broken ethernet on rk3399 based boards. The issue got introduced due to a late commit in the 5.14 cycle. It would be great if this commit can be taken as a fix for the next rc as well as applied to the 5.14 stable releases. Thanks, Punit drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index ed817011a94a..6924a6aacbd5 100644 --- 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" @@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) return ret; } + pm_runtime_get_sync(dev); + if (bsp_priv->integrated_phy) rk_gmac_integrated_phy_powerup(bsp_priv); @@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) 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); }