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