Received: by 10.223.185.116 with SMTP id b49csp1078044wrg; Sat, 3 Mar 2018 14:57:30 -0800 (PST) X-Google-Smtp-Source: AG47ELtISFg+6lz79xZp27ruop3OjigroGLo498xZJXh5F2TSzIwYE3VfkTp7NHP8zuj4UzpskF5 X-Received: by 10.98.196.84 with SMTP id y81mr10363099pff.11.1520117850750; Sat, 03 Mar 2018 14:57:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520117850; cv=none; d=google.com; s=arc-20160816; b=tKZa74VTz2m395TGQQOlLClB0kTibhO+PLtYSKPL1XpSxis1vhczuj/fz7qNNWQzj+ 2+lvRucWuvOCouwbuR/zUVkogREwm6ozD3ZdEN4LWwVbp+jI+pucGGAt7miIWxfJIO4d rmGZrreKJ99njDRPaONvUGJzhDn7ucBYCAcaErPItxLBGi1p12LNO6e4WPu9NKs6tuzE d3hJlnBcxVufuJP/BzG6/4Ala3t6ZOqwcZgR663ldPBMog2FFBoT/Fucb2qByWynvHnI KFCmZccjXjAK5oYym8LisXxacaEzhyC8ImuRsvN3y6p3iND4356nxWC3N/r6DsQdgVK9 wAnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=S8Dy+eouZT+LkCfOPBdHQkdDjaabCY+yTsJohCcPP3k=; b=EoMTyzbh98E6BPcjlEIynjZwl3ReFyBLUzhSCkcYlaUD1gukiL7J4duTP8+5r+6jMe iIILWcWJFb2wbda8xYZqo3HA5ms0HlfwSlWzoHn4Bl+wEvGhMy36mXTJWoDpUBPYKgOA +1LKBr/rhZUftTDkqaxqoB5QG3ilyZzJZSdJpTVixgu5C3gLHXI2jESMGwY3ntGgA1/S kk+eBoINDht1lNMYDdv0qox08ZDTIk6ppbLhCXZinZ+/KAmq25nQ1rmp5POLRc7nEnBm AJMwcXKs1lcCrycS7i0uUdgWBgVf3/qgahyIirtTYGVCFTgFpFdworqi2yzpfC7ognXJ ys2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=B0Kify8w; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si6079602pgq.113.2018.03.03.14.57.16; Sat, 03 Mar 2018 14:57:30 -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=@microsoft.com header.s=selector1 header.b=B0Kify8w; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934970AbeCCW4j (ORCPT + 99 others); Sat, 3 Mar 2018 17:56:39 -0500 Received: from mail-cys01nam02on0109.outbound.protection.outlook.com ([104.47.37.109]:30112 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935356AbeCCWk7 (ORCPT ); Sat, 3 Mar 2018 17:40:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=S8Dy+eouZT+LkCfOPBdHQkdDjaabCY+yTsJohCcPP3k=; b=B0Kify8wS14xCPNFBfj4Yzy+rjTMrwGBsPDx5LUYY4o9GCiEP20QDyZpqylTipLC7J5nfI7OUals2itaZVJsitQpU9ewOaVFOe2XdDpoz9J/bUBSSD7p+0gLFgARgZYAokjKK7N0DN8zZqHz5UteX955rT/rL5mdZLFAVLGHzVM= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MWHSPR01MB344.namprd21.prod.outlook.com (10.174.251.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.3; Sat, 3 Mar 2018 22:40:55 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:40:55 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Thomas Petazzoni , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 04/63] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Thread-Topic: [PATCH AUTOSEL for 3.18 04/63] net: mvpp2: set dma mask and coherent dma mask on PPv2.2 Thread-Index: AQHTsz+bghc7jxP6rkm1WA1QyLs3GA== Date: Sat, 3 Mar 2018 22:33:10 +0000 Message-ID: <20180303223228.27323-4-alexander.levin@microsoft.com> References: <20180303223228.27323-1-alexander.levin@microsoft.com> In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHSPR01MB344;7:rZ/1fKFPGRw1MdMOJQy21nlwdzxgxybjAodUYZuupwUMiB2UyjmodsvTeSMDcG6Mgei7E0Zl9n2gD533TSCTtg2myX0kFCYXBWLxVu7MphnRm8x9mj9uZJJYCT5O9CeUNP35VDsp9g2C1oOWdPAY2PoyJmBVNCQqsqF/kz1dSbkI/Qdnp7EXu8fYunOjHXDP5vMz0tiAReNJvhZMijVITBG7CVYF/ca/ouKMFr2ixEcY0suT9u0wq1JgPjwjRuXn x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 020b9d17-ef61-4df6-9c7a-08d58157d3d8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MWHSPR01MB344; x-ms-traffictypediagnostic: MWHSPR01MB344: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(58145275503218); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3231220)(944501244)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:MWHSPR01MB344;BCL:0;PCL:0;RULEID:;SRVR:MWHSPR01MB344; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(346002)(39860400002)(366004)(39380400002)(189003)(199004)(8676002)(5660300001)(5250100002)(2501003)(6506007)(575784001)(7736002)(36756003)(25786009)(3846002)(6116002)(97736004)(305945005)(2900100001)(76176011)(6436002)(10090500001)(26005)(8936002)(186003)(81166006)(102836004)(81156014)(106356001)(86362001)(10290500003)(3660700001)(2906002)(99286004)(14454004)(86612001)(105586002)(478600001)(4326008)(6486002)(53936002)(107886003)(68736007)(316002)(54906003)(110136005)(6512007)(72206003)(3280700002)(22452003)(2950100002)(1076002)(6666003)(66066001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHSPR01MB344;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: av1DVD83izxjso/19SJ4C9EJgq0VgqiGOz0T2/NutnHz2Ohow4ywv4BA9esj3aMQnsNjelr5I/iSIB8QK2V1nOcdotKwMpFIKcJqbIIuEqJEeF/RFRxYsA2aI3n5LmT9bbQla1lJmBYCl5DWXSXoocGdt+/p7UKZX7vxhtHhe6A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 020b9d17-ef61-4df6-9c7a-08d58157d3d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:33:10.4972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHSPR01MB344 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/marvell/mvpp2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/ma= rvell/mvpp2.c index fdf3e382e464..68a5b71ec5c4 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -6339,6 +6339,20 @@ static int mvpp2_probe(struct platform_device *pdev) /* Get system's tclk rate */ priv->tclk =3D clk_get_rate(priv->pp_clk); =20 + if (priv->hw_version =3D=3D MVPP22) { + err =3D 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 =3D dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (err) + goto err_mg_clk; + } + /* Initialize network controller */ err =3D mvpp2_init(pdev, priv); if (err < 0) { --=20 2.14.1