From patchwork Wed Nov 7 22:03:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1518C13A4 for ; Wed, 7 Nov 2018 22:06:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 059B82CBCA for ; Wed, 7 Nov 2018 22:06:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC90F2D1BA; Wed, 7 Nov 2018 22:06:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4352B2CBCA for ; Wed, 7 Nov 2018 22:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IFdqA1om+XUeqnux5EmKhBCar3i6dz8oDN7/tf/jfe4=; b=RpbtsgRvU0sNhS b5k+BLb7jVpvqeN57aZn9DLefb6lXtBUjmgeghHsXv81pYoUcDwdv5vgTLGb0RDAI+k8jUX9c8u4n IK7zAYsuABLRFaig1PYHImpgidb/rhmEKtt2brMKu+hhYjML91Ei61y8Duc489RCQMiwfqEfSbWZB 5PsQt3gTrDPKjpHqJhc1WBuvpBhIRdi8RJJZsJG5fqtXBM8j75pnq/hnAqKOIrNjiaIOuiUEb/Z+w HCl+ee4aAh1vQMF5LdagSNHVwiuLP+WlTLlJJ0x6B4uVHOsGdDdmBW86hAcl2CUJ4/Pk7oYsN+7vH +5Uww0Kq4ouSQq886U2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVy8-0004yb-75; Wed, 07 Nov 2018 22:06:36 +0000 Received: from mail-dm3nam05on0623.outbound.protection.outlook.com ([2a01:111:f400:fe51::623] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvb-00013S-Mv for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:04:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FdMTJJAYsYZRn8Oi0kazk0cfdLY+RmpuGRLxSU7ozpw=; b=KwANcgsXEgu9ErStmt36N6UPwedFtxddhqtE5UDIfjTb6iaxfxRQ3gLTIgH5qSQtqXdTmSD1pOEBbf3MnjGuAQQHD2qvuUMckGQTRV9bgUUCfDvTleevJyhVY0O0UQbYGf9pBYh66bED+IrNk0vDBnXMUfGYq66YZ8JS95SsOs8= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:11 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:11 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 01/10] irqdomain: Add interface to request an irq domain Thread-Topic: [PATCH 01/10] irqdomain: Add interface to request an irq domain Thread-Index: AQHUduWsV81u7L9sPUy5ady0TaCFAg== Date: Wed, 7 Nov 2018 22:03:11 +0000 Message-ID: <20181107220254.6116-2-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:Y7j4ZvdSMq7cFO2EPjizXcKRTtgqCNI0WX+kbTiIh/L9uOAH8yZT0ji0PeVELBm40qP5kdG/RiofW1hB4vaY1pB8NKo7S5LJFT/ryie8JooJYHo4Hgs3Nb6xUMHy7fRbMR8VKHmEbvmCJ0UOY9SqlrBd4G8AiTNM+6GkAARELd5JOxuP6fJ65VQG1bmHXiu58eEmTWeorVdXPkzk4ranNJtzk3bXf+DPNf9Uro0w7HUwhnWBWsuN0ELweXbq0igNp3Mnp7XttMxQLXlR40O4yACxj9YPwPm/9YV59qEJ+a9K7TBdOPh7e7NDmSDk0nRCqMphAzQEaiRUOb+knNdQz2H3/VdXNI8GSCzVA8ZOC94n1aeBe6eGbgzjB+cmFKVi/cX6ZYqmU5cgGiDAfMJN4moGA8fpuedm4iJ/znVdU4EjsMxljijoOg3EX//HxH1/gUh2EYg1Qtm4rL6u7vL2tA==; 5:gQYXhlY5i16twmcVlqEg2/zuZiRm2WbaOlWyKNOdFKKZbO1zHyWeHXQyeZWG9TkarX2f3hqMaKaQP+xg0I1PMkCkgL6jIhgYAz4yV+gujVQVByAUuZR792JWXOiqGmiLW+//7Q1n0PfOss330SNo4pzFQhrTMxCzfz8YUf6PybA=; 7:RAYaqkejFeD5eLI+UTAf3tNG/EuRgxtzxrR+g6YPjqddmnyIpNxAWF3x2RciJfuI6MdJ25Mpr8sNsAc8FLyH4wdUShJ2oX1j0QBKvQmH5FPH8nRMlclKa0jB7/omyTtnNXp+v+tD+Jljx+FW1sas9Q== x-ms-office365-filtering-correlation-id: f9abd27f-1ee9-4274-b12a-08d644fccee4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(575784001)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: HjmqAXNQlJeW0KnVNyAIbw/FsxHQ9wbiGNlyZGXpfB0TyHbJlZEQ8xKVME172CSzFScASualNj4eg9j6qhAUbRvynkAIktN360vGmLBwm4S1XobpDeQzWbOdsIoFuIopF/DltvCS5RI+xzev/D/8kRfvbWJ4OB0ZqA8PE0h+mv5ELrNC+1/WVQcsTNeMmDYtKkfzUue7/ZzSYTPorGjh9kA5tBjFEelK2tOaVnAX5Ba2mZaBI7gRCS7cIWjp0HWOLITwfEgerWElD1512I75DTfQ/FuFdZvU/XTudXMkfJF1fCC/fVcX/M33TEr7exEjqDfkL4gHvbTgi2K3DzPRGnPlbFKjYiPDI8WLvtyfTEA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <4297B85ADB745A4EAE920BE3A5855B7D@namprd07.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9abd27f-1ee9-4274-b12a-08d644fccee4 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:11.7948 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140359_951650_B24D7BCC X-CRM114-Status: GOOD ( 21.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a new interface to allow irq domain initialization regardless of order dependencies. This is done by requesting a domain and registering a callback function that is called as soon as a domain becomes available. A typical irq domain initialization code is the following: Parent initialization: ... domain = msi_create_irq_domain(fwnode, info, parent); if (domain) irq_domain_update_bus_token(domain, bus_token); ... Child initialization: ... parent = irq_find_matching_fwnode(fwnode, bus_token); if (!parent) ... create_irq_domain(parent, ...); ... In case the parent is not yet available, the child initialization fails. Thus, the current implementation requires the parent domain being initialized before the child domain. With a complex irq domain hierarchy it becomes more and more difficult to grant that order as irq domains are enabled in separate subsystems. Care must be taken when initializing parent and child domains in the same initcall level. E.g. Arm's gic-v3-its implementation might have the following tree and dependencies: gic-v3 ├── its-node-0 │ ├── pci-host-0 │ ├── platform-bus │ ... ├── its-node-1 │ ├── pci-host-1 ... All domains must be initialized in top-down order of the tree. This patch introduces an interface that allows domain initialization without any order requirements, e.g. to be able to initialize the irq domains in the same initcall level. The following functions have been introduced to allow the registration of a callback handler: irq_domain_request_fwnode() irq_domain_request_host() Instead of using the irq_find_matching_fwnode() function and it's variants the child code replaces them with the new functions and looks e.g. like the following: ... irq_domain_request_fwnode(fwnode, bus_token, create_irq_domain, name, priv); ... Here, the callback function create_irq_domain() is called as soon as the parent becomes available. All registered handlers are stored in a list. With each update of the bus token using irq_domain_update_bus_ token(), the list is checked if that domain is requested by a handler and if that is the case it's callback function is called and the request removed from the list. With a late_initcall all requests from the list should already have been handled, otherwise all remaining requests are removed with an error reported. Signed-off-by: Robert Richter --- include/linux/irqdomain.h | 15 +++++ kernel/irq/irqdomain.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 068aa46f0d55..27e83803627d 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -311,6 +311,21 @@ static inline struct irq_domain *irq_find_host(struct device_node *node) return d; } +typedef int (*irq_domain_callback_t)(struct irq_domain *, void *); +int irq_domain_request_fwnode(struct fwnode_handle *fwnode, + enum irq_domain_bus_token bus_token, + irq_domain_callback_t callback, + const char *name, void *priv); + +static inline int irq_domain_request_host(struct device_node *node, + enum irq_domain_bus_token bus_token, + irq_domain_callback_t callback, + void *priv) +{ + return irq_domain_request_fwnode(of_node_to_fwnode(node), bus_token, + callback, node->full_name, priv); +} + /** * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain. * @of_node: pointer to interrupt controller's device tree node. diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 3366d11c3e02..9e33d873d8f6 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -21,6 +21,7 @@ #include static LIST_HEAD(irq_domain_list); +static LIST_HEAD(irq_domain_requests); static DEFINE_MUTEX(irq_domain_mutex); static struct irq_domain *irq_default_domain; @@ -45,6 +46,106 @@ static inline void debugfs_remove_domain_dir(struct irq_domain *d) { } const struct fwnode_operations irqchip_fwnode_ops; EXPORT_SYMBOL_GPL(irqchip_fwnode_ops); +struct irq_domain_request { + struct list_head list; + struct fwnode_handle *fwnode; + enum irq_domain_bus_token bus_token; + irq_domain_callback_t callback; + char *name; + void *priv; +}; + +static void irq_domain_call_handler(struct irq_domain *domain, + irq_domain_callback_t callback, const char *name, void *priv) +{ + int ret; + + ret = callback(domain, priv); + if (ret) + pr_err("%s: Domain request handler failed: %d\n", + name, ret); + + of_node_put(irq_domain_get_of_node(domain)); +} + +static void irq_domain_free_request(struct irq_domain_request *request) +{ + kfree(request->name); + kfree(request); +} + +static void irq_domain_handle_requests(struct fwnode_handle *fwnode, + enum irq_domain_bus_token bus_token) +{ + struct irq_domain *domain; + struct irq_domain_request *request; + + if (!fwnode) + return; +redo: + domain = irq_find_matching_fwnode(fwnode, bus_token); + if (!domain) + return; + + mutex_lock(&irq_domain_mutex); + + if ((domain->fwnode != fwnode) && (domain->bus_token != bus_token)) { + mutex_unlock(&irq_domain_mutex); + goto redo; + } + + list_for_each_entry(request, &irq_domain_requests, list) { + if (request->fwnode != fwnode || + request->bus_token != bus_token) + continue; + + list_del(&request->list); + mutex_unlock(&irq_domain_mutex); + + irq_domain_call_handler(domain, request->callback, + request->name, request->priv); + irq_domain_free_request(request); + + goto redo; + } + + mutex_unlock(&irq_domain_mutex); +} + +static int __init irq_domain_drain_requests(void) +{ + struct irq_domain_request *request; + struct irq_domain *domain; + int ret = 0; +redo: + mutex_lock(&irq_domain_mutex); + + list_for_each_entry(request, &irq_domain_requests, list) { + list_del(&request->list); + mutex_unlock(&irq_domain_mutex); + + domain = irq_find_matching_fwnode(request->fwnode, + request->bus_token); + if (domain) { + irq_domain_call_handler(domain, request->callback, + request->name, request->priv); + } else { + ret = -ENODEV; + pr_err("%s-%d: Unhandled domain request\n", + request->name, request->bus_token); + } + + irq_domain_free_request(request); + + goto redo; + } + + mutex_unlock(&irq_domain_mutex); + + return ret; +} +late_initcall(irq_domain_drain_requests); + /** * irq_domain_alloc_fwnode - Allocate a fwnode_handle suitable for * identifying an irq domain @@ -293,6 +394,8 @@ void irq_domain_update_bus_token(struct irq_domain *domain, debugfs_add_domain_dir(domain); mutex_unlock(&irq_domain_mutex); + + irq_domain_handle_requests(domain->fwnode, bus_token); } /** @@ -417,6 +520,61 @@ struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, EXPORT_SYMBOL_GPL(irq_find_matching_fwspec); /** + * irq_domain_request_fwnode() - Requests a domain for a given fwspec + * @fwspec: FW specifier for an interrupt + * @bus_token: domain-specific data + * @callback: function to be called once domain becomes available + * @name: name to be used for fwnode + * @priv: private data to be passed to callback + * + * The callback function is called as soon as the domain is available. + */ +int irq_domain_request_fwnode(struct fwnode_handle *fwnode, + enum irq_domain_bus_token bus_token, + irq_domain_callback_t callback, + const char *name, void *priv) +{ + struct irq_domain *parent; + struct irq_domain_request *request; + + if (!fwnode || bus_token == DOMAIN_BUS_ANY || !callback || !name) + return -EINVAL; + + parent = irq_find_matching_fwnode(fwnode, bus_token); + if (parent) { + irq_domain_call_handler(parent, callback, name, priv); + return 0; + } + + request = kzalloc(sizeof(*request), GFP_KERNEL); + if (!request) + return -ENOMEM; + + request->fwnode = fwnode; + request->bus_token = bus_token; + request->callback = callback; + request->name = kstrdup(name, GFP_KERNEL); + request->priv = priv; + INIT_LIST_HEAD(&request->list); + + if (!request->name) { + kfree(request); + return -ENOMEM; + } + + of_node_get(to_of_node(fwnode)); + + mutex_lock(&irq_domain_mutex); + list_add_tail(&request->list, &irq_domain_requests); + mutex_unlock(&irq_domain_mutex); + + /* recheck in case list changed */ + irq_domain_handle_requests(fwnode, bus_token); + + return 0; +} + +/** * irq_domain_check_msi_remap - Check whether all MSI irq domains implement * IRQ remapping * From patchwork Wed Nov 7 22:03:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98C4C13A4 for ; Wed, 7 Nov 2018 22:03:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 855762B4AF for ; Wed, 7 Nov 2018 22:03:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7892E2000A; Wed, 7 Nov 2018 22:03:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D2BFC2000A for ; Wed, 7 Nov 2018 22:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oDbu1QQA6gxHrP6aY2E6L7P/y3zAYt1Tj8Bq44AT4k4=; b=ZbfjFdY4MU7pfm w74jXcXcOXb2E5f0bMPxsMMnEoKlwT9WWoEKciCaYaeg7Q8eMzXqVpf03jDUJqJuihLOboO6L2HdA fxccua/BEfiaR0JtSKqPqYaUlluJ2eirdbwTWglkzfl1MNjF9QsES5S1vznOzGrnYwTP+n1lpDEwl 0i34pOPwOsStBSnAe97WU+K7xAT1o1IsSgAQPSDXS8cn4jHA1B2ejHLWECB5dNpCQqtNfwGaEwq1L n8EhnYktHvHY6Fxw4GK4BwXKWAA5tXfECIOxhL88YqfWkAYLS+xRzSvhLSsRaV8c8D5t+9jcMT2Lc RJiN1CuhrsWdTG3WVNJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvT-00018u-ED; Wed, 07 Nov 2018 22:03:51 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvJ-0000xM-N5 for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WVJPuN4UrdNuubbuIz76x9ByAl3G3stZh22pOcKjrkg=; b=CO0/tl/1cc0qOFEFqXrsNlCld54A/sGUnuxUWF6UbXW9aBAMAUOd1rXQq2qRh7epJswAZUc4ycnxc49ja+TYp8v5Fk50vrO/at2WZQC2F5MugGINNEZfCrRmNKnBQl0ms0ijP4iL4ubRk8EcprbQUJv74I8zVe8PfCNC+2Z48BA= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:15 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:15 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Topic: [PATCH 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Index: AQHUduWu+Z2RJeOXo0upX6L9SWCjNA== Date: Wed, 7 Nov 2018 22:03:15 +0000 Message-ID: <20181107220254.6116-3-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:4ABxiR3GpVS7fpiswXTxW6X2h6PB8SR0Totn438zpDX/Juf3O74+7cLGiOkR5n+0ydIGlCn24trxHiS8A0l5SzJtkZNHIlo8bQf51Vg+a7bcJq5nHaDTiQJa7nTO1KLqrEJSVqQFrJxatx+sl1LQ0H7BD07WccPmvSLIypR1e8zrRKbnXGjpeeoCJy8hY198rqgwVSXw8XJtAi9+JpmV57StoCnYudikcLmvvixlekuwpwzPfL1E6YZL9+fqczJToALhohLzbLHe59tojFiSTEB3K3d/BKf2kMYB9wXuv56C9m4Nru7gg1Ii4xVCnA8YZWi1doqhZXrsPlvcxBXNk7DH5CPJuLq+oAketzS9KUcU+E40/vqNY5rC6zJLiep0z32QKWwsAgLzU/fx6v2ihtATNZKAdmS24115OaSmjYNblaHdRFh+/fwdBsbzIfGE0uk7SnCzzpJRiOFQgdQq1w==; 5:Zbb416Gtm0JVuQ4XU5H1K1XC8okqZTqlsBKSkdsE1TrQ6B1jskv+lnnpYWr8tRW9nyyzK7UAUT8RY4Ls+OEocknAow8AInWaC5DhdrL8J65LeeY1ijxZM3TJQ0jt7CbaSquI3EjwW10+fanIKm3YN9VGvNoPWah8vtNq4DLffnQ=; 7:7fEVTQ2w35Ro8ytmGkBj7RYujrkBL2vrQo+k39kHaLhY9qhqtxtcLwUihZd8iUYUVOdYDtkPaBsiAwsTq65BywDEmo2g1gULSBvxUxv2tPcm9SmRg1ueLVd3PqL/GQVDPdswbwMt+74SpBBJzkOk9A== x-ms-office365-filtering-correlation-id: ecf6d9d4-2c72-495f-f882-08d644fcd0e6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: vG99BxTyVW9Qed+y4m+ey0/LQDK11td6c0b3tdSju8WaqtW+nK99r2FFOXsY1hplrmujI1JkUcO3kcYu2OBaQAmj5U0vQhBHorUvuxssAOF0//nmiLsbIbpl+4AGSAtZMIRlttCngJSthn8sr7YmuytDm5cKaAAq1Sr84XMUU9FZGDDYL8ruwpP/wmgM5hfD0yb6rKNdqW2ViQDs4L+MLLA1ohf1JbydfE3Y31MDCYIkFX1nNO5tNbo0snwczcQueZvUAtuqnRs63Lp/gHbVFDFa8sDovH/w1xiJquCPCPHP+6AEFzCQt8NbItzGeNelLDzqhpXIa//pyt8Zs3dp5l6NInyM0xNs/xVnbl3jMVw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecf6d9d4-2c72-495f-f882-08d644fcd0e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:15.0581 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140341_750940_9D922BC6 X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new irq_domain_request_host_*() interface which allows independent parent and child initialization using an irq domain request handler. This makes it possible to move its initialization to a later point during boot. All domains can be initialized in the same initcall level then. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its-platform-msi.c | 54 +++++++++++++++++++++------ 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index 7b8e87b493fe..1f2849bc58c4 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -94,25 +94,56 @@ static const struct of_device_id its_device_id[] = { {}, }; -static int __init its_pmsi_init_one(struct fwnode_handle *fwnode, - const char *name) +static int __init its_pmsi_create_irq_domain(struct irq_domain *parent, + void *priv) { - struct irq_domain *parent; + const char *name = priv; + int err = 0; - parent = irq_find_matching_fwnode(fwnode, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { - pr_err("%s: unable to locate ITS domain\n", name); - return -ENXIO; + if (!msi_get_domain_info(parent)) { + err = -ENODEV; + goto out; } - if (!platform_msi_create_irq_domain(fwnode, &its_pmsi_domain_info, + if (!platform_msi_create_irq_domain(parent->fwnode, &its_pmsi_domain_info, parent)) { - pr_err("%s: unable to create platform domain\n", name); - return -ENXIO; + err = -ENXIO; + goto out; } pr_info("Platform MSI: %s domain created\n", name); - return 0; +out: + if (err) + pr_err("Platform MSI: Failed to create %s domain\n", name); + + kfree(name); + return err; +} + +static int __init its_pmsi_init_one(struct fwnode_handle *fwnode, + const char *name) +{ + void *priv = kstrdup(name, GFP_KERNEL); + int err; + + if (!name) { + err = -EINVAL; + goto fail; + } + + if (!priv) { + err = -ENOMEM; + goto fail; + } + + err = irq_domain_request_fwnode(fwnode, DOMAIN_BUS_NEXUS, + its_pmsi_create_irq_domain, name, priv); + if (!err) + return 0; +fail: + pr_err("Platform MSI: Failed to register %s domain\n", name); + kfree(priv); + return err; } #ifdef CONFIG_ACPI @@ -135,7 +166,6 @@ its_pmsi_parse_madt(struct acpi_subtable_header *header, } err = its_pmsi_init_one(domain_handle, node_name); - out: kfree(node_name); return err; From patchwork Wed Nov 7 22:03:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5727413A4 for ; Wed, 7 Nov 2018 22:04:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44E2A2D1AB for ; Wed, 7 Nov 2018 22:04:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3770A2D1AE; Wed, 7 Nov 2018 22:04:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B73552D1AB for ; Wed, 7 Nov 2018 22:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W/2tXjaorZDBMRmvx/mPPyUla0w87934VfddeTfVek0=; b=r3DBQ5zbNT1Cy9 4qn0Pl3Rm4xRGhXMpvTO+E7dGJ6bYQqn17eAr5SHyt9Xus3QeqrmxpaGPbgujIiOFZWqn7MQBqZ/0 GJ5d3x+LvU+CCFn69JsP+9E/vtpmLw6p5QBDv2b/KiAedmc0x+PmC1EfTRjmYMoYzAPGEb3MyMene CQstD2MB/JaiGh/63npWOuWfYH+GNBt8LBwixSz69lDabw8PFRTXMelFgi8QpR5slWjkrhLXccejG k3cq6G/LKFF1HUI77p6xVmuNppOQqdHh99xp/p7SpcqUw2PNvVy5ef30m1U4ihn7qyF+5IvN/Cow2 ktXsbX6SVsgQm3EQDypQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvf-0001Nl-Us; Wed, 07 Nov 2018 22:04:03 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvL-0000xM-Gh for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dEqSRyxg+X7syJAyBlpOWnQo615RYOtMty1tKH1sdqQ=; b=edwCP7IL9OpxlAa6QsWdT+NFEEoQV2fD6XubH2x1KFv2psgoSwDte85tLp/yftlB/tpptvztwWFE+SWgp5jEO7oGdCCg2/xHZlYO13QmCU5aPVGVGnLh4xGfus9m+CVHJ9jD1kx7RaLTuya8vO7avnAQDVlzts/aqNSL+YIwTL4= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:18 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:18 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 03/10] irqchip/irq-gic-v3-its-pci-msi: Remove domain init order dependencies Thread-Topic: [PATCH 03/10] irqchip/irq-gic-v3-its-pci-msi: Remove domain init order dependencies Thread-Index: AQHUduWwz70Juxgk6EWnduSjhzzlwQ== Date: Wed, 7 Nov 2018 22:03:18 +0000 Message-ID: <20181107220254.6116-4-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:xJndUGydXmU1Yum4ZIibQ1Q0U5eD+tq3f0tWeJmUeCxcl7niWzfx4g/TNbP6bq27NXGvg0lPCZIDihgrkKeRGXWFwVlPqUXlQ7TWDbkN1JVJdwegq22G47JJAYKcqfScXvZ9j8SQs3ialn/QHyKzxJzWN5PoAyNT4UO0k3YGG44zmNMcwVgdtwGT8pHIlcpbBeZplaQnBBclIdausy6BYUA2BJ5ePIkb74HHq5Uwppdh/jV3D7fc311YLMFeGomm6CVoxXx0j7H77oI7mz8b7ObhDTdUdEZlvGUIUsLkS88QGrnX4BhzzXUUvVTYyrdhpyHNyf765PCYooBcJhl0fmr3eVzmXXlScTzXkImVozj4dpzcLbCaU+46SxY1y5xdIS3Rk3nwNt8R+PjlA5G8Ab+ndxs4xSRNZOtr5bYfaPWx//D6oDJ64UF741FzdKbKERpQ4e2DiTpymUqbdVrY7g==; 5:V08LRANL3BHeu7hN1Le/3hIFTs3GXGigsu08YxUNKzaTkdtSt4zuFql2NkR5gZbiMf4LnLfN7l/bpJqFicl/vxZTwPGRShj7Qust/HYxh8hVikZGp2IC10M3wNfTU60cslfFeOlRIHvZJ25A/bZKr0hcXCGx90c72CMlvbsaD7U=; 7:OGYLRqZtWAqaQQseDzfGZpW3WXGj6NDaJzpk9d+H5S+KExwWRA0LxGs6Y3eJM7ZSnNCWtO0dPG9muJR56lQxi/N5GWInhoohH8Jr3ElBcboIdMyir3HfZYArZDSy5tj+y9Sly0GqaFd1Z60dCx2bpQ== x-ms-office365-filtering-correlation-id: a60ae2b5-4f78-4d26-a2ae-08d644fcd2d4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ZairD0bqm1gD0QhykaJ9qn22Rp9/6cB26aL02qBkZ5V9b7iJuyN7grNuxVF8TekZk95NhmiVYk8Pf4IvdD2BMZqWOLcE6CPQ04rXJhTqNt7lKd9PG+4nkDOvJjjVzRue1vTtCgrCvM4ZuFKHWD8sCbGSjvZ788SgulcQdU0Q9eVqyyWxFZXxZdnYRYFmsANIY6uKY+FdAZG680GaDQSGEPfcxMuw8E9/18QlHdCNFt9eCc6ulMtLl92g1+GokVgN48//WEA/mME2Y+E4JA6Vgxw8GHySzusseAIzfCxgkkneIakH5FW60A+71BloNgA61h2dVq+McP6VyByKiiqgEkLTxJrbHywoSnFGceQxDVs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: a60ae2b5-4f78-4d26-a2ae-08d644fcd2d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:18.3344 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140343_565815_780100DE X-CRM114-Status: GOOD ( 16.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new irq_domain_request_host_*() interface which allows independent parent and child initialization using an irq domain request handler. This makes it possible to move its initialization to a later point during boot. All domains can be initialized in the same initcall level then. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 66 ++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index 8d6d009d1d58..7d7366d55d34 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -116,27 +116,50 @@ static struct of_device_id its_device_id[] = { {}, }; -static int __init its_pci_msi_init_one(struct fwnode_handle *handle, - const char *name) +static int __init its_pci_create_irq_domain(struct irq_domain *parent, + void *priv) { - struct irq_domain *parent; + char *name = priv; + int err = 0; - parent = irq_find_matching_fwnode(handle, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { - pr_err("%s: Unable to locate ITS domain\n", name); - return -ENXIO; + if (!msi_get_domain_info(parent)) { + err = -ENODEV; + goto out; } - if (!pci_msi_create_irq_domain(handle, &its_pci_msi_domain_info, + if (!pci_msi_create_irq_domain(parent->fwnode, &its_pci_msi_domain_info, parent)) { - pr_err("%s: Unable to create PCI domain\n", name); - return -ENOMEM; + err = -ENOMEM; + goto out; } - return 0; + pr_info("PCI/MSI: %s domain created\n", name); +out: + if (err) + pr_err("PCI/MSI: Failed to create %s domain: %d\n", name, err); + + kfree(name); + return err; +} + +static int __init its_pci_msi_init_one(struct fwnode_handle *handle, + const char *name) +{ + void *priv = kstrdup(name, GFP_KERNEL); + int err; + + err = irq_domain_request_fwnode(handle, DOMAIN_BUS_NEXUS, + its_pci_create_irq_domain, name, priv); + if (err) { + pr_err("PCI/MSI: Failed to register %s domain: %d\n", + name, err); + kfree(priv); + } + + return err; } -static int __init its_pci_of_msi_init(void) +static void __init its_pci_of_msi_init(void) { struct device_node *np; @@ -147,13 +170,8 @@ static int __init its_pci_of_msi_init(void) if (!of_property_read_bool(np, "msi-controller")) continue; - if (its_pci_msi_init_one(of_node_to_fwnode(np), np->full_name)) - continue; - - pr_info("PCI/MSI: %pOF domain created\n", np); + its_pci_msi_init_one(of_node_to_fwnode(np), np->full_name); } - - return 0; } #ifdef CONFIG_ACPI @@ -177,32 +195,24 @@ its_pci_msi_parse_madt(struct acpi_subtable_header *header, } err = its_pci_msi_init_one(dom_handle, node_name); - if (!err) - pr_info("PCI/MSI: %s domain created\n", node_name); - out: kfree(node_name); return err; } -static int __init its_pci_acpi_msi_init(void) +static void __init its_pci_acpi_msi_init(void) { acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_TRANSLATOR, its_pci_msi_parse_madt, 0); - return 0; } #else -static int __init its_pci_acpi_msi_init(void) -{ - return 0; -} +static void __init its_pci_acpi_msi_init(void) { } #endif static int __init its_pci_msi_init(void) { its_pci_of_msi_init(); its_pci_acpi_msi_init(); - return 0; } early_initcall(its_pci_msi_init); From patchwork Wed Nov 7 22:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4128175A for ; Wed, 7 Nov 2018 22:04:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C49582D1AB for ; Wed, 7 Nov 2018 22:04:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7F232D1AE; Wed, 7 Nov 2018 22:04:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 503A02D1AD for ; Wed, 7 Nov 2018 22:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7OdsWHJCc/u2A96IBNwgi0cJO+FWxbFa3lVMPfbEOJM=; b=iGgWoh9qcY8EGW yrLorgUMvTGw2wmP4ou/J+ufYLqol7TfZ3k98iW9ISsdCAWUo4ijN/elo8AE2J+dAo90KBYr1JiEc HMR2Z87Z+2msaLHgjPHQpefvDNuKGNTtL3ndFFMk1PZ9/EWQxIsfJI0vrP/0JKhqoPCRnvEuk+rhK 1EkyfPK3ZxVgNdau66IpUsjQY3E62NpTMMFfJ2BUj9Rl6s2KE3ZqBj4fsejKtLMfKic00tW0HqWTU 2/P3iNytZZ58PsWELqUUN8iPwTQFQt5kVJ0OAXbO/vSn+90OtL+xMh/1E54vXOCn5qNnEeSpCOsD5 exs5iRdqKhzz9bMXujUQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvv-0001kM-2L; Wed, 07 Nov 2018 22:04:19 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvN-0000xM-Fh for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RxY00ErQKJ4xpBYOSdrd55Qxk0rjbsXTA/h9LTaUtgE=; b=Fyend2PWO6LFXydAxQ2vuvf+FzOrOzdeJBN+d1gHlglQKyi3HfrTGajsRf6GapZJiv5CyquUq5IT4Ql84IlM26vM+JA+npOcDPm9omF5e/pQalO1RFxZkpJrzjNkZ/Dee10Q/TXYDNnMztws6861TQYAW5GBTzMTDJ9ayS2gxUA= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:21 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:21 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 04/10] irqchip/irq-gic-v3-its-fsl-mc-msi: Remove domain init order dependencies Thread-Topic: [PATCH 04/10] irqchip/irq-gic-v3-its-fsl-mc-msi: Remove domain init order dependencies Thread-Index: AQHUduWymEhPeOVkDkWPP01/DQYsAA== Date: Wed, 7 Nov 2018 22:03:21 +0000 Message-ID: <20181107220254.6116-5-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:wFSW8HfanECKc5HLIPPee6iJ/WUR9CT6aL5AnQkGCSQdNvV090ZDUWewj3YeZ0njOkT+HS4eZffkQyHmQhnS/eSnl1eV0zevzIRTOX4h3bJZYZY/vzPheYRBWnAJvtEVS+aejSLYadLYj9HRgn0R+cDJKOeuuRAwukbYd8azx7pTSCWfe65Cg7w+7rlIqxfrzdKkkg4a2F5aC0iEColufGTUXydD4l/d/cpuU/wqY8ErT/Rb80dhEJ4liGtO67wMcbFkzBwz6uEOG4ClLYbsSsYbtmyYTUudP/eF66CcK53/7fIW9lYwQdNUCQiccKPIamuUiHR55ZYngOmq7WmhsuG5yso4rOnbL0eVMud/iuB9F2j1d3ckUFNcxB5yNbPqAZYapgQTFaf5eK5wJnMKE0GUcEWi2Cs86FwufOkLebV+mQqi/1xHiJpJbhcYN1H/Hd8faQCUHWFyLQAusRl0uA==; 5:4wNOWLNuXdPkiyGD8fGtW5nqquj3WvBMnebM/C/W3gWyHndMI9c4lyjLQtkq15JKy9blWQYeiQdIFRlGDGLxL7Q6jaIOib893DY7m53w3SjcDB34oSph5wV/qwfQV4iIf11zzWCpktZNSMCbPV/KUN+/4aHyhy1vowJ02jeLeQY=; 7:PgK/IAeUE09EyGmwIBL8XCZOPGgS442tsbST+xBjyAzAdf+r54ncuWONEIvZELmXQn4JmOIFKnijYvdtaobfevl3BolwJIeJ0ETSK9xl7bETHy1LkCUpXuDjv6ypDaniWB0bctXXihC91kjn4b1hzg== x-ms-office365-filtering-correlation-id: bd3a7037-4484-4eb8-04e3-08d644fcd4c9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: f7MaG4JQJsZUfwtsMygYeGKPmGdmLnerGNKPzGt05iV/0B9Phf1J8sKp9x2Q2gvbQ5D4Gjs8rbxmaVzZbTXdQfjVFX3Vkx07DitaJIKRh2eguYae0WkEFglKr9i+OfaXUdil3WZ1JDrnHRYIwxuRxH3SaFV4Uq3VQnInoXcdVfwrVYCGse5xuJTCVJdV+g43pHFAeNZwSMYLzGqAXT3vVX/UtxvOTnuzLKkhwYtL2dsxHyJySu3IQ9dXzwGHKPk32UNtNo4YiBN/MM10O+FEfJ1fHWXiipeVHNSG4vjGd3viA4dhRaD8DSwJZgUFVEW9apVMItF0yhp8fWOnnlA57nlGT7I4xAjSUK92B8fYLMs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd3a7037-4484-4eb8-04e3-08d644fcd4c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:21.4797 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140345_533290_6F80F3A8 X-CRM114-Status: GOOD ( 14.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new irq_domain_request_host_*() interface which allows independent parent and child initialization using an irq domain request handler. This makes it possible to move its initialization to a later point during boot. All domains can be initialized in the same initcall level then. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 47 ++++++++++++++++++----------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c index 606efa64adff..0e9b31f13618 100644 --- a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c @@ -66,11 +66,34 @@ static const struct of_device_id its_device_id[] = { {}, }; +static int __init its_fsl_create_irq_domain(struct irq_domain *parent, + void *priv) +{ + struct device_node *np = irq_domain_get_of_node(parent); + struct irq_domain *mc_msi_domain; + + if (!msi_get_domain_info(parent)) { + pr_err("%pOF: unable to locate ITS domain\n", np); + return -ENXIO; + } + + mc_msi_domain = fsl_mc_msi_create_irq_domain(parent->fwnode, + &its_fsl_mc_msi_domain_info, + parent); + if (!mc_msi_domain) { + pr_err("%pOF: unable to create fsl-mc domain\n", np); + return -ENOMEM; + } + + pr_info("fsl-mc MSI: %pOF domain created\n", np); + + return 0; +} + static int __init its_fsl_mc_msi_init(void) { struct device_node *np; - struct irq_domain *parent; - struct irq_domain *mc_msi_domain; + int ret = 0; for (np = of_find_matching_node(NULL, its_device_id); np; np = of_find_matching_node(np, its_device_id)) { @@ -79,22 +102,10 @@ static int __init its_fsl_mc_msi_init(void) if (!of_property_read_bool(np, "msi-controller")) continue; - parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { - pr_err("%pOF: unable to locate ITS domain\n", np); - continue; - } - - mc_msi_domain = fsl_mc_msi_create_irq_domain( - of_node_to_fwnode(np), - &its_fsl_mc_msi_domain_info, - parent); - if (!mc_msi_domain) { - pr_err("%pOF: unable to create fsl-mc domain\n", np); - continue; - } - - pr_info("fsl-mc MSI: %pOF domain created\n", np); + ret = irq_domain_request_host(np, DOMAIN_BUS_NEXUS, + its_fsl_create_irq_domain, NULL); + if (ret) + pr_err("%pOF: unable to register ITS domain\n", np); } return 0; From patchwork Wed Nov 7 22:03:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C585813A4 for ; Wed, 7 Nov 2018 22:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5EDA2D1AE for ; Wed, 7 Nov 2018 22:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9BA72D1B5; Wed, 7 Nov 2018 22:04:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 460682D1AE for ; Wed, 7 Nov 2018 22:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JxmfHhm9gtxIwuL0+j6TduI4AIpgNXvR+XugKYOPc3s=; b=sXfKh9WoYV5raJ 4IynenJeT1XroBm8qdPZD7GSDFXhOsQRlGwFxf8e8DuEBMhE36eWW7t8a+kp9RbaakkusrUKsZuwY 3TjHHYaRO9oFmw5zTI077c2uZKz2ucuUInLFbPAvoca5z97/b9SusuLjRQBti0neDsv5qoQMaT8AF X+xRkPzrThrI+/jdYPELFNgNpWJnYjB2L1uPjc9Ta+kwqnmQgIt1scJb43VmsQInl6bc30Gercoep GEE4XLxHhnIkmu+FLYSru1DnHLKsjypCALcA6zO40QktB46ruNOsdg7W5oP7IeK1d4oheSwsihEpD Me4Q5a2xj+hu+PEpsx6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVwF-00025X-6I; Wed, 07 Nov 2018 22:04:39 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvP-0000xM-BL for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1v6kKh3w8DKI6XhxuOY3njcmMYdey+u44Omf1y5S84A=; b=VQNE2jsAYCp0xeaQG0FbbxhTi2bUzEtob1cptOScM+lAeYJQgoeQuLwiBlw1erunu1Qe26mXpewVUij0VKR3N9djhrkIIQDzzaV88Ug9kYfd+E7VynBL/HOuX8Cck3/YbapmQrR+BFiks+CZIh1dQ2e2YR3dv+2gBTCKa6Wr+aI= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:24 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:24 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper , Stuart Yoder , Laurentiu Tudor Subject: [PATCH 05/10] fsl-mc/dprc-driver: Remove domain init order dependencies Thread-Topic: [PATCH 05/10] fsl-mc/dprc-driver: Remove domain init order dependencies Thread-Index: AQHUduW0VN1jp84mL0GDuCXIDaS+Ow== Date: Wed, 7 Nov 2018 22:03:24 +0000 Message-ID: <20181107220254.6116-6-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:X8PZ1s7uxwnfYUgTzSFV8x2smH6NSVypUyCUihKNNgVZ85PXprk9AT7HBfeRh7dcI7jeSBYlU8k0a/SWI/MgHH/5h5bvDQ2RvmJdZiSCb6ynasSLnQrQmMCwQwZxXWihaRQxYsJGD992L+EBIanTSGb4vhTtuljz9157ViSnSWHFhvimsnI9FHKjescH1Z6Dnzn4f0rQUCcbQ9/c0SgnMnGYnMiji499SjZ49RQ26XVi0gxSNJf8zVvRVnoLr5QVJdQ08ynyT43O5wRP/Z8ViHf6RNBueeH0TEatobQo4f4fkvrGOIFeTKTEkttU2xgHJAPsmmj3c/WCHJG5VjhfWlMIxiZ5jboYmZqyMNJ7DUYfPPwVgn/ddDVvLLZHZ8XvG0KceI47L0JWW/vzT3Dq2ZlAqubNffvjqHoulQRB2fUL2+CFJ1DKtI4ipFFUiNqnhhX7jhOgWBypRADLN5A4VA==; 5:NofFWQ5rt9XOisBnEmsWRWTOi9rwTDgxhchD7DtYe3K78I21vf6j375qVTsj9vrGr6QP2oqftI3Id05juSXt7+xPb5FwhI5kRw5tH/I7PST/R1l3IWFAWEJNGv0Wj2TL0AOnx4fGd1GiPwqVY8MiKywpFqb9mgJ248aMLQ2clkE=; 7:NKw+3gpYkLSXndST180P/5ITbWkDvj9A9q30v9OD4LU3dYO5i2dpHyj5P59ERIalFMG8e73rPE3qdj5sc34RkSyiNL/bjBCFsTEmjM/24rG5oLXn19jpCkRYpoq0VOGoCcgYt8yjxhTDhUKn4fLazw== x-ms-office365-filtering-correlation-id: 10ac5363-bb9e-4b35-634d-08d644fcd6bf x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: csI32IRMuSOrQkbLos+TufEyBEE4nRBxHKYyOBz5p0SdOVaCb7Wx3iOV0zqS+Pm29tsn1FJip0PqXOrRjigRp8EdBjcYka7brLveVLTXr459YJ2SDhRDUaFvEQcAifsTeuaucBuyqryevUgYueLcWCm8uNAdWe2QfmfFBmy9mMYTp8iC8E60HKNF5PajJ2B9zlqMGGE/1u/L/grrgQTkuPOC+USQ7O+X/WdRYmJleNrSKyUkn+/GmwSUvX5e2gyawzcRghXKR0Jp1jJiRdF8HKqdK0MK+vfFaSzn0mcMKQhqoVSdIleLxIKOw0XLVhUgjAYZkKuDWXIc3fQRXGyg4MtYnuVXdodgokb+G3JuzXU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10ac5363-bb9e-4b35-634d-08d644fcd6bf X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:24.8410 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140347_397197_6BAA9999 X-CRM114-Status: GOOD ( 16.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use new irq_domain_request_host_*() interface which allows independent parent and child initialization using an irq domain request handler. This makes it possible to move its initialization to a later point during boot. All domains can be initialized in the same initcall level then. Signed-off-by: Robert Richter --- drivers/bus/fsl-mc/dprc-driver.c | 41 ++++++++++++++++++++++++++++++++++++++++ drivers/bus/fsl-mc/fsl-mc-msi.c | 6 +----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c index 52c7e15143d6..2f41886c8e00 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -10,7 +10,9 @@ #include #include #include +#include #include +#include #include #include "fsl-mc-private.h" @@ -575,6 +577,40 @@ static int dprc_setup_irq(struct fsl_mc_device *mc_dev) return error; } +static int dprc_probe(struct fsl_mc_device *mc_dev); + +static int dprc_probe_late(struct irq_domain *parent, void *priv) +{ + struct fsl_mc_device *mc_dev = priv; + + of_node_put(mc_dev->dev.parent->of_node); + of_node_put(irq_domain_get_of_node(parent)); + + return dprc_probe(mc_dev); +} + +static int dprc_register_msi_domain(struct fsl_mc_device *mc_dev) +{ + struct device_node *mc_of_node, *msi_np; + int err = -EINVAL; + + mc_of_node = of_node_get(mc_dev->dev.parent->of_node); + + msi_np = of_parse_phandle(mc_of_node, "msi-parent", 0); + if (msi_np && !of_property_read_bool(msi_np, "#msi-cells")) + err = irq_domain_request_host(msi_np, DOMAIN_BUS_FSL_MC_MSI, + dprc_probe_late, mc_dev); + + if (err) { + pr_err("Unable to find fsl-mc MSI domain for %pOF\n", + mc_of_node); + of_node_put(msi_np); + of_node_put(mc_of_node); + } + + return err; +} + /** * dprc_probe - callback invoked when a DPRC is being bound to this driver * @@ -641,6 +677,11 @@ static int dprc_probe(struct fsl_mc_device *mc_dev) error = fsl_mc_find_msi_domain(parent_dev, &mc_msi_domain); + + if (error == -ENOENT) + /* initialize later */ + return dprc_register_msi_domain(mc_dev); + if (error < 0) { dev_warn(&mc_dev->dev, "WARNING: MC bus without interrupt support\n"); diff --git a/drivers/bus/fsl-mc/fsl-mc-msi.c b/drivers/bus/fsl-mc/fsl-mc-msi.c index 8b9c66d7c4ff..550d2ed07f69 100644 --- a/drivers/bus/fsl-mc/fsl-mc-msi.c +++ b/drivers/bus/fsl-mc/fsl-mc-msi.c @@ -185,12 +185,8 @@ int fsl_mc_find_msi_domain(struct device *mc_platform_dev, msi_domain = of_msi_get_domain(mc_platform_dev, mc_of_node, DOMAIN_BUS_FSL_MC_MSI); - if (!msi_domain) { - pr_err("Unable to find fsl-mc MSI domain for %pOF\n", - mc_of_node); - + if (!msi_domain) return -ENOENT; - } *mc_msi_domain = msi_domain; return 0; From patchwork Wed Nov 7 22:03:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95B0B13A4 for ; Wed, 7 Nov 2018 22:05:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 819F92C580 for ; Wed, 7 Nov 2018 22:05:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72CE02D1B0; Wed, 7 Nov 2018 22:05:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D1CF2C580 for ; Wed, 7 Nov 2018 22:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=51DpKbC3cWIOF45czxWXtRHkDhawfof/i1NnbVATsv4=; b=KZXbcNCMg9Jzn0 ZnSm3ui0TZ9rVhnWwTB0FmW4q8W5EC157RKrqK8omGCGxOub5sgcE1TsYoqQeB1ZnArC71G/dHfKh j6NN5g35ErWoDK7ZMK2as1avGJEd8sKprT+p8hkZTvzTOFooiGZvjOeyKmxin50Dc2SF52YDNhuLQ F5iggfA+EO1hX97WpvfjLYF7MqxBvAUZb0NGG4dBXw9gqlglxdObiMMO7ahV61Rz2qUy0+65Jw0fi 73IzXcog2RmqnDCJF8QqTQC3sKEdaTYSIXQv2FWhNKWYDbcxSWXFUnnYj4lPd9s3giXN+5gz3MT+R bHE15T8GyCMzgmyyXs+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVwX-0002NI-Hs; Wed, 07 Nov 2018 22:04:57 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvR-0000xM-Av for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TcQINiNVc8Uhdwk5x/VRP//r9Jm7EmAM+Er+Ce2Oyvw=; b=LnvuWkUO3FqymVx/LDsX062yOjq55wxtlCtrpm+jDtD5Fy5xiNhWtHDWSREVFqVh2yQm/FmTTALGlxx/ImTQNRLzxfXfLxK/cqh0HFiUF64sHT9vC8YnqB6X5F3HGKafKh7py6SapD1L5o13wFapqvccMUyJLm2iF9QjOqSuxP4= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:28 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:28 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 06/10] irqchip/gic-v3-its: Initialize its nodes in probe order Thread-Topic: [PATCH 06/10] irqchip/gic-v3-its: Initialize its nodes in probe order Thread-Index: AQHUduW2QuQef2Qx6k+rWXI5dg3fTA== Date: Wed, 7 Nov 2018 22:03:28 +0000 Message-ID: <20181107220254.6116-7-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:f2rmJRhoyrEwNtPw/sAEMq/JiiJY5vR5+U/g1Y8m3gUrC45twngMWspMQGyQpJgT7uysslhisOwXxQ76v/SP1eJLPkI7932c4htnK2vQT4VcLbqIMwqi+FTkuxTP/o5IXpiHapw92De2t2GLzSxJezJhFzZYLaHcdxXD4K0P7Ysn0YTFpWZzm4WC4z4aAdoL6J9cZDtnJHtX9ZTW0/Y1ijm8FX2i4omzX3k7JxKRBm4ZPK9nQNGR20GNUc29bzbVG1+ljPCxgkKfkfhorYJZdxORQFB3YTmOO1qWfwVVdvyFrIpiPAVFkmOVarFoOw7E4DBPUrRVOYnlqWQUftnFWsJeMjY/rYmflYUeXjSD70Q5bD2agnVc3wp3fhaCynhJ7EDXr3bCP27WumLsFnKm+w1K84uhACj2Rw1y3Pc3m+SIo9eAPYddn194sloj6kcxRRmvlyAvUx2T5USuuQ/iPg==; 5:ZNDhDW+9FNF65pknhdXGICtZ9W4AfQayV+sxDxxBsDAqU20cNtA9U6q1+s8UX7y9DCQIc/JM/ily+gaWQGI37u+rbdQI/Cw5hzr48PXVxm9p4D/0xc9OnuhUwNDLExx52z9jiBTpfmT86K0O845WXO12b0mZQEZKnB4mEFKxUNs=; 7:yrkUkpfljj4YUnF0UlPjvcchXyQaOQ/FAfb0cztujNGJNLrchPEFG8RGDkeC6WX2165h9ycVMeuCYiUQdY9grWPZf5vIoEM4535iIJVr+8vSQvLcaSUgXaFn6/qjwmfDmW/9lh0B0BdKVw+NDlqbdw== x-ms-office365-filtering-correlation-id: 126cbd01-a25c-44c2-c705-08d644fcd8a8 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 13vc0D9VT5Ksk+GnBPR1IYcE5dmovyv1NpFCvPVUpkbXfZ1g/l7GZq17WnQeJCF22ygX3bHDCYBo5USCYOvy0w3GG7ePu73zRPfWyONm5yk0fqK+IycHk8p8xNl07/J8tTdDob1wfJV2P2W9j/GxC859m0Fe20f/7CT+oRjCwpMyt2dYEF49OVm2P0sD4KuSZGBkHtANYNb7/0FNeq4ugXcbF+KqS/eAMHinhQvcgl84HgV53nSKqJyrpZWq3TVqy9f8/xRIinFSvnhD9y9QnzBbKT6VuFPL0lcd/s83MaGVOxtEn6U5Nim7GfM4ZtzV4oh0+5TqQdmhTPCL62YqMZIcghM1B8ol2xVA9tl1lu0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 126cbd01-a25c-44c2-c705-08d644fcd8a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:28.0733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140349_418218_CC6495DB X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ATM the last discovered node is initialized first. Though this order should work too, change the initialization of nodes to probe order as one would expect it. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index db20e992a40f..4033f71f5181 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3602,7 +3602,7 @@ static int __init its_probe_one(struct resource *res, goto out_free_tables; raw_spin_lock(&its_lock); - list_add(&its->entry, &its_nodes); + list_add_tail(&its->entry, &its_nodes); raw_spin_unlock(&its_lock); return 0; From patchwork Wed Nov 7 22:03:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50BE613A4 for ; Wed, 7 Nov 2018 22:05:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F68B2D1B9 for ; Wed, 7 Nov 2018 22:05:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32E4D2D1F2; Wed, 7 Nov 2018 22:05:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E89C2D1B9 for ; Wed, 7 Nov 2018 22:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=duGTkOwAcH7Qm3//xM5ebM3U3sN+4JwVJn5SbTYNi90=; b=daqjcZSEWmp3pe mUcEJpKGIDeAyankuYH64z77aW29P8TxR2w7+rP9VzXHy95kOc5WXc1cqWByW87KR7Ur2ofNEN8wD EF+C4SZiQTbbLH4E5GmErd73O7CQX7CkOC4ZD9usM9JhzSOH+aBIGD8T/ArkmtGEs5T42Wx2Znzul htlErKL2mpqPPBvc7uExLhTLcLEka28MLAEM4jE9PQyxQL1nG9AkqcJvnddUpqNlg4hgJijXoptgH A8mqyAXNxJYS7T09IbD3kEl51n6pgYBSfgBsnTNTlwtYmaZLXHlfTS2QqYh7SKdDfToTQkVRCZ4Un i2F+asihML3bf+2+uzXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVww-0003eh-4L; Wed, 07 Nov 2018 22:05:22 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvT-0000xM-9W for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tq2M1TlVT4F+bOTdvDJjbvGp/OA4i8Nm/ptqbYMNPS0=; b=HI0KR+KkG0UEQBhSoCfxg+oJfNLxwDhgMeJw7xL1OETWRrFX4hIAGTQB+cX6PsR749zX+me0MhryZKYeHIWiw6WNda3tWHk8x7zBjG55R/q08TsSM4+zAMDfAa9eBfyM6xxrV8QbFoXANrF+uSiKoj5qP/FkqfTkybkOLhdoJ2o= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:31 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:31 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 07/10] irqchip/gic-v3-its: Split probing from its node initialization Thread-Topic: [PATCH 07/10] irqchip/gic-v3-its: Split probing from its node initialization Thread-Index: AQHUduW4a8Xj9OqBxEGOxPHNQ+pN2w== Date: Wed, 7 Nov 2018 22:03:31 +0000 Message-ID: <20181107220254.6116-8-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:cT7u2ZLqQklela7F1DzOjm+tgwVHk/Ycj3YMUigJ0GZb/F9nD7220xRo8JHLn449cNW7xMJLbzUjEhqFgggMTw2lZKD05GJmZYkUOWPGP9803h1dr/ZoAgFq5bLrgkhVzG6TgAh6ZHeOPpJkUlLnjR35xtXBhtpbe9wIYulSl7s/XUFvpLBrWmJLSyXXYdn+0DMEQM9I9yCDY/wg+JDesxaANIL0Xa+tyV4XWDRR7RXPbnchP8jRGNejlF/ZWed2hto1q2lUnZ2rDEKVyQ2Xjz1pVJNENhEoz+JLK5tUuoUmofpDJdj6+gt0b7HuLd4T4Vm4ecAfOL8XUWRzOZ9uM3QrNTELIm1jgDw4nwQBrs4BON8HpPU0nwHhJRfT8vxNyWrtDlhCUmbQDPxsRHI98ghCfJrxpMAGvvRiOYwY6gp3+ryoetf0Y3TzcUTBrFTFEcweUOSYSWemK/LMiyfzDw==; 5:ZYa5qY81hMlJGL39xPhqIrzYNQe7h5VO3BVDjzeoYxSPUV4et/zKRh7jAbC+Dhwx08eprLa+XcpjcSvKm5iM1hFMYiqGY2zsqEx+0xs4ZRkcLk5MO6EdW0Y3bK+3koL1a1UVoXr4zqzZ84SElBV27eFObCg7rKS91jbPhnwqBEY=; 7:QzSZSS7wHkbCeM//rv2eOtD45cfOcktBnJUorlYk5hCSOBOB43+j6CvSm3ZkGxRylddY7Uq7isiPi7Kcf4g5yLL/eZvs+hGvV1umRFbonmHdDUiMjVmIP8tgQDX4Q9OF/gts2wwe24LRxi1tezIgNw== x-ms-office365-filtering-correlation-id: 059d4034-44c0-455b-776b-08d644fcdad0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: g8fZ0J0r+ibfX7aPvqed9teyat72nmXGwvr71L4wvfSlk4MrmZo3XlcAIVCibMBj4bK4vl+7qD75/aqjsFMjeiwEZTguFbzcsKWnIuKw03S74xiK6ha/t8xTypLrI63Xud2HfX8j8aZ7E4RFL143xgo8lBRiYmF2o9HHMFN/72fYlHEpMsVqLkGSWiJ4bOAvQnezNr45CuqHnOaEuEwVqdIu9a7ZvxtWtHUesIsdy3WZyBScaM1Z/cvKPCYRT/6kKJ2X8tlH0pofx+Q5kqIKHvgl6q0I29COs/AjG1BZ1NAiEWjgRizeS7KopfaE3ytwSIyiBavBpN+5gnyRDcPBBLteWg0g7iob37hl73h9dsE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 059d4034-44c0-455b-776b-08d644fcdad0 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:31.7829 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140351_529921_74353427 X-CRM114-Status: GOOD ( 18.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To initialize the its nodes at a later point during boot, we need to split probing from initialization. Collect all information required for initialization in struct its_node. We can then use the its node list for initialization. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 135 +++++++++++++++++++++++-------------- drivers/irqchip/irq-gic-v3.c | 2 +- include/linux/irqchip/arm-gic-v3.h | 4 +- 3 files changed, 87 insertions(+), 54 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 4033f71f5181..c28f4158ff70 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -103,6 +103,7 @@ struct its_node { struct list_head entry; void __iomem *base; phys_addr_t phys_base; + phys_addr_t phys_size; struct its_cmd_block *cmd_base; struct its_cmd_block *cmd_write; struct its_baser tables[GITS_BASER_NR_REGS]; @@ -3375,7 +3376,7 @@ static struct syscore_ops its_syscore_ops = { .resume = its_restore_enable, }; -static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) +static int its_init_domain(struct its_node *its) { struct irq_domain *inner_domain; struct msi_domain_info *info; @@ -3384,7 +3385,8 @@ static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) if (!info) return -ENOMEM; - inner_domain = irq_domain_create_tree(handle, &its_domain_ops, its); + inner_domain = irq_domain_create_tree(its->fwnode_handle, + &its_domain_ops, its); if (!inner_domain) { kfree(info); return -ENOMEM; @@ -3441,8 +3443,7 @@ static int its_init_vpe_domain(void) return 0; } -static int __init its_compute_its_list_map(struct resource *res, - void __iomem *its_base) +static int __init its_compute_its_list_map(struct its_node *its) { int its_number; u32 ctlr; @@ -3456,15 +3457,15 @@ static int __init its_compute_its_list_map(struct resource *res, its_number = find_first_zero_bit(&its_list_map, GICv4_ITS_LIST_MAX); if (its_number >= GICv4_ITS_LIST_MAX) { pr_err("ITS@%pa: No ITSList entry available!\n", - &res->start); + &its->phys_base); return -EINVAL; } - ctlr = readl_relaxed(its_base + GITS_CTLR); + ctlr = readl_relaxed(its->base + GITS_CTLR); ctlr &= ~GITS_CTLR_ITS_NUMBER; ctlr |= its_number << GITS_CTLR_ITS_NUMBER_SHIFT; - writel_relaxed(ctlr, its_base + GITS_CTLR); - ctlr = readl_relaxed(its_base + GITS_CTLR); + writel_relaxed(ctlr, its->base + GITS_CTLR); + ctlr = readl_relaxed(its->base + GITS_CTLR); if ((ctlr & GITS_CTLR_ITS_NUMBER) != (its_number << GITS_CTLR_ITS_NUMBER_SHIFT)) { its_number = ctlr & GITS_CTLR_ITS_NUMBER; its_number >>= GITS_CTLR_ITS_NUMBER_SHIFT; @@ -3472,83 +3473,110 @@ static int __init its_compute_its_list_map(struct resource *res, if (test_and_set_bit(its_number, &its_list_map)) { pr_err("ITS@%pa: Duplicate ITSList entry %d\n", - &res->start, its_number); + &its->phys_base, its_number); return -EINVAL; } return its_number; } +static void its_free(struct its_node *its) +{ + raw_spin_lock(&its_lock); + list_del(&its->entry); + raw_spin_unlock(&its_lock); + + kfree(its); +} + +static int __init its_init_one(struct its_node *its); + static int __init its_probe_one(struct resource *res, struct fwnode_handle *handle, int numa_node) { struct its_node *its; + int err; + + its = kzalloc(sizeof(*its), GFP_KERNEL); + if (!its) + return -ENOMEM; + + raw_spin_lock_init(&its->lock); + INIT_LIST_HEAD(&its->entry); + INIT_LIST_HEAD(&its->its_device_list); + its->fwnode_handle = handle; + its->phys_base = res->start; + its->phys_size = resource_size(res); + its->numa_node = numa_node; + + raw_spin_lock(&its_lock); + list_add_tail(&its->entry, &its_nodes); + raw_spin_unlock(&its_lock); + + pr_info("ITS %pR\n", res); + + err = its_init_one(its); + if (err) + its_free(its); + + return err; +} + +static int __init its_init_one(struct its_node *its) +{ void __iomem *its_base; u32 val, ctlr; u64 baser, tmp, typer; int err; - its_base = ioremap(res->start, resource_size(res)); + its_base = ioremap(its->phys_base, its->phys_size); if (!its_base) { - pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start); - return -ENOMEM; + pr_warn("ITS@%pa: Unable to map ITS registers\n", &its->phys_base); + err = -ENOMEM; + goto fail; } val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK; if (val != 0x30 && val != 0x40) { - pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start); + pr_warn("ITS@%pa: No ITS detected, giving up\n", &its->phys_base); err = -ENODEV; goto out_unmap; } err = its_force_quiescent(its_base); if (err) { - pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start); + pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &its->phys_base); goto out_unmap; } - pr_info("ITS %pR\n", res); - - its = kzalloc(sizeof(*its), GFP_KERNEL); - if (!its) { - err = -ENOMEM; - goto out_unmap; - } - - raw_spin_lock_init(&its->lock); - INIT_LIST_HEAD(&its->entry); - INIT_LIST_HEAD(&its->its_device_list); typer = gic_read_typer(its_base + GITS_TYPER); its->base = its_base; - its->phys_base = res->start; its->ite_size = GITS_TYPER_ITT_ENTRY_SIZE(typer); its->device_ids = GITS_TYPER_DEVBITS(typer); its->is_v4 = !!(typer & GITS_TYPER_VLPIS); if (its->is_v4) { if (!(typer & GITS_TYPER_VMOVP)) { - err = its_compute_its_list_map(res, its_base); + err = its_compute_its_list_map(its); if (err < 0) - goto out_free_its; + goto out_unmap; its->list_nr = err; pr_info("ITS@%pa: Using ITS number %d\n", - &res->start, err); + &its->phys_base, err); } else { - pr_info("ITS@%pa: Single VMOVP capable\n", &res->start); + pr_info("ITS@%pa: Single VMOVP capable\n", + &its->phys_base); } } - its->numa_node = numa_node; - its->cmd_base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(ITS_CMD_QUEUE_SZ)); if (!its->cmd_base) { err = -ENOMEM; - goto out_free_its; + goto out_unmap; } its->cmd_write = its->cmd_base; - its->fwnode_handle = handle; its->get_msi_base = its_irq_get_msi_base; its->msi_domain_flags = IRQ_DOMAIN_FLAG_MSI_REMAP; @@ -3597,13 +3625,11 @@ static int __init its_probe_one(struct resource *res, if (GITS_TYPER_HCC(typer)) its->flags |= ITS_FLAGS_SAVE_SUSPEND_STATE; - err = its_init_domain(handle, its); + err = its_init_domain(its); if (err) goto out_free_tables; - raw_spin_lock(&its_lock); - list_add_tail(&its->entry, &its_nodes); - raw_spin_unlock(&its_lock); + pr_info("ITS@%pa: ITS node added\n", &its->phys_base); return 0; @@ -3611,11 +3637,10 @@ static int __init its_probe_one(struct resource *res, its_free_tables(its); out_free_cmd: free_pages((unsigned long)its->cmd_base, get_order(ITS_CMD_QUEUE_SZ)); -out_free_its: - kfree(its); out_unmap: iounmap(its_base); - pr_err("ITS@%pa: failed probing (%d)\n", &res->start, err); +fail: + pr_err("ITS@%pa: failed probing (%d)\n", &its->phys_base, err); return err; } @@ -3888,13 +3913,12 @@ static void __init its_acpi_probe(void) static void __init its_acpi_probe(void) { } #endif -int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, - struct irq_domain *parent_domain) +static int __init its_init(void); + +int __init its_probe(struct fwnode_handle *handle, struct rdists *rdists, + struct irq_domain *parent_domain) { struct device_node *of_node; - struct its_node *its; - bool has_v4 = false; - int err; its_parent = parent_domain; of_node = to_of_node(handle); @@ -3903,13 +3927,22 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, else its_acpi_probe(); + gic_rdists = rdists; + + return its_init(); +} + +static int __init its_init(void) +{ + struct its_node *its; + bool has_v4 = false; + int err; + if (list_empty(&its_nodes)) { pr_warn("ITS: No ITS available, not enabling LPIs\n"); return -ENXIO; } - gic_rdists = rdists; - err = allocate_lpi_tables(); if (err) return err; @@ -3917,10 +3950,10 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, list_for_each_entry(its, &its_nodes, entry) has_v4 |= its->is_v4; - if (has_v4 & rdists->has_vlpis) { + if (has_v4 & gic_rdists->has_vlpis) { if (its_init_vpe_domain() || - its_init_v4(parent_domain, &its_vpe_domain_ops)) { - rdists->has_vlpis = false; + its_init_v4(its_parent, &its_vpe_domain_ops)) { + gic_rdists->has_vlpis = false; pr_err("ITS: Disabling GICv4 support\n"); } } diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 8f87f40c9460..e04108b7c6b7 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1132,7 +1132,7 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_cpu_pm_init(); if (gic_dist_supports_lpis()) { - its_init(handle, &gic_data.rdists, gic_data.domain); + its_probe(handle, &gic_data.rdists, gic_data.domain); its_cpu_init(); } diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index 071b4cbdf010..a6fdb2910f73 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -603,8 +603,8 @@ struct rdists { struct irq_domain; struct fwnode_handle; int its_cpu_init(void); -int its_init(struct fwnode_handle *handle, struct rdists *rdists, - struct irq_domain *domain); +int its_probe(struct fwnode_handle *handle, struct rdists *rdists, + struct irq_domain *domain); int mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent); static inline bool gic_enable_sre(void) From patchwork Wed Nov 7 22:03:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CD1F15A6 for ; Wed, 7 Nov 2018 22:05:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF87B2D1BA for ; Wed, 7 Nov 2018 22:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E21022D20F; Wed, 7 Nov 2018 22:05:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 461DB2D1BA for ; Wed, 7 Nov 2018 22:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uhNYcT6LRqZTTMrDkiLUHLxUzj4mA5/Po/gDpCWAFR8=; b=N5BNb//FgFG8yv yobfjBflngFtQG69htO6sPINLJ1C4hPr6LLR9cUvCZHcha5GeFQ8LFIBBqnA7xQfd1BVGJhzy1uLm MrC+TAM8IisMbR9Cfbu6teBo7nrriAGrO4nkIpYUANGlFcQAbSXUr19k/FOl7C0F56kEfEC2+2uJN xJabAc4FI6kxu9wpwoQK2LwJsyTEk/tT6pJm5V8CkkZXogUD+9ogn4/Q//KyRQTE9leRUmQY2nqi4 hPI+3wXlwMN8jPobDMCCi07o8ZaqDaBG9PQRTnf5RJBzbPdxJ3OwWaENnckidUoZ62Njf/58+8Ulm umB8YiiXjM/DKFp4ldiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVxC-00048b-U7; Wed, 07 Nov 2018 22:05:38 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvV-0000xM-Q2 for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IXb+GAEoraiyNOmdqnTOtP3SeGPlwUy8jnhcvWxXRDg=; b=e8V2b0NemnfgA83ypjrI9jBompZMEOVHzQrjzV4bIYs5CNWDVL2E+k7n+KbYXx/RvFBRcxE1J+Vtv5AQZSsQVap8cDYc6Bm91FKJm5CBYWKLIz3zqZfAJanEhSmcnOIGNHcXwLYm+lASruwc1qB70mZsw+rFKMNcDBeV33HaiOI= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:36 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:36 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 08/10] irqchip/gic-v3-its: Decouple its initialization from gic Thread-Topic: [PATCH 08/10] irqchip/gic-v3-its: Decouple its initialization from gic Thread-Index: AQHUduW606qvYKxACUS/t7Q6A777CA== Date: Wed, 7 Nov 2018 22:03:35 +0000 Message-ID: <20181107220254.6116-9-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:P4u2XC0M/FRONswrGncFocv0hylvBw/E9puHI4JDu5QWeaP3uwxa73HLnLNL9vCmZ8QKwhw815gf9QkZKihgpxQKLli6L6RbhEOG9FQWv1nlx1aMze6UBKAK3ZC4zEQOhA2unh3dNLF1ldPUh9wiTQjIY7q/QV39qSOF6Sg5GlGb0URVc5ujS2Dacw58ysmgWtXGYU1heNE89I38MY8jLT1qCDovqCBf7WjZV/x+vw7Ci36PUsdczi+cHuxi39ZPG+UUkoD6hwVMAwlXWtMuUxI8HtUjRTovrXt0+ohm4mIuE0PXAeaYx4pigxZfdSoPjv0iFjYoG/OYa7H1pl0OpN//v/fKDw4k7PbeoqkAY/pcGVHVJ30bC6ufHyB2qUzDw94ps8twM0kFs+A+jIrqo/hlty4gilJbguRuvxJTeoHun0+/10s0AiWkXDkLuDT8rnecI1cYOTBCdkmIgX9nIA==; 5:ut4SxifV7OA84EROapD2gqVcq2LlYTV7V1XxbaW9dCz8mRnq7eH44Z5Vk6g5KJDfz5fziUpVEJtoEh7yDqAHW63fFFuPtZ1/M4zBeCDXtQyJooqHK8boqTQO01ZWSZYRUga7AwmkPN1lzzWhHau9DkgfmdCZT1NWb2dPWGWJm3A=; 7:P2oEkaw91jqVNiFWlZS3g8s+u6xLndIN8YeVMzsicsDqO4Maj4LYG7O99WWq2N1//A0S/Qcj6jnDGTuxrqWZkrUvmJp5CjFydapXPbXGshydXCdJ6++xg4qXkPQZyEvRHcJ1abWGN/mJLf9v7icFIw== x-ms-office365-filtering-correlation-id: f6775881-154e-4e85-5bed-08d644fcdd1a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(192374486261705)(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(575784001)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Kw9/SS4eXovT2RujH7sV6iREvvd1GQP5hCqZ8IfCi9Wly8DaegzL/qofPXWcxOtAUcS1kRYaJr3NI7tR6U/RKCTXYKbegNN5z6VzNw6b4UfeBMglTHHYbn4OD7TgzP5x03VU8xJLUABUEsl4tM3x+8FZxokXxMaOA2XYOLnzGg3Tpt4ldJwIkSDK+c7wPfVsXVKpxFEx2eMtEkLKsehRNumZlqpd27L9akhYu7DDbXRmECQm+qOqKzeEOLSCKIWx/nLl/dG3Q8QPAW9Fe90z+g/kyWhm3sfgwOIOpMtGdpjOJpd1KP6C0TO6t++GgFlqlybsbhjD9HzUAJH9DXShhu+USuB2MejCGJM5QXgoDPM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6775881-154e-4e85-5bed-08d644fcdd1a X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:35.7137 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140353_846943_FAD7A403 X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch separates its initialization from the gic. Probing and initialization of its nodes is separate now. There is an own cpu notifier for its now. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 58 +++++++++++++++++++++++++------------- drivers/irqchip/irq-gic-v3.c | 14 ++++----- include/linux/cpuhotplug.h | 1 + include/linux/irqchip/arm-gic-v3.h | 2 +- 4 files changed, 48 insertions(+), 27 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index c28f4158ff70..fd8561fcfdf3 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -167,6 +167,7 @@ static struct { } vpe_proxy; static LIST_HEAD(its_nodes); +static LIST_HEAD(its_probed); static DEFINE_RAW_SPINLOCK(its_lock); static struct rdists *gic_rdists; static struct irq_domain *its_parent; @@ -3482,20 +3483,13 @@ static int __init its_compute_its_list_map(struct its_node *its) static void its_free(struct its_node *its) { - raw_spin_lock(&its_lock); - list_del(&its->entry); - raw_spin_unlock(&its_lock); - kfree(its); } -static int __init its_init_one(struct its_node *its); - static int __init its_probe_one(struct resource *res, struct fwnode_handle *handle, int numa_node) { struct its_node *its; - int err; its = kzalloc(sizeof(*its), GFP_KERNEL); if (!its) @@ -3510,16 +3504,12 @@ static int __init its_probe_one(struct resource *res, its->numa_node = numa_node; raw_spin_lock(&its_lock); - list_add_tail(&its->entry, &its_nodes); + list_add_tail(&its->entry, &its_probed); raw_spin_unlock(&its_lock); pr_info("ITS %pR\n", res); - err = its_init_one(its); - if (err) - its_free(its); - - return err; + return 0; } static int __init its_init_one(struct its_node *its) @@ -3717,7 +3707,7 @@ static int redist_disable_lpis(void) return 0; } -int its_cpu_init(void) +static int its_cpu_init(unsigned int cpu) { if (!list_empty(&its_nodes)) { int ret; @@ -3913,8 +3903,6 @@ static void __init its_acpi_probe(void) static void __init its_acpi_probe(void) { } #endif -static int __init its_init(void); - int __init its_probe(struct fwnode_handle *handle, struct rdists *rdists, struct irq_domain *parent_domain) { @@ -3929,23 +3917,51 @@ int __init its_probe(struct fwnode_handle *handle, struct rdists *rdists, gic_rdists = rdists; - return its_init(); + return 0; } -static int __init its_init(void) +int __init its_init(void) { struct its_node *its; bool has_v4 = false; int err; + if (list_empty(&its_probed)) + return 0; + + raw_spin_lock(&its_lock); +redo: + list_for_each_entry(its, &its_probed, entry) { + list_del_init(&its->entry); + + raw_spin_unlock(&its_lock); + + /* Needs to be called in non-atomic context */ + err = its_init_one(its); + if (err) + its_free(its); + + raw_spin_lock(&its_lock); + + if (!err) + list_add_tail(&its->entry, &its_nodes); + + goto redo; + } + + raw_spin_unlock(&its_lock); + if (list_empty(&its_nodes)) { pr_warn("ITS: No ITS available, not enabling LPIs\n"); return -ENXIO; } err = allocate_lpi_tables(); - if (err) + if (err) { + pr_warn("ITS: Failed to initialize (%d), not enabling LPIs\n", + err); return err; + } list_for_each_entry(its, &its_nodes, entry) has_v4 |= its->is_v4; @@ -3960,5 +3976,9 @@ static int __init its_init(void) register_syscore_ops(&its_syscore_ops); + cpuhp_setup_state(CPUHP_AP_IRQ_GIC_ITS_STARTING, + "irqchip/arm/gicv3-its:starting", + its_cpu_init, NULL); + return 0; } diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index e04108b7c6b7..d2942efdb6d5 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -685,9 +685,6 @@ static int gic_starting_cpu(unsigned int cpu) { gic_cpu_init(); - if (gic_dist_supports_lpis()) - its_cpu_init(); - return 0; } @@ -815,7 +812,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, #else #define gic_set_affinity NULL #define gic_smp_init() do { } while(0) -#endif +#endif /* CONFIG_SMP */ #ifdef CONFIG_CPU_PM /* Check whether it's single security state view */ @@ -1131,10 +1128,8 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_cpu_init(); gic_cpu_pm_init(); - if (gic_dist_supports_lpis()) { + if (gic_dist_supports_lpis()) its_probe(handle, &gic_data.rdists, gic_data.domain); - its_cpu_init(); - } return 0; @@ -1327,6 +1322,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare if (static_branch_likely(&supports_deactivate_key)) gic_of_setup_kvm_info(node); + + its_init(); + return 0; out_unmap_rdist: @@ -1630,6 +1628,8 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) if (static_branch_likely(&supports_deactivate_key)) gic_acpi_setup_kvm_info(); + its_init(); + return 0; out_fwhandle_free: diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index e0cd2baa8380..584f73585142 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -96,6 +96,7 @@ enum cpuhp_state { CPUHP_AP_SCHED_STARTING, CPUHP_AP_RCUTREE_DYING, CPUHP_AP_IRQ_GIC_STARTING, + CPUHP_AP_IRQ_GIC_ITS_STARTING, CPUHP_AP_IRQ_HIP04_STARTING, CPUHP_AP_IRQ_ARMADA_XP_STARTING, CPUHP_AP_IRQ_BCM2836_STARTING, diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index a6fdb2910f73..f4348fa4260a 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -602,9 +602,9 @@ struct rdists { struct irq_domain; struct fwnode_handle; -int its_cpu_init(void); int its_probe(struct fwnode_handle *handle, struct rdists *rdists, struct irq_domain *domain); +int its_init(void); int mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent); static inline bool gic_enable_sre(void) From patchwork Wed Nov 7 22:03:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B22A13A4 for ; Wed, 7 Nov 2018 22:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 592362D1B9 for ; Wed, 7 Nov 2018 22:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CE9A2D20F; Wed, 7 Nov 2018 22:06:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B549B2D1F2 for ; Wed, 7 Nov 2018 22:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3/KZWCQzyGy0uSxEACrDIHO78YMFLFF5jNUOxAWMF98=; b=d2CqxJ6t/gZXdG 0TuDpYa3lJC4aQ/ZjX0bbUnGhvCKA5Gty50HKsjbMGWeIt4HKAT0g5upGxpiQOeZye+mqfzBpJwRY MW/AUxJa2MzfjpDqxLQ9pvAA5VQ3vE+sWgDQaHHydtMasdyMWnqrisiMNtkR9ywM1LiIrhEvSYd3L RLqCh5K+pAYG0U26Diw1N3XMncFoMB2R7lPWiMoevWaz4qtGh4oItt2PmvMnmbuguO26vMb0Z+ZDv l+nYWNmVMmiGHi8NXlFr7CHqFXtBGpBwZ8GHZ1esSAmm4GhZEWXnhTXctW/2duoFj3qH7RLnMkgyn XMG2Hh994TjaVUIXycTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVxY-0004SP-RK; Wed, 07 Nov 2018 22:06:00 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvX-0000xM-SH for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=63O86WtqYE4lfiBL34hoKJ5lQTXr+NwWTlJyCQ0B74g=; b=Ay9IetxhVLAOYiSsf9xRrWxuxzj5IlPoq6vpB7tAYgooCa/0NKZvdEbpR8ZO6w43H3fXP98FuZ1D2F7AHwyShWaNY8q7vcrfEd27g/FhMJfY2P9Mv9aTch8spKqlzIzqK9ZQYHji3qhCrSzL4bIhH7fyK7XTTvwHSFoHtK9zdNE= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:39 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:39 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 09/10] irqchip/gic-v3-its: Initialize its nodes later Thread-Topic: [PATCH 09/10] irqchip/gic-v3-its: Initialize its nodes later Thread-Index: AQHUduW9H28TYQeuq0q3ZPDCnEjlYA== Date: Wed, 7 Nov 2018 22:03:39 +0000 Message-ID: <20181107220254.6116-10-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:9zlO7XmWud2q5ElCgSTc6H7QS8QdKOvz+uGCp77+G5Moainp3GRPr8nGi+lXq/ri8euXahRqv2YQSZ6Zu5jm9yB6jYlsRhMouebfgd7en/e0SPOZBkKByYWEuwDO+PAlnUXvnUoXTWBudaP7bhCR5UVG6ASosTsZwkMtBKFQN1hRFjoeaOVadx+f4n+qyowMSm96S8lbZrknMdCYHms9X3ftVXXISVDpmNUzEV8GExMEjUahlNy0/AdHnGaQHwYBxwcXJHlTDDxJ+EP+gG5+iEK3HVKCsmf0KhTvYIDIsMiGjc1il13I4+fNh4CAba5lT/9anlP4P01sDlmsTzrJ1H/E4NksA3grgB+s0w0fMzQ2qqI2KJzrXzOdBgjDBYkp/8ZwpmEBlVWi4ljis0Ad1eNJUfgZCSeilFaQBJpESyEtemqm9EXa4osQ4yOITTTCVz1CM78IYIVlPDmReAexrA==; 5:DqPYdv7jcxdsbzjQAVph0LeyxPcyRcJqaHp8KcfyKl/IDU7O6u95yJdEw8cRqeHuselJUQQ7/GumFqtWU6PEP3qgTCJq6F/Vr359kovEVjrNxJWvb6115luwmXvwLC7AKFcRf8Y9Ph8TxNO8lJCQccU9OmdlU0Z43p9At1ZncrQ=; 7:HfPdnLNqGqtpXIstLU/zBHk7O9NjIBMJ5Jb9+f5b0r20Q+0BGnTtuh+p2W4jCId7AEO26zhLKCnx5kW5gdBGeJnGqt6ntUpsuuV+Abv0Q2XOrQwWXkOJ1KBRTQsrUQ/AHUiS8YVo58KfJa+pjtdfFw== x-ms-office365-filtering-correlation-id: cf6f5872-ad7c-442c-2299-08d644fcdf55 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xDtJIv0UvoPpExeWnibemLaKr2Z27KZbicYjlqJq1VzrSfjiU2DPUHvz2h1blSKXUxJNjlq208DIXyziSwLoVPyo89doChO2PiTHhHBmZXK2yi7N02mLmfYKDRmLmXIijmpAF0jp41XP5hWkTbZhSL2aexjkXq+QT85Fn1X/nypS8N0JUEWqyRG/ivK6BFaXwuGwuqiTtj/UFbl8MrFi2m75xJy0IsFUPuvH48sTSE4Ph0Osf7m1lcN7bVMcB0FmTkA5qKCCdZDEFhIYY084KarXMMw08w08CkA4E9pwQi1NWM0QUtycWoEZNhBP+ukMNVqavsFF8kokY/iDydfl4qZFEcT7LIntmig1AkKZlHA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf6f5872-ad7c-442c-2299-08d644fcdf55 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:39.4784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140355_925493_AB0050DB X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use an initcall to initialize its. This allows us to use the device framework during initialization that is up at this point. We use subsys_initcall() here since we need the arch to be initialized first. It is before pci and platform device probe where devices are bound to msi interrupts. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 3 ++- drivers/irqchip/irq-gic-v3.c | 4 ---- include/linux/irqchip/arm-gic-v3.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index fd8561fcfdf3..13cf56c66483 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3920,7 +3920,7 @@ int __init its_probe(struct fwnode_handle *handle, struct rdists *rdists, return 0; } -int __init its_init(void) +static int __init its_init(void) { struct its_node *its; bool has_v4 = false; @@ -3982,3 +3982,4 @@ int __init its_init(void) return 0; } +subsys_initcall(its_init); diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index d2942efdb6d5..01538876ad15 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1323,8 +1323,6 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare if (static_branch_likely(&supports_deactivate_key)) gic_of_setup_kvm_info(node); - its_init(); - return 0; out_unmap_rdist: @@ -1628,8 +1626,6 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) if (static_branch_likely(&supports_deactivate_key)) gic_acpi_setup_kvm_info(); - its_init(); - return 0; out_fwhandle_free: diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index f4348fa4260a..885d5a4e239a 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -604,7 +604,6 @@ struct irq_domain; struct fwnode_handle; int its_probe(struct fwnode_handle *handle, struct rdists *rdists, struct irq_domain *domain); -int its_init(void); int mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent); static inline bool gic_enable_sre(void) From patchwork Wed Nov 7 22:03:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10673135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3E1313A4 for ; Wed, 7 Nov 2018 22:06:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B37632CBCA for ; Wed, 7 Nov 2018 22:06:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6E412D1BA; Wed, 7 Nov 2018 22:06:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4FB0A2CBCA for ; Wed, 7 Nov 2018 22:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5IRsRLx7KH6ixXdzIBWxDT9d8gYTyE/soRH4zMxYbT8=; b=pYvON+0c9/93a+ ks7LCjRhgJH7hOD0yZ3NcavdbFfYN0tfNimbzT2TySg3VEJJhSwUYiS8rySf6H+aRS1kNNXhYxupS U9aotSC9ET1antG7mUpYhmMbyjFQIJacPw2SxCbrrRTPqX+KyHqgCAfVCCf0ugLCLCWfN/tqSjcCB f6Dyew1+lhPqAT+SKdTe6vBNlJTBC5OQMi5YUTdxDMYyvBL2IkX9Ixa6zfjg+bu7nXiFvo6U51+po ez1TeWMK1pvJqiVZ7waz5h31QmTt5JG9GPGHrwPjkCWOupEPBJrqnOj0q7j9CjgccEcDhxyBbErw2 XZV9cXc3lcMFE5wtyEZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVxr-0004iN-KY; Wed, 07 Nov 2018 22:06:19 +0000 Received: from mail-dm3nam05on060f.outbound.protection.outlook.com ([2a01:111:f400:fe51::60f] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKVvZ-0000xM-Nj for linux-arm-kernel@lists.infradead.org; Wed, 07 Nov 2018 22:03:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SDuDUaJXIBkDhEMjnXeu92GzrTHmkYt7IHsgl3ZQBzk=; b=R+hfw3+yNjBvYeTXdNFEmIo1rubI02xNO1k9HIuRxMWW8j4d7Y6mDO3yxks+AFJlfDIVbUT1nORU1O2WugdykqoLo5WiVjLZlOPwAvgz2VnqBYuAMEPfGDR9+thWyXU39UtMjfgWMpGgpuwLQy777WLFgyFoxtVt0xysCxM1+nE= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:43 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:43 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH 10/10] irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls Thread-Topic: [PATCH 10/10] irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls Thread-Index: AQHUduW/5AZAzs1nm0y385/013eVbg== Date: Wed, 7 Nov 2018 22:03:42 +0000 Message-ID: <20181107220254.6116-11-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5232; 6:2IqIAbNxz7VogIM1NxuGMz675CCTuNPCz2yGlAnvZBmxdFGIImtgopl/xavtsbaS4YbjXU7FVrbOH9SKP6hxkfImx5Wo9hkr/9/QWWxMGaqyCzt3TvRruC3iCiocrsDEQVFHhoCHzDjb+Qv/T7vO8teymZDThJNblwgc7MWi0dhTFgSs2iVoLfFoeqg3H+vntfkGSqMvQMaCCkla3k23NTU9zVo2VQF7dTFOFQvDJvatHZcCUjcxDaM65TvkkHby6cG+LLlOBHM5hgwoY3EuzaOUO87ChefA2exO7O+IUeFNs5CcIBWthVwuqKto3Ld/xRrl0RilojGGFmPurCtGjIX1cdWm4wAJBdrRAM5X5BTY7sljY42xUU0DvFfCzMidt4SleZQUmIH/XIA1UXzEQcOuA2LLA8z+CByEhatWePynMdyxD4YA+06TM4I4jHrE1n4Mtf/VpMNvuN5FJUU0TA==; 5:f0rNUN+uwi8TnDuG1b3gJrPW/zBjHvUvPZ0sJvVMVe2mmPOCWbEfUU+O3X+8Z+rZtUkdhnq6dZy1gh4lZ3NyPhD7bpxEplgyK82bLG4v0dGK0SzSnubYMXdbZVqtn+/HozwH2BufhpCPfn3yCApowWMrUfkMHW8nLwPyjjIMmUI=; 7:iIDvmxSeDZk4gsqLbym9GhLyENQV811rZTyH16pioZH4cfety8awfuub3XHRwMBUcasAmNHp8azYfjsZawnFVNKNJh0kHPdrTrXGJf3QllOo/AI5+Qgzr7aMu0K8RbzEBKhUbuXrG3gqWY3yOLVRNQ== x-ms-office365-filtering-correlation-id: 157f63f4-b375-451e-8fbc-08d644fce195 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5232; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(575784001)(2900100001)(52116002)(26005)(48284002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5232; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 5ZOJOUQ4DvXdPhObawpzKun6uCls3wABbhkrs3JTxUkbrXs29WhfO8vAcfNGZn7LGbj0BybBbXz+gpFn2YuHWSbqS3lf7J2Y7wVXKMPW5YaKfMM8RP1v1SSc9qLGcN7l7mOgqYeR674Iv3fOeSjTGbla4FuOqW5oUMB7DaXCtSs+mwkjMVJptYkS5iLrFqY8JtWB0JnHo74POQvO0raBYhfAJ/juMPYjAjw2qWQt5DUTKGxGzr0s4koAXMo/pr09TyCW+W4wa6wjggxfT/OLcbyNSrN50yzTTFid4I/INgsoXqGMRtRbmdWpHtUZphBwyFJsQdIw9/pHQWV4RkNDxV7Wl0CcGmuCKaevA/4vA7s= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 157f63f4-b375-451e-8fbc-08d644fce195 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:42.9788 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181107_140357_779928_B6BE7EA8 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Stuart Yoder , Will Deacon , "linux-kernel@vger.kernel.org" , "Richter, Robert" , Matthias Brugger , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since ITS is initialized with with the subsys_initcall now, we don't need to enable ITS children earlier. Due to the use of irq_domain_ request_host_*() there are no order dependencies when initializing irq domains. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 2 +- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 2 +- drivers/irqchip/irq-gic-v3-its-platform-msi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c index 0e9b31f13618..74d63fdff411 100644 --- a/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c @@ -111,4 +111,4 @@ static int __init its_fsl_mc_msi_init(void) return 0; } -early_initcall(its_fsl_mc_msi_init); +subsys_initcall(its_fsl_mc_msi_init); diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index 7d7366d55d34..9c4a0ebdab0b 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -215,4 +215,4 @@ static int __init its_pci_msi_init(void) its_pci_acpi_msi_init(); return 0; } -early_initcall(its_pci_msi_init); +subsys_initcall(its_pci_msi_init); diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index 1f2849bc58c4..76f8a2e85375 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -201,4 +201,4 @@ static int __init its_pmsi_init(void) its_pmsi_acpi_init(); return 0; } -early_initcall(its_pmsi_init); +subsys_initcall(its_pmsi_init);