Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3614821pxj; Mon, 21 Jun 2021 02:46:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNfOtsre3wO3QPgM2X2lZ8h0SBfcanDFhxroF+YFJrLTmNIOTpXtRaCGeND92H/Xo0CC7t X-Received: by 2002:a05:6e02:1848:: with SMTP id b8mr3569676ilv.107.1624268806932; Mon, 21 Jun 2021 02:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624268806; cv=none; d=google.com; s=arc-20160816; b=z9bYk1hnNBr8AmiJ3H5heLfyLwHZbewIqvFqhzBd92Ud1yqXjszCukL8sv4gSZ93Hw nXm/SeNsK8/u73p2WfyigO/Qj73An61l6C4AGfs/TFGKS0YPtWlzOh4EMrEe7ri1KTCF PF+F9QNVuTl2C4X3/FXu4e0zwA2DgJ7OknLeIEn/TGGiZ76rzXPUX9AD1jnjUBitLTZG 19i5ByWQ300X2YIz4sDqqNJTHH403H1ZlUEQcrrFdnGwPrA4a7muLotyRP6ZbChbDwVP E2E+t/gG08V/yA8c2OC7+vgYB9cfuZ9woJ6Zp45zALt0U1/sL/LuXiMEiDRkj2wU04w4 kkNQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=n7qDBFDOOutqpWfSUuF5leRzsI1zvf05ybemYLdIb2w=; b=MMWQUooYWhoHkGdZdFvz9LBMMcMunH+nuTfUSXLI3LJfS3bP2MGaqw2Ll7emIdzZHl ukHGOBvYnFkH7i8T1oxeFOnEGiyPgPzntQRiZkO6AqKtK4jlMIpe4mycufKoz6oY28c9 RRlU3/39xQDaepg7+GjCR9ikXkA2FMWu7KI0fDUrhwPv31hrr0k03IRFAa6EvVfHPVDx WnJ1GLQPGFapAzcDMxFN233F+RjtzJZYzF2f88+my6R9wrbBspbur6D+IISQt4ahJgwY oc0kiVX5Ls59K6m6uPhl6Zf7+YZ4mWOlJuy8Zl12lJL6mfVuNLvDgKcgunm68barvP/X EShA== 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 q24si13494462jav.15.2021.06.21.02.46.35; Mon, 21 Jun 2021 02:46:46 -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 S230291AbhFUJsP (ORCPT + 99 others); Mon, 21 Jun 2021 05:48:15 -0400 Received: from mga18.intel.com ([134.134.136.126]:3842 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbhFUJsP (ORCPT ); Mon, 21 Jun 2021 05:48:15 -0400 IronPort-SDR: ACKINIfdYFznCtK5tu8GZSp/ZmGJga/zHav6t9gh2QtbWfFvweCqGdsqCnfjDAmp9BjkzeEzy/ 1TGPs5XuBcOA== X-IronPort-AV: E=McAfee;i="6200,9189,10021"; a="194122097" X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="194122097" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2021 02:45:57 -0700 IronPort-SDR: UYcFbSaQpm9HP8pM6XRraAIQTHeKL9oInUzshZB5a+JJ/FV65qNZQVGpiocM2/Rs0dUiJ9nNoP TGDPEiytJ4pA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="638720260" Received: from peileeli.png.intel.com ([172.30.240.12]) by fmsmga006.fm.intel.com with ESMTP; 21 Jun 2021 02:45:52 -0700 From: Ling Pei Lee To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin , Russell King , Ong Boon Leong , Voon Weifeng , Wong Vee Khee , Wong Vee Khee , Tan Tee Min , Michael Sit Wei Hong , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: pei.lee.ling@intel.com Subject: [PATCH net-next V1 1/4] net: stmmac: option to enable PHY WOL with PMT enabled Date: Mon, 21 Jun 2021 17:45:33 +0800 Message-Id: <20210621094536.387442-2-pei.lee.ling@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210621094536.387442-1-pei.lee.ling@intel.com> References: <20210621094536.387442-1-pei.lee.ling@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current stmmac driver WOL implementation will enable MAC WOL if MAC HW PMT feature is on. Else, the driver will check for PHY WOL support. There is another case where MAC HW PMT is enabled but the platform still goes for the PHY WOL option. E.g, Intel platform are designed for PHY WOL but not MAC WOL although HW MAC PMT features are enabled. Introduce use_phy_wol platform data to select PHY WOL instead of depending on HW PMT features. Set use_phy_wol will disable the plat->pmt which currently used to determine the system to wake up by MAC WOL or PHY WOL. Signed-off-by: Ling Pei Lee --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0a266fa0af7e..a3b79ddcf08e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6533,7 +6533,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv) * register (if supported). */ priv->plat->enh_desc = priv->dma_cap.enh_desc; - priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; + priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up && + !priv->plat->use_phy_wol; priv->hw->pmt = priv->plat->pmt; if (priv->dma_cap.hash_tb_sz) { priv->hw->multicast_filter_bins = diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index e55a4807e3ea..9496e6c9ee82 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -263,5 +263,6 @@ struct plat_stmmacenet_data { int msi_sfty_ue_vec; int msi_rx_base_vec; int msi_tx_base_vec; + bool use_phy_wol; }; #endif -- 2.25.1