Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4826453ybl; Wed, 22 Jan 2020 05:28:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxV5VcMjfumhlYTLaS4Rz2FXH/ISYfnbMAkHo2tMr1fKnV3FxgnK48mB9jMB3bDB85+4HqN X-Received: by 2002:aca:c493:: with SMTP id u141mr6829814oif.62.1579699716126; Wed, 22 Jan 2020 05:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699716; cv=none; d=google.com; s=arc-20160816; b=T/bp6nzcV2AYuKf84cryM7Vyma4cJBoYeAxlQBcBM55aqrwJCIx/Jn7f7Z+QpHey97 4rLgb8r38oXeTv+dFlalHpk8sMoswANpftTFVk5N6pTRO5Ik95aaA3P39VILpzFyCvkd eeun9/TDBwNnvVTAI9WXPNWM1mvStFYOd+0WBZA7LBdyyLAFHDL2LCtJ8TzBC3Jvutka Z7NRavLaoMdHmSJFyxPeorv88MsfiCNr4SKkZQKEUVaN8fkcCljk1tOouuwvoA6Hp/+d 7hlBCiDQbMzO7sbLC9v1SojVRUhCa//XDCKSlyrTHC8w2shoZw0dv/gvSAaepv1qWuR2 iPkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Oejm+kz9tFGXU94cFemFDxevG0D/CmFkMCOyK9PtXdU=; b=Tv3RBTh29U/YVqycfxCUP67lNQgNAoAOYMSh3db/O3vH3xyNqaS7Y9OFp920rgHwYe nxptBMtSMhc09Qp1DsQoY34irzYDott1j1qstUJPyT7MMlvSC7JZWMGJFpmWXNm2GoQ0 jdnb+RjASZrCTXZt5KRaA3Hc/wdjk5xQ8YTf9vsH3fSh2j14hWDTIJQJT1sEV2uiUKU+ 8WkoWeLKIUE63rqVha8qUh6ejl33KWYb/yVKSGhJIzWD0E0D9oaZ3dmAXyBqxIAyvSZv wK8iuOsU9VRPxj4HNYwUCiT4lhYiCaeA1bvypKoAF3rXh/281RsH8RVo5wNQ+T4UhVfb 3R6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rAT8WlkK; 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 l14si18973051oii.37.2020.01.22.05.28.23; Wed, 22 Jan 2020 05:28:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rAT8WlkK; 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 S1731618AbgAVN0c (ORCPT + 99 others); Wed, 22 Jan 2020 08:26:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:47328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729163AbgAVN0b (ORCPT ); Wed, 22 Jan 2020 08:26:31 -0500 Received: from localhost (unknown [84.241.205.26]) (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 D787B2467B; Wed, 22 Jan 2020 13:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699590; bh=3TSY0k3j/NS0qp81sKVoj9zgSdog5u4XrMOmTpcP3dk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rAT8WlkKRiG/QTBSDZWy93uTXfPFwTUaKPzmfoSU+RZCkMllW3DrUOSx4FvhsC9N0 SyxkQliiMOB+WOlCjplREYIYOo1Su+DJdSWuZ50nWHG3eHuDY+6D837PW54QBjSS9I yb+2v6o6T8hBzXh/0Z4CvF1ftbmMEvPIhxhuVCeo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunihiko Hayashi , "David S. Miller" Subject: [PATCH 5.4 152/222] net: ethernet: ave: Avoid lockdep warning Date: Wed, 22 Jan 2020 10:28:58 +0100 Message-Id: <20200122092844.606889750@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kunihiko Hayashi [ Upstream commit 82d5d6a638cbd12b7dfe8acafd9efd87a656cc06 ] When building with PROVE_LOCKING=y, lockdep shows the following dump message. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. ... Calling device_set_wakeup_enable() directly occurs this issue, and it isn't necessary for initialization, so this patch creates internal function __ave_ethtool_set_wol() and replaces with this in ave_init() and ave_resume(). Fixes: 7200f2e3c9e2 ("net: ethernet: ave: Set initial wol state to disabled") Signed-off-by: Kunihiko Hayashi Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/socionext/sni_ave.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct n phy_ethtool_get_wol(ndev->phydev, wol); } -static int ave_ethtool_set_wol(struct net_device *ndev, - struct ethtool_wolinfo *wol) +static int __ave_ethtool_set_wol(struct net_device *ndev, + struct ethtool_wolinfo *wol) { - int ret; - if (!ndev->phydev || (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) return -EOPNOTSUPP; - ret = phy_ethtool_set_wol(ndev->phydev, wol); + return phy_ethtool_set_wol(ndev->phydev, wol); +} + +static int ave_ethtool_set_wol(struct net_device *ndev, + struct ethtool_wolinfo *wol) +{ + int ret; + + ret = __ave_ethtool_set_wol(ndev, wol); if (!ret) device_set_wakeup_enable(&ndev->dev, !!wol->wolopts); @@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *n /* set wol initial state disabled */ wol.wolopts = 0; - ave_ethtool_set_wol(ndev, &wol); + __ave_ethtool_set_wol(ndev, &wol); if (!phy_interface_is_rgmii(phydev)) phy_set_max_speed(phydev, SPEED_100); @@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev ave_ethtool_get_wol(ndev, &wol); wol.wolopts = priv->wolopts; - ave_ethtool_set_wol(ndev, &wol); + __ave_ethtool_set_wol(ndev, &wol); if (ndev->phydev) { ret = phy_resume(ndev->phydev);