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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 2FEDCC54FD0 for ; Tue, 21 Apr 2020 10:41:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DD5220679 for ; Tue, 21 Apr 2020 10:41:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="pTnCWWqQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbgDUKlj (ORCPT ); Tue, 21 Apr 2020 06:41:39 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:32622 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728625AbgDUKlh (ORCPT ); Tue, 21 Apr 2020 06:41:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1587465696; x=1619001696; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rK6cWA0PkySI7DE/ZpSxKyujUEY/9QCd7k1z9i+Kkpw=; b=pTnCWWqQ0DYvSUMGhoQq0iWj/xMCHgENDxQmEKxMNMNKXGc+Sj09BkGP 2FbdxoaV+xpFWL1tAF5by9rOYMHWTWE5Nv/i/Ee4j2tl1p4Xm5iUXLdkg SPoPUDlJ8MyWOd0iQABN1fAlME6HPq61CdK8oZ8wBXoG08UfzsXnLV9h+ EZsR2ofwZbqOb993JHelsB3hOf8auV8Bn885DvR7EaFoEcnZm8cUMpJr9 PKQVcstFsVMXpYGv0TZhO7H7AYIhWYwRknfXVYl9gUt9vtVf/B2N493Eb VCMl1NGltVd5828FzKIXFOgemeE1sqYh5v3ZZga36H/o/UqQV2E2uM6x5 w==; IronPort-SDR: Qx6hDdrwJI2R/qlc5JFMUD8EJnBzhQlN/WWBqRszDFmUhCVBj09HRHIUFqCUUfQYNOcfwsOnYT 2+KIECJr0oSyDww824uSAaiYX6lr/CQxdwfOhnSlf66QNxLHQhMdh9NSl7LtO5jCZ7wVygeCU4 +VikIo4XNrV2MQFTbApx45x+yOZRo4WK/5ZMK4yY2Qf7ACtdZljNYK3mJRMjd+UMcwQvPk2kkq oLV3GDvOD0ci7MjvCMyiw4SAtgJVx1CQdpHcqAxkZsMED2rFwKq9+hHycDa94Yke2/CKmxKOnf bpE= X-IronPort-AV: E=Sophos;i="5.72,410,1580799600"; d="scan'208";a="71017508" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Apr 2020 03:41:36 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.1713.5; Tue, 21 Apr 2020 03:41:35 -0700 Received: from ness.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 21 Apr 2020 03:41:33 -0700 From: To: , , "Claudiu Beznea" , CC: , "David S. Miller" , Alexandre Belloni , , , , , , , Nicolas Ferre Subject: [PATCH v2 2/7] net: macb: mark device wake capable when "magic-packet" property present Date: Tue, 21 Apr 2020 12:40:59 +0200 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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") Cc: Claudiu Beznea Cc: Harini Katakam Cc: Sergio Prado Reviewed-by: Florian Fainelli Signed-off-by: Nicolas Ferre --- 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 d1b4d6b6d7c8..629660d9f17e 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); -- 2.20.1