Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932078AbdCFPjX (ORCPT ); Mon, 6 Mar 2017 10:39:23 -0500 Received: from mail-by2nam03on0079.outbound.protection.outlook.com ([104.47.42.79]:46016 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753633AbdCFPjO (ORCPT ); Mon, 6 Mar 2017 10:39:14 -0500 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=cavium.com; From: Robert Richter To: Marc Zyngier Cc: Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Richter Subject: [PATCH v2 0/8] irqchip/gic-v3-its: Implement ITS nodes as kernel devices and use CMA Date: Mon, 6 Mar 2017 13:57:31 +0100 Message-Id: <20170306125739.19445-1-rrichter@cavium.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [92.224.60.20] X-ClientProxiedBy: VI1PR0501CA0018.eurprd05.prod.outlook.com (10.172.9.156) To SN1PR07MB2351.namprd07.prod.outlook.com (10.169.127.17) X-MS-Office365-Filtering-Correlation-Id: 2b658cd9-3b7d-4c32-7e53-08d464907b50 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2351; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;3:nh9VOB2qPuCFmUGlz/OM4W2nKhMWbtNTQb5xyToaXiDBImrCBMsqDPL14XwlCzRHeagIzemlmfZrGxPnZtpkl+bUuTQUP6zE3D2b2EbnloL286WbQ2sQclVAvTXndP7RZHlY7c7BjDDTS31P0LR277eN+gOeQpIqIOZjj+5b/ujCZ9s+OoeDATo+fOSBQBHifZECVyjm410zLPw765qZJVsmMyfzviyXGt3zV32DF1ZFAgTmfjhi5XsNx4xiwOWniOvXSCQHP7yJpk/f+R81yA==;25:Ex6ei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U02pIA4KxEUywXH4I657+wvrld6APx2BB86IkaTppYVt6tNjAHNkwNiOk8r0+/hcynay+qDTBn7OMSRwgw0Rjpd5oGq7BW3PXfwC083GMheyO7DAksH8mY7kLTVZM+CwBTlCLnWb47Xt6LoZjm+qKA8FBjApMoRJ2ozjMls7NwPiJ85qevPSxOT4X7DYQPX3uziL/RoFWXnqQ5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558025)(20161123560025)(6072148);SRVR:SN1PR07MB2351;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2351; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;4:Fd2JGVnkxMKL7WiNpBoNJAy4+PaxcUg/XmQ0tdiKeYA6+drmU1UxxPZi2TyqCnt50lVPGd7JyJXx/GbZAUMpxjtJ1q9yefreQZPQTZnxXMTJDdEzzlb7FESnTY18XZZ2fpDkGBtNgw+xpNx6QJyfbBUoRrPiqg9UrW7BFjD0uaery3Gm6/jUSkYUldfRchWbu3N9hD/GtQvFvLmTPMy+klb+roHPFHi5ZXm6sHjP6mG3P1ETh/YIHFEPoY6PTGUQQ0+rA/6ebXYG/zoQd8tRBC3UXAg6UK2iN8kOZe4HuU7DvCijnyUHAG+zSfJQE1VZU0wT4DjpnUsZZ8tXlYzwAfBxygFr2dUbzEctQ/iNuQcQHg3fDGSY6LLOMKluefrCB1rnr8YpzytX7Ien24yA9LhCHqtTZSdR2qfXbWWoszHhC7TedTegl4Mb3ImynqvXQaphcYpc4p6xMZETh1TSBftAd7waAJ0Ks006QlqfNVwRcHXO7/FVSjOqtRNWN8ToH72GIL+4ZT0sDRBmguk0eWOlUc97eVSNi/TrycuKF1jyjkCCiKf4NzUtNMwcm9NmVd2Hg8DMOWMdlLSLA3106/+8+wANdShmPIEmguBzwgY= X-Forefront-PRVS: 0238AEEDB0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(979002)(6009001)(7916002)(39450400003)(6116002)(3846002)(2906002)(7736002)(1076002)(47776003)(5003940100001)(6506006)(25786008)(6486002)(66066001)(92566002)(5660300001)(305945005)(4326008)(33646002)(50986999)(81166006)(6666003)(50226002)(230783001)(6916009)(48376002)(42186005)(53936002)(6306002)(54906002)(6512007)(50466002)(97736004)(189998001)(36756003)(38730400002)(110136004)(107886003)(8676002)(6606295002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2351;H:rric.localdomain;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR07MB2351;23:Ll+u9HIOrbEsLT/+maUC+VF2OCzBb93FjBev7arvd?= =?us-ascii?Q?VmzxJU+HSqvL4Qug04niFo2+3BAwAP3206ODLZ12zw5KQItqy2Cci+lD2i+/?= =?us-ascii?Q?Pmo9VFNGLBvX3quDLah/gCwa7t33qVqehugOA0mR1Inq3CUgqVAvgI9np4wd?= =?us-ascii?Q?/JAzHX3DO3WjLGdm5rOr6kw6StYssZdDmfvCffFHM8d2iYZPl0KGBscJZeQC?= =?us-ascii?Q?EyWei4zEpsNsdUz/HbNTzqCmiM8jmYaHr5QMccZW2iySus/dgscgCfBsPMRX?= =?us-ascii?Q?sCZpEXEpYyU/6G42u5095xfx/kwM82aURmPaKwEISSIygRnQLrdUczFgs91o?= =?us-ascii?Q?smysXKYUNbXCE5+6rR6S2sNKgzg/RRKaQ3HIDYET2rLkhkARucmlp//Xo5/R?= =?us-ascii?Q?fIddjgwkuSHAGlpl4Eywx+EAkCCzBajDonJnM5l1XvlVUdszNNoT9dJFk3pF?= =?us-ascii?Q?ahihRObkAxrswCb31hA8axx+DdAkCAPoT+2BizRQq5wu+OAvRVEXgxRd1die?= =?us-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DyitUsJldrNWhOkPxLfioBnVE9X1rvaJpss/aPA8FFRgJE5OE6LTukINGNuZfZCSfnZVU/izvRGm9+H7w1c1071ZD3gpBKAmABGs/DVk7IjxR2YxqpvDa8YA==;5:+p2EkSoaXZ83zi7eCCE9K1F6nLKdviYi+q7zWU8v03XtsCHWdakYapd6kR//MGUnRy5MGK+/lKkyEDvd8/bDJ1t9K6+wfhJmBWpbGmncMuRiRuvdYOfB0RJ1LSiqIyZ1VeTPJZsaVimV4NrzfqnNWg==;24:Itr5vfPPUj/JuU1ohIxEayYGmTcrQk7gsvNKfR1Hws5VLLHlRShdYBUqoA50+Ps9S4Ik/r/nHs6YB9kLCFx69++3s8AzLZXrRLXu6sGuozw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;7:wypsi0FLpCkwoctC2+O0ZANsKojEGhlmJBB5qocZviddmoboCVfhtarcMzgigEEHjdR6VGrofxeCBfEBY3iZJZm6De+CvddpUWy1O42nwPgz7SBm6wsm4Db1+36WDCQVmnKOsC3QhQLw/222QOMR2HqpDcnAn6euxG8Sc8upDYPN/4unqOBcMHmitghPLnqEUWUUHvinR5xN2IQlDfNiqNHDtMC+LHh1UfDoASTadWyFF03AeNAzLjpvOUjKlC6IabriBg8k8fLNB68X30OnamM1vhEbgxLoe+srrGAN32PA78mdUVNN7IHYo2gEXa9BhQzR8f3HqiVh9sMZRwfRaA== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 12:58:25.9429 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2351 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2077 Lines: 53 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. 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 | 276 ++++++++++++++++---------- drivers/irqchip/irq-gic-v3.c | 8 +- include/linux/cpuhotplug.h | 1 + include/linux/irqchip/arm-gic-v3.h | 5 +- 6 files changed, 186 insertions(+), 116 deletions(-) -- 2.11.0