Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752533AbdHOPCl (ORCPT ); Tue, 15 Aug 2017 11:02:41 -0400 Received: from mail-dm3nam03on0052.outbound.protection.outlook.com ([104.47.41.52]:57504 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751665AbdHOPCi (ORCPT ); Tue, 15 Aug 2017 11:02:38 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Tue, 15 Aug 2017 17:02:13 +0200 From: Robert Richter To: Will.Deacon@arm.com, lorenzo.pieralisi@arm.com Cc: Ganapatrao Kulkarni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, 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, gklkml16@gmail.com Subject: Re: [PATCH v4] acpi/iort: numa: Add numa node mapping for smmuv3 devices Message-ID: <20170815150213.GD18024@rric.localdomain> References: <20170725050237.11033-1-ganapatrao.kulkarni@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170725050237.11033-1-ganapatrao.kulkarni@cavium.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [77.179.229.218] X-ClientProxiedBy: HE1PR05CA0137.eurprd05.prod.outlook.com (10.170.249.152) To SN1PR07MB2352.namprd07.prod.outlook.com (10.169.127.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b999d49-7812-4348-e79e-08d4e3eea9ea X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1PR07MB2352; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2352;3:aKtqFZRP53WJQvus38zCxt0a660cFK0lzQPr7LebZBO0LcxacWG5F18B0Fk1cUYi3R8vM3v22Ngs6teG/Xl7772RVLNlYsWNqFNkWr/9W+wF/djkMD3NZ87b82o4ZoVbK4LvB0PWSoQxrid7VB7YXpEttt9FMF6VSzIBwjQvODSpJCs8zSmZUE7jAtJfO4ehHh+ul9S63p7oNeccuAPeyzTgF243KhzXG7wQbKiCvIwnCPGNb3Glm0yoEmphyQMd;25:MqUJ8YJw1/Ro0447+RJ3TIPVVxeWjbImc6JA0Cx22co0xi/DcZW8U2jp1cMNn8W+5U6Od6Vcs7cnS7LmTNkKBcr8lfcLGW1DCAaJ/Q4RWKbduhb+7tec254O8aSVKk4zyX0/KRtjqHAy8wE6d7Zn6u079uB8/EZfwE2UfNUxQbmiviCn887F8Ni2YvIO72tF55jmMczFHzXwFAFNMz/rIQt/UD9LFTt/4gDntQ6LtRkKhu7ZZTQ51vER46OcoiHeeQD5mVmqW4Ega35nc372wMLB2eMFofg9w7+3fZ3W/M+1+dSll2xBFpGTcnBR2PeQIz0Sdk7zDF/dAeC06t5ZxQ==;31:HKbMO6D/UVECaxSyGLXN8Z06t11nTCoW94MqCYnRjLE1jQS1BiR11kBaBg9Of7T1OqNUXRKDnDl92kAU+Gy8Grad33IAO5/SqcTdX7kVWzs46B+8bls4uOdyXFYkh5j4sKy+cSNfdTzbshxNkyQNjzq7ahQHW101AxG0+iU1Ecyu75j1x5ggmnpxhg1NK3wcRJyXimmsA6q+aYN0TTUMUZT52j9IQsqmdApeFIry4i4= X-MS-TrafficTypeDiagnostic: SN1PR07MB2352: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2352;20:f2XBzgJ0/mx1PjgaGeKKXOggLTERNkgk/x/cOwzVPzDHGF6Wq+TaK0J7mrk0ORmSF9JyDWNLvgr4C/hlHKvMw/JPSRH2MkDwWLoycp/YYMF3/+nSmZlCcyKqYTQiu7os8f6/1Swd+Y4PBzU+oQSa5ptdaUVaCBXTbAXCtBWiXJSiAVPDQqm6kjKJ2G7KDmWXUugJ/7R3uG0Tys/4te6lEcTAK2SMPyE9D+aNc17uDZtE2TIO4AKjUKL6XT239AJxZc03YC8sokCgu8XLGnDq+nPNdJlW3T2qPbChaVhbCJowvDGWFGjOv2XN7KcwfDbVptgnhT2+XjoqhnnyNPrKTVLUlBw0WVd2v5Ku1fDxx7IGuFJea0QF1TPEOvjjEQ4KvPyLofLYWwaGeMp3PExhE5/2N0QSrNhFF77P+4RFcMGkwYgbDJ1AHtNfoTMc6qXb/7q+ZsyJMZot2e+6CGKGIJkYy7yyghQOYgdygVYmY66U2TlmRn1kA5a90owKho1j;4:jaEP3msOFH78PW+X+hK7kPnd43HcoDTEy3vYS8uPRwDpQp4gdlKk72k9ElxKzAY7olblr0a94Kuip3bzBcd81DRIL1mHl25Xa7FFkbNd2CRq88Czm9xKMwFN57u0yf+v6DORs/HS9jsjd3e1YYuLU2NDShSuQNDzqQLmWTkaYlPOih4Ai3tVFJMoCdhyrvZ2XdH4LIwlNg4hkyiP7ffENMqe/0JJnrtWJk9aKdhYkVNCvz4icdTAK5kcTqqdHwVt3AvQB6yWVI0J2zPmJ4xOspnIw3Sq93x+1ldXC2pYiGLyOcjS/+f6/0iH5Ni5gssopz0JSRb53FauKNBKQEgznA== X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(84791874153150); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR07MB2352;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR07MB2352; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(199003)(24454002)(189002)(6666003)(33656002)(189998001)(2906002)(1076002)(2950100002)(47776003)(106356001)(83506001)(68736007)(4001350100001)(97736004)(478600001)(23726003)(6116002)(3846002)(66066001)(7350300001)(105586002)(5660300001)(76176999)(50986999)(9686003)(53936002)(86362001)(6306002)(55016002)(6246003)(229853002)(42186005)(81156014)(81166006)(25786009)(53546010)(50466002)(8676002)(110136004)(54356999)(966005)(7736002)(72206003)(101416001)(4326008)(305945005)(7416002)(6506006)(18370500001)(422495003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2352;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR07MB2352;23:dXmmO/NXclgz3Rw4u1F579gYOMJDswwR6AV7u1xhw?= =?us-ascii?Q?seD15mNIfF4H/vP1E5R5JhkdAJ0oZEliMGk9vBuBemKbpkyJrF3FlvxIfwx9?= =?us-ascii?Q?+CQarOf9PW/ge/NPRdhOEiSsgFYIpgG7bQ4BGsX6oCS99tGUZKv3UHbm1bHh?= =?us-ascii?Q?bhtc6FWJGz8Wg2uDDjBHS8JAAjQb2g/Mo7uSycYj5+IWTkdCsHBurDGW/oX/?= =?us-ascii?Q?C/my5yu3H3d/V8z15Z2QFyPVnsJCpPSfPf9RQ5znrGwj3BuY8PyV9vsncAna?= =?us-ascii?Q?YsKMvFmKqQ1FCzyI84nZcLJwVgpZyiyLPUywwE5cpTK0qjeF5hcCSPXHTTw8?= =?us-ascii?Q?UubrR7PriCMU8jU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=?us-ascii?Q?jCpTnqNWma404xW5UGpHB3i12xT4gVLHh06Q02kRrkSwzimrULkPCzh5nBsO?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2352;6:6aUefr2yyWiSbJWj+o+2BrSbl8zvmm//33/nbtGxEUEUnIczbL5rxmfqPHmTfGQSwe0fGtYsIvgesu4uTi+vQU0oW1/hbramE+C34gxbH2ZdYPkwrt0DlLfniX5w5Rvgdzh7/0J+wEnTewx1l/0vG4aON7lDqrmwgOh7pxCeUhoi5aZjRHKBVNJsetDTDwUNTkCVHh5O1NvHcVXXgx8kavVDGnUwC84O4kuil/efrNG0Ht9VGaDhhQELfiNAUPxRqdQOb84nQwipP6lVXEPP+xpNzeRn5uAAPlW0rW36fxV4CY0fof6rhJ4daHb/s0sNUxzgS2EaGW4hfZ7fPt81EA==;5:hrDPC5XOkKpgrqPTO6IFhPjAFxAQCl4B058co65LVag2BkOvuqjFb+KrfnISHt1YkYFzTkPsms9ByuBLt0qcLJQxrxj31kFPU+hay0+ghgilWw7xYLCsGH1v3RdPVzKf0q0EkRUuF8x/3LXN0vI5ow==;24:shIz6ja4evqQnjxSo+eQYb2SZe6q74+pFPv8a3DamjC0ahkvtVQLwXxi/lzOlthmTZTSZD53rTb7RRxxk+Jur4J9EBSVq/1ZqpDWRZpQhMA=;7:wfMw35SdXeXGqWfB/DXAAPTuX6VfAvyJpBxENgJ+sUSvBiKlGCwRoDRe/yBmTVTLyjSbx5TxS9m+G930G6C6Ty2DQP44uE6lYOyt9Ncqx+3aAAaowHFc7MhYcehJQSAoOMC30s9rvI8ii7ZRoEGXtVdcAOatpAXXJg4wMySGB32g518i9h0mrD2ZD7b5h6Gy54u/aK7m6StU6sqUK6D4sTtIBfS2b5ieW/OFuofb73Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 15:02:29.6983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2352 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3838 Lines: 117 Lorenzo, Will, On 25.07.17 10:32:37, Ganapatrao Kulkarni wrote: > ARM IORT specification(rev. C) has added provision to define proximity > domain in SMMUv3 IORT table. Adding required code to parse Proximity > domain and set numa_node of smmv3 platform devices. > > Add code to parse proximity domain in SMMUv3 IORT table to > set numa node mapping for smmuv3 devices. > > Signed-off-by: Ganapatrao Kulkarni > --- > > This patch has dependency on header file patch [1], which is > already merged to linux-pm. > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=c944230064eb65e4fa018d86779b4fd200b1d7e7 > > v4: > - Fix compilation issue in !CONFIG_NUMA > > v3: > - Addressed Lorenzo Pieralisi comment. > > v2: > - Changed as per Lorenzo Pieralisi and Hanjun Guo suggestions. > > v1: > - Initial patch > > drivers/acpi/arm64/iort.c | 33 +++++++++++++++++++++++++++++++-- > 1 file changed, 31 insertions(+), 2 deletions(-) could this patch being scheduled for v4.14? Thanks, -Robert > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index a3215ee..c5c82c3 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -908,6 +908,28 @@ static bool __init arm_smmu_v3_is_coherent(struct acpi_iort_node *node) > return smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE; > } > > +#if defined(CONFIG_ACPI_NUMA) && (ACPI_CA_VERSION >= 0x20170629) > +/* > + * set numa proximity domain for smmuv3 device > + */ > +static void __init arm_smmu_v3_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); > + } > +} > +#else > +static void __init arm_smmu_v3_set_proximity(struct acpi_iort_node *node, > + struct device *dev) { } > +#endif > + > static int __init arm_smmu_count_resources(struct acpi_iort_node *node) > { > struct acpi_iort_smmu *smmu; > @@ -977,20 +999,24 @@ struct iort_iommu_config { > int (*iommu_count_resources)(struct acpi_iort_node *node); > void (*iommu_init_resources)(struct resource *res, > struct acpi_iort_node *node); > + void (*iommu_set_proximity)(struct acpi_iort_node *node, > + struct device *dev); > }; > > static const struct iort_iommu_config iort_arm_smmu_v3_cfg __initconst = { > .name = "arm-smmu-v3", > .iommu_is_coherent = arm_smmu_v3_is_coherent, > .iommu_count_resources = arm_smmu_v3_count_resources, > - .iommu_init_resources = arm_smmu_v3_init_resources > + .iommu_init_resources = arm_smmu_v3_init_resources, > + .iommu_set_proximity = arm_smmu_v3_set_proximity > }; > > static const struct iort_iommu_config iort_arm_smmu_cfg __initconst = { > .name = "arm-smmu", > .iommu_is_coherent = arm_smmu_is_coherent, > .iommu_count_resources = arm_smmu_count_resources, > - .iommu_init_resources = arm_smmu_init_resources > + .iommu_init_resources = arm_smmu_init_resources, > + .iommu_set_proximity = NULL > }; > > static __init > @@ -1028,6 +1054,9 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node) > if (!pdev) > return -ENOMEM; > > + if (ops->iommu_set_proximity) > + ops->iommu_set_proximity(node, &pdev->dev); > + > count = ops->iommu_count_resources(node); > > r = kcalloc(count, sizeof(*r), GFP_KERNEL); > -- > 2.9.4 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html