From patchwork Thu Nov 29 08:06:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 152369 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2086787ljp; Thu, 29 Nov 2018 00:06:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/XQgm2E9huo7AB4RPZFaFBrX6Z2DvMwL7vmQQPOVi245XbT6uIRo3zvLHmKX2vACwfzG8hh X-Received: by 2002:a63:f901:: with SMTP id h1mr419099pgi.154.1543478809786; Thu, 29 Nov 2018 00:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543478809; cv=none; d=google.com; s=arc-20160816; b=n0kNUxhyadt71I2VHXImA0X+NOifD3UtnAviIDmLn27h7K3l206wAw9NGonIoGt7oH c0BvlhRBItLDRPSyjelPgPkx3cZuwv+3uA4ZCpTFVp9PEUWcINnnhS7s9ZGXX68dMmF3 jd+pcHq5++VVRCdbxhZAd8aBfQv+RvdMOWsdL/rTSoF4LPNZxorNSrj0L/rJCl5GxEwI C80+5rwE390Kf08I57VtePhVllGRc/TjmcFMNLTW9V1IkD6kDkao2W+Ff3ME90/GYp1g TuSJ+Cu+owozOZDQuMoo4mTAJGElHeKXak7F18zthxS7EjB/E0B5BYO/e7zVoc8FzwC5 Bgng== 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=P7MErgPO1kK6Vbfug1blnhwCr2p9n8BQHaO8/wvwEtk=; b=bbIZ6S64XXL5lAju4DlK97YCW04s2mmzDaq1z48hSPUeeLWMIDecEazhyCjpvz8wWd dUHtBEetWo9WOrNJpQ5I7Lo6zNjJUBhEBK7YOM7jr2FUxumUiE/QCuuhLUTa/kjopsxg OWpxDU2hPqNK2qf026U9EcGuHwVC3aNnyReXQqda6Dnu9swMGUxTBmmZ1L7vLSCCBIf3 en3gfUG56JaartPgbuWaZ5hjEJVmASAJ3L8l/vFmdFGzYm2jGEov8Gej8+HCLyF4UHpu lKafzVzMmuMQiNXBbP/Nrxwxr42cffcTDaqB0BG2ZtVMaIigtkvZ88TccgNH7Ds6JW/q u68w== 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 f65si1573192pfb.194.2018.11.29.00.06.49; Thu, 29 Nov 2018 00:06:49 -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 S1727698AbeK2TLS (ORCPT + 32 others); Thu, 29 Nov 2018 14:11:18 -0500 Received: from mx.socionext.com ([202.248.49.38]:4099 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbeK2TLR (ORCPT ); Thu, 29 Nov 2018 14:11:17 -0500 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 29 Nov 2018 17:06:46 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 2B3C3180BCB; Thu, 29 Nov 2018 17:06:46 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Thu, 29 Nov 2018 17:06:46 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id C6D111A03A2; Thu, 29 Nov 2018 17:06:45 +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 2/3] net: ethernet: ave: Set initial wol state to disabled Date: Thu, 29 Nov 2018 17:06:32 +0900 Message-Id: <1543478793-13719-3-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 If wol state of phy hardware is enabled after reset, phy_ethtool_get_wol() returns that wol.wolopts is true. However, since net_device.wol_enabled is zero and this doesn't apply wol state until calling ethtool_set_wol(), so mdio_bus_phy_may_suspend() returns true, that is, it's in a state where phy can suspend even though wol state is enabled. In this inconsistency, phy_suspend() returns -EBUSY, and at last, suspend sequence fails with the following message: dpm_run_callback(): mdio_bus_phy_suspend+0x0/0x58 returns -16 PM: Device 65000000.ethernet-ffffffff:01 failed to suspend: error -16 PM: Some devices failed to suspend, or early wake event detected In order to fix the above issue, this patch forces to set initial wol state to disabled as default. Signed-off-by: Kunihiko Hayashi --- drivers/net/ethernet/socionext/sni_ave.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index 64115b1..ac96fb9 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -1208,9 +1208,13 @@ static int ave_init(struct net_device *ndev) priv->phydev = phydev; - phy_ethtool_get_wol(phydev, &wol); + ave_ethtool_get_wol(ndev, &wol); device_set_wakeup_capable(&ndev->dev, !!wol.supported); + /* set wol initial state disabled */ + wol.wolopts = 0; + ave_ethtool_set_wol(ndev, &wol); + if (!phy_interface_is_rgmii(phydev)) phy_set_max_speed(phydev, SPEED_100);