Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4489419pxv; Tue, 6 Jul 2021 02:06:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2Spuy1LyFjD8wgc77f2gBdkTaMnTZgCuXcHTahlhk1hPI5ZGKJejyVyjinNSRhe1fPo7k X-Received: by 2002:aa7:d554:: with SMTP id u20mr21694123edr.50.1625562379478; Tue, 06 Jul 2021 02:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625562379; cv=none; d=google.com; s=arc-20160816; b=YnLl/nWSFlZUTf/XHd+UK0LGZrKtEVGQFCaMZ/whyxxshp6rmeg/WD4bUlQPSxFtsD Eb3uSAL+xdDz7DToxaJYnlxvv9LcoLCGJl7XhfigoJQJSKq8dxWEzNHHrxwtYNr2qNeM RghQy74Gn3tMPOfpvmuNmKNzJeeELMLKMVAwt2aN3guvRvDcAK/IrUK1Wx3ED6aHUyW0 LLeeqTokMKFTNkYgMSZclEaP54fRBAPHzhSrdIYWEBPR9I/i92yRTkVnr8ygs9XomqVG LbDHkflQXR0HhzJv8DTLi/kb0SqTGBwscz1D0yafE0kWZijYbZzOYgTSZvQ3FZAVQ/SP P9Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YtgdfFYeErO6WhtSnP8IuJfxC6JKU1ajZ10QSWoqgq0=; b=lUmRaM24kdtHA3y3ax8y7ARjOFS6SqeFwEJJzrSnBi6DAX/iFS9dQSCaiBEr0YPW0D Njyzjcyyey18jnaRn8VrgcLnKe2agoDYRWYxflr2ywtW+xiE+juY4s/RXdT4SCgPw9Cq 3ZCQUEvHWw8KGcGVIk72I08Z9xjQMEQf7xz/f6tSX7xFqg+GPZ0Hhza+AQG+tmBh33ch kos4YMRutUOkPq2P99Yu2/CYSLU2/Icy0t9jt6fpqyMWffG/dOxytbT26hwpd8b7M77o cc6Rc4o7iolt/YbIgVv2vw9wnKwMqWaLEmk7q2F+eQtQGWm9MUskDmh85+FlTe2x1E42 uwPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si13923552edq.548.2021.07.06.02.05.56; Tue, 06 Jul 2021 02:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbhGFJFO (ORCPT + 99 others); Tue, 6 Jul 2021 05:05:14 -0400 Received: from mga06.intel.com ([134.134.136.31]:47823 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbhGFJFN (ORCPT ); Tue, 6 Jul 2021 05:05:13 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10036"; a="270202644" X-IronPort-AV: E=Sophos;i="5.83,328,1616482800"; d="scan'208";a="270202644" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 02:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,328,1616482800"; d="scan'208";a="559882172" Received: from peileeli.png.intel.com ([172.30.240.12]) by orsmga004.jf.intel.com with ESMTP; 06 Jul 2021 02:02:30 -0700 From: Ling Pei Lee To: Andrew Lunn , Heiner Kallweit , Russell King , davem@davemloft.net, Jakub Kicinski , Ioana Ciornei , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pei.lee.ling@intel.com, weifeng.voon@intel.com, vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com, mohammad.athari.ismail@intel.com Subject: [PATCH net] net: phy: skip disabling interrupt when WOL is enabled in shutdown Date: Tue, 6 Jul 2021 17:02:09 +0800 Message-Id: <20210706090209.1897027-1-pei.lee.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mohammad Athari Bin Ismail PHY WOL requires WOL interrupt event to trigger the WOL signal in order to wake up the system. Hence, the PHY driver should not disable the interrupt during shutdown if PHY WOL is enabled. Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure") Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: Ling PeiLee --- drivers/net/phy/phy_device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 1539ea021ac0..f4b88f613dc1 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2994,9 +2994,13 @@ static int phy_remove(struct device *dev) static void phy_shutdown(struct device *dev) { + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; struct phy_device *phydev = to_phy_device(dev); - phy_disable_interrupts(phydev); + /* If the device has WOL enabled, don't disable interrupts. */ + phy_ethtool_get_wol(phydev, &wol); + if (!wol.wolopts) + phy_disable_interrupts(phydev); } /** -- 2.25.1