From patchwork Fri Jul 10 12:46: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: 11656459 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 94BE892A for ; Fri, 10 Jul 2020 12:49:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 69D632077D for ; Fri, 10 Jul 2020 12:49:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tadOltQ9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="oOL4ijxB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69D632077D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine 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=merlin.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=7yOajf7tUwqAztVNAUQafGWZKGIWmuhzX5NdoGOsflY=; b=tadOltQ9avNOg7cMnSdWTtJcv h/FY0EbcKN2RMHuljGRQtIOp1ErXaIF10eBA1S2peHcQeN6ukkx8i1eyvfEwM/uEbhXDR4ODB+IqU I+tRvrlTDlx54CS5d/+7tWeoL3UmReoP7pDajXsdi/OiXm2pLfEdzV8ndLiCVYApU93LdQHaSpBS1 MHyouW3Np4c1gh7bgYPDNK/hDXErsHFbGA9SQ54W+q8tQGjGFLgtYPhQxKJLNkPuKf8/cx4y60VXW DegoP2ddmrIY16lcYQ7z6gjQIM/Toy9eSvwFK4y7XwSt46yy/nFbUesWbBLVnfhxIG0/Vu4LnC4lx BbXU8JQSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtsR9-0004ya-2g; Fri, 10 Jul 2020 12:47:31 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtsR5-0004wz-Em for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 12:47:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594385247; x=1625921247; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LAboS01sDMUr2hIzOB5JCAVYKTW4PFCO3EQWiwSvIXo=; b=oOL4ijxBTJhQlEKPLTWOgO7kq1bveOL4z7F6vivAVJtFgSjMPDn5qsRg oYj4VDIsag5Zr7tBVjZseCind3Sw976C2BZwlOoWE53AoD5sVXM3oq6wQ MAXTsAtIYOGugbWdnxyV6qsQp2R0+TZXCrObyWxmmI44GG8oDcSOfThUc KqAGp0LlA4kFwIyHSSnUwN3Q0TY5P4kh+3bk8nnS2omVNReTB+HIvyM2p /mFNOR2YhIM/JcnWvuG6m6se/7rmQGQH4+wI4y4h7wpFOVcaDmf22ce0n nrXsI/ls/r6+f9tT79vUFbnIG99qKZD3DN/RqvVLAT3vA84rgEC206bJ3 g==; IronPort-SDR: hFcQnaWCLTr6DrUAL8L0pmv0mceNMbvloToGxr3RyABt2fhLzL3AF2V8KSwJfGizBhQH34NSuL 61kQRIMTvSYpdMbYTaqxW9C6/vCv7nKH+gkxb8BdarIlqbd0s77LVCspodpasMfvC1hUVn3nLj ekhoT+zHcmZLy+ROCDbX+8DsNEovmZq3VsjSF9r0kRiwAXbqk+xXsWbIolcHNNenEHww9TOxUj 2haHk5R4udQ3vuLKYb/YkdJbKLg5s4G+sS9JFcFxfsmqGmETBn8G4O0MNgr9LBEm3BrR+mijE2 Y4A= X-IronPort-AV: E=Sophos;i="5.75,335,1589266800"; d="scan'208";a="83305778" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 10 Jul 2020 05:47:25 -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.1979.3; Fri, 10 Jul 2020 05:46:58 -0700 Received: from ness.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 10 Jul 2020 05:47:22 -0700 From: To: , , , Claudiu Beznea , , Subject: [PATCH v5 1/5] net: macb: fix wakeup test in runtime suspend/resume routines Date: Fri, 10 Jul 2020 14:46:41 +0200 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_084727_741980_06FCCAA0 X-CRM114-Status: GOOD ( 10.96 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.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.153.233 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -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 -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.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: antoine.tenart@bootlin.com, Alexandre Belloni , 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: d54f89af6cc4 ("net: macb: Add pm runtime support") Cc: Claudiu Beznea Cc: Harini Katakam Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre --- 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 52582e8ed90e..55e680f35022 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4654,7 +4654,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); @@ -4670,7 +4670,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);