Received: by 10.192.165.148 with SMTP id m20csp792480imm; Fri, 27 Apr 2018 07:36:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoy1gCNMiEsZZdyfTm1ugMZDEsROuNWpQ1W04De2dqZPsPDwwwHUGI7t9DM8QtdZM56uOoM X-Received: by 2002:a17:902:7209:: with SMTP id ba9-v6mr719198plb.119.1524839761539; Fri, 27 Apr 2018 07:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839761; cv=none; d=google.com; s=arc-20160816; b=JRfzyE49SY8DTfT42XXMq4A6N1PyCND0zhVm/TwQ6GriFSuluRnlWotmQnsmjCh4o2 13UlsgJ9YQEqydzHrDIq+K67bF+nzQza3ZTpBLsbiHuHCm/s/LSK7IWo3SsP1AAa3eCi c9F2KGruINnMin4Q9eBNnJEZAIahGiYYrP12AJP4bgWvaoQRhsPkr9YcsqfY7LSj0XDl W7wQV0Z6oobNvWkHLrcb1h/iwnZV3b7KWQJoO9S0ivMXrzJLOP+qNXUJlrCOuwE8dPjf YHiYNIwzKjHQm2KKwYspo/3rvXiqo5acZz3kE4IPbK3n5Ur8AEokV2sj77vpARbZPhh6 lTzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=ZJIjHa946tM+bV78HWgHOvY8t3FqebUSc9/Ecvrjg78=; b=AZiWAtjJqyty2gyjPQhnfg0BX09RLBIpXdjsE7DnimM/O8TP1XRcYwIvQkoIPHyXip k7k8yaxsYMpugcg+VwzajXo3BdkKPU+hI6TBRNVvQX83XaC6PdDdvD1E4Vo992l45lYd dEJ53uZo6KNyQply1hcb9CwW9ljVYNz7TxiVrq4PpW938ONLHm3wztuLZqiY2jnH9JRY 0UlGsKhi5kgKEUqANUOhfVucB3bpM8a91ZtLmRLBevve6KmQO67o2lhUk+7rCMR1Ceni TprI0arb2GuLnw/P3LeqEJPhdkOEOsmapgbQ2rZUJX/oxDEDf/EdGX8frHEiK6tjuVxd HUxQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si1380306pln.54.2018.04.27.07.35.47; Fri, 27 Apr 2018 07:36:01 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934769AbeD0OKC (ORCPT + 99 others); Fri, 27 Apr 2018 10:10:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934732AbeD0OJ6 (ORCPT ); Fri, 27 Apr 2018 10:09:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F2BD21892; Fri, 27 Apr 2018 14:09:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F2BD21892 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Chevallier , "David S. Miller" Subject: [PATCH 4.16 17/81] net: mvpp2: Fix DMA address mask size Date: Fri, 27 Apr 2018 15:58:19 +0200 Message-Id: <20180427135744.287610465@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maxime Chevallier [ Upstream commit da42bb271305d68df6cbf99eed90542f1f1ee1c9 ] PPv2 TX/RX descriptors uses 40bits DMA addresses, but 41 bits masks were used (GENMASK_ULL(40, 0)). This commit fixes that by using the correct mask. Fixes: e7c5359f2eed ("net: mvpp2: introduce PPv2.2 HW descriptors and adapt accessors") Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/mvpp2.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -838,6 +838,8 @@ enum mvpp2_bm_type { #define MVPP2_MIB_COUNTERS_STATS_DELAY (1 * HZ) +#define MVPP2_DESC_DMA_MASK DMA_BIT_MASK(40) + /* Definitions */ /* Shared Packet Processor resources */ @@ -1336,7 +1338,7 @@ static dma_addr_t mvpp2_txdesc_dma_addr_ if (port->priv->hw_version == MVPP21) return tx_desc->pp21.buf_dma_addr; else - return tx_desc->pp22.buf_dma_addr_ptp & GENMASK_ULL(40, 0); + return tx_desc->pp22.buf_dma_addr_ptp & MVPP2_DESC_DMA_MASK; } static void mvpp2_txdesc_dma_addr_set(struct mvpp2_port *port, @@ -1354,7 +1356,7 @@ static void mvpp2_txdesc_dma_addr_set(st } else { u64 val = (u64)addr; - tx_desc->pp22.buf_dma_addr_ptp &= ~GENMASK_ULL(40, 0); + tx_desc->pp22.buf_dma_addr_ptp &= ~MVPP2_DESC_DMA_MASK; tx_desc->pp22.buf_dma_addr_ptp |= val; tx_desc->pp22.packet_offset = offset; } @@ -1414,7 +1416,7 @@ static dma_addr_t mvpp2_rxdesc_dma_addr_ if (port->priv->hw_version == MVPP21) return rx_desc->pp21.buf_dma_addr; else - return rx_desc->pp22.buf_dma_addr_key_hash & GENMASK_ULL(40, 0); + return rx_desc->pp22.buf_dma_addr_key_hash & MVPP2_DESC_DMA_MASK; } static unsigned long mvpp2_rxdesc_cookie_get(struct mvpp2_port *port, @@ -1423,7 +1425,7 @@ static unsigned long mvpp2_rxdesc_cookie if (port->priv->hw_version == MVPP21) return rx_desc->pp21.buf_cookie; else - return rx_desc->pp22.buf_cookie_misc & GENMASK_ULL(40, 0); + return rx_desc->pp22.buf_cookie_misc & MVPP2_DESC_DMA_MASK; } static size_t mvpp2_rxdesc_size_get(struct mvpp2_port *port, @@ -8347,7 +8349,7 @@ static int mvpp2_probe(struct platform_d } if (priv->hw_version == MVPP22) { - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)); + err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK); if (err) goto err_mg_clk; /* Sadly, the BM pools all share the same register to