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);