From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn3nam01on0125.outbound.protection.outlook.com ([104.47.33.125]:13020 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752376AbeA1W0T (ORCPT ); Sun, 28 Jan 2018 17:26:19 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Yan Markman , Antoine Tenart , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 023/100] net: mvpp2: allocate zeroed tx descriptors Date: Sun, 28 Jan 2018 22:26:12 +0000 Message-ID: <20180128222547.7398-23-alexander.levin@microsoft.com> References: <20180128222547.7398-1-alexander.levin@microsoft.com> In-Reply-To: <20180128222547.7398-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Yan Markman [ Upstream commit a154f8e399a063137fc42b961f437248d55ece29 ] Reserved and unused fields in the Tx descriptors should be 0. The PPv2 driver doesn't clear them at run-time (for performance reasons) but these descriptors aren't zeroed when allocated, which can lead to unpredictable behaviors. This patch fixes this by using dma_zalloc_coherent instead of dma_alloc_coherent. Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 netwo= rk unit") Signed-off-by: Yan Markman [Antoine: commit message] Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvpp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/ma= rvell/mvpp2.c index fcf9ba5eb8d1..e9bc551d7621 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -5408,7 +5408,7 @@ static int mvpp2_aggr_txq_init(struct platform_device= *pdev, u32 txq_dma; =20 /* Allocate memory for TX descriptors */ - aggr_txq->descs =3D dma_alloc_coherent(&pdev->dev, + aggr_txq->descs =3D dma_zalloc_coherent(&pdev->dev, MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE, &aggr_txq->descs_dma, GFP_KERNEL); if (!aggr_txq->descs) --=20 2.11.0