Received: by 10.213.65.68 with SMTP id h4csp39699imn; Mon, 19 Mar 2018 18:50:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELuWSmx0+wtpkGFynVrhDlDVD9KIuw5s9ENMNzAgsD1DrZ6KfVhkDXNpgLEV6rf7gB3s9xjG X-Received: by 10.98.166.196 with SMTP id r65mr12149982pfl.110.1521510655134; Mon, 19 Mar 2018 18:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510655; cv=none; d=google.com; s=arc-20160816; b=khn9geKkJFuAzxIa2UBnemFtOCduWMMHaMUlbCEtYulZ3uWAufcUSD9gC88Fnw3rEn GeLd3Rs37rGEy4a+oswOBSk0c4bO+8DvHG0zC9VAHGQ/c3PJl5/R5tv7UhpO0///cQrv 7smk4o6ds6k7fwUwFcUjkdFX1u6lYGLBz0RHF9OlyWdwvuTJufcQJ3xkpdkzQC7PWS1m cznfRPnqgsYOtFlEFgC26PNSPKjfsW7KbWTnvhCvEVs5pZDRlHGTLJ1/uMZRe30IegGp rxUhlUCUwsbNpyErpi1R2SxlQoVtnLzjQtTatcaijOgaXsD+Px8PrJmkoto1gFsw3k+J npLQ== 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 :arc-authentication-results; bh=oSjX3Q8NZEkHKGnujRZCkWodxDXPUBRWPNGTZnUSlJU=; b=0xUYOVZPo7dobol0hDV1jW7E2Cta2ZdCi6/DEYxQz9EIl+5GRIn9Uq5/IUzY70xkRI /4fCD+M4tXgy6UH2izucBVBGCyMB/bYmBCzinaZ8DoTidmDC7MgRylf51uSschtQcMyt Iine4WnuEYB8+77c7d7U+D1PVs7GdSHYO4igeQiQlXdXSolfsjUJM0Sh6TP4kLeAtaT0 dM2yvissTRXGQByadlkpDv3Ah3QN1+m79WQ56yyyGs9B4Zx1OZhHfjAYAiTvURrrVlar Z3u+4jyucHUwliQ9aqA8agTWVgFnNRez3G4v4Qg8gtkYvRKcSdYWqPD9D2pxnfDQsPCc I91w== 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 a9-v6si537123pls.127.2018.03.19.18.50.41; Mon, 19 Mar 2018 18:50:55 -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 S968872AbeCSU1Z (ORCPT + 99 others); Mon, 19 Mar 2018 16:27:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43658 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030573AbeCSSNc (ORCPT ); Mon, 19 Mar 2018 14:13:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9647CE17; Mon, 19 Mar 2018 18:13:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Petazzoni , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 008/134] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Date: Mon, 19 Mar 2018 19:04:51 +0100 Message-Id: <20180319171850.300796587@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Petazzoni [ Upstream commit 2067e0a13cfe0b1bdca7b91bc5e4f2740b07d478 ] On PPv2.2, the streaming mappings can be anywhere in the first 40 bits of the physical address space. However, for the coherent mappings, we still need them to be in the first 32 bits of the address space, because all BM pools share a single register to store the high 32 bits of the BM pool address, which means all BM pools must be allocated in the same 4GB memory area. Signed-off-by: Thomas Petazzoni Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/mvpp2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -6448,6 +6448,20 @@ static int mvpp2_probe(struct platform_d /* Get system's tclk rate */ priv->tclk = clk_get_rate(priv->pp_clk); + if (priv->hw_version == MVPP22) { + err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)); + if (err) + goto err_mg_clk; + /* Sadly, the BM pools all share the same register to + * store the high 32 bits of their address. So they + * must all have the same high 32 bits, which forces + * us to restrict coherent memory to DMA_BIT_MASK(32). + */ + err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (err) + goto err_mg_clk; + } + /* Initialize network controller */ err = mvpp2_init(pdev, priv); if (err < 0) {