Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbdHOQKb (ORCPT ); Tue, 15 Aug 2017 12:10:31 -0400 Received: from mail-sn1nam02on0052.outbound.protection.outlook.com ([104.47.36.52]:12029 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751573AbdHOQK3 (ORCPT ); Tue, 15 Aug 2017 12:10:29 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Tue, 15 Aug 2017 18:10:14 +0200 From: Robert Richter To: Lorenzo Pieralisi Cc: Will.Deacon@arm.com, 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: <20170815161014.GS31351@rric.localdomain> References: <20170725050237.11033-1-ganapatrao.kulkarni@cavium.com> <20170815150213.GD18024@rric.localdomain> <20170815150549.GA1301@e107981-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170815150549.GA1301@e107981-lin.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [77.179.229.218] X-ClientProxiedBy: DB6PR0202CA0013.eurprd02.prod.outlook.com (10.169.218.23) To CY1PR07MB2347.namprd07.prod.outlook.com (10.166.194.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a28cb69d-61fc-4607-b020-08d4e3f824b3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR07MB2347; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2347;3:pu2p/CF/kJNGt+GPXMrpXVpsD3q9jdSe3oFJW7b0TublnxkoUgDu4xeHEX/ZsD0iPKHovBohYw9MhFt4mxfvFLmsq9Djhl///15g/Lq4VWKaaywufK/oPJePyh8nRBiCM3gCk3bmX0clQ2Eov8T9b0tZZYuwLpzyEmdPW0t+etZGfjrLjQ6zalTsQFBIKR5RaRmk3kaVqofkRHKmpOPtxKFNPDyXOHlCT5aDL55N/AnSTEEPq6ytZbLacS1aDXqz;25:x1WTgzOa2loKdGjEhCuwbsLgvVakaXoE+r4DH+Uo8oSCqiwRQnlnppzX8hhj4b6vOkSCLeY9hA/s6H0fmOIa+wEjISFCkMMCAVS4j6nzWaHvvlbIoV5twIIcbIxYYVSyj9lTKd7EcqwC6IzUE0CLZ3353lTO4Yae3+X8g62uKzaoizXsAOlKr6ZoFWv87ycVmj+tKzvB4bfmzKL5Bxyb8buCpg86jiFIxn0zEE722VqqqDSREgcy0yUQXrs8OMCpaNE3sEZ4qmhIYYUBeBl+h6qrDzA7/AZDMRk8I5uaXIBh7r+dQF72MScj6fzYsjxJ9yv9D6RdaJlWFfldZQQFXg==;31:emZzKqOdhqJw6IhgCGflykow9KHddjv08f58EnbISmF/GWSqxU67CMxlpg4zvKFbMqYPzD3Rd3IufHoUAEwX73DgMzdu1dXibFvuHNVjmHDf9BqED+Mlg5OJHYKQQWFn0nXjihz46MlSEFlyTSJeFRmcsI4ARs3UTxxI1gAXo8XnXUT3uUGWyYFXx01y06bxkcsX1MBK/AgwoIbbRNl2c+5OOK4ZJOhHYPfSHiZYGFA= X-MS-TrafficTypeDiagnostic: CY1PR07MB2347: X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2347;20:kaGpa1El/EwOiQVaXozRZjw5ip1ymHueiA6GmeeM6qvNYOwD/oWEar3fNbie5tZIvpvrA3H3FHwnsYrlOCpWq5K94zmajVCHwTna3cJp1g1TIs021JZ/fbNmQM/qHtD09RTYqw/WNCySpBkWKkfdLH9pwIQK+kuGerF6aCwJ7iqkpbTDYThjbFxwA3qo9nfh5/RxYrOSmdgcS74HBlysDgxZvmV7BYmjdylIoliO2E26VJl3jkld8tnpZsmDtyT0A8LjUdRJ5EDS7NeOKWcT/I/Omr67JU9RPcekCZeWx+rpwQ3TMIdQGN3F5j7q1hLNMfKZH3UywIyMyiMlpgn5tEWiRQFpMPX2Yicp2mrL/zxrJam5djNRiJaoIsvfmX3t6Oy99uIMfB5bgGMAENMTCpdB3TmcNK1k7kFCJjFarFJuG0LfRSK3AmEBpCBRSmcAde5tRAu5joFXtuaTSv0d0KgMxBPheEW9tS1BG7mcILkniIcVzpA3L5HJ2SRy0a35;4:bRSQbVgsLMW+vWw6U5T1dgdjXMdvKjSc4vSSZZQHT9glSbDZsheUTpmaHXeGPAdx2cGA+L7FC8GQRdSYnLC5tzqIC/o/ijxdqj5qyCHTZgTqVLjDAWX7bl7EN9w4JZaXRDp7w6cqmO4J2sxCsg9b7EDl4PeZeOwDKDptJZYhMqG0DdULBkkC5cPNKUQENNvs/AnNxzPW3bGXaM+mMvHtSvywgkQVULXFP4FgjXnddCRIn2U5XbxJgA32sxjNn2RyosL7r98zvP8bQIazIJL21Axe2EQEWKbVgCvJT3EgQRoit7Lp/acXdnpFe2BXnwYAZVvGoge6c8oSWnxGsychZg== 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)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2347;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2347; X-Forefront-PRVS: 04004D94E2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(24454002)(199003)(189002)(6916009)(6246003)(6666003)(42186005)(106356001)(7350300001)(54356999)(50986999)(76176999)(105586002)(4326008)(101416001)(47776003)(7736002)(25786009)(189998001)(5660300001)(110136004)(33656002)(305945005)(9686003)(6306002)(2906002)(66066001)(478600001)(81166006)(81156014)(55016002)(8676002)(3846002)(83506001)(7416002)(1076002)(23726003)(53936002)(6116002)(2950100002)(50466002)(97736004)(53546010)(229853002)(68736007)(6506006)(4001350100001)(72206003)(966005)(86362001)(575784001)(18370500001)(422495003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2347;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2347;23:2PH0HlZPDTVM6vWb4F36TFBODTZuYoh5rcSQvKglk?= =?us-ascii?Q?iErDLHlaFjfLpZ7Y+xTUogNCbKe7BoBQ9DNKMSsZYL6Qi4klFlAYR0diF3fM?= =?us-ascii?Q?aJkQ3b3frAB1DPk+b8TpnrzdpZh9rEOm2m0ac6+KKT+oEV2kqd3qAhoknBfo?= =?us-ascii?Q?/q/+0my56vd5sxTtvXUhgNh+I7UaR5JzdfohpKEzwsGVGEmr3eIoH5l5vklU?= =?us-ascii?Q?BdJ3rU/qOzvns3XVct3QVwLOR0rQRgqykO0nlIUpiHWl6gSCtphMejlxGWMw?= =?us-ascii?Q?Rin0KZDPT7ISronHSPMhIy/lN2EMbO6qd0VlF+Sayj9kRhiTamTRZeD62sej?= =?us-ascii?Q?S1y2jOQojIzExxheFeK8nsypgt8Q/FureRiH4HgMMoEiy5DIYmoHI+7pb6vJ?= =?us-ascii?Q?use1u+J57dpN2za7czThynwG1x8CRTaqaiqnsmgf+f3zM4XpRviqKC/L744o?= =?us-ascii?Q?aRWK0UpMFfzZFTj9GhYyjgMxuYojtviIEpcX1ug037oH1SQ0JkGNE3mJX9SM?= =?us-ascii?Q?CP9CARjDv9Wp2cwPIfg3DAp+ersGqkcX0ev2AyKTAj2mybswcojCkOUVEEy5?= =?us-ascii?Q?cAjKY4Jkqo3KseJeSICZB1yEpaczj34/hvAnS+iHU6ICwY6Jgp9emq2Wdmas?= =?us-ascii?Q?1esGXmQh8FXZFcsGHhEBZyifqz0mA6cEUpjbBEVwtv6ziWv0xwHC9VWO686h?= =?us-ascii?Q?afVgwEGZzAHBS20fvcgiwUDQZ4Z0mj75uUuiS41xChdVtLSF56hFQKaZq05V?= =?us-ascii?Q?rlhKV/enkSRW17BBhs2As+uH3g0TmJMqF0nGYO+HfRMjL+EP0vB/L5uiR3a/?= =?us-ascii?Q?mDn/22mGIo8fUk0ApDuIv+TjYEdehEok9icnPYoP2Q72IubPMF+Jf1My8E/V?= =?us-ascii?Q?AX3u/p2I72d4rDvae9MQh8Rix/pDwONDfIs8RBZb8V6uAnDcL/RVueISUMW9?= =?us-ascii?Q?n6ps7vLXiB/DGKG+7MsbwzRtTEH81af8ONhjX7sUG4kblFld2O7OTFq4n5X2?= =?us-ascii?Q?2btyNMiTZSZXQNwh03Eb8vrAxM6ZJ7zNPQHhFu+Sk0MnpB47Li64TNKJKkjD?= =?us-ascii?Q?V7C54SRK4Wg3oyN0hpe12sULaRc58AuH16muF1oPboLf6JXUXXBSRKZzV38C?= =?us-ascii?Q?k8NRDvLYmDl6QjSnbggOizc6z9AuVxldQXGrgY0Sw3ucpSubc2RMd6WTwBIj?= =?us-ascii?Q?+QT1vbtdh9ojptKlrMMZAfcSMPtbXiKFNcKe2o3YIwB6k4CtWMzgVArMHsXY?= =?us-ascii?Q?LMbir9MzYmetpVSoEMZFnAAOIa1xIXUJoIiBUB4q8FBl/4dAouM30ZFSpjZs?= =?us-ascii?Q?HcwSjjDnij3wBvmSFi++lBjNVUab+t14vytM7gbqoHN?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2347;6:ICAQ4daKo8RLJhFYJwVicaxK144DnmbECiXFrNuAPXow4GrFJvXD9pf290uhrvzyUvagsl37jUv92EKlUJVKnioq5Hj9pzOvYbXb9zLtrnorVLwLTdPNBXYOu4oJDGuGj16UF5tWhokmQbxR4gbpJC280vvwU1aXk32GqWOnDlYZKHNFslXhStb3iV0RqeRrtgV3T/3t9luykDtVgj12G3o8X7QWTSgbW5j3jHLLhfoVvoTpudTt1I+kwED1wL07jf0aynBGLq3UolzM6XbKxO6bTPR8oZKknExXlvAQ6y52WhbDV6YoP9oE1fJBkOEuxpnMNq5QlZiokmdbxB5MvQ==;5:FnGCeP1iVgt2Txf+Zw8e5U9dDsgHiXoTkRJ8bc3mgTlJ7lUVO/M4AGhdg1p8GgcoSazdCvmt1WZpVuhB84diXR5jK239QtqirLVWMqBlHLTSCfneBDW6Nj7RkfiIMaFAnw8lFV1GdWTW6kjiLTvu5w==;24:IG4HbWW1rhI9+nJg1QpXTMamA2bP9ihWsMl7rZXACe6No966iMuJoTboCvmvXxoUxl4SllE3+Wx4UvUDq2QUk5mPxRqerKe9Twg2zNK+Vqg=;7:M2d1qu/vQVudcu+qP+MTRullkbuufOMMT7n1u45K3n/PPQ+9I7czABHmLVOBnbnUyEnMV1tLr/ekn51czjTJn52M9Q4YJ4hjj4TYfLSNHqQCNOpoouaNVCdDL+juwPJ4SwqzJkT7CEdZK3C6qCIQVbBa3Hho+IxCi2XI8txkdnBeH5l3zePkFnjcNHWvQj2v3X9LmYOgT/aM88Tidfwje0Hmm5t1oE9UxACZ26WhOyA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 16:10:23.9950 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2347 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4674 Lines: 134 On 15.08.17 16:05:49, Lorenzo Pieralisi wrote: > On Tue, Aug 15, 2017 at 05:02:13PM +0200, Robert Richter wrote: > > 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? > > https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/core&id=5fe0ce3b9e514168427463d0c7a86dfa635da3d2 > > It is already :) (I CC'ed you on the PR) Ah, right. I missed that. Thanks, -Robert > > Thanks, > Lorenzo > > > > > 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