From patchwork Tue Jan 14 02:01:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54B541398 for ; Mon, 13 Jan 2020 10:13:53 +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 270AC2084D for ; Mon, 13 Jan 2020 10:13:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u/Kjizde" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 270AC2084D 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EU7ygPdh6DRdge5xyKzNzOOyRpVEOLtYmM+OfsU9R0M=; b=u/KjizdeagLqr/8g+C+vmYCAjy YCB1vK+lFbX8xsxt2wVLTJVb2yHa4EAq4+4V3RmD0fNBgAZIS+N1/UziA62KPgCZ/Dv9AmS6Nbrl/ 88nw7F+Ou6Y+APgswYnBc64KNrlEX81yZ7WgUJ+cvjv9TRGflXPfPxa0Ssl2NQ8HZyj0xOvRNrNza vxMl3kiJOhQ64xaEeLYETgbEP9VsoJLILe5UwelPmx4cerUYgAhvEl1KsCRjMfLcjXZ7QIGkrHftc MmPVtOTxizOZn3wXAHQlZit+ZMvMpV4FR8X6W+8jXvKixkd1FD6CDidTENj0gTcAQ4IK1atuGtESC dc84/ZRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwjG-0008E5-F3; Mon, 13 Jan 2020 10:13:50 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwiu-0007iW-7f for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:29 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116758" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:24 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 1/7] net: stmmac: fix error in updating rx tail pointer to last free entry Date: Tue, 14 Jan 2020 10:01:10 +0800 Message-Id: <1578967276-55956-2-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021328_286600_6F97EDF7 X-CRM114-Status: GOOD ( 14.44 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DMA_CH(#i)_RxDesc_Tail_Pointer points to an offset from the base and indicates the location of the last valid descriptor. The change introduced by "net: stmmac: Update RX Tail Pointer to last free entry" incorrectly updates the RxDesc_Tail_Pointer and causess Rx operation to freeze in corner case. The issue is explained as follow:- Say, cur_rx=1 and dirty_rx=0, then we have dirty=1 and entry=0 before the while (dirty-- > 0) loop of stmmac_rx_refill() is entered. When the while loop is 1st entered, Rx buffer[entry=0] is refilled and after entry++, then, entry=1. Now, the while loop condition check "dirty-- > 0" and the while loop bails out because dirty=0. Up to this point, the driver code works correctly. However, the current implementation sets the Rx Tail Pointer to the location pointed by dirty_rx, just updated to the value of entry(=1). This is incorrect because the last Rx buffer that is refileld with empty buffer is with entry=0. In another words, the current logics always sets Rx Tail Pointer to the next Rx buffer to be refilled (too early). So, we fix this by tracking the index of the most recently refilled Rx buffer by using "last_refill" and use "last_refill" to update the Rx Tail Pointer instead of using "entry" which points to the next dirty_rx to be refilled in future. Fixes: 858a31ffc3d9 ("net: stmmac: Update RX Tail Pointer to last free entry") Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 80d59b7..a317f67 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3417,6 +3417,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue) struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; int len, dirty = stmmac_rx_dirty(priv, queue); unsigned int entry = rx_q->dirty_rx; + unsigned int last_refill = entry; len = DIV_ROUND_UP(priv->dma_buf_sz, PAGE_SIZE) * PAGE_SIZE; @@ -3471,12 +3472,13 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue) dma_wmb(); stmmac_set_rx_owner(priv, p, use_rx_wd); - + last_refill = entry; entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } + rx_q->dirty_rx = entry; rx_q->rx_tail_addr = rx_q->dma_rx_phy + - (rx_q->dirty_rx * sizeof(struct dma_desc)); + (last_refill * sizeof(struct dma_desc)); stmmac_set_rx_tail_ptr(priv, priv->ioaddr, rx_q->rx_tail_addr, queue); } From patchwork Tue Jan 14 02:01:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 826686C1 for ; Mon, 13 Jan 2020 10:14:06 +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 5CA022084D for ; Mon, 13 Jan 2020 10:14:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eOxBQr08" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CA022084D 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DbncZuWs0UwejLtoJb2mr/nygeJlbhTdTK3Fg5bwY0U=; b=eOxBQr08b/PZfejJ6fniFLdmsk 77UjGXjljroqxZjKh8ftqreqqMJqxU1QNv7C/qCi2s5fHysRhCOfiuZIUMMCNplbDbPUgFRivZeiF 8s79JqYKwSQOu8Mam1kq9lQt+8voJnk19+GLnPv1sUxIAgR2pz1w7yO+6oI88DGtZbSL6fOX0R0W1 L1z56W3OhCaZLaV9PiK+b9W0bR0m1y0jZ2YIjluon7jHPGl4e6e4UbId0/z1XMY1u4SJb5RpN5Oq2 wkTZzuEZaJpJzUm/2ZbOwR+hfLj733aw8SWHsrcCauYETcqr/3FssFb3MxK2Sv+WQPbaefQHySomD lwTXRetA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwjU-0008RU-Vk; Mon, 13 Jan 2020 10:14:04 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwiy-0007iW-0h for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:33 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116774" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:28 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 2/7] net: stmmac: Fix incorrect location to set real_num_rx|tx_queues Date: Tue, 14 Jan 2020 10:01:11 +0800 Message-Id: <1578967276-55956-3-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021332_105685_2C66B0EA X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Aashish Verma netif_set_real_num_tx_queues() & netif_set_real_num_rx_queues() should be used to inform network stack about the real Tx & Rx queue (active) number in both stmmac_open() and stmmac_resume(), therefore, we move the code from stmmac_dvr_probe() to stmmac_hw_setup(). Fixes: c02b7a914551 ("net: stmmac: use netif_set_real_num_{rx,tx}_queues") Signed-off-by: Aashish Verma Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a317f67..cd55d16 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2624,6 +2624,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) if (priv->dma_cap.vlins) stmmac_enable_vlan(priv, priv->hw, STMMAC_VLAN_INSERT); + /* Configure real RX and TX queues */ + netif_set_real_num_rx_queues(dev, priv->plat->rx_queues_to_use); + netif_set_real_num_tx_queues(dev, priv->plat->tx_queues_to_use); + /* Start the ball rolling... */ stmmac_start_all_dma(priv); @@ -4624,10 +4628,6 @@ int stmmac_dvr_probe(struct device *device, stmmac_check_ether_addr(priv); - /* Configure real RX and TX queues */ - netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); - netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use); - ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | From patchwork Tue Jan 14 02:01:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329871 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D629C1398 for ; Mon, 13 Jan 2020 10:14:23 +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 933632081E for ; Mon, 13 Jan 2020 10:14:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SX2chY22" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 933632081E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QJ1xCjrW1IgEkaPebk/1cCWWBQDrdPf8oGwWSmzHKdk=; b=SX2chY22HTipaUwyn2jy3j1H4s ZFw55BC97dbxESLao+Tl17FnRILTr6UPymAs1aJtKvDD35wjlnZtjUPMIr1pt1VRapvgtUxF2ZE2x oDwUGAzEa1qt407T7dEfouAtU2q4jSgcbLklMGVc2LHpBv33byeOCGjzg+N/J7IpwxSnDhWqoZru+ 82MKBFVqYwhBy8SrDCe9tzpQH/q2E+PSLDTCk2YRdf+lEQ6jNQF1yq8REzc23JNA+I+W1B/VDsRl1 i+l62lHCixb/uzBd5a82y6nh7A0bsvwKBuvXKHmcWCY40bDZcuogmPLghj1NHQ+mZlxtpUJd2/2Yr BGYhMoeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwjk-0000F6-1d; Mon, 13 Jan 2020 10:14:20 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwj1-0007iW-23 for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:36 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116794" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:31 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 3/7] net: stmmac: fix missing netdev->features in stmmac_set_features Date: Tue, 14 Jan 2020 10:01:12 +0800 Message-Id: <1578967276-55956-4-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021335_133485_E62FE19C X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fixes: d2afb5bdffde ("stmmac: fix the rx csum feature") Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index cd55d16..dc739cd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3911,6 +3911,8 @@ static int stmmac_set_features(struct net_device *netdev, for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++) stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan); + netdev->features = features; + return 0; } From patchwork Tue Jan 14 02:01:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAAA31398 for ; Mon, 13 Jan 2020 10:14:37 +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 C8C5A2081E for ; Mon, 13 Jan 2020 10:14:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AvCeQX6T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8C5A2081E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XniBK6UJn4hDdH8837VHT+AlQFCb7qKUYQCpM2QZC8k=; b=AvCeQX6TH8TfEHMqQW7HB6LFaH 13uWikNcgTzt+xXLELfMu5DbA6QZErGs7qat5usEoq3jz9gF/k5ywys65DSOvxYVTOopYhcFELCbh AvbZCSfctB4xp8ERdh4eKgyD+ivmLeU8lLSyA06+f3TDzhuIcNcn+iE6xS0WEVWMF+K3NgNEALmQ6 VZGZsamf1ffhVlwBet6PfWvIC0zdJfAiN3fWYCDnKxFmE/C/ET30+QDZDUwyVjRpMpu8n72/RIIPj Bl32oPxH63mTrDcOCkIahpHmpp5F+++76BZJAI+3q6IWQqkb/ZlJQZdByRpcB8Pth6QsKtgV9/Z0c BSDIyp6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwk0-0000UH-4O; Mon, 13 Jan 2020 10:14:36 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwj4-0007iW-EM for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:39 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116812" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:35 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 4/7] net: stmmac: Fix priority steering for tx/rx queue >3 Date: Tue, 14 Jan 2020 10:01:13 +0800 Message-Id: <1578967276-55956-5-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021338_533446_2E844C8A X-CRM114-Status: GOOD ( 11.37 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Voon Weifeng Fix MACRO function define for TX and RX user priority queue steering for register masking and shifting. Fixes: a8f5102af2a7 ("net: stmmac: TX and RX queue priority configuration") Signed-off-by: Voon Weifeng Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h index 2dc70d1..798a53a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h @@ -97,12 +97,14 @@ #define GMAC_RX_FLOW_CTRL_RFE BIT(0) /* RX Queues Priorities */ -#define GMAC_RXQCTRL_PSRQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -#define GMAC_RXQCTRL_PSRQX_SHIFT(x) ((x) * 8) +#define GMAC_RXQCTRL_PSRQX_MASK(x) GENMASK(7 + (((x) % 4) * 8), \ + 0 + (((x) % 4) * 8)) +#define GMAC_RXQCTRL_PSRQX_SHIFT(x) (((x) % 4) * 8) /* TX Queues Priorities */ -#define GMAC_TXQCTRL_PSTQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -#define GMAC_TXQCTRL_PSTQX_SHIFT(x) ((x) * 8) +#define GMAC_TXQCTRL_PSTQX_MASK(x) GENMASK(7 + (((x) % 4) * 8), \ + 0 + (((x) % 4) * 8)) +#define GMAC_TXQCTRL_PSTQX_SHIFT(x) (((x) % 4) * 8) /* MAC Flow Control TX */ #define GMAC_TX_FLOW_CTRL_TFE BIT(1) From patchwork Tue Jan 14 02:01:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BE956C1 for ; Mon, 13 Jan 2020 10:14:57 +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 D5E252081E for ; Mon, 13 Jan 2020 10:14:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IsbBqm1X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5E252081E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=sFgi/UEkZr7rl8qNN5xfVbcOQmwPR7JYNkMHzrkSPtA=; b=IsbBqm1XGEy51cYYORFR89jICN gDCKbr/qyOfbae9AE8GT8ZQPkwmKSTveO699HkxGeangH+mdFcsiHuYV+GRyjHkYfgFBklxOFhnl0 f/gBgP5o52qHOuIs/4hfA86Ds8DaNQ04AGz/sQSLJFIv1rXbh9ntioN3E4glfMMXcNHbeIfchdTV1 HnuyM7a9Ns3EBzicC5q4rwr3bms905e9gDvwUhFSriDx9FzUsNt9z3bHb+kn6GIUg+CIdpVpW6dgu 5tAXGWWS8WK+cIbBajY1HjTYtyt7Rb1GgZRhW5wujuyKjmTwRkowMTn7Zu1Zdz+60WAoEBMeEWjQZ QkAtkAVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwkI-0000lN-NG; Mon, 13 Jan 2020 10:14:54 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwj7-0007iW-TK for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:43 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116822" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:38 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 5/7] net: stmmac: fix incorrect GMAC_VLAN_TAG register writting implementation Date: Tue, 14 Jan 2020 10:01:14 +0800 Message-Id: <1578967276-55956-6-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021341_974718_68114718 X-CRM114-Status: GOOD ( 11.69 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: "Tan, Tee Min" It should always do a read of current value of GMAC_VLAN_TAG instead of directly overwriting the register value. Fixes: c1be0022df0d ("net: stmmac: Add VLAN HASH filtering support in GMAC4+") Signed-off-by: Tan, Tee Min Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 40ca00e..6e3d0ab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -736,11 +736,14 @@ static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash, __le16 perfect_match, bool is_double) { void __iomem *ioaddr = hw->pcsr; + u32 value; writel(hash, ioaddr + GMAC_VLAN_HASH_TABLE); + value = readl(ioaddr + GMAC_VLAN_TAG); + if (hash) { - u32 value = GMAC_VLAN_VTHM | GMAC_VLAN_ETV; + value |= GMAC_VLAN_VTHM | GMAC_VLAN_ETV; if (is_double) { value |= GMAC_VLAN_EDVLP; value |= GMAC_VLAN_ESVL; @@ -759,8 +762,6 @@ static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash, writel(value | perfect_match, ioaddr + GMAC_VLAN_TAG); } else { - u32 value = readl(ioaddr + GMAC_VLAN_TAG); - value &= ~(GMAC_VLAN_VTHM | GMAC_VLAN_ETV); value &= ~(GMAC_VLAN_EDVLP | GMAC_VLAN_ESVL); value &= ~GMAC_VLAN_DOVLTC; From patchwork Tue Jan 14 02:01:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EBFB6C1 for ; Mon, 13 Jan 2020 10:15:34 +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 1CB1D2081E for ; Mon, 13 Jan 2020 10:15:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UghFF/LU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CB1D2081E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KQk59VYhXSZhZoEmyJL+2UiVmIIwV9tPlVZJ3LTrvJg=; b=UghFF/LUY1Aqqa0TCg9mVLl4XS 5KE+47L8sj9LIG0nG/XeD2rmAPtfwSdWkGbFnwFmTeD1/o853HAw8nCvkVpaj8ujDToLJUrxRii7q /h6rUNyXAa5HUM31Sd80VHuns0bKNNUEjnls64Q5wZpXIADMeVKN1ck4KyqRNXbXfL7moNFcjK9Gb v7N6cI6H/mvPQGN13JEwzcPXK6IeOEi8DXIwmqxpAXw3gCQoUfNX5Q/mjrHwqI8wTXp6rQ44Dhn2k L2paZh4lYHsMC4wS/gHVH7Yqn1Enz1MrVXvq1QqnV+UKZBVY1XRCdlmZc1xtxTtCxkCC0qYGpoGwl YR74jDVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwku-0002S1-0F; Mon, 13 Jan 2020 10:15:32 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwjB-0007iW-KY for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:50 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116851" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:41 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 6/7] net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter Date: Tue, 14 Jan 2020 10:01:15 +0800 Message-Id: <1578967276-55956-7-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021345_705587_00E5AA64 X-CRM114-Status: GOOD ( 13.64 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: "Verma, Aashish" Without checking for IFF_MULTICAST flag, it is wrong to assume multicast filtering is always enabled. By checking against IFF_MULTICAST, now the driver behaves correctly when the multicast support is toggled by below command:- ip link set multicast off|on Fixes: 477286b53f55 ("stmmac: add GMAC4 core support") Signed-off-by: Verma, Aashish Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 6e3d0ab..53be936 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -420,7 +420,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw, value |= GMAC_PACKET_FILTER_PM; /* Set all the bits of the HASH tab */ memset(mc_filter, 0xff, sizeof(mc_filter)); - } else if (!netdev_mc_empty(dev)) { + } else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) { struct netdev_hw_addr *ha; /* Hash filter for multicast */ From patchwork Tue Jan 14 02:01:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 11329877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C88216C1 for ; Mon, 13 Jan 2020 10:15:17 +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 A61B32081E for ; Mon, 13 Jan 2020 10:15:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oYqCEbnH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A61B32081E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XznknqlxlB3CFJfVL/HJFuaV4cpLR1oKMZegs93mvrY=; b=oYqCEbnHkqGTvUTfWxqWhOo9S+ fKmyE7nFaBU9azcLWUCIHnQfaOx0icGQzRCpOtON2vghsi9zXznyIW4TY4p9P6sZxJMdIQdr32QoM jnYhrd1j/UK3pDIRaZPDsWei56nzdR9XEHir24a8tB4skGhIGt7725JiQvnq9/fxW8ZktBYQz6fv6 jKMYUtlw9K7Db6beWakQBmoLAuuwhj+CUgqjkCAOf1ickvjQnmx1djqUSp+Fqz0VQXTvahfEj/Xja GmLQV/IGkTr2Gx2gH1Hon0f4fixiYksnx4QNHr5ia4raKX2xBbJyy9pFUydmBBgPPpndIDJX4p01s KgHkN0Ag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwke-0002D7-9m; Mon, 13 Jan 2020 10:15:16 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqwjF-0008DG-Cq for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 10:13:51 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116867" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:45 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Subject: [PATCH net 7/7] net: stmmac: update pci platform data to use phy_interface Date: Tue, 14 Jan 2020 10:01:16 +0800 Message-Id: <1578967276-55956-8-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_021349_469738_11552835 X-CRM114-Status: GOOD ( 13.06 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 2.5 DATE_IN_FUTURE_12_24 Date: is 12 to 24 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Alexandre Torgue , Voon Weifeng , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Tan Tee Min , Ong Boon Leong , Giuseppe Cavallaro , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Voon Weifeng The recent patch to support passive mode converter did not take care the phy interface configuration in PCI platform data. Hence, converting all the PCI platform data from plat->interface to plat->phy_interface as the default mode is meant for PHY. Fixes: 0060c8783330 ("net: stmmac: implement support for passive mode converters via dt") Signed-off-by: Voon Weifeng --- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 8237dbc..d2bc04d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -96,7 +96,7 @@ static int stmmac_default_data(struct pci_dev *pdev, plat->bus_id = 1; plat->phy_addr = 0; - plat->interface = PHY_INTERFACE_MODE_GMII; + plat->phy_interface = PHY_INTERFACE_MODE_GMII; plat->dma_cfg->pbl = 32; plat->dma_cfg->pblx8 = true; @@ -220,7 +220,8 @@ static int ehl_sgmii_data(struct pci_dev *pdev, { plat->bus_id = 1; plat->phy_addr = 0; - plat->interface = PHY_INTERFACE_MODE_SGMII; + plat->phy_interface = PHY_INTERFACE_MODE_SGMII; + return ehl_common_data(pdev, plat); } @@ -233,7 +234,8 @@ static int ehl_rgmii_data(struct pci_dev *pdev, { plat->bus_id = 1; plat->phy_addr = 0; - plat->interface = PHY_INTERFACE_MODE_RGMII; + plat->phy_interface = PHY_INTERFACE_MODE_RGMII; + return ehl_common_data(pdev, plat); } @@ -261,7 +263,7 @@ static int tgl_sgmii_data(struct pci_dev *pdev, { plat->bus_id = 1; plat->phy_addr = 0; - plat->interface = PHY_INTERFACE_MODE_SGMII; + plat->phy_interface = PHY_INTERFACE_MODE_SGMII; return tgl_common_data(pdev, plat); } @@ -361,7 +363,7 @@ static int quark_default_data(struct pci_dev *pdev, plat->bus_id = pci_dev_id(pdev); plat->phy_addr = ret; - plat->interface = PHY_INTERFACE_MODE_RMII; + plat->phy_interface = PHY_INTERFACE_MODE_RMII; plat->dma_cfg->pbl = 16; plat->dma_cfg->pblx8 = true; @@ -418,7 +420,7 @@ static int snps_gmac5_default_data(struct pci_dev *pdev, plat->bus_id = 1; plat->phy_addr = -1; - plat->interface = PHY_INTERFACE_MODE_GMII; + plat->phy_interface = PHY_INTERFACE_MODE_GMII; plat->dma_cfg->pbl = 32; plat->dma_cfg->pblx8 = true;