From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C239C11F64 for ; Tue, 29 Jun 2021 03:10:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 738C161CD8 for ; Tue, 29 Jun 2021 03:10:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbhF2DNG (ORCPT ); Mon, 28 Jun 2021 23:13:06 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F87BC11F64 for ; Tue, 29 Jun 2021 03:12:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41B9D61D0E for ; Tue, 29 Jun 2021 03:12:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41B9D61D0E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=64aBnTAjLq12QjjK+LujIrJ5IWltU6prvCRXtAgnlyA=; b=OcUHozx9xCkt76 BfYsoJb8r4pOwrpkmunaqAqoa3C0YZOdE+NFXblis1TPViKjShACuutirSR51jaxSTek4bdGuBecA tI+FRuC7Xgw30kM2IwoaVCdnP2gqxgQlQv+8Z0BFU1ZgagJP3+DLZrObbEsE8ufDz+GoCILr7vrb8 CcIgwlpqohCXUoI0jwf12KJvirxB0oIwyd/XXKW/TDs/as9VCwUDUTgYIe10WW3kovMTAfbQWKufm uUg5JolfUtM87LQT1JUr9tWTdlstq44T+je/Te6jiUqiEh2byer0n/kX4Hl7B0RHA8Bq4838tRRV3 BiSHcrcHO83x0JnhRUBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly496-009gFd-LY; Tue, 29 Jun 2021 03:10:44 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly48u-009gDf-04 for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 03:10:33 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10029"; a="271931385" X-IronPort-AV: E=Sophos;i="5.83,307,1616482800"; d="scan'208";a="271931385" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_201032_121289_E2BB50EF X-CRM114-Status: GOOD ( 15.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel