From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D452C433F1 for ; Tue, 14 Jul 2020 19:08:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D17D21D79 for ; Tue, 14 Jul 2020 19:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594753686; bh=Z3rIJa+Xax5nS02cYxpdGAtB9OBg2QGFnRukB6j2RwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Fy6RtA6SAe88PnFYeKAs3/oFQjdVsG5w2q5xBGRTHx/vAv9QjOAAwH8kL9xf2rOKT j82PjjLC0GOMRGIXaXRE+hS/i/P7QJY1F4SRBWapFdofJfKG7dnZA7bUxQRb2kjp/5 HzyZ+JYP1bXrTECH7y2qnqxCGZlrJUbcSiqSkER8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729695AbgGNSvP (ORCPT ); Tue, 14 Jul 2020 14:51:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:47536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729818AbgGNSvJ (ORCPT ); Tue, 14 Jul 2020 14:51:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7FDDB22B3F; Tue, 14 Jul 2020 18:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594752669; bh=Z3rIJa+Xax5nS02cYxpdGAtB9OBg2QGFnRukB6j2RwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZEEFzCfzho6oxirRAsG8aOsvsCepnv2HsMrG3712vJURmTb1ldoaR5UrJBQWZTzw9 U5E9/ee0n2nFIZDhUUl0fsqUpiNNVXVc9BIi1N1kxnAc/l5eHb4cu3PJtYR4OiwKQg 978VPvwfXfRA6nyp41TFi+N0xX6hCEJMAYj+7Zwo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Harini Katakam , Florian Fainelli , Nicolas Ferre , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 065/109] net: macb: fix wakeup test in runtime suspend/resume routines Date: Tue, 14 Jul 2020 20:44:08 +0200 Message-Id: <20200714184108.637156243@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714184105.507384017@linuxfoundation.org> References: <20200714184105.507384017@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicolas Ferre [ Upstream commit 515a10a701d570e26dfbe6ee373f77c8bf11053f ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 1ec19d9fab00c..16f5c62ba6dfe 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4507,7 +4507,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); @@ -4523,7 +4523,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); -- 2.25.1