From patchwork Wed May 6 11:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11531077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 790FB139A for ; Wed, 6 May 2020 11:42:19 +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 5688E20736 for ; Wed, 6 May 2020 11:42:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BwtzP5w1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="r1dk1doM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5688E20736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+IFMgX/XtZzrc94AK+kIkdc+Qz+tcT9asfqaQIgc7I0=; b=BwtzP5w1YbTPZu YXAzPMxiqHTa5eh/GBbNCFWD8Kf1sfOyYbHZGi6hCClDjoAthQYiWwTOc10uIN8zPjCeo8k60sMsP /tt592bALyGJ6ic3CQl3SCueitmuGSyjipb5amxiamobssd36akjJTJFwkPPE1/vYcMhBcYA+CFJP iX9xzvFXZ7Bgz1dXEYSHEKTM0LMb9Sj+VM/dhbApPcYsPs1BF0Lgb5DQ+5wtCDdGO+h9y9vozt9ts /w1xC4w+yep7NpD3rMEVAroZ5PnleD4BpTRNvOUYFx1OH6V/g/FSAs+VGWnTG2PO84xLKvyac2xs4 vy4MG0UFBKdARaCvYq1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRL-0004p2-Kd; Wed, 06 May 2020 11:42:15 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIR5-0004al-55 for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 11:42:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1588765320; x=1620301320; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Cg4BPRaGxfrS+/zj5AePP2N7TWIwyo2J9Tr/Whwu38k=; b=r1dk1doM+i/SSWV81xAE45FjbGaANx0wre0GqkNJRJUtoUM/KkyCM1Xl Pw6s1dhCLU2VqzRjaDJRIyuWf12GHcTU0bZbpRU0R6K5/6MiFMCl6SlIn DDCuuoDvOJIVcALRt9jr+34uxp/4wmIiG9ZhK0IJ9tlm0iOYV1W2NMSe3 Jru3DFrEjJQ7308PxaNv8T4jQ35IS9hNlfrPhPp5is11VgRABK7rMKfEW evU/IUIaDU3LtLT0V77yfhIGM9NlMkMFQYhEUGUIp981O4oSy7gEsJxgV QPGfrbx+NnWpbmbLIoqkVSTL3vJdjQvIjbhc1S/90qQD7BUZ1MBt/XNQJ w==; IronPort-SDR: knYoS5+AmJ0w/4fuKWSH/HCpZ9HI9CXeWtZXpjH4z1cXRlc9VIIGG9MlTYO84n1IKNQtIwbFSe g2gPQVNq5lBkCVVvN/4AwplWkSpO5jaUbFlGZovKwm/wksU8RiP3GQcsBmMGAuY9pc8W0Q+Rpg SKJ61T0VB6ntzXnLFUQHlrmGOr74elIPn7r7UQEIfsDLxi7MoIZ78YaLo3Ek1UofO0qnz1dwlY 7OQpAOQ4wLrinSc4+5jwTdRIguY5Ez/JMqh+BqZ4x7jgUkY9A20CILE/nIpNnyHAnurfH+O2Uz wHU= X-IronPort-AV: E=Sophos;i="5.73,358,1583218800"; d="scan'208";a="74979852" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 May 2020 04:41:56 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 May 2020 04:41:55 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 6 May 2020 04:41:51 -0700 From: To: , , "Claudiu Beznea" , Subject: [PATCH v4 1/5] net: macb: fix wakeup test in runtime suspend/resume routines Date: Wed, 6 May 2020 13:37:37 +0200 Message-ID: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_044159_206017_36D3F830 X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , f.fainelli@gmail.com, antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre Use the proper struct device pointer to check if the wakeup flag and wakeup source are positioned. Use the one passed by function call which is equivalent to &bp->dev->dev.parent. It's preventing the trigger of a spurious interrupt in case the Wake-on-Lan feature is used. Fixes: bc1109d04c39 ("net: macb: Add pm runtime support") Signed-off-by: Nicolas Ferre Reviewed-by: Florian Fainelli Cc: Claudiu Beznea Cc: Harini Katakam --- drivers/net/ethernet/cadence/macb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 36290a8e2a84..d11fae37d46b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4616,7 +4616,7 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev) struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); - if (!(device_may_wakeup(&bp->dev->dev))) { + if (!(device_may_wakeup(dev))) { clk_disable_unprepare(bp->tx_clk); clk_disable_unprepare(bp->hclk); clk_disable_unprepare(bp->pclk); @@ -4632,7 +4632,7 @@ static int __maybe_unused macb_runtime_resume(struct device *dev) struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); - if (!(device_may_wakeup(&bp->dev->dev))) { + if (!(device_may_wakeup(dev))) { clk_prepare_enable(bp->pclk); clk_prepare_enable(bp->hclk); clk_prepare_enable(bp->tx_clk); From patchwork Wed May 6 11:37:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11531081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C795E139A for ; Wed, 6 May 2020 11:42:53 +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 A549620736 for ; Wed, 6 May 2020 11:42:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nsa7sE40"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="2TeY/wlM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A549620736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u7IpT+u+dU8noYATUORI+SQCFYxy03FatMKCXBIWzTY=; b=nsa7sE4005dxHm ENylDN1TCC++HeZ6sQCM2wKNqWO+L6T1hGMyyVl/TF5jQ2vyc5r3qCDkWV7axR6WLOcbaN0IWbagY rAVFLDtw/QUae3dE8d7WSXAIDs4Z5blk5K6D4IBrcYKD0sNOlH32CIytTNISlvHqnBcypD4nkZPmS rszxOIZRyhEit8jSvBcb8twbtUDZC8ksTNgdmw6PWak78l20gA9t8xNE6oCn0OO0NLOTxoDiv4xvS Khtr7r9nIO9vFFvglJEFl6KmKFdrK0c5A2UOP8F59/WmLvwFsw8T59gShu+3Kd4SLwx4/84Fud+vX CPwWN4RU7TljzoPslB2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRt-0005Oj-VL; Wed, 06 May 2020 11:42:50 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIR9-0004dL-TE for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 11:42:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1588765323; x=1620301323; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Tv6yJ7LbbY1iSVkwSqx5jSF+okHW//DxXRB/JfgHvV0=; b=2TeY/wlMCHOlj/z5EvoYK8pLSrI4Cy+1dyRCooyIbcWJYirJJ06QdQ2/ fL9W5/d+s1nzGctA0ejheQjKTGGhQGDHxbC9CLLzr8CLE/oXZLclRcbCe bnM30HWd37Q2yE6uzx8tiP/9UWf/cG4MA8X40atdpGFp2ezitXoXmUBtH HxbbKLGdd01WlgeV7WJJTIK0jliTzCBhDSZ7880zm5ktOaiK1rP8HyMOI tagjOI8L7/eOCQ75qP13KzEH++EAog6wgY2WpgrTHHW08q/w5e9bYoZjC DEuxlIemW7IIi4XoNIZrLVstsxjYX2SsLzUdIGczpNnVQEkF1uq27vQj1 w==; IronPort-SDR: /qz0F12LrMVzDtxM0Yzbwgc1vdt5nba7jH4t4WMGJHJuxo/pGUMRASLobG/IZU3Ap6oh01JaqE n837HY/8jb2foWC78+Yg/oUs461tqzCfoJSuobWogRxvOX6VG9ZAdsuKdGwqNM7zqDNp+K5rZz 5mLCqYeRgBahGpNWa7LyWQzvy0WJXLMT3w6ZwOIyKBDPQfaVvbWD3sP7n81KnLglrCFTYriJZE Uv3wu7Cn0Y1lqBGQoVaz/JNKMPG9ULYY5JLLnfwvBjdWFMvawPYOTANZfPReVrbrOPwKn0iNq6 QZY= X-IronPort-AV: E=Sophos;i="5.73,358,1583218800"; d="scan'208";a="11483896" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 May 2020 04:41:59 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 May 2020 04:42:01 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 6 May 2020 04:41:55 -0700 From: To: , , "Claudiu Beznea" , Subject: [PATCH v4 2/5] net: macb: mark device wake capable when "magic-packet" property present Date: Wed, 6 May 2020 13:37:38 +0200 Message-ID: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_044204_078814_E9705110 X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , f.fainelli@gmail.com, Sergio Prado , antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre Change the way the "magic-packet" DT property is handled in the macb_probe() function, matching DT binding documentation. Now we mark the device as "wakeup capable" instead of calling the device_init_wakeup() function that would enable the wakeup source. For Ethernet WoL, enabling the wakeup_source is done by using ethtool and associated macb_set_wol() function that already calls device_set_wakeup_enable() for this purpose. That would reduce power consumption by cutting more clocks if "magic-packet" property is set but WoL is not configured by ethtool. Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet") Signed-off-by: Nicolas Ferre Reviewed-by: Florian Fainelli Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index d11fae37d46b..53e81ab048ae 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4384,7 +4384,7 @@ static int macb_probe(struct platform_device *pdev) bp->wol = 0; if (of_get_property(np, "magic-packet", NULL)) bp->wol |= MACB_WOL_HAS_MAGIC_PACKET; - device_init_wakeup(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET); + device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET); spin_lock_init(&bp->lock); From patchwork Wed May 6 11:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11531079 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10D9F913 for ; Wed, 6 May 2020 11:42:40 +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 E372220714 for ; Wed, 6 May 2020 11:42:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Zkqxkyad"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="H85E8fhr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E372220714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iTbucak7wWrQrmXPyGcqoK1D/4xYNI+FgKYB6L44k2k=; b=ZkqxkyadN4TQU+ Q0+Nra8bnTlmutoR2rQudoSH1225MQbFOplzsb81snCQk3diorjGRwVC6zRfqZPndx2/gZn9UQnUb cZFqY3PTx9b/r/oIluIGaSTzjOdGl4I9a6l26M8gGnbAX6od6EylT0j4bPAU75jP1kQg5nQf7YQmX 7KXkUnMbvLU5ewEqpzlWu6U61P8thsm/sGYlwysAyJL29TGTmU5Het0sl62AXfgdEUuBWVrsMsSJt 6U4oEJcsajdUipxkN8AYgIwqhyzS/LxpUw07P+Hacf16RF9AD/N3qPasG7jgV0XuUhC/BxNtrSbae BqahWTpoVlnk7SdmU7Nw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRg-00059k-19; Wed, 06 May 2020 11:42:36 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRB-0004fN-5d for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 11:42:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1588765326; x=1620301326; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CnDfNyn7awnGdDhHf08Ujco+xu5QtOjUT5JuHd7ht7E=; b=H85E8fhr6qFYPFLWdimlhdyBejLY1OOKHJcUu+wWIrMzFvsyn7ipUtit o+3yaVAFqyKnDH7uokOVM+2v+S8aA87bIPScjqiA1O1kSOCieyUTI+q+x uA7iMiV5LY8Moy+OWgBJkxeyrXcRCpJ3mCNw0MFWWIAZ7s0d+kIzkLbe8 utK0qzvVYTR1tO4Qdv4Pt7U4m4gTXB1KWeTODiZjfTeCHNXbZv50fRUKD K/W5uOg4jWypIxnIEe77QFRKe950qRdft8ZhkF4ImPRM697mbjQjD8wxu vT6DgC78kUu09ovo56ZYBNj6Df5a4XHJUST6ZyXI9JVK82jKceoalBi/o A==; IronPort-SDR: cJYnnUxg+4j0D7pSV03wjwCRrbdanfXhtfur+zVNRJw5J1IzyXxNIeUaoAYmW0E5aSe2BLPdKv FkV9+rvKgCzOwUsntDv+cdVxnyYbYMHFDKu8Qy1o9nhr0SODtlPq5nqP6dtm0FS4r4eR8Kry0t bwPw5UnXX0+wHTD+3E/jZg4fRvgax+JsqU3j7IffzKUEnztQ6QQtJXIjwEBjfApjmltD5szECM 2x/QVfCkrNzBp60esJyK6GCHl3aWW20H8ZntLRlqmwwwg+5mNFpFYpUfxV3zwTrt3FzQwnmQ5j hp8= X-IronPort-AV: E=Sophos;i="5.73,358,1583218800"; d="scan'208";a="74979879" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 May 2020 04:42:05 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 May 2020 04:42:03 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 6 May 2020 04:42:00 -0700 From: To: , , "Claudiu Beznea" , Subject: [PATCH v4 3/5] net: macb: fix macb_get/set_wol() when moving to phylink Date: Wed, 6 May 2020 13:37:39 +0200 Message-ID: <4aeebe901fde6db70a5ca12b10e793dd2ee6ce60.1588763703.git.nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_044205_282113_D22976F7 X-CRM114-Status: GOOD ( 12.37 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , f.fainelli@gmail.com, antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre Keep previous function goals and integrate phylink actions to them. phylink_ethtool_get_wol() is not enough to figure out if Ethernet driver supports Wake-on-Lan. Initialization of "supported" and "wolopts" members is done in phylink function, no need to keep them in calling function. phylink_ethtool_set_wol() return value is not enough to determine if WoL is enabled for the calling Ethernet driver. Call it first but don't rely on its return value as most of simple PHY drivers don't implement a set_wol() function. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Nicolas Ferre Reviewed-by: Florian Fainelli Cc: Claudiu Beznea Cc: Harini Katakam Cc: Antoine Tenart --- drivers/net/ethernet/cadence/macb_main.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 53e81ab048ae..24c044dc7fa0 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2817,21 +2817,23 @@ static void macb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { struct macb *bp = netdev_priv(netdev); - wol->supported = 0; - wol->wolopts = 0; - - if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET) + if (bp->wol & MACB_WOL_HAS_MAGIC_PACKET) { phylink_ethtool_get_wol(bp->phylink, wol); + wol->supported |= WAKE_MAGIC; + + if (bp->wol & MACB_WOL_ENABLED) + wol->wolopts |= WAKE_MAGIC; + } } static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { struct macb *bp = netdev_priv(netdev); - int ret; - ret = phylink_ethtool_set_wol(bp->phylink, wol); - if (!ret) - return 0; + /* Pass the order to phylink layer. + * Don't test return value as set_wol() is often not supported. + */ + phylink_ethtool_set_wol(bp->phylink, wol); if (!(bp->wol & MACB_WOL_HAS_MAGIC_PACKET) || (wol->wolopts & ~WAKE_MAGIC)) From patchwork Wed May 6 11:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11531083 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9D90139A for ; Wed, 6 May 2020 11:43:09 +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 C46DE20714 for ; Wed, 6 May 2020 11:43:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TTJRY1XQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="SM/g4umm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C46DE20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8NED3lsbXxi/XPM6sfdMILKYM+6GKa0C9Tu49naZ9UY=; b=TTJRY1XQIPElXc bAiqcZ/SoxSRt4ppqTA5fsXw7wPY7cuaR19ObTREmbCR1HZH7QEoCq+wax+uSEwsE/xNQOpDzp39J BAa5WASaKwY0kRrR+bMubu+3zvx73PSugHdEJddxo9WOL+Thx26mpfOdJBhIBSrWtICVhHfpGMgs1 KlMV/MaMvHN4heYPlkjELFcqJZ+FFRd+Ib3nROUC6wX9ChkXacFxfiBxUTkt0vdkiQeSWQy3NS2K5 ykKw2F+7hM60jT3VC6WL8aY/coLLP6fHrLkGGkGrT71ZmpYLPuC1EHk6PvNmr22dgOJlU8IvYEgFw WK1O42Nd/VODkGGO/XDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIS7-0005cA-Tf; Wed, 06 May 2020 11:43:03 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRJ-0004mg-4P for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 11:42:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1588765333; x=1620301333; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LT3J9ik/ZJWvrD8XpOG7/NwP2Lq90M4T+y17p4Ln3ps=; b=SM/g4umm1+bgdDfyky7BFAbPKv/Ss1V8iSgNKHZltwSFvXjsguCsKZYd xcbn9Wc/xKwqIFqwPenEio3dfk5ZQt96p6Jh1Tl1hD/HNANIbVy5Rh/yK /lf0s4HtMyqREme9WeMUPlfBggShs+Eem+VrRAT1oHV0sO+AditdXb6Lx ZSlorVd4Xp5BvfvZB1Gz+1Gsp8WLX+JlLpiEw8q0RAEmZbxSKJxj2ibDK befg10lxtKKSn/J1SO2dHjJ5BmNK8rNu0CiZ3gUN/FBno3MpRLi059UL2 8EGxyglGelyfTZibfshtw4+i8s8B5/zeh8C6YH9p4KhHCf/Ce0jOO1tdi w==; IronPort-SDR: 8jR4LZbj5arbqc3uRsmUnFtBhO6LM2wTSSc5CvwjxaTWnCWZ7EsuskT0ES9jPfAKp5/xq9jPRc rYgsuPn3306qJ5wyirMwv9AWA8h04OOrzce0CJphmKvTAwWG2nt4sSJrhlbqE5EM+GG5M8Si/r N6km9gWoNpKSCShyPPSVm3G0aFaLZeNnni8cvBrhVyLx61tef7HcOx2JQrtbCw/q1xm8XoLVP0 ObFKwbFPAMCWAef+0k9rjxJ/x7ze33uYDmIyBBS4kIjutTQ+k2e6d9ZwfZxKW5WKuxsEJWBXl6 p+Q= X-IronPort-AV: E=Sophos;i="5.73,358,1583218800"; d="scan'208";a="72599442" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 May 2020 04:42:09 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 May 2020 04:42:08 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 6 May 2020 04:42:04 -0700 From: To: , , "Claudiu Beznea" , Subject: [PATCH v4 4/5] net: macb: fix macb_suspend() by removing call to netif_carrier_off() Date: Wed, 6 May 2020 13:37:40 +0200 Message-ID: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_044213_330725_46FF13C1 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , f.fainelli@gmail.com, antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre As we now use the phylink call to phylink_stop() in the non-WoL path, there is no need for this call to netif_carrier_off() anymore. It can disturb the underlying phylink FSM. Fixes: 7897b071ac3b ("net: macb: convert to phylink") Signed-off-by: Nicolas Ferre Reviewed-by: Florian Fainelli Cc: Claudiu Beznea Cc: Harini Katakam Cc: Antoine Tenart --- Changes in v2: - new in v2 serries drivers/net/ethernet/cadence/macb_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 24c044dc7fa0..ebc57cd5d286 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4562,7 +4562,6 @@ static int __maybe_unused macb_suspend(struct device *dev) bp->pm_data.scrt2 = gem_readl_n(bp, ETHT, SCRT2_ETHT); } - netif_carrier_off(netdev); if (bp->ptp_info) bp->ptp_info->ptp_remove(netdev); pm_runtime_force_suspend(dev); From patchwork Wed May 6 11:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11531085 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8F71913 for ; Wed, 6 May 2020 11:43:22 +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 9221420714 for ; Wed, 6 May 2020 11:43:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GsjAQobz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="qfr429Yk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9221420714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qZY04sbbr5MhsSL/G+S5B3z8HsTv2yJhN17AyhwBOJ0=; b=GsjAQobz9rm0pR 8KIIix7Rcok2fF/S0Utql1ikW0MTGGSCRqFxJzz1biRMkWV8PBP4UirZ70EXDnOPqy5Y2ep0UXiOV IMuKrfmBi7dq5XkfB1AR8gTqR9PvIM2v1/Gmk4VFD/T9a1NCvsE0hfHI0u37RaiJE7hny2+MC1h5r 8WgzW9vX+NjMyDI5PX7lNHDo4Eyw0dCacbkAV4ZTyiq/SRuouFbgv9nw+Y+PChbbfJ8xK55jNTmk3 QXn9oOfuMZfgbSy0BfIJ8iQ9N8afSevpuPBzjcUk6D/obfkZLMZzSbAvZiO4q7j+i2tYmfj/2Uw8d fkE7TClAkEUVVXFdhguQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWISJ-0005pO-CN; Wed, 06 May 2020 11:43:15 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWIRL-0004mg-3F for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 11:42:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1588765335; x=1620301335; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rNIeyGDtU/ObatCtRK8/2BrcAEK4nBJLJd7TnqPJUmc=; b=qfr429YkEiv0TNHeWlt6l3wCC8YSTzrVqWSj3XJeU3PG1BzHFtkpTa8P saSUJzU2Y0jNRPJdX0FUZU9+UNa9f/PcAKcGzT5E1VJ8OLOtU/WIgoNxQ VRHp6S+l3eHrBE1Gz5YhkC3U31WsAHAwcqLoydT16BYLZOf4ACNyMDOCo gEcJpdAzjKsnFTTYIZQ0stA74kbFG3H8CIdIT7LwnyzLp6b8hPob6JHRl a9/k4MEraDcOZ8YcggeHQIuqYwlYBmLZdbdAK+a+JOpcDBI2oujBdFupz DgK6Xtn4+BqsbetaFnR1agK5/8CeW/0405q3jue2WgbbNXwHeZ76A0X8T g==; IronPort-SDR: Il0T3scwtTKFf3RazNpNV6QZOoRnf34El2f2q5I7L6wzLDqMeUHQE2D7gxrYQvMiChTk8QRa/U sIqWsbdvySFQaeRX77yPbI5rq91NNWjH0Jb6pMu095vjFrpWDIDh3XChqwT7QV3r49D4iFAwHM gozXyHi64oDnaioMCZnrwEO/uaZFnaqNDe7UWakhTJMAk2iHxRy4eTTyHd2YDm0GE3JRLmCPlq 1TYUCiWOkmr9+FGtz5lV9TT6lkctr1xZ7uSZapQ7u3OdZTys8eR3cilC5ejvqCaX+9zPLZXv3a X4k= X-IronPort-AV: E=Sophos;i="5.73,358,1583218800"; d="scan'208";a="72599461" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 06 May 2020 04:42:14 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 6 May 2020 04:42:13 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 6 May 2020 04:42:09 -0700 From: To: , , "Claudiu Beznea" , Subject: [PATCH v4 5/5] net: macb: fix call to pm_runtime in the suspend/resume functions Date: Wed, 6 May 2020 13:37:41 +0200 Message-ID: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_044215_242042_577474AE X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , f.fainelli@gmail.com, Sergio Prado , antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre The calls to pm_runtime_force_suspend/resume() functions are only relevant if the device is not configured to act as a WoL wakeup source. Add the device_may_wakeup() test before calling them. Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet") Signed-off-by: Nicolas Ferre Reviewed-by: Florian Fainelli Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado --- Changes in v3: - remove the parenthesis around device_may_wakeup() Changes in v2: - new in v2 serries drivers/net/ethernet/cadence/macb_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index ebc57cd5d286..f01b9831b219 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4564,7 +4564,8 @@ static int __maybe_unused macb_suspend(struct device *dev) if (bp->ptp_info) bp->ptp_info->ptp_remove(netdev); - pm_runtime_force_suspend(dev); + if (!device_may_wakeup(dev)) + pm_runtime_force_suspend(dev); return 0; } @@ -4579,7 +4580,8 @@ static int __maybe_unused macb_resume(struct device *dev) if (!netif_running(netdev)) return 0; - pm_runtime_force_resume(dev); + if (!device_may_wakeup(dev)) + pm_runtime_force_resume(dev); if (bp->wol & MACB_WOL_ENABLED) { macb_writel(bp, IDR, MACB_BIT(WOL));