From patchwork Thu Nov 29 08:06:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 152370 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2086836ljp; Thu, 29 Nov 2018 00:06:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/XigxFyIYb4/92P7NYlCtzgfp4ftgI2c3hl3ByyUY7DCM1Wi+DjLTPx9dD1dr0RSN20g7dJ X-Received: by 2002:a63:fe48:: with SMTP id x8mr398677pgj.261.1543478813318; Thu, 29 Nov 2018 00:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543478813; cv=none; d=google.com; s=arc-20160816; b=xh7sYz+MFGjeDEnYbtDK2kLU8N7b73doaLUjZXgLRK6x2Hv6noVAZa2TvuXL2C67Ex IcBJlm4xXBWkg48o0qvoo7/LvocvoZ4iCwObQMXlDBFpNeCtqekwNkAHRHAfb3u6+Gi1 hQcmirRkdwhb71hcLYq7A5cqgDmM1s6HhKnEoOLvqMKD3pLL0oSQVi8txQRmqSVathMr xTufTpTpjaOWii65UmUdwGknDEh2fb5tJl5KaIrGoN0CYCE5IVU5dRtVReBWBrFxR9Td xBzM5VDk0ERJ++fQWW7kJ+FIeNny3upKHl7+e9MCpeX1YlaLi9TntL69d+6fW+8FAfiF 4YYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=MBxYjwzV0QdBHIQV/sRW1xDtbSnDVui4puWNvX6jg/s=; b=OmBz0pxf44kthkufAv05cXt3mslFbLPKf5MoHFOjZTyHG5HNUSZXh+L8bFpjKS4iQ0 inX+dGzMgdXdlvceIm0ck6lyX0lps8znTYGHfetPGYYh9eRKzOI7f7U9/RXRm1qI0qSK caOe9EyAlsl/99fydKmRSocT/xWD6xeAnGlyiFf9evdfjaZFVtBoefUhs6oQqpw8jziB GdQclXg6Um1A8W9DvNYscEo06thRNsuxTv5WlnoINOros7gY9XqhJz2pFcIuOBzLGykS tchxJmX2D485gStHHTRTYaLtkViQPP4kXLkUEhtsYkGsUaKQNH7DXcF50P6MvpieBmrc +wUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si1348457pfi.184.2018.11.29.00.06.52; Thu, 29 Nov 2018 00:06:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbeK2TLT (ORCPT + 32 others); Thu, 29 Nov 2018 14:11:19 -0500 Received: from mx.socionext.com ([202.248.49.38]:4094 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbeK2TLS (ORCPT ); Thu, 29 Nov 2018 14:11:18 -0500 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 29 Nov 2018 17:06:47 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 5C01060062; Thu, 29 Nov 2018 17:06:47 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Thu, 29 Nov 2018 17:06:47 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id BD2511A03A2; Thu, 29 Nov 2018 17:06:46 +0900 (JST) From: Kunihiko Hayashi To: "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH net-next 3/3] net: ethernet: ave: Preserve wol state in suspend/resume sequence Date: Thu, 29 Nov 2018 17:06:33 +0900 Message-Id: <1543478793-13719-4-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543478793-13719-1-git-send-email-hayashi.kunihiko@socionext.com> References: <1543478793-13719-1-git-send-email-hayashi.kunihiko@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the wol state forces to be initialized after reset, the state should be preserved in suspend/resume sequence. Signed-off-by: Kunihiko Hayashi --- drivers/net/ethernet/socionext/sni_ave.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index ac96fb9..8c1e120 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -261,6 +261,7 @@ struct ave_private { struct regmap *regmap; unsigned int pinmode_mask; unsigned int pinmode_val; + u32 wolopts; /* stats */ struct ave_stats stats_rx; @@ -1741,6 +1742,7 @@ static int ave_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int ave_suspend(struct device *dev) { + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; struct net_device *ndev = dev_get_drvdata(dev); struct ave_private *priv = netdev_priv(ndev); int ret = 0; @@ -1750,17 +1752,25 @@ static int ave_suspend(struct device *dev) netif_device_detach(ndev); } + ave_ethtool_get_wol(ndev, &wol); + priv->wolopts = wol.wolopts; + return ret; } static int ave_resume(struct device *dev) { + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; struct net_device *ndev = dev_get_drvdata(dev); struct ave_private *priv = netdev_priv(ndev); int ret = 0; ave_global_reset(ndev); + ave_ethtool_get_wol(ndev, &wol); + wol.wolopts = priv->wolopts; + ave_ethtool_set_wol(ndev, &wol); + if (ndev->phydev) { ret = phy_resume(ndev->phydev); if (ret)