Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5794519ybl; Tue, 10 Dec 2019 11:35:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyrj0IHkSW866CpU+okIHU4uA0tt4tW/aFk8OVuGaDtGkfH/81w76nER2hHGGbskQXCrCtL X-Received: by 2002:a9d:27c4:: with SMTP id c62mr27772322otb.292.1576006514794; Tue, 10 Dec 2019 11:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576006514; cv=none; d=google.com; s=arc-20160816; b=GvSRKCbUb6vIbCkZ2CQtOh97MNdtZmxxZRN8bFrjxFkCNC4qpow7/4mQ6PAy1Rb3wr on2t/RV0yqkdHV9RGV6gSJJE82zvulyH2NF4G+yDm6SRCSbocLH6GyefwrmMXG1hzWwD 0DAcc1GfP3XjeBoa7oHbzy7YMrP+tRfOvz+O0QE22beuUUfFlf14J8YU6vmsbL7dE5uu n3smPSRWGc5h1X65gNdy87eYIdwuRiJGvxLxsBQ/Kww+wVCG192zXA8qTI4YjwekFcVA RerYfsmzuwpGmcr878gktzH6Vpbyr0HhssWaL8OxZ4A+x1Z3CCXOd8c+HcwjB64tcLW/ lvBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=8FKI6uppz/HJSci7VswmoYsnQC+4vblwsHg+Mf+CVpk=; b=mPVIesLko5iNrX/BpJ47QjKX4asNMQ2IAnk/5RuXElCF03ovj/8mzZ8y7LjEkL7HW+ aWjIdFz4pFnc57bkD/jtLFyOhiCcgdjcHauQvcQ7uqLVNXeDEoKMBiSY89NEWz9FaIxR +Q5s9OfKTN+mw+XV8jq6YxPszhnxASA/8e0h4mkE3A8viGc9wiTSplpy9j7txRs8KmsM pNPihEtE7S1n5XwGdSgIeOw3LGwbDVf3l08dU/Ebx/sjRtNIMvBXQVMqPd0tLG1FKZCF +pS9wFBXl5muxrQHFrr9toRUqIBvxII4eG4rHD0ytuuRsCS0nClN92GDcnTK2GWnvA4L gsJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=bNJ4J1Ko; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si2470860oih.2.2019.12.10.11.35.02; Tue, 10 Dec 2019 11:35:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=bNJ4J1Ko; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbfLJTeX (ORCPT + 99 others); Tue, 10 Dec 2019 14:34:23 -0500 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:44146 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbfLJTeJ (ORCPT ); Tue, 10 Dec 2019 14:34:09 -0500 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 35F01C0BA9; Tue, 10 Dec 2019 19:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1576006448; bh=273lLdI7WjAvMCo++9OKcx//zzUtteRXA+1x/gS5aZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=bNJ4J1KoZvhezaQK3Q7Usu2KK2PtG1Nmm+b8jLbri9Y/w26EwIB1MctcPiDkmnIjG s6EwzNj+FUBY3S09p1+qXxlTmchujCoj3ezLi0M2Bsrzn4AjPGs/GgRy2Lm7vSWu2o RlmyHjOCbMOcmsrOV/6WmG3J5Jhr69tsyd7md9yX+AWNuHjyvwqDtyoyKK0743VtHf HrD/9kOf+fNyLEiDOz2rwNZdq8NkSM5/QRrZFlU2u6aAflDIM6kDwhN2TnrLSnh0lF NwUeYj1/09hYPNLMZRPPeXCv9GD+Tp9qj+6vSb8U7cwnm+kU/c/PZf5E4avtjxX/6t iuAFPsOslYsHw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id F2A6FA009A; Tue, 10 Dec 2019 19:34:05 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 5/8] net: stmmac: xgmac: Clear previous RX buffer size Date: Tue, 10 Dec 2019 20:33:57 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When switching between buffer sizes we need to clear the previous value. Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 ++ drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h index 3b6e559aa0b9..ef8a07c68ca7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -343,6 +343,8 @@ #define XGMAC_DMA_CH_RX_CONTROL(x) (0x00003108 + (0x80 * (x))) #define XGMAC_RxPBL GENMASK(21, 16) #define XGMAC_RxPBL_SHIFT 16 +#define XGMAC_RBSZ GENMASK(14, 1) +#define XGMAC_RBSZ_SHIFT 1 #define XGMAC_RXST BIT(0) #define XGMAC_DMA_CH_TxDESC_HADDR(x) (0x00003110 + (0x80 * (x))) #define XGMAC_DMA_CH_TxDESC_LADDR(x) (0x00003114 + (0x80 * (x))) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c index 22a7f0cc1b90..f3f08ccc379b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c @@ -482,7 +482,8 @@ static void dwxgmac2_set_bfsize(void __iomem *ioaddr, int bfsize, u32 chan) u32 value; value = readl(ioaddr + XGMAC_DMA_CH_RX_CONTROL(chan)); - value |= bfsize << 1; + value &= ~XGMAC_RBSZ; + value |= bfsize << XGMAC_RBSZ_SHIFT; writel(value, ioaddr + XGMAC_DMA_CH_RX_CONTROL(chan)); } -- 2.7.4