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 A297BC433E7 for ; Tue, 14 Jul 2020 18:51:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7ACC922B3B for ; Tue, 14 Jul 2020 18:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594752675; bh=pIlEJRjVxi2ury+/Ey2yaXirtWPwYck8Ee9HE9kUsGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZFg9VhLNYAhlCKB43suhMAd62qsu6qLJX4qLna6d6ya1ZY8SxGUEV8AxEJjBMj1kV 5NkHjykdx/sPuESOS9jjtk6WwcV+wYmM1kJkOgdZYR+HtU58tw07d/glntxz25zXPq rmdgaaa7BkBVjWL1h6fb8vQDQx3LxLZYg0XBEmwc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729898AbgGNSvN (ORCPT ); Tue, 14 Jul 2020 14:51:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:47606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729904AbgGNSvM (ORCPT ); Tue, 14 Jul 2020 14:51:12 -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 81968207F5; Tue, 14 Jul 2020 18:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594752672; bh=pIlEJRjVxi2ury+/Ey2yaXirtWPwYck8Ee9HE9kUsGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KM7MKYkzpZC28s07GxEOXtkdmnsGZVDPp+u0HQEzDGVUARW1qBlnZ63qpsC7HIAbf 7LipdeRsadeXJ7hmrPuyQdEV62ISTr+rXR+mn2kEAdoY/VkKxnSqjC8zU5JYfBoQqj awIIxoqZNDRynuhneLNof9ypJliV9SeGQCMzw1ac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claudiu Beznea , Harini Katakam , Sergio Prado , Florian Fainelli , Nicolas Ferre , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 066/109] net: macb: mark device wake capable when "magic-packet" property present Date: Tue, 14 Jul 2020 20:44:09 +0200 Message-Id: <20200714184108.685050591@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 ced4799d06375929e013eea04ba6908207afabbe ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 16f5c62ba6dfe..e7fafe2fcae5d 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4260,7 +4260,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.25.1