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=-12.8 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 4CC8CC433E2 for ; Fri, 10 Jul 2020 12:49:03 +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 188FB2078B for ; Fri, 10 Jul 2020 12:49:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ugR+TGWA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="g9i8Mv+T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 188FB2078B 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+linux-arm-kernel=archiver.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=JF+1yYL+JO/Iw1egn1Z2smI4DSrww8xlMENBBNRiwt4=; b=ugR+TGWADTHaUcZWah2fdDHf+ 6zGQiyboJLIb0Rjcb56yWMt+BebiHeYIXolLVPzCev85Mxo6kBi1ScgTCnGgpGByaIRfmmyFUPtHT DCW+nXsLw3TATmBdO3R7Ik8rkUFjoG+XrM+ddt5/fSy/0G+7+21eOBS7dzO9oI7u6oGs+1ht+3Dwh KiPhw2IDIztoeOwVOCCo8o3F9B1n5em67OM2Nn1w4CNXRCc4aC9CatPsuekw4TQMQjU8jgWhbTL51 NlRQBId/ThIBH8+UOA9G7HPND3ebmbZnSxgvjk6TbHpb9cmJYdxDd9V2e1XEoRS9vruA7H3LebvRR E3Nn0kSJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtsRS-00054C-4j; Fri, 10 Jul 2020 12:47:50 +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 1jtsRI-00051C-Nb for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 12:47:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594385260; x=1625921260; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F198PHt3CmmrCPyBEGbcvHM9j1ntyqNfdwfITtlue5c=; b=g9i8Mv+T8WKk9agzt0lOMUD1dEt++y3xcR+7dhMUEc7zXOuEKnLlGzPC bvE0ZLblsuKh5BdLJY+yFMoRUnDrie+cPrgwWR8+o+5VAYjfL8os3owK1 ANbfR6Rs0Eu0eDmx2CXC+ucb4h85h7nIqeylvDEJKHCrJ0b7sRXesDvwf YHjr8VDH2FqxeRhdQFto2aiuYi0caC7jizW0L3sT2GL07kU218w94fJi8 nhdikSW1Qda3J2pCkWCcOovgOKdKZty9aTz6BsZSppZ6t/sPzhf7GvJ2n oVhvS5DGAWtJngMN9n4DRzanmkcEBVHzH6m8TRHePzDLfH6742zb9FKU6 w==; IronPort-SDR: HBrMMwKuQf6Di2FjkopmR62P4XsHGDVVK0EcV4Qycn5uxTjsqfSMYOw02a3/ONXxVGifaPQGNr ZJCEgKFg3nPdEC4lIOCIimu1j438AkraRJ79I2NB/i1xEmbzlHs2dX7M2PhYcJheq0MohvDVnR TMMsPcTnNfqAMnoF7RrtsSNWW8sOySK4GbCTy17m/1wmfGd+Bx8fa2lbscmjD/lW+q9/JJ5RK2 P+g/oIfXZwj01BfvX5/DPFRRnQabec5l9WkvDAU4OpWvfRxswus0RT2WEhBzDWO++Y6wEIfimW zjQ= X-IronPort-AV: E=Sophos;i="5.75,335,1589266800"; d="scan'208";a="83305801" 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:39 -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.1979.3; Fri, 10 Jul 2020 05:47:39 -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:35 -0700 From: To: , , , Claudiu Beznea , , Subject: [PATCH v5 5/5] net: macb: fix call to pm_runtime in the suspend/resume functions Date: Fri, 10 Jul 2020 14:46:45 +0200 Message-ID: <5d36a9f6956fb4fb55778cabd2c21bbfc3670cf5.1594384335.git.nicolas.ferre@microchip.com> 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_084740_969169_A74CB3A2 X-CRM114-Status: GOOD ( 11.29 ) 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 , Sergio Prado , antoine.tenart@bootlin.com, linux-kernel@vger.kernel.org, "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.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") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre --- 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 548815255e22..f1f0976e7669 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4606,7 +4606,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; } @@ -4621,7 +4622,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)); -- 2.27.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel