Received: by 10.213.65.68 with SMTP id h4csp1778662imn; Mon, 19 Mar 2018 13:02:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELvaCpD3jox98GRDeE9CSDjnFZY/CJNbYsw9ObxCbA4/xUlB8ky78u29J18o3gTUfCVJZyzK X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr13573580pld.247.1521489730938; Mon, 19 Mar 2018 13:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489730; cv=none; d=google.com; s=arc-20160816; b=m/TIgKvAe7EUhpNxuISS7FYV/y/t2rO5gfU0vR8xFnnRe0H9bY3BVG+mtLBlNT+b4/ K4x/WhM97pL0gx67IO6VZxv9m48g0sYJrRk16PGru3iZKvh+H5BInpP5IxjHSKQyO9gO pqkRm0zBdya7lQ2M/420dM+3NvGF2rRCF28IOncQIBiEOk6dM/GISWV333MOCh4zD8FB 70zIbVUIAR6WFhP8NZEldUKGQ+2uZHFd1GlWABIWihRCa3wr5Dl/1Tm5Z95Mqit7GURu FvrPmNilvKcIFC+HRPcrtPkxwdRHOwc7t6PHZ7ztXT5EkbMRNYlG1wWWQ3scsEsX+/B1 cpdQ== 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=7uun66CoH6yGtz9KrI99Zp3bV5lTO8Wws8sEC/3vCUQ=; b=cIGaUSRBP79c0P5Nt7UDugS5soLaEKXEJCTBHBsSi9caKCu205erWXS/O8jYlEntyR kyOUcTd39a2Pl+cnyRLkXDAFlSkVFZQcJk+BnzQ5MIwhTVGfZsxVeCXzpOzQOuS5gPOK BVaysmeMC+er1qQjqpiCd29R8bnoRuityF5JEIE5aa3C5gv6rRPeIfMYDZuW7vGJCwBM epsjRlXcorL+fFZHTTYfWo2ltRVKUQsi8gGvmkTvGEH0rj2oP4phfIHutN7ivpSFHJQ0 40Vi4aF26cZXqodrqQZqQVZbyzGAxt8zH4XzCIL6kxwtLpuSRBzdbdlZ5vQh1NRbK2GX 5yHw== 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 t80si446314pgb.686.2018.03.19.13.01.55; Mon, 19 Mar 2018 13:02:10 -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 S1030669AbeCSSSh (ORCPT + 99 others); Mon, 19 Mar 2018 14:18:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969319AbeCSSSd (ORCPT ); Mon, 19 Mar 2018 14:18:33 -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 C3A64106F; Mon, 19 Mar 2018 18:18:32 +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.9 017/241] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Date: Mon, 19 Mar 2018 19:04:42 +0100 Message-Id: <20180319180751.880741514@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -6420,6 +6420,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) {