Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752536AbdHPTyE (ORCPT ); Wed, 16 Aug 2017 15:54:04 -0400 Received: from mail-sn1nam02on0076.outbound.protection.outlook.com ([104.47.36.76]:31472 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752229AbdHPTyC (ORCPT ); Wed, 16 Aug 2017 15:54:02 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Wed, 16 Aug 2017 21:53:48 +0200 From: Robert Richter To: Marc Zyngier Cc: Thomas Gleixner , Jason Cooper , Shanker Donthineni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/8] irqchip/gic-v3-its: Implement ITS nodes as kernel devices and use CMA Message-ID: <20170816195348.GU17961@rric.localdomain> References: <20170808122259.6299-1-rrichter@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170808122259.6299-1-rrichter@cavium.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [78.52.106.40] X-ClientProxiedBy: VI1P189CA0030.EURP189.PROD.OUTLOOK.COM (10.165.188.43) To CY1PR07MB2346.namprd07.prod.outlook.com (10.166.194.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74bba6c9-de20-42af-591f-08d4e4e089d0 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:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;3:W3+ScJzpm+6v0QSOBXq34NX0o00DIIXwzhI0EmTDae7VZWJeOdMuM66Xn5i8gUfleg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Y5p3gFsVwCWk42ApznCDBsXicEsn21omt/p1auJdNWGFBy46NKH3SBq90aQkYxMddWD13m3Bn5yLhUEElOvNmgT29bFrdacaYJo5YaV08opT+cFz1L8Zw4O2fsl0RCI1ht9nMdlo/+kHtoleonQTNwgbA5ZhobzZuOskobDe5oPainJY/yyrzcB8tyGIdsMcv8y+U/T56dGoG77+QW/VSSmlhu4P4CvV/B4pbEZBTPLgvxUb+sgpcgy4wfm5BdfDThicCsmNnGBW9;4:gfphDielwJo92vzKdMbOYVbxny6I1Ag18TADGtL1lp4vjNf9jCjuBOvYYdzOA28yIzUaGmxyQK+Kzkdlaanwe2NVy+RBluTrGyOuhSmkD4AVYp8IADmDL5pEd7Uf+pYT6mLqGs+grTFXrdbF9my8L+2KH8JhJ40VZr8REgkq5GgXt3dVdDNSpjQxXBv55SBpcVwfpz5PCWe+61W4srLOAhV9/CIfmqONi9hs1v7fy2ysKcp93R+uEikuRyX1WBLo X-Exchange-Antispam-Report-Test: UriScan:; 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)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2346;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2346; X-Forefront-PRVS: 0401647B7F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(24454002)(3846002)(966005)(50466002)(6506006)(4326008)(25786009)(68736007)(6246003)(229853002)(83506001)(4001350100001)(97736004)(106356001)(7350300001)(53546010)(2906002)(7736002)(55016002)(47776003)(305945005)(42186005)(110136004)(6116002)(1076002)(9686003)(23726003)(6306002)(5660300001)(53936002)(86362001)(54356999)(50986999)(2950100002)(76176999)(6666003)(101416001)(6916009)(478600001)(105586002)(230783001)(72206003)(54906002)(33656002)(81156014)(66066001)(8676002)(189998001)(81166006)(18370500001)(6606295002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2346;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2346;23:8wW8VW1flqxrTDDC+rfKZLfMDyxxNy9BWhJfnOgu1?= =?us-ascii?Q?7SLecZB2j0wh95lya/0KEosZkSFfSqC6zNjoMvPxPrpPBre+c0XHCgj3ZJxv?= =?us-ascii?Q?TQl75xnzjr1QdU4x7n/DdqkHj65NRwAjchda/RJlPPRtNex0eVa72meHT5AD?= =?us-ascii?Q?m9jR7M1+LKHh5xG7m6ogPicghPEiJICBG+gn4Af6y6uDZmuNv2PwY6RBAkmF?= =?us-ascii?Q?hDocZHGQf3Uswd2Koh7ZJ/tJbEN/sm3xHyBt5Hl2vg9+91zpnLYABZvHIjjk?= =?us-ascii?Q?78QVZXWdbjSep88vvA8EN5AZfFqz/5L7kyYzjfmUJBkRabrgi73Wj7J28xV1?= =?us-ascii?Q?mzDKvVAJ/f/ihgzg7crMoMqw8q4E64jYJwPViktMlzjaQuVsKoubrka41ClJ?= =?us-ascii?Q?/pmL/ZMtk4cO2UsfGI1cKZHG4HvS6/5yxLF1L9Aq0rHRuS/DlWfc1DiTZ5cD?= =?us-ascii?Q?nm4h1pKP8zaIGP0OEJCpgYJP8+7LnfIrrh7kyA6CHQj7YX0VRA5bJBRfkpQ7?= =?us-ascii?Q?rNAYRECzHeYRXJGo64w+9GlZ0XQPpKOwYO3Dno3MBzjFZdk8EKiZkr6YjFhN?= =?us-ascii?Q?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kmfvl7Z75x3KiQAAqC0lzTiqr4NJADIB8jh6sTsE5UQM2TWw65bcaHT872h8hKjN8yx1IrcQ29DuoG1Vv9e/HxIDxP08QcUTudCgsZ/ASRdFwXlL9uw9ye50yoOnjPjq8fsOp9XfA85ULxGw47BmEmaL+MpDSqR6pjt7FIqRkdn74Uish3hUl0ZKMbd4oxWSDbIMhpdDERxXH4a/JAouQkAiuQ1T3aV6ei11YsRw+3KwtaGAbrog==;5:IC+PkjWiLrUF78soz90tclR10Fzmzvmbq+VjXKRVUQrWmu+vc/XH+eyn7WXilMB82Xn/OOWnvAxCQgfhgDlkhj2ZyHUI3tp93oZ4q75XyAmjlkAJai+98QVfxr1uYSnD9Pk00EkNkUCdPQx8yJztYw==;24:4hs/MDmZlrU3QIrNBelPFX7R3um5PFDcZ4ckVFo8i47YtODLWN0Ty4YEo5X3F3GLNt+Nxmn9MBruhL1xUGQ2gzilbmqws9ddiJ8uGLop9rM=;7:b80ZxPvqjA0IbpTGzprru2PR+zi3LG9hwJ1/LFwAeFM6DD8XFyHl7Yfh83UeOuJ/dazlHdvjJKW6ii551mAVdbdmIWopktdPNhWP4Pj8ATkMIjqHSmv4o+84rmelCHSEu86BUpmh6x3u97+0mLpp+YbUaQqfYjN4Ue5HrOxyKTvQlJ0IdVof7wV3OpDtiUUZ1g5108fd4N65wlKzgfYlAj4OZ4WowiCzzOaIjkeDoOI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2017 19:53:58.7022 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2346 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2666 Lines: 74 Marc, On 08.08.17 14:22:50, Robert Richter wrote: > This patch series implements ITS nodes as kernel devices. The > advantage of that is that CMA can be used to allocate large ITS > tables, where standard memory and page allocation fails (above > MAX_ORDER - 1). This approach was suggested first here: > > https://marc.info/?i=56D44812.6000309%40arm.com > > Another advantage is that all memory resources of the device are now > device managed, thus the code for releasing the device becomes much > easier. > > The following is required to implement this: > > * each ITS node must be assigned to a struct device each, > > * the ITS initialization must be moved to a later point during boot, > > * the ITS enablement must be separated from the GIC code (the GIC > still needs to be enabled early), > > * the early ITS node probing by DT or ACPI must be separated from the > ITS initialization, > > * ITS table allocation must be changed to use dma_alloc_coherent() > which uses CMA for allocation of large memory ranges. > > This is an update of my last patch submission here: > > https://lkml.org/lkml/2017/3/6/570 > > V3: > * rebased onto v4.13-rc1, > * fixed use after free in error path in its_init_one(), > * added comment for arch_setup_dma_ops() to describe coherency, what is your opinion on this series? There might be conflicts with your gicv4 series you sent around. Any advice how we can move forward with this one? Thanks, -Robert > V2: > * rebased onto v4.11-rc1, > * fixed syntax error in its_init() function (split probing patch), > * added comment in its_create_device(), > * fixed GITS_BASER_PAGE_SIZE_MASK usage in its_setup_baser() > > Robert Richter (8): > irqchip/gic-v3-its: Initialize its nodes in probe order > irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls > irqchip/gic-v3-its: Split probing from its node initialization > irqchip/gic-v3-its: Decouple its initialization from gic > irqchip/gic-v3-its: Prevent its init ordering dependencies > irqchip/gic-v3-its: Initialize its nodes later > irqchip/gic-v3-its: Handle its nodes as kernel devices > irqchip, gicv3-its, cma: Use CMA for allocation of large device tables > > drivers/irqchip/irq-gic-v3-its-pci-msi.c | 6 +- > drivers/irqchip/irq-gic-v3-its-platform-msi.c | 6 +- > drivers/irqchip/irq-gic-v3-its.c | 285 ++++++++++++++++---------- > drivers/irqchip/irq-gic-v3.c | 8 +- > include/linux/cpuhotplug.h | 1 + > include/linux/irqchip/arm-gic-v3.h | 5 +- > 6 files changed, 195 insertions(+), 116 deletions(-) > > -- > 2.11.0 >