Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4037626pxv; Mon, 28 Jun 2021 20:11:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0FrFMu2YR0OqZMoRmA/vXXABnYxj3Zqt2sicXbJiFqLrfq0ZendxA3/fjoYHjEGNlYHda X-Received: by 2002:a17:906:ae85:: with SMTP id md5mr27688395ejb.93.1624936317834; Mon, 28 Jun 2021 20:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624936317; cv=none; d=google.com; s=arc-20160816; b=r84Z8DXgQyOINSMtrnX720tP79UHOG/P7iGL8wGHpvFkLrcXXU7iOlTykSxKhI6rEk iWx6k6fU+0vKZyjcR1zT2eawcHIK28tY6qN1tidchwzNlbdAtofCaB8OeKatVebacD0k JxRQ8uwDt9Z/b3JXDBB/y5oq/hDPqUXp3NbbngCIAAUJKMvhkuFjf4zfKymgDmPdT5D4 F/TFN9hHtXKlcnXZV2I60ZZ4hP6GHoj0mMIVcYK1Go0X716M+1VT9Ap3ZZmDpEL6K1NE 1tg4CoHlA3nltTVzCxhikMWfBSwn4KBn086qnUyaH6pGSmPQEzF2kz0CDCSOzB95vZO7 p7Eg== 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; bh=n7qDBFDOOutqpWfSUuF5leRzsI1zvf05ybemYLdIb2w=; b=pL8lQpsCQGV+gu3qBddQ67sdvwMHpBtieGpRcfhWJWpBf/PN0abQpVQOz7HDf7hNJi KCriFKMhrgMfzOFYscXXJCk5sS1bvJEidvl+KdGWZ3wjz/9DDO+TZufbmmIuHkjHg/9w lyCep6bpuKDCHCuWH6MujYii+4+LpWMzF4qGHI0lVFRp0yqyBIbWAs1ifpzmJMAy2FgL Vu+oVgsMbvifT6ay4F8505P3iFz+2i6uT1fWZOXNadZv1N+j6zd4zvy0qjRKmWnJ1yMU eTQshE3DvbNUmPVOuVPKkDeNvKPSma+sxbmXp26Jz+WJuVAi2jlIt28IVt4DAYHVcTcf TOmg== 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 m27si15780225ejn.47.2021.06.28.20.11.34; Mon, 28 Jun 2021 20:11:57 -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 S231932AbhF2DNE (ORCPT + 99 others); Mon, 28 Jun 2021 23:13:04 -0400 Received: from mga14.intel.com ([192.55.52.115]:18882 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbhF2DNA (ORCPT ); Mon, 28 Jun 2021 23:13:00 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10029"; a="207893964" X-IronPort-AV: E=Sophos;i="5.83,307,1616482800"; d="scan'208";a="207893964" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2021 20:10:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,307,1616482800"; d="scan'208";a="558597302" Received: from peileeli.png.intel.com ([172.30.240.12]) by fmsmga001.fm.intel.com with ESMTP; 28 Jun 2021 20:10:27 -0700 From: Ling Pei Lee To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , davem@davemloft.net, Jakub Kicinski , Maxime Coquelin , Russell King , weifeng.voon@intel.com, boon.leong.ong@intel.com, vee.khee.wong@linux.intel.com, vee.khee.wong@intel.com, tee.min.tan@intel.com, michael.wei.hong.sit@intel.com, 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 V2 1/3] net: stmmac: option to enable PHY WOL with PMT enabled Date: Tue, 29 Jun 2021 11:08:57 +0800 Message-Id: <20210629030859.1273157-2-pei.lee.ling@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629030859.1273157-1-pei.lee.ling@intel.com> References: <20210629030859.1273157-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