Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3496182imm; Sun, 16 Sep 2018 20:24:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZoX+ygaPDnFAiKInzbNV7jAtn83fbJHPj2MuVdKpeh6fUl2vi7CRThwf/7LtwKsxtoiB7t X-Received: by 2002:a63:6ecf:: with SMTP id j198-v6mr21085398pgc.3.1537154657268; Sun, 16 Sep 2018 20:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537154657; cv=none; d=google.com; s=arc-20160816; b=DTI33xwOoEEdXWb1gYP/GSCAl9r9swaByyzn12K+/jyvOzmIWS5FrxbRAf2xbKM3Ly EWRsudaPdQg5RK1EDPQFrn99OPSXtAgmLS22gNEVPALVMfkNKskcXa1vAyCfF+ngFr1m 6yhe7RurypmP12inNPzZ3OBYdYB42DRAU/EdbJtyAuIxTw3NdmQwHc0KGi+CZrQGPnMN OFk5gfc8sxDF9JdhAwJZzU0ugo2DR9JWVMC7oPDRFZKvAl9d5quiOAH+DAHHDZ5+aUdh uIp9JEYWWqYzEvTGrwczdrVUxUTP9y0fds5KqVjDz4YKcW/xZuNsDy4OyahYo4IhFZSH gBbg== 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; bh=KKHi7THa5t/fR1LyFkyUKlyxMlzn8QPx63tLMIbiptM=; b=I1F0p5xQCnwmAQF4fNIlioqvuVweO+vHbmeBfbGIBOPOu93B/GxKTZWEB3nxGlhaxL Ubi54xLHKDVs3usYps0b4Dg2hIRcuUiMFoCwNkLOFhgRFJRN21AFTJU+UQcIJbEQGg7Y d7qI9WC536lEYwp0gDynrKnlf1S765ldw/KiwQnwSGkZekPiAhhiMQbx32HqCt8ETWb4 OFCMglFpaU906qX2+FaOuowK4g2sSUO5PvyrXNeNyWOEHtezKlE28FBijI/wBZ++ZukH F8gR6lcngay53TMyBWgsbNqVJ1lDvIpMSBF6e0lVLiKwfq8U3AaW18H+k2E/G9LZrngH LHBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WG3Ku3gZ; 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 t13-v6si14234140pgl.461.2018.09.16.20.24.02; Sun, 16 Sep 2018 20:24:17 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WG3Ku3gZ; 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 S1730218AbeIQI3i (ORCPT + 99 others); Mon, 17 Sep 2018 04:29:38 -0400 Received: from mail-eopbgr710093.outbound.protection.outlook.com ([40.107.71.93]:31768 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730193AbeIQI3h (ORCPT ); Mon, 17 Sep 2018 04:29:37 -0400 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:X-MS-Exchange-SenderADCheck; bh=KKHi7THa5t/fR1LyFkyUKlyxMlzn8QPx63tLMIbiptM=; b=WG3Ku3gZcAoOMs5R1gL1GJ9Ahcp9oIpIGbb7CF0bMfJhh33fRxEqYO0DdLf6LJNrxzmCmLv53p9Z1uaGdf/cAV7edfg13Gss7gkDFltXmL5h0x8laWPxLIGb1+ZRjD0baZ1gHnlVj7gA7ASdu4iNhpqTFjXzQM25WdAYzJEnz+4= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.5; Mon, 17 Sep 2018 03:04:15 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1185.003; Mon, 17 Sep 2018 03:04:15 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Alexey Kardashevskiy , Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL 4.14 41/87] powerpc/powernv/ioda2: Reduce upper limit for DMA window size Thread-Topic: [PATCH AUTOSEL 4.14 41/87] powerpc/powernv/ioda2: Reduce upper limit for DMA window size Thread-Index: AQHUTjLq3Ui3WShxXUint4xLHmJaPg== Date: Mon, 17 Sep 2018 03:02:49 +0000 Message-ID: <20180917030220.245686-41-alexander.levin@microsoft.com> References: <20180917030220.245686-1-alexander.levin@microsoft.com> In-Reply-To: <20180917030220.245686-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;CY4PR21MB0776;6:ATHpNJ4dTmZwr+AgVOlcsDM1WcULU+yGaABe7RNz1fLchQ7nFxRJclnlcgVJ9r23gdzP6fJpmjWLrrs3cEiGWtTxd5loQMkyCZEjCnIETlYKAWaqTPIV3Z0/O/UXpZL67Pi+ZpcNY7MZKMrABqn5mFaFLuw5AFMaDOyEFyaa0ePptK0w/VvbURjD5hdLWDV4Sy6YI4uv8BXwPBMd4c9Z+R7vwE4LYkQLIa5H+eR9treaZcVt/uQAoSOvDUPh07h4TbPNqtQrBl/kpLt04VgFryGgqY9xePeZlU84APVjog/JTOdEaAeQrtXRbf8cz6+cb66nL2yZUZJNxhsDG05bYvC4kzUoF8JVc14QZ87YINe/f7oYdFvgw0zDirPjH3OrxFjm/wlBOMZhORaElL+IsJFv54O71MHwOW0N+ZBfOrJgmEtPh3Ssp4S41+yAT8j2/kPPwSVBpyXDKD8BAKlkdQ==;5:HVwEDHMdJI/U0VW/kBzM+WOZ4mR2bkQHsy6KcRAItciRxbrAIKFMGy3lQ/KhhPWayXb0BScmC38+A/Ot3eEs0Gj1hjgDDR1X0Mnryfak7e1OmjOxNT+OTPrwum6G4Oidj0Xw3dQUKiWSVu6Eou4uykXgp7UQwqs61Jj2xJUG8Jg=;7:iYqj/1KBoTOcFseoRsWzfEugLa2fUqoBWa+g3NTqwVdIdH8Lx+L6230lvEK65VQELsWVqGrHPaVlxw1Zgq/5ai8aofjjjoh0DXPC0ui5X64yKWxy3Kssl6sa64XcY6KQtDtbCw68dKNvZrGIaWoTtFAFB9DAelKjMjg2Rdi1wJeh7I3/iXI4O95++bm6cEcPSf4RxJWDmuYWQxRYJ1BMFbZfqT2nZQ/+cTvBZknthkVmOiGoqAK2j7xd91ef7eKa x-ms-office365-filtering-correlation-id: b10ea2b0-2a7d-4547-d1c0-08d61c4a40a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:CY4PR21MB0776; x-ms-traffictypediagnostic: CY4PR21MB0776: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231355)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050)(76991041);SRVR:CY4PR21MB0776;BCL:0;PCL:0;RULEID:;SRVR:CY4PR21MB0776; x-forefront-prvs: 0798146F16 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(136003)(346002)(376002)(396003)(199004)(189003)(5250100002)(53936002)(72206003)(14454004)(102836004)(478600001)(4326008)(6346003)(4477795004)(2501003)(25786009)(6666003)(10290500003)(110136005)(54906003)(6436002)(66066001)(8936002)(316002)(107886003)(76176011)(2906002)(217873002)(6116002)(3846002)(22452003)(14444005)(6506007)(486006)(5660300001)(7736002)(2616005)(11346002)(446003)(97736004)(476003)(6486002)(105586002)(81166006)(99286004)(186003)(81156014)(2900100001)(8676002)(86612001)(68736007)(86362001)(26005)(36756003)(305945005)(256004)(106356001)(6512007)(1076002)(10090500001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0776;H:CY4PR21MB0776.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: ackrTd2XP7gPLQvT0WtQ3KDSp9e7LttvsUgduFPCLK1YLQ6g3gSTQtEUq+BlUhZUR4UCXViZkRA+igbJ05tEaZ/3OjpqOINc7ORXTuavX2pDWUKkxrlM3ugsmWWx9Byx323S8m5H7dPmaDH0QpDUnmr/BJan8nMaXdABtxrQZSDwDMLfMgO/11/BdcGiWjhBAPqh89WXWpAUN6Fg6Ytzt2fi8dsrQhwxbq70dUH3WCe3BF+Qmr4Icq0UkgZLCgq3Z4zHyYcU3M1mv4kMEFsZbFXOdkSF7nq5M1B2dvCo1dtIXNwiZbNB4tSgTNu2F2qvIbIEp74Chrl4G9y0sUKvUuAZdj6GjijQHSrVva1lVus= 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: b10ea2b0-2a7d-4547-d1c0-08d61c4a40a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2018 03:02:49.6811 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0776 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Kardashevskiy [ Upstream commit d3d4ffaae439981e1e441ebb125aa3588627c5d8 ] We use PHB in mode1 which uses bit 59 to select a correct DMA window. However there is mode2 which uses bits 59:55 and allows up to 32 DMA windows per a PE. Even though documentation does not clearly specify that, it seems that the actual hardware does not support bits 59:55 even in mode1, in other words we can create a window as big as 1<<58 but DMA simply won't work. This reduces the upper limit from 59 to 55 bits to let the userspace know about the hardware limits. Fixes: 7aafac11e3 "powerpc/powernv/ioda2: Gracefully fail if too many TCE l= evels requested" Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platf= orms/powernv/pci-ioda.c index e919696c7137..ddef22e00ddd 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -2787,7 +2787,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, = __u64 bus_offset, level_shift =3D entries_shift + 3; level_shift =3D max_t(unsigned, level_shift, PAGE_SHIFT); =20 - if ((level_shift - 3) * levels + page_shift >=3D 60) + if ((level_shift - 3) * levels + page_shift >=3D 55) return -EINVAL; =20 /* Allocate TCE table */ --=20 2.17.1