From patchwork Fri Jul 10 12:46:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 11656463 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 20428618 for ; Fri, 10 Jul 2020 12:49:04 +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 ED1912077D 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="kRFjzMk7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="iAEGsQJI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED1912077D 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+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=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=2YyN5lId1B6qwzh03q3YEGizdlFx9CQP05u6c36BU3k=; b=kRFjzMk7jjoRqmyS+bUjyoMJm uPGNuyn5eQNcG3/5E5wXBQubWXOz28d4wblMqMh2vsj57ZZ0Vaxks/gpwEUpRDQHJqDy11uRf2VCD mnEsTSHI4EIHJ6tryT+vG0CruFCKnwS7tnGtQQNSDOn6vB2a+00+dvLRLYSH+M06mc+BcMZuLRVnR C+3onMRb3BaYC7DHYQgq97NFtqnVX2jOlQdgTIdwdLFnj0+/kaJVBtwDh/H0IV997KbIZ28HB45G+ 2JkYQiddkyLILJJ8OgxNw5lJCJYQgFW3pj37Y7767UzBex4ZcGKHVy/pUcK8zqG5b+BJ6KB89eOJt WYiIeIldg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtsRC-0004yx-59; Fri, 10 Jul 2020 12:47:34 +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 1jtsR7-0004wz-LE for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 12:47:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594385249; x=1625921249; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3dSAtd0YST9naogJUwhR283iRPreXicwpYimF4Vmvi0=; b=iAEGsQJIbz2QIwJd9GGxifSENkQEEskX8osCpOkgrEPgvyO93dTal5O+ qAu3zxe9vJQr9ZY6BevRZZ5NGVdrkSuuhSe7XpZLL9cAayHH8UTD/Ktit GZqFw5BxcSF7DvkYyJlKDHiSEInQb0wRfoySX8kip6ogWLXxp/icX0qZZ YtvzWhpr51OAZYzb7cb7Hof8reaXPm/5sy2BKZnEx8JSkYZwtkMJxvqZD QHGLqiIXyQCv1rRn4/oH9d1/k+UJY7NvgVTc5OtSNqgk0HrJvF2Na0hyY XXkyQHEH+jdoLNjz9SlbsF14Itp3ysthIHPzePFbRRvffwdWCn305KYqk w==; IronPort-SDR: SwZKNCbVMNiyrrtLkALj6JNq8fh0MZ2dVkj7HytbeXgGXnQikweAeLAJJZiauk3XXQbrW+8uNf bARdVIdkKIbaDpuw0Y0q1X69lwMLUcRxQcsGNpVxM63XK02v7LTkUYimiatzLPvANHSA4hDT0s VnF6QH+kB6ZDZSxKqfXEvytZGi608N7K5pOmZX1eBjV1cgjwfIFxSaxrDHYx/3U24KK3wKCoJI 6A58hGLNlafdyqhigrB7r25poiUmOZs+e1T2c0gW3X2FsJ0X8DMrkj+UlpOy7Ulbv7E8IOBsWa aM8= X-IronPort-AV: E=Sophos;i="5.75,335,1589266800"; d="scan'208";a="83305784" 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:29 -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.1979.3; Fri, 10 Jul 2020 05:47:01 -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:25 -0700 From: To: , , , Claudiu Beznea , , Subject: [PATCH v5 2/5] net: macb: mark device wake capable when "magic-packet" property present Date: Fri, 10 Jul 2020 14:46:42 +0200 Message-ID: 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_084729_924310_E7112A1C X-CRM114-Status: GOOD ( 11.63 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.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 [68.232.153.233 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -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 -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.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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" 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") 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 55e680f35022..4cafe343c0a2 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4422,7 +4422,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);