Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdFFKtX (ORCPT ); Tue, 6 Jun 2017 06:49:23 -0400 Received: from mail-sn1nam02on0053.outbound.protection.outlook.com ([104.47.36.53]:24864 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751388AbdFFKtT (ORCPT ); Tue, 6 Jun 2017 06:49:19 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cavium.com; From: Ganapatrao Kulkarni To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org Cc: Will.Deacon@arm.com, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org, sudeep.holla@arm.com, robin.murphy@arm.com, lv.zheng@intel.com, joro@8bytes.org, rjw@rjwysocki.net, lenb@kernel.org, jnair@caviumnetworks.com, gpkulkarni@gmail.com Subject: [PATCH v2 2/2] acpi/iort: numa: Add numa node mapping for smmuv3 devices Date: Tue, 6 Jun 2017 16:17:45 +0530 Message-Id: <1496746065-11082-3-git-send-email-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1496746065-11082-1-git-send-email-ganapatrao.kulkarni@cavium.com> References: <1496746065-11082-1-git-send-email-ganapatrao.kulkarni@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.214.17) To BN3PR07MB2564.namprd07.prod.outlook.com (10.167.4.153) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR07MB2564: X-MS-Office365-Filtering-Correlation-Id: 6b96dbca-ac97-4325-a27f-08d4acc9a6ba X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR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VyWFTt11psZ3BNbPeNagyF4OxBrIorEVSeEzrzTdtAtN4rrncrhG2vqmHXAT96IBDkCKjXalY=;20:ykhKmRdVYAECeHXYAq/aYRWmNCw5ll6FUTGxJnHQFQFx6IdGMp23QanrxD/1baLqdZWmgfXyJdxMK5fcqqIHGGwZYscz52R3B6fxG+fcbX2SJkC1WCVnW6CZNMggJeBxK85dHY/fp7vrv9zKdgVfrVXWPHRcV9iZfdABB91nNBKVq1hCM5PLhVsZ78QPgylZI/Z5LeSh5nc8Ipnlx0HERs6DvMa8guKKnE3auDlmvNfKfYqk3UX4jkJxApU86krs7aafiFpEODTdixdnQZLjyl5nelU4Kp/Q3WJDEpTe7txPB63ELL3trCXZ29oK4aLQb98CwjUZponmFizscNXcnbtiCqrO1WcMJAjZhiJ3Ewj00DepCzP82kkAGKFHpa7TZI4H9YIX1Zw8y0ipz+SJaqC4+qwmXjnhj0zk3qBuJcCk+LQPM4wlSqIj0AQ0iKaRf3e8HqEsB9/zH3shzUcbjXe9Hh8bn6awpGmkStvQ52Oyu/GLHD9qKsQyzfbXivaJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN3PR07MB2564;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN3PR07MB2564; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2564;4:dqXbSAHW0CCYSAiUHs31bSlLF6gn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OeOrFt+UbCfI4XxAv5xBRsVr6VU25qAEDFT?= =?us-ascii?Q?271aa8zdHZT00tdBHQrPg9J0lOcrdnffyzNO9CE/YFwsXC3tpKt63vhTyjm5?= =?us-ascii?Q?L6OiUXT7nHtyOwTBqXNKR9+Lm7n+RrWZgYf12qQs2uLGXBLSzCk8QQoBfKko?= =?us-ascii?Q?mCPkTpPuiGEdHKNSs/FmTnOiQGd6wchrIa9s5uDXte4v7SBvq1AEszAxGkZT?= =?us-ascii?Q?JOpB4XHnTb/EQI1CKBWTmZkezEUY1B?= X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39400400002)(39840400002)(39450400003)(39850400002)(39410400002)(6666003)(50986999)(53936002)(5660300001)(8676002)(81166006)(50226002)(189998001)(72206003)(66066001)(5009440100003)(47776003)(25786009)(6116002)(4326008)(478600001)(3846002)(110136004)(38730400002)(50466002)(5003940100001)(42186005)(76176999)(7416002)(6486002)(86362001)(2950100002)(7736002)(305945005)(6512007)(2906002)(6506006)(4720700003)(33646002)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2564;H:mypc.cavium.com.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR07MB2564;23:2K3cG+h8Vze4Fk7XjUJkZvlm5iboahtEK5Ol+5Sgm?= =?us-ascii?Q?opfC/Cc7D+Uz2YHWn0BFK+J5T9bZ28TVkjTTgtot4nT06NHGqSw/yXHPQujz?= =?us-ascii?Q?hGIqNneKLISI9SI6bInv6zMDt1Y54iCQYLlXgKIYEIPcmDFDKJ9Q+74b7MoO?= =?us-ascii?Q?aCD/6J/t/PXhHTHDKdRokZNZuPiPR7u3Pn1yVSON5825FUPMky8JMKcMI7+2?= =?us-ascii?Q?UZHOSgZU3cwjGBOZvl1N+gEy2QvRO9BXaKwfZqMjT/KJC6KdS7mbEF9EbhGL?= =?us-ascii?Q?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xvaodjwbr72Ikr2Ql9FToQUG+jTw64YnXKY5F55PRZUPMVPDDmo3JIW5P/aQYaWgQOR/SXM+ga0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN3PR07MB2564;7:ARfaMdP4e1NTPFMdK9cJOEjxlFFCosWSp6aUipxOO3KwoGgUArhcM9G1h1ae9GWLFWeutyXrVw90lH7kHWZvaHIlg5U9iIHEI2BQDIG+AGVqJiF6+krbB3FLWWK7nM5ONH07JY3RPy3qLvRnI+5qRnlz2ibaYk2Yw5ZPyfbA3+FvBbFvi+L3hORG8g/+F7b0kfTJ3Xmdd46Cbyyeg7mwGIZozUhDSDgBvHuSNj+wF+1PkrUo5q5d4xhcNouB43po60hWG7EPXFKpdD80nv7Ta1zixIcV05q8PToRYhUSuXrgYbxSepB0NH4DiQEkaPTO7EhHRJTIjudMv34ArN0cOQ== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 10:49:00.9860 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2564 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1465 Lines: 48 Add code to parse proximity domain in SMMUv3 IORT table to set numa node mapping for smmuv3 devices. Signed-off-by: Ganapatrao Kulkarni --- drivers/acpi/arm64/iort.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index bba2b59..b4f328f 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -882,6 +882,23 @@ static bool __init arm_smmu_v3_is_coherent(struct acpi_iort_node *node) return smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE; } +/* + * set numa proximity domain for smmv3 device + */ +static void __init iort_set_proximity(struct acpi_iort_node *node, + struct device *dev) +{ + struct acpi_iort_smmu_v3 *smmu; + + smmu = (struct acpi_iort_smmu_v3 *)node->node_data; + if (smmu->flags & ACPI_IORT_SMMU_V3_PXM_VALID) { + set_dev_node(dev, acpi_map_pxm_to_node(smmu->pxm)); + pr_info("SMMUV3[%llx] Mapped to Proximity domain %d\n", + smmu->base_address, + smmu->pxm); + } +} + static int __init arm_smmu_count_resources(struct acpi_iort_node *node) { struct acpi_iort_smmu *smmu; @@ -1002,6 +1019,9 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node) if (!pdev) return -ENOMEM; + if (node->type == ACPI_IORT_NODE_SMMU_V3) + iort_set_proximity(node, &pdev->dev); + count = ops->iommu_count_resources(node); r = kcalloc(count, sizeof(*r), GFP_KERNEL); -- 1.8.1.4