From patchwork Wed Nov 28 14:43:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702785 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 401F113AD for ; Wed, 28 Nov 2018 14:43:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B42A28445 for ; Wed, 28 Nov 2018 14:43:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E7F12B3DD; Wed, 28 Nov 2018 14:43:52 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 628D528445 for ; Wed, 28 Nov 2018 14:43:51 +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=kMY6PVAFzkD0pjLuWi41/JZIQn3IesO6REFCkeFRWdY=; b=lWx6EgjTvhKgsV J+M0bzHd1VmLP3Y1r02DxGZ+K4TFgoPwoEWUNWcku7FZEngxjzq5/pHNuqpC/6/S5WEtbn/JQJk84 Xz3TdUKSA9z7QZrvm8NsGCSKH1jjF+FTnI7U0uwotSQwmeVe/ECv6mj+2+67bsF4HU1270HaZ7Yij h0SyZLT3UDgy7bIPY3udxA5Arm7RzaPwjTf/mfDh5H9Sq6RXvQvT/gBQ4DD2vnqYfG1FoytlAbzvs dGPVlS/W2X9n82GQv+A3Mm7FGB2AhaLR/kwS/gG60WjH32SZAGDlN1VkbHyM1ab8pGj5JVVzk0Djn lHUplaaQUBLQSpr9ecdA==; 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 1gS13x-0003J4-DZ; Wed, 28 Nov 2018 14:43:37 +0000 Received: from mail-eopbgr800052.outbound.protection.outlook.com ([40.107.80.52] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13f-0002zo-Cn for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:21 +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=TYHCRlEizg5103RwzZTClabwWKofx1bNw4wZzNMVTmg=; b=JXVsLaDjZlwfoXiZv1LWuv8rJI9MsrvdU74w7LNSqqLAk2zJyOX83plUJZw2LFW5mn+RoTQg0toHjvxQ8hCHrQFeYIopkvl6FRCy2kskuYkiuzmM+TTmwO8hdm9yUG9OBltw3R3ij8mIiWCXjOtzbEXdJhxGubdyIEU0/ej7y7A= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5182.namprd07.prod.outlook.com (52.135.101.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:07 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:07 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 01/10] irqdomain: Add interface to request an irq domain Thread-Topic: [PATCH v2 01/10] irqdomain: Add interface to request an irq domain Thread-Index: AQHUhyisHG0MwjEfWkSkFCadyWhX5A== Date: Wed, 28 Nov 2018 14:43:06 +0000 Message-ID: <20181128144240.28727-2-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5182; 6:EH/OMymsIvzSsDqGmPwyZwwURgLiSQddk1TVBQF+I5RxrbJu8PwP9dIM/SLXtB1U1SZzjOl+B+BvmUM4dX8FAzA3zTvV8Az/TAdtJ4y5Xe7Gh8GjNLYonITX97Wy0GdTIk5s5d82npjJIjfuRbvUIbkPAa4Q4IBvDvYbT5kyiifUE8nXuIQLM/XkiXQ/B+YtuvW2jjVWRP5q5AHBI2ALN1zj7MxE3JVBsr0LFakvFxuUWv1c/vQTvaoR49bXPBeooJyXNzajX55uloer664xMpgbPnWW4flOZGO6iQGv4+jgQGEpPJQzoLDljywnXGj1kXt6075tq3+vPi97pn8D5dEpp3jAUikrtGPqlUcoJhlHxz5PVity24kRyofmxjz9Svf2vV3NHQXLWsKrlyR03Em3o90kv+xtYZVtQrJJOVCPeILWGabV4TacADV1QXvFa+bl7EUylEnstX65qfKVeg==; 5:S1+93suEWh9Z/WtWzzx2VeE3ECFv5odH3O5kEMK9HCM1Lqh/WwNlFJzWQF6Bpja4eP0tFFdq+kJ09c1B5RuDYnF57mmgluUz+H9al9l7XVsIgNz3tCHE//vN3oe88nzlipd9des/rxv8khmYbyz5MBrSo/mkNtL4M/vslYtDDnE=; 7:iL0z23IiXqXlFRzYnM5+WrijMEcXtb6WAMyoKAe9UErhXJQBa2E8OZeAzFrk2dBlXdxVe/vmAb51zJRiqm0V5U9xa9FEygz24KlGFzQLGre0ODUMlc9Zx7ew3opgfmNouNP4i07eI8DV96DyBWQGMg== x-ms-office365-filtering-correlation-id: 279c8a19-fca7-49d6-55f9-08d6553fcebd x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5182; x-ms-traffictypediagnostic: SN6PR07MB5182: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5182; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5182; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(396003)(366004)(189003)(199004)(7416002)(5660300001)(6436002)(36756003)(54906003)(39060400002)(110136005)(446003)(11346002)(6116002)(3846002)(53936002)(97736004)(52116002)(76176011)(102836004)(4326008)(476003)(316002)(14454004)(2616005)(71190400001)(71200400001)(6512007)(1076002)(6506007)(7736002)(305945005)(486006)(81156014)(81166006)(386003)(72206003)(2906002)(575784001)(99286004)(68736007)(8936002)(478600001)(106356001)(186003)(105586002)(6486002)(14444005)(66066001)(26005)(25786009)(256004)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5182; 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: 46ao3zkoKEoLH0zt/8JVxpIK+4+PVZg5NH1SmkaI6rhG+WgU0UMRAyTAlmZPLPSD6XQytD0hlqza0mXVrMzHnuexaNX5XohyVXpP0vj2UkooplXm7uFoD1F8iDfk8G7er/KsRFIFlr7BOXMIH9nI0sD/Xl1hNEtvMDTagYeQg15tOi2ZZa5IBgx5EpTYWzSBZMpT4FTEqDbgqXgyEV+Ve4HnfTFb8mGtTWWAbtHq1PSDACcBIRpY9KRAs5U1O3i8mk3/aqS5sD7e26Edo5UZmJb4VEnLQ3IKdKobP+uV7tSgXcSMtRDpIMuqjmE1T6muabQuacefRsmfJ0ktVIUfJfEJa00yGL8On/LnytCejZY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 279c8a19-fca7-49d6-55f9-08d6553fcebd X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:06.5569 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5182 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064319_482493_82D60A01 X-CRM114-Status: GOOD ( 22.91 ) 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 , Julien Thierry , 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 | 163 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 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..ebe628dad568 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,111 @@ 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); + + /* + * For serialization of irq domain updates make sure to handle + * (and remove) the request only if the domain still matches + * the request. + */ + 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 +399,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 +525,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 28 14:43:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702783 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 496E114E2 for ; Wed, 28 Nov 2018 14:43:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30B922B36E for ; Wed, 28 Nov 2018 14:43:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2228928445; Wed, 28 Nov 2018 14:43:51 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 B0EC728445 for ; Wed, 28 Nov 2018 14:43:50 +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=JrpJgR8SEkku/c 7mevLgdwrUM+7iJCTf8cs62EAK+76cMShFep1xNLcbE3FWDb3mFgvQ+RsM5zZjEBGJrQGEJChi4fX WDBzxlTwM0xgUNDyT2JNoD1RlEaG2AX7dEJWzmSu1ZJMrPBUZ3faXW3dhhZLRNI05XopJVoTLZqza pQobmECi3iLW2ruPFA6wNMQB5BhSgvfv6vE6b1IEN7VFTJZmgAaLCyj9hoDFvSlXS0vrp3S+PLDfU eEz4+lOx0lcFh7qgSr6lYUF8vEyoAjOiidgMljPr0b0pUnuBDerklGpe/KVokBXjhd5rF2b8GX6Fi 5JetJBP5XoQjTdJw8mFA==; 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 1gS149-0003Vn-8l; Wed, 28 Nov 2018 14:43:49 +0000 Received: from mail-eopbgr800052.outbound.protection.outlook.com ([40.107.80.52] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13h-0002zo-B9 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:24 +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=Kl7Zi4NRSUfDJA37B7EML5v50F/c1pNiifgiZeq3zjI1H4eH74JLOd82a9jSS+S2pVFNZZb6yk1iGEtVk0u293xs06jQsel8N1sDpy1xyCCOvI21MOrfFHKB6YcWsGEIxTl5JKPm7QPFV1IYXVsm59Ilf2etpYj5FRW1SqxN4Mg= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5182.namprd07.prod.outlook.com (52.135.101.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:09 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:09 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Topic: [PATCH v2 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Index: AQHUhyiuiJ/5aLda5UGC92pCn/0y1A== Date: Wed, 28 Nov 2018 14:43:09 +0000 Message-ID: <20181128144240.28727-3-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5182; 6:CD+F/Z8LrRHmDQEZppQv6HfugA0KR45x9OdwDk7+8mXqnGT9jqKBbyTf8eKR8GXkXGyZ6kc7T3WQRLmKrWWMtd23dJcd5nnnOwdJRz+4eEG+8jb5NZPT/WY/GPtJUn48CHKIANuRnBGFvAZO6iUKvG/Vn46xRo3nnb2OECpBi1ielOl5670gAHPKNRpmPGZJvKHrkiUrqj2Meip9Gebh8a+g0y4tFHYRl11QxwK3Vjj1zGTNH4NhKw7PBeXBA2deD/Ik9SpOsWmJsLBhTZ6JAYm7gfPh0X2tlINtwdPWsOkGIkdXg7Jnlz5zI0XRPPByYZSrW0ytli9DwheCblxKesge7HWlPcyGrV+kYRGHDyKGV28dEeM8XvBq7wkC3cL95DyS5e1+yaTV4TnYZF/xPXfcWdlfhcf+CNTpIH1YkKI2mSdZZOTORca2NSptna6pKjI+5WcN0qhawyVmsMb+Zw==; 5:0RSWt+c9+qsY2WpBrJ8H+29eMJ1hP7dGTTeI2u36UGH6PUostgxYoSYwgGmmhZsU4fzvwpRqVcGe78Hj8MODsAmMaO8Qg5zz3XtbIFLYVsVDyH/V9cq4hYB9QAkRboVgkwHRPBw0uqRqqmfl+gB24guAd2EXGM/AwhDzjEK+AxQ=; 7:5Hxyu+R/XOBKISdHjk0tQsHtBCXkmAHWLUx3ijdDvk3nPRaKfPTO60Ht0y3X9veJH6T2HVQZUziPZT0IpbisWuyyLvS7A+rYK6TNWacAJTuVx7I6IGAcMRjtheoa88C6GB6ethOEiiXDr3D7ICwrBw== x-ms-office365-filtering-correlation-id: dc754748-4c3b-4590-d803-08d6553fd0c9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5182; x-ms-traffictypediagnostic: SN6PR07MB5182: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5182; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5182; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(396003)(366004)(189003)(199004)(7416002)(5660300001)(6436002)(36756003)(54906003)(39060400002)(110136005)(446003)(11346002)(6116002)(3846002)(53936002)(97736004)(52116002)(76176011)(102836004)(4326008)(476003)(316002)(14454004)(2616005)(71190400001)(71200400001)(6512007)(1076002)(6506007)(7736002)(305945005)(486006)(81156014)(81166006)(386003)(72206003)(2906002)(99286004)(68736007)(8936002)(478600001)(106356001)(186003)(105586002)(6486002)(14444005)(66066001)(26005)(25786009)(256004)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5182; 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: imD33EJ4JFbwtSgj5tbRMCsT8UrP/UprFNF42UT88YCrxe7DW6Mqw66xPZzkTYmGaw6yooYS9uZxfkYhC0hJK4qEewVo32LEE9pnXOHvo4IBDY+uWI2/p4PhR3aofw+98Yt43hJSZ1qhRCRou5z7T0oRhS/G7YG0InnhV8Ck0wE2ecoasNYanqKTDZ2QCLX1ESJK/1pgmJbV8YPUMWMknGnfpfzMC2mp6slrwRLpHHsXgBGb3fwUQTag3b58so5TSchCRdxjlsIgUvGuVr1S9vwNYwdNp8ZfbL3KDkJCQ9486R88pUX3UsKXQ9xfLQsabKioe1q7cX6FUZbOLAp5eqJKZ3nfLUQKaA815wJJdXg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc754748-4c3b-4590-d803-08d6553fd0c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:09.7130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5182 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064321_732286_F016B1B4 X-CRM114-Status: GOOD ( 15.35 ) 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 , Julien Thierry , 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 28 14:43:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702787 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 A607B14E2 for ; Wed, 28 Nov 2018 14:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 943E52B3DD for ; Wed, 28 Nov 2018 14:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8792C2BC46; Wed, 28 Nov 2018 14:44:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 15D402B3DD for ; Wed, 28 Nov 2018 14:44:19 +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=QRK3iYdUerQsJF NyjKn1kBXB5xKIEGe2NGKzX3jYS8I8ScZ62X2L7mpfWSGc3aPfXORsZmfGgn3DHDNwObJLfZigfJs EyxxlVphtlMkR7Ta6Rj6XhauhwVF5i3CZZ/CwqHu/oo1kIM4JUwcjV2Y7vfLyvRjl3E3bICts6DSP FWg42/AKO50Kpv2+jO67DR87IXBmgLhhfOFbU7DCZ2L1tOSaEHqLvTg9x7Ky5l8YWYitigmt+QXKQ NTUrKQIB6yrFpZKm2+XT9XAfqCu6EQhqfQWEZwsxF3BLRWWW2K/rRRFvgcLUapQqsF1mqozEkV+SU sWcOuKk9gvc5IkA+hSNA==; 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 1gS14O-0003lR-N3; Wed, 28 Nov 2018 14:44:04 +0000 Received: from mail-eopbgr800052.outbound.protection.outlook.com ([40.107.80.52] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13l-0002zo-16 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:31 +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=XNmmkBvbAEYpLw/WfJ1l3rOTy00+0OLhGK5Vwf64f06bbWnRiBV7vVjvVzh+7AXTDMA+PrVg8hjOCsjbAUBJS/ROKFgQJn4ezBCWCrtzcP4mc40vY1nqtQYHOMDiN1+vaGKZL8OYredOdoQBR6wKwgZ7NydEY9SekEi5XNoZF4A= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5182.namprd07.prod.outlook.com (52.135.101.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:13 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:12 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 03/10] irqchip/irq-gic-v3-its-pci-msi: Remove domain init order dependencies Thread-Topic: [PATCH v2 03/10] irqchip/irq-gic-v3-its-pci-msi: Remove domain init order dependencies Thread-Index: AQHUhyiwGzOi7c6W9ku3mSyUcOuuSg== Date: Wed, 28 Nov 2018 14:43:12 +0000 Message-ID: <20181128144240.28727-4-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) To SN6PR07MB5326.namprd07.prod.outlook.com (2603:10b6:805:73::33) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [77.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB5182; 6:mz8j1i6f6buHO8ty//2s2vgVnCd5rfJsbv36x5DfZiXM6SYh1c6JyjT+BBZC1b2N9CM8tEwJnyW2aQyJesIL999VgAn8MOLvksWyrAgFEdlHmv3MzVba8Nocb4xSD1n9SfXck7HQNJxkMrE/ztqhFf/SuzWXYrq6dcMCrGj2JQWhgUMl45TSwigOLL7Nu7JO0XhZlNwD8NDkLUGseuOY14TRhT/Ccbx/BmC2Fj7LZ4obWY3w/5XgIyZanr2y8gM13Kz+Wgylad8vfIm6YOv5B+AGR16hX36zbcWaYc1CUDwWbL8OLSrAKz4XrqkG/L/VemZNskVcjz1l/qT+uLe8WCyYRD//vcLZJpzRk/No1OqAFcl2JTArp+Ms7I0tSjp7L/641AeN4k3eD/1BQspp3cXTf2gzM3cUyG0EX9E/9K1caHOo9gnCdmGiy1+0Wn725Qs91QNrVhbYEZbKeHKccg==; 5:ca8k7rPCBWPRh0EO7m79U5/nhqd6MRgx60bdwkK67Ll7EOb9OyEdAbmvZPuUovhXlEtdiL085TK0IWa8V6VP9JbPlqZFRZp8DSfpZlneB2fUzW8TXy93Ot4bC+qok8BXT6eEbt2AacsxmWDyW2qLC7QqPWl1LA71VVsBWK8oOWQ=; 7:6FYOfy/9sMoEDsg6kdMjk1sdC0R10R3AC1yvrap6CTf5p4eQeaI2yoT9B7U2Dq2N//g56WGEDd9A1Gr92sXB14nKzE/UASiaxEkoZzQIAhRYgaZo3uCL0RuVclyXWK1brQ9R3F/GMlO+xAGC1FEmXA== x-ms-office365-filtering-correlation-id: c74032bc-a110-424e-d257-08d6553fd2ad x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5182; x-ms-traffictypediagnostic: SN6PR07MB5182: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB5182; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5182; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(396003)(366004)(189003)(199004)(7416002)(5660300001)(6436002)(36756003)(54906003)(39060400002)(110136005)(446003)(11346002)(6116002)(3846002)(53936002)(97736004)(52116002)(76176011)(102836004)(4326008)(476003)(316002)(14454004)(2616005)(71190400001)(71200400001)(6512007)(1076002)(6506007)(7736002)(305945005)(486006)(81156014)(81166006)(386003)(72206003)(2906002)(99286004)(68736007)(8936002)(478600001)(106356001)(186003)(105586002)(6486002)(14444005)(66066001)(26005)(25786009)(256004)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5182; 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: p63nP/zFaj7qrlp35Y9/e5SZcYi7Yurj0FP1Lkaw9nfj5csQuJs3Yy87xAcAU7SofC250QPS78VuXcXk5XsMcEkEM+eVdbiSEDurqAwljiunUv2ALsv1dU7mBt9KRs0Tozq+HNoPo+yL5m4IyYMdST3vfVmIBLPmUVBp9RWSUftkfsQ0LhOWyM4puLEQhHBtYdFBfKh1noHTAKwPsDuU+ILWBfH0HyWBiweM4bFUY7xv+swpmzce6wX/A9Khxx7i2oUknwVndIHTdHQN9G0RPP5THiSVDOL5qpGFf7lx1gfLZolrxWjQLmNrqNVQLpUMe64PqvWOgJKjOYG9TI6umtgmNn7OLeq4aUcwLTYG2wo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: c74032bc-a110-424e-d257-08d6553fd2ad X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:12.8692 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5182 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064325_676413_53F8E7E1 X-CRM114-Status: GOOD ( 16.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 , Julien Thierry , 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 28 14:43: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: 10702789 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 327DA14E2 for ; Wed, 28 Nov 2018 14:44:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 200162B3DD for ; Wed, 28 Nov 2018 14:44:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1286B2BD9A; Wed, 28 Nov 2018 14:44:25 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A33B72B3DD for ; Wed, 28 Nov 2018 14:44:24 +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=fXZX+kp1dUjc+gsj2KI6ANfQKHsiHR8KQ7GV+ZHOq58=; b=mjJjIBZpKXw1AK yKrBWLMr+afK80Q4L+4enzHuQSXJEFphUiJ4ESFkGxSuhuvnHwFV7RJxfvZFQRJNhNdCfXMeGwQ4G vSLldkj+YgXoqLotH61Sdb4YuhnNRT7krtMTS5xfuw2i1yYgsruAO53dhUqDA+UyxAnNbOCu/p2as sehBZ2kFv8EdVGEgjaV+ZUg6JT9TivsAvWA5ikgnAAL/fXf8iZalibJ7hcK+UPSJxRnWDRCK94YMm 4wgflC/CFn3Dp+CPNP8fRl1ROQLhq9BK+QLZjKrw+xs6EfFEsoM4m+XLI4TGe09l4W3ZOfDhlA1OU jeEf9BNI54tkfdm1mKKw==; 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 1gS14e-00041T-LO; Wed, 28 Nov 2018 14:44:20 +0000 Received: from mail-eopbgr730041.outbound.protection.outlook.com ([40.107.73.41] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13o-00031A-Mz for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:32 +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=cb2JuV/VRNxx02cKKRzEH34nqnmavH+4S6QRZ7rDHdA=; b=AA6ETgT0VfCIgxlhlAOylsnK3J2+1op3TC5jTtqTrfWvKyShKmloH4Q8QQRNOdVQTUWTpiYi0zrAFPFMvbrKoWVgyyHxXMcTQ46oUCSUFmLgRPJbR48tQs8qSU10OWpP19m6NYZoThI4zr8XTZDtGiRMR9YLZjIj6hrkir1J/6c= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4269.namprd07.prod.outlook.com (52.135.89.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:16 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:16 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 04/10] irqchip/irq-gic-v3-its-fsl-mc-msi: Remove domain init order dependencies Thread-Topic: [PATCH v2 04/10] irqchip/irq-gic-v3-its-fsl-mc-msi: Remove domain init order dependencies Thread-Index: AQHUhyiyrS1HlGLxGEyUcM/gwdB22Q== Date: Wed, 28 Nov 2018 14:43:15 +0000 Message-ID: <20181128144240.28727-5-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4269; 6:dnTBPcmv5dtw/+Mz0sNZ/AMXbB6zV0s8XrXxwPH8q6DYrDuoMwchfubW/F+Su8Ni0J2Q0nA6j0/6/2xaInax6RKGJ9aqXl+ti8F2glpNOkUoyz6q1ARMM6td2VTspsdY3+f+Es89QvWITs00bTSTi7mEfiZE5CRkG7RHveWe0PoqZrNyKGI6nVVByxREkOCutLBjwtGuQysiBlmg8aePC+C2BnLIDQDuJGVFEasUXm+09VOWuEbvu2Q2CO2ohW9dUPR6ieftct/8KDKgn8FVqyMYglbH62u4bg74wVeqc4PoZO02B48aDG2OjUtVI27zW0sVnQ2nsIjQ8U7bn50TwZO1en2m+c5weY0Jr2jOMHNP2SKmV22WqJOV9myRmV1whjndJaEc3Hl/ie07WrRPjt2YoZs63yRi49X+PhB7vKxPR3zFdESJXudnWE8Of4WIklt1DloeeUPrt/tSZyVoXA==; 5:yNGhf6sAyZOFz8ZZTsKqXLM3b93DhoTMA7oBSd3jwHH7/FH1p7nIOoaA8jyNhgrya9oWuPFFEloVbdaXKzosUzGCV5491IlaImyu25ehQMgHMIxZXHaOlRFdrE+5Q5wjxsIX2nBl/Q+AVlMFJMD6PI44/K1BsrkJzWekx+30N9k=; 7:5jn441jzCOimzAK6f+VcSxwmTdnmeLwBheN1gsLqeJPR/sx4au/tHBn/SdF66xjl5z0ziKYLrv4YYbhZdkNuLVKSvYH/xbAyftDTUMC5kDi+X8JvkNCNbpgB+g9f9Qp1hMfXvy9ag9QBxfsex00gpQ== x-ms-office365-filtering-correlation-id: 92e29052-05f7-4c3d-084a-08d6553fd48d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4269; x-ms-traffictypediagnostic: SN6PR07MB4269: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4269; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4269; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(136003)(366004)(199004)(189003)(3846002)(4326008)(97736004)(14444005)(105586002)(106356001)(110136005)(8936002)(81156014)(66066001)(54906003)(71200400001)(81166006)(256004)(71190400001)(316002)(6486002)(14454004)(8676002)(2906002)(39060400002)(186003)(76176011)(52116002)(6116002)(6506007)(68736007)(7416002)(25786009)(72206003)(478600001)(1076002)(53936002)(6512007)(99286004)(446003)(26005)(11346002)(6436002)(476003)(102836004)(7736002)(36756003)(305945005)(5660300001)(386003)(2616005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4269; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: M+807HLNzTxBYUsnRkPdEYhlGBAz43KIyWuouKq/kR1VaXBgruEh1yPgDZAoUSYmhyy6FpX57ZaKSAj0BZygiEz5ulaLbre4Psq026LpqfP5n3J5VW28bz+/iwdD+3IFK61cMgzIhwkOpKNF7doFWstsoBmYgWiJw101FyNk39xdGLA78dZPZQ7y7CCqidKnsD4vMjvVnNXcR2WhRephiZbEktX6sFM7HHbIhs2XeKrHVTmX5Y4Qdctw+MucxrHab0eAJ/Y/WhdzFoFyVb9NB3iu1/pqaeuOunyJdc+SXgRPBnPC6IF97lsxAwBu/wXoY1oSzKPiFIv8Nf20ZLTTAM6mNWQZK4aPOKOpfSIbTzI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92e29052-05f7-4c3d-084a-08d6553fd48d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:16.0566 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4269 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064329_201281_9BD9DA2C X-CRM114-Status: GOOD ( 14.83 ) 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 , Julien Thierry , 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..81dfc534ded8 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 28 14:43:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702795 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 9386915A8 for ; Wed, 28 Nov 2018 14:44:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78B7E2D581 for ; Wed, 28 Nov 2018 14:44:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CB222D509; Wed, 28 Nov 2018 14:44:43 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 DBC122D57A for ; Wed, 28 Nov 2018 14:44:42 +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=HoODd7Zr439Uh7 sX7yIpBlG1p9sLLM04d5Oc9hF0bn3odNzJeAZCJyuOnvBiBjr77zmR0V4Y5WRdYGoH9gF+pF9AKTF OWHScgtt6X1206RffQlzvb0IqwimkNQTsnn5qwrjBQ/1KKdQvjJG89LUWuFmLJ9VzaiTyfHyUYnvu 9FOXNSlnk2JtkTTKWo40YQJQ8njMNFU95zQIVZBG4c1dG96PXgSwsNqWFHD2gHkq1syvyPh6kqBPJ MCJar7wAo4GsCek/Zyf5pblqLRwf1TvWLZgell3+vGeadkkRAMilhzLacEJ+iOvjpqf8JGQbzVTbO w8KNidI1/cbCNIIuq4aw==; 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 1gS14s-0004GV-RU; Wed, 28 Nov 2018 14:44:34 +0000 Received: from mail-eopbgr730041.outbound.protection.outlook.com ([40.107.73.41] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13s-00031A-Cg for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:34 +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=URrAnWxI1R6Gkfq+ThN9LUbWFuVM+fFFX8FvUk1E74GjpfvCPeyQ+cX5vzCGkXl20sOQ9aQFz7WWsZuIOzy/SMK61wTmB+UzVBYCgu7ZWIjlZ0TkhA0TRVC/JKJnBzKpcSSjD+AlhPWvO6L8LgWVEyEXASEYhcSggggs1wfx6g0= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4269.namprd07.prod.outlook.com (52.135.89.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:19 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:19 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper , Stuart Yoder , Laurentiu Tudor Subject: [PATCH v2 05/10] fsl-mc/dprc-driver: Remove domain init order dependencies Thread-Topic: [PATCH v2 05/10] fsl-mc/dprc-driver: Remove domain init order dependencies Thread-Index: AQHUhyi0qFdjTljGQU2/GluYiC9iqw== Date: Wed, 28 Nov 2018 14:43:19 +0000 Message-ID: <20181128144240.28727-6-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4269; 6:IiDzMSj3Y7nYs0NGN+hwht0rNSKcpJl4b5J4T4HgL9IczbX08AymcmIQg+HIZvVLNTpGtEIcVSGnsM/nGPgZP2bA66UQqmGzFxR3p1IBUN7TzO9dWdjvKi8Rir4zzDTFriFHcLAwLQrxfd1oOEVVfP+86j6m6eLK1zZCbsGK0yI+fGwS801BGtPuvO1WCh/7Vygmgd9m0GxtoF3dD9sNinfyuEx641qUZ2RAA/gnnCiExTTvFriYusGzMwoHS62G3+G55jd9eyKhu61BMIeveqIlpZ5m6+1Mg96lIQldi+7415uF9FSM2MOuIqh+3SEUTE+iNQx3mk1CUQfNV8Fcceq6cXgRO1GI5PpSXk4M0JcI0KJ7KrE+W7bCSJop117YAmaI/I8Ug166Xgk/whvQfh4GSn8Dm8ch+Qd+nJrLS7qIxPkTacR7uZyssBFfjxog8kWYBeafc2+ZtSkKDru0AA==; 5:N5QMj/3v5kUB1Ok5f/Nz/oDbLIJGYCOgkJaN9t1cKLs5gtfZlZIA6oMlG7rRq1QQXzLZ9SrRTMvhpvCUrAxQCI5DtA989O9TOlQyS6TukIoFUWc7Vom7Mj+AnlqPST2uYE20KmIeYt1vOZcqE3Kn3opo0OGaHGsjLqIbJaca+lk=; 7:hOCh7JddnjWORnrCCmoM1hULJVI4PnhmEOZOzYjWNPXXykqFJuBRwkPq5y2POQGxT69JZNnL1tJV2yCMsbn2G4hbB5igdWTQpi0t/akfLd20OJik+7B9VPCAXMe5PNr9hijVIV+cWAXMSPjKykSMpw== x-ms-office365-filtering-correlation-id: 19a8e64c-f72a-4bb5-3d32-08d6553fd68b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4269; x-ms-traffictypediagnostic: SN6PR07MB4269: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4269; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4269; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(136003)(366004)(199004)(189003)(3846002)(4326008)(97736004)(14444005)(105586002)(106356001)(110136005)(8936002)(81156014)(66066001)(54906003)(71200400001)(81166006)(256004)(71190400001)(316002)(6486002)(14454004)(8676002)(2906002)(39060400002)(186003)(76176011)(52116002)(6116002)(6506007)(68736007)(7416002)(25786009)(72206003)(478600001)(1076002)(53936002)(6512007)(99286004)(446003)(26005)(11346002)(6436002)(476003)(102836004)(7736002)(36756003)(305945005)(5660300001)(386003)(2616005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4269; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: woZ1/ylx1G6aqHPdyjLJEnu9Ly6z8QBo7p1jPv5ScAlDsiBNGGj6EZglMf8Acuxz6ySido8sMMVhIR9dNOKQiSdfFW1c2rGGchGCT6y1uI1/kZqGnVpaMyqiJosGOaeX6yAH6Y8md6ccTG+QIppGlg/cpuKsyDctxYtym5bZ8Beksg4z6g7Q4bH+hismhnwEMrFoNOlx+IrEfujUNcmsdQcvLiapDdYTAHoR301j/qKXoiuPZuqJLsZi6KM66XyAHagS8jMALKx4U1RJ+GSey3vYSFQmtJPVd1vR7+fpehL2s0hqVsvbsvHq+oxXnddYIWXADPwatQfxEJ3aG2sgyHoaF0eXuUwrypWpBU2qXJc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19a8e64c-f72a-4bb5-3d32-08d6553fd68b X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:19.5878 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4269 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064332_564483_B11855BD X-CRM114-Status: GOOD ( 16.62 ) 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 , Julien Thierry , 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 28 14:43:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702847 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 1A75513BB for ; Wed, 28 Nov 2018 14:54:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82F892D5CA for ; Wed, 28 Nov 2018 14:54:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 754252D4EE; Wed, 28 Nov 2018 14:54:52 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 29E8C2D4EE for ; Wed, 28 Nov 2018 14:54:52 +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=NsZ5qX+txGT3lW n+8FPhB3rAXGn+O5jy6hYPVNr0ik2QfmO6XtwPA9xF9ikaCD/lLtVtpOjk0X8QjxW7kFr0ohhqME8 mCNZCE1X2aaH62VRII5w6ZDyRIeAhSjg7p2FhQW5hc5e2Gc2KfuQ+W3ABWn+/CAOxvDhjN5daK3ba KyvPgNIOBO4DZj2CXItQFaVGG5hd4XnJ8Ky7BfCQmiNn1wBuvO3hmQVoe6BepJuywwdzJoCk34wIL 2AaZkq+D//B4cLiwDHz/by0aVrPv/uf5jsTnFsKUbThhwZ6T3gMgUXURRpnPr1bic6N0C94joLXs9 It5Qo2+MJVwS/mqiMeDA==; 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 1gS1Eo-0001wm-8Y; Wed, 28 Nov 2018 14:54:50 +0000 Received: from mail-eopbgr730041.outbound.protection.outlook.com ([40.107.73.41] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS13u-00031A-TN for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:36 +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=Ypmi5mhogYk8Z+EhaDtzniOiKPqgf4y8w+7ghaeBMSWVfp4sfpsVDC8X+lWsqLoIC6OSq6aawLVcpFFrnLhwNfouuOsbpjFpE4FMGy7s5o/JMY90FTtuG1cdXbOo/ZrDqLa4hKOmoQhRyDVbk4tMX810rLUCfSDRqmBn81TDY8Y= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4269.namprd07.prod.outlook.com (52.135.89.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.16; Wed, 28 Nov 2018 14:43:23 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:22 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 06/10] irqchip/gic-v3-its: Initialize its nodes in probe order Thread-Topic: [PATCH v2 06/10] irqchip/gic-v3-its: Initialize its nodes in probe order Thread-Index: AQHUhyi2YubiEyidEE20sokqXWnwxw== Date: Wed, 28 Nov 2018 14:43:22 +0000 Message-ID: <20181128144240.28727-7-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4269; 6:SvQe8/fH+P8+R3hE18M0VkYl+htpcVdEp6FL4mTGEI3zXAj7zWRBbU2AA42hWQGuklF3WFruP8UrcCqnyPayT0yobXqCmsMCE4LBENTFwlGyz5k3kpIyspwm6oU2ewK2jR+MQQqB/p8pgGUjBIwjglswH4ASOK2JDxrPvBoQYjqZTdrQV6ajqu0sh9CrO0u8TH9cIto+jwhClV2jZgz10kptMtLWEclS/4afEpbRdvIKPPxZsWbaet+rO2AqqolInuGh7y+wXqYSG+Y/qPTgmbf10zoEnXXDQYrxLeg3K9q0EAseWjNmia3KVtQQO6aa4SSK+YxRXixwSdjQCF0ekt9Wm5qZmRG78xhw5rrY1GoLxB9dEkF5RhmqYf+znVyToyel5OIF7Orf0NW1CjmLn8wvOXEKgondXMhDVncZw+3MhtgtA6wd2NHliSy0PmNLLv8VAKAz1Z5QcEiyDCwVIQ==; 5:gmxR26aTe+scg8avx2o1HvIfVwdcVVfe7KwUsT6hBd5jQxLwzqLMCihtLYoZtTcJZbFQIbRdHPpEBzLmnLPIInezNdm63eP2olVVj8rFtEyQWEtIAkSNR63t7B7t21Uop5SMP8X+6JesuxNVPXQOy3kb6Vsmep/PTkkb2SQolk0=; 7:hTpNwKRtQfZffBS9u+j4Fg3Pzv/5U3LAp7p+v9iLmsrPPux4gu/T4j9Y2BF6mYAC2uZhXuWsl59SdB28J1NzptPRj9hwhxvVIY0dco8K9PWRvB2w+T218IhVDuy5TqKgpAeRb3zJqbOjz45v9Ef/9Q== x-ms-office365-filtering-correlation-id: 370bd765-198d-4095-36c4-08d6553fd88e x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4269; x-ms-traffictypediagnostic: SN6PR07MB4269: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(10201501046)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4269; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4269; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(136003)(366004)(199004)(189003)(3846002)(4326008)(97736004)(14444005)(105586002)(106356001)(110136005)(8936002)(81156014)(66066001)(54906003)(71200400001)(81166006)(256004)(71190400001)(316002)(6486002)(14454004)(8676002)(2906002)(39060400002)(186003)(76176011)(52116002)(6116002)(6506007)(68736007)(7416002)(25786009)(72206003)(478600001)(1076002)(53936002)(6512007)(99286004)(446003)(26005)(11346002)(6436002)(476003)(102836004)(7736002)(36756003)(305945005)(5660300001)(386003)(2616005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4269; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0WsMFFyTpggisgmQ+kYyUdgU9tyDOCB51BeOv0FIP1rrln5nRCvqezTF4oaxklVVVZnH23LPt205vF8OpaEpNPnoKEdOc6olATN1HtTOM7n5x5RPusMEOaEPEekxISNmzo38TMu3RIYCO2oOcZvHnPPEz7iP17sdJW3Avcpf4Pc4GkA/bNRURjSWJqkBZy9+eR/9J64WCvGEcpy/5TeI+5XLBNAbZ9rEdAUmHT3kGZ9R5uBSRv4f+UVeoMe0Fx1uWLvf38UJPzsruCyW1M0u9xBYwDtXIHls0ARZiuZ6VBeYEplCcyiAkSGTznT7a1UYWz8uEy+Al5BL8b9AyIGhNjVAWJu2aWxLPF7XlPBJJh8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 370bd765-198d-4095-36c4-08d6553fd88e X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:22.8846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4269 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064334_963620_55CEE32E X-CRM114-Status: GOOD ( 13.57 ) 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 , Julien Thierry , 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 28 14:43:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702799 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 21D2413AD for ; Wed, 28 Nov 2018 14:46:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF212D59C for ; Wed, 28 Nov 2018 14:46:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01ADF2D5AA; Wed, 28 Nov 2018 14:46:02 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 2D49C2D59C for ; Wed, 28 Nov 2018 14:46:02 +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=ojmhGiXlV5F+Bj Ohbi2jEpEmBKIG3K3D9ScZ72pRon0goGOT5arjecDDf0Z/MCplcQKT502lJ2+/975y2LODSMfh6Cy 2qSCkfnCaUJpk0PgN8AiIpcwe1RKFl0VqdzL9pJQGO/ziOWiYoywriLW6rS2hQ8rIPo/qM2Uf+2F7 B1j5w0GTRLfH5bzYPZ2S6iVc/G+yuMIbflpE5PrAgEUlh8CkUqbfjRLimwor3nWSaWsiv9zXw8t5D URRpO25dK8P1XvhqaYYtWOVruyK2OChw1FdNYP18dtfU1CfdBVoLzRpJ/dQWXF6/jAQTr76+E7zcf RQH5pEty48H2OxgLT5Ww==; 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 1gS168-00069B-TC; Wed, 28 Nov 2018 14:45:52 +0000 Received: from mail-co1nam04on060b.outbound.protection.outlook.com ([2a01:111:f400:fe4d::60b] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS140-0003BM-M6 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:43:49 +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=XORwnPZOxjgxBH9eQwGdX8josZJGmOdwaY5BDoTOZ+32+/vZ9b/01NnjX9tSOgLahbUEmmkcjg79lGs8J2NTtE6IGg1awckVmb2GCdIorK1vcb0XT6ybSVtxNUIT2nwczoMU8RBRKVTUZ6VZEr64lMUFPAZwabKQiwPFKRKrkpk= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4399.namprd07.prod.outlook.com (52.135.91.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.18; Wed, 28 Nov 2018 14:43:27 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:27 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 07/10] irqchip/gic-v3-its: Split probing from its node initialization Thread-Topic: [PATCH v2 07/10] irqchip/gic-v3-its: Split probing from its node initialization Thread-Index: AQHUhyi49zwsWTLFgkavvMhD/AmiTA== Date: Wed, 28 Nov 2018 14:43:26 +0000 Message-ID: <20181128144240.28727-8-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4399; 6:YOlNepsUlCq0llNopMFTiGAFwIgpRTLEWYeBjX7WpeY+oiE1BXMVfi730Rw/+EVFAh9ehpFLA8Yo0CdTWZWIHls9zCDxRXbaY9f1THtgjQe9Y+3KpIL1do966svEnhbBZZ1Ap4+CRA4ikcBSlxLv34ZZewQ779Tm3ojuZ2fLLD+OOGUODRK+Um0NAoOT9VNRzILap2JF0KJrVo5Z9IMY2a1xnoptwdgEeQwzuWOCCAekJUoy/tXOIz1Tb2ybyqKG6ZHlfA9/JYMhbapEUkf5yuDWA8dnmwSDBMnTRU7Vg1YCHAgNqDrVXUeaNmtLrU7VodDSAZZw3X5BifQDIcDalcKYSHeGeetmCKkaCPQz7tQ+Q4kt42fV+x7E4yCM5BjOsdI+tzMaFHklx8++i/igVpOZGHA4K18rqnzV7s5ufQZBPmccJjPCmIqp5ZUOXmM7kAmtloUqCptlCWC0WOUFBg==; 5:GjwfWcloSlsbVqy138aoh85brMGFxSIHxlKXAsErgyeITJmAtgPGKCSF9GZeg+vBz4okpn1LIiIwx2JplPLr+valuD20EsMRu2lFYmRq9zXlJx6pO8Fc3lcGTr2Zg0Lm6qFIbKRcNGgq15nVAJrRKOchBih2PwBVKkqmIXRqlEU=; 7:YC+7118cCK2lNr6XjDLPs0gPNJbi4aOkUg5OumQ/nwEf6UsMQ7nqPvXWcQeooa1EXiXd5atkZGcPjYwE1BuA9ifovANh07GEGLrxNKMEi+bnNdpQAvrsWmaoqxSzSlzfOb2INLXrZczj11bzTTT/9A== x-ms-office365-filtering-correlation-id: 97106d82-30c4-402e-1a7a-08d6553fdabc x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4399; x-ms-traffictypediagnostic: SN6PR07MB4399: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4399; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4399; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(199004)(189003)(97736004)(14444005)(256004)(105586002)(4326008)(106356001)(81156014)(8936002)(66066001)(2906002)(54906003)(110136005)(71190400001)(81166006)(6486002)(316002)(14454004)(8676002)(39060400002)(36756003)(76176011)(52116002)(68736007)(186003)(6116002)(7416002)(25786009)(71200400001)(53936002)(478600001)(99286004)(6512007)(446003)(11346002)(6436002)(26005)(305945005)(486006)(7736002)(102836004)(72206003)(3846002)(2616005)(6506007)(5660300001)(386003)(476003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4399; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xziSxoPHfjnA+MRNnBGBN4fHQmuBwzMfapuXRVy3W8peGrG25dGENWDAVBzYEeh7cPqrRZcrnTCtmEWqKahsP0VeP6bgRmIXoXKPUnNUOP1gAGHXzmoGecyq+I1ARVR7NOBp1mN0Xqqjul0eZ6X/G747KHEW3szct4ugGaK8pffaTrBMB4GlSzhc9fPq18DMCxjheXn19xe+hNFuBJ56BDlUhpNrg/n91xVmVetLqntm7Zwn1ufq0QS91aosg0LcXD9hUwEvHXIXUK7WCnX5fuBIAIvgczEwo+dJgVfthbK/WiJdRGXn3kboC4yFjHpm9zlefPmrE51LCF+DBaOa/H7fe5pv50xE9KA3M59nwFI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97106d82-30c4-402e-1a7a-08d6553fdabc X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:26.9314 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064341_457531_0BEB15D2 X-CRM114-Status: GOOD ( 18.79 ) 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 , Julien Thierry , 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 28 14:43:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702801 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 125C513BB for ; Wed, 28 Nov 2018 14:46:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3B3C2C1F6 for ; Wed, 28 Nov 2018 14:46:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E76B72D596; Wed, 28 Nov 2018 14:46:09 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 5CF8B2C1F6 for ; Wed, 28 Nov 2018 14:46:09 +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=NfpuxvNnRWgkEn 7LYrpnbYCV04nWs29bPkSpZB3G2PA0VXYDcA+VP+tNlpudO9b1uhkb88lKb1tL9H+Tvom3IsMCa4c hM3uFWQRG00+RRzuCY4VfJy6oJTKUgpF5VgnRfY/9MHiuo/PwaPbF9TT78kaLIToUrIwFw2DKWGvH iN1w7pT4myjgCmuGrEy/SiGjGk4A77II9UBEuNklGASiq6PgErAL+qBgfXClssXxiSEcVxj1Zc4I+ dRxXhlJ2xHGm8Pv/ETtSQ+GTSDYa/aF2/wcmQOmsXe20FuvlH9iCV2UXeVvrg7wMvsr56doBNbpvd HgnoigVUCkAc+/YcZAqw==; 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 1gS16N-0006Qh-0e; Wed, 28 Nov 2018 14:46:07 +0000 Received: from mail-co1nam04on060b.outbound.protection.outlook.com ([2a01:111:f400:fe4d::60b] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS14A-0003BM-24 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:44:56 +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=jFkBPMzymW7FSl41SXdTMEyvNWldl3qLT3yFLGFJChV4dBy5Tiupw/9WjTeCM5NUmjrOtG8Hn3uy04UZiEzUeJMMI3WwRvHJV/f3vITYWyWh9u9drbpdIF1kLGOnIzYX5dqR0kxwn8qOHsEEJ/Z+x/jWuRUVtMmW4/4iNSBZUhY= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4399.namprd07.prod.outlook.com (52.135.91.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.18; Wed, 28 Nov 2018 14:43:31 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:30 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 08/10] irqchip/gic-v3-its: Decouple its initialization from gic Thread-Topic: [PATCH v2 08/10] irqchip/gic-v3-its: Decouple its initialization from gic Thread-Index: AQHUhyi7J6nxU0I0fUOV/EFE/c3JsQ== Date: Wed, 28 Nov 2018 14:43:30 +0000 Message-ID: <20181128144240.28727-9-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4399; 6:OQz25jywiKo5KK1r2TJQVOtyNjeanLJWwghon2vCLKC3D7qi2T30Cy79wL+JTERdjWRTWT+TDMXHpytfTBWA8NPvCs4ClMp+wJq0GjIz54f71rx4/6kwO1Dtxo6SRBtD5upmOG4g9smX91wCtg56WqzG5PHej9kRYMmWxeDulo8cGvnhcDTdr87b89vPLOodnyxFdkt0WYVB3C/ieX4u6fBT1LyvRqG7fa4chn6+E3bUqREJsZiT+NM5Sau3dpfjkBBAEyahYSqUoEjxa8QlBmrQcrDbnC6G4MJCFgFCyPPFRZvbftHwUdkv+LOZqJM88YMKwR8CqGsqILrhI1d3j4YLDdeZOopYGzualFrYp2hCirr5H8eNT+lnAAJPR1M6mdjBuUL1sUYtHu1ov22dHHWMzAM0Jo+oYIulLxPSGTlGoUdyvA2jjeEMXyN6o3NSwzoiM+OPi3rXMvcg3rlM4Q==; 5:+l66DSIfY1fbp3lKbkXxJzujbBSHNzpkEvcCsqdZVfIGvOmOm0qNIGoXpXJ1kFsDfnlXS65ywzTnbYeQdKoXL6US1aOxZ4nNWJbqbD0zZ4YLaJyEcnP6wBJ7wjivupS2J+sKux4BLN/NFLp0iFyBXCvJCZinnIsUyT+YYjPe64c=; 7:LAsYVfGJol+XoHidK6Vgn/dNL8/ott3wqLsvs/cXlouGb0Tz3K+rJuqhMph4DLLrwUufshPtBEw5GHoFgqjOb/O79Fh29kittoK3NdI6I/Ph5A38lysVPHDGCajK3h3MPkrHYN0YliS+ebvxqYGPJA== x-ms-office365-filtering-correlation-id: e0fa4443-9a0d-4911-d27a-08d6553fdd3f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4399; x-ms-traffictypediagnostic: SN6PR07MB4399: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4399; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4399; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(199004)(189003)(97736004)(14444005)(256004)(105586002)(4326008)(106356001)(81156014)(8936002)(66066001)(2906002)(54906003)(110136005)(71190400001)(81166006)(6486002)(316002)(14454004)(8676002)(39060400002)(36756003)(76176011)(52116002)(68736007)(186003)(6116002)(7416002)(25786009)(71200400001)(53936002)(478600001)(99286004)(6512007)(446003)(11346002)(6436002)(26005)(305945005)(486006)(575784001)(7736002)(102836004)(72206003)(3846002)(2616005)(6506007)(5660300001)(386003)(476003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4399; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SrHnSxULl5bUGAITusbpMBdLQsDRWRyRWS1J7JMtJ9dOuQN2hFrDFB505A3lfQRmSJetrr0e/4fKlQkrAARf1a/RsA18AJAz621dmnB/qD4PoPWtz11cF1J6Ue2kjURCUdj2yzuVxeaB0HK2vIdsHnLLvdimOfiDuhQ7xqNM8RjCAg3VW3+r89clrKQxUT9zNgKDGck475iFWbLSPYNVa+HCF4IS2SLttV2akXeTzBBVlMqGcjmndIZZjDTZz8l3HfPVKFh1OA9s3Kg6VcBnBlvrsEqC2lSLEa89BRJ6Sg2MSRFhLUrxeiBbGcB1YJ4AVthiB1mVmkU72n02TYp+CAFrdU1MdBK5Nx470X+1hwI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0fa4443-9a0d-4911-d27a-08d6553fdd3f X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:30.8533 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064350_931453_FE334681 X-CRM114-Status: GOOD ( 17.49 ) 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 , Julien Thierry , 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 28 14:43:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702803 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 B294913BB for ; Wed, 28 Nov 2018 14:46:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F3092D59F for ; Wed, 28 Nov 2018 14:46:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9383E2D59B; Wed, 28 Nov 2018 14:46:30 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 2D53F2D596 for ; Wed, 28 Nov 2018 14:46:30 +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=ZREvWFFg6poGIa FFNnI5uZpSMcednl5j3UtoixcEmWbGuDljX6q08DAEMO2664z318tEglE6EryV4DgEji1u1YJ4/BW m68bqZKanOgttuJ5SJSIALwJOtBqgU/OFx0AHjjhFlbW+tr2ZXUuKkIE9ouHQwN7vJtnVySjPvif3 kq6XdMu4DkohpJVLtKDTccBsE85jF11Drq2/x5w7xoePdS5TtFQbZuph0LvvQvwBmP3XXHV6xJu+M 07WU3Mq1OV3RR7FPVPIZQdsFnUvHOJUXrHB5Y02mI8sLPVDhb1F5vYkIEhS3oFE+XltOBzdaePZLg 71NASpNtPvBWVqT7em3Q==; 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 1gS16e-0006k1-3P; Wed, 28 Nov 2018 14:46:24 +0000 Received: from mail-co1nam03on0621.outbound.protection.outlook.com ([2a01:111:f400:fe48::621] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS14s-00043q-8o for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:45:12 +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=ch5I9NfNI4Qp6EqHN3eu4WExmWnDSfLr7+Mm1m/ECUo+Z7MNtcrA/UA2JLkEy4JBrXnef0wXqo+AnJz5miXDoEUdqUzT51/8tBDt0wt2QHfPQNVUAjMZQVNkNkPX5+J5o4/W8SCYTMaELLmj5wZb+5GvFEVLMTu+/kUKgDOTL/g= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4399.namprd07.prod.outlook.com (52.135.91.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.18; Wed, 28 Nov 2018 14:43:34 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:34 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 09/10] irqchip/gic-v3-its: Initialize its nodes later Thread-Topic: [PATCH v2 09/10] irqchip/gic-v3-its: Initialize its nodes later Thread-Index: AQHUhyi9TwLQwwjV3kulXsTCwl2DVQ== Date: Wed, 28 Nov 2018 14:43:34 +0000 Message-ID: <20181128144240.28727-10-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4399; 6:LEjV5XVjaLHgXXI7h/WpMFJYTIbQwyboHHQFvWN/0NqgxdgJ/VdFM8DZ3fiFJUqokRHOi9B5yj1PDyx74SYCjTgK5fbeg8ABTXEV/N7Jv44gkjW1czJVMtLQDa4uy1uQB0zYguD3vUbdI7KDDbSlgRIuI8vWLmS3Yi4IxYPpL37b8oa8p+vxAwurlFj+HOD1FH8gcM5ZWGz2WKxlYrXXBypF16hx/KnzkUoxMm4JkXVVbGsn8ld24O9rrI4IubHCgArcf4djupAVyc0aQWVIQskElNokaNaZE1e6kCpiSnFpRLjiaMw6LEKpY0GwEAxP0VjAgi9qnI83rxqthALV2I5MGjqLwSoUl5kBXAuK3WPHkpXKjxr6uGY/aCE/jWQp/m1DKi5xD/ciV17RfOMz/zseKzNcHGFtTe6BacHSPPaqZjbqpUPI4tFxJYRjq4fqEHrZW/rFVRkge+9bamFAeg==; 5:s1Z9Jl9I63O9PmoERAMq8udJ3xZXMJ5f4ZgSNB4MUOC1y/yK8DJ0R2um48DbeVU4bWQG1HcBJjfMX6d0D+YSVDCOjCD8+HlL6nyDOnugN9ggBcSGzVPM2uvl7RkXgBdEULVD+zLe3rdqdfXrqNI077wIprtwCVL3U3rpIe3Lruc=; 7:tYGW8zJUgcFzNjcz/G+JGF/VH5c6UyYI5FOxMF3nMBzFUBiz+UgXJt4OY8FzpVkymegD6ydjNW13FoFxFH++bITC9W3d2ZaWpWWJWy7tBPw/WxcpLiMUBcUp2jLkS5i9L15/6/fz+hvBKa1dPXvkpQ== x-ms-office365-filtering-correlation-id: 37d52c40-3946-477e-3f8b-08d6553fdf77 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4399; x-ms-traffictypediagnostic: SN6PR07MB4399: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4399; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4399; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(199004)(189003)(97736004)(256004)(105586002)(4326008)(106356001)(81156014)(8936002)(66066001)(2906002)(54906003)(110136005)(71190400001)(81166006)(6486002)(316002)(14454004)(8676002)(39060400002)(36756003)(76176011)(52116002)(68736007)(186003)(6116002)(7416002)(25786009)(71200400001)(53936002)(478600001)(99286004)(6512007)(446003)(11346002)(6436002)(26005)(305945005)(486006)(7736002)(102836004)(72206003)(3846002)(2616005)(6506007)(5660300001)(386003)(476003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4399; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: BfkcZ4HF3C1nxX9OgM6MjGORyeb462OfezeBAlfuGwAPZQ/IW2HkgSiqnGsTUrsAkK8xdkLRuXy4OOva2H/rsZmqCQAfqjK1x7thvkjRpDcDzJWCWS5dX34VKyfga6aCKEbMGnooPC+wLLYgmEZd0Zk6R6vLH6CZj3+aF5MXDQjaWrkW4Ry6aKCGfp0m93f7YDfX9mQlIEmICcCN1WUU8qbb6WsXhdgUrV9WShOAryQPwDkZ6LLI6g11rbbQOnhQ38QkB2kIchF0qjao6FnUeiCia1F/aZiCAdFnsSEvFG58t0rD+16UE2eqMFJsHstk3WoJ176G/dYfrEnaqtHC9YBpTPM7GPpJKkNe8KZ7njw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37d52c40-3946-477e-3f8b-08d6553fdf77 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:34.3219 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064434_726973_93D8DDAA X-CRM114-Status: GOOD ( 13.09 ) 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 , Julien Thierry , 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 28 14:43:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 10702805 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 6745613AD for ; Wed, 28 Nov 2018 14:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56B2A2D5A3 for ; Wed, 28 Nov 2018 14:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A4BE2D564; Wed, 28 Nov 2018 14:46: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 E73D62D581 for ; Wed, 28 Nov 2018 14:46:40 +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=afKqTWGsn6EKnSa2sqK/MYQjiedC5jjqyxCV1mVuWt4=; b=p6TF1avUJzgBPT vRJRNV7bd4dxa2zDtOVQHRdwjlpTwzmNow8tDWogkOgAkiRKXnvMCSAKnZ+Z0QtZZ6IRbShYv6G0T orxM/GX87A9tbxg4b+7ua3+kI0iX3SfvOSx30i5fo8HfPdshJ5uXFwW5NHb0xyBVVRd2k4v/4KEtB gps/JUqxcrySw/WSZ91I+3h4NtjgplP5B/dEb7ESjp12C9R1F7RGTyA6pOgwNQ3EUwCbxbCwGXgUC 0thNkYvJtbLtWcklIM7aA+rEs0qjOT43GGK2mjMV6Pd0HyyzyPw02aZO0FbfXFtaDZluAyOt+a+Yf X1IO3qWfMV1kutoORUQg==; 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 1gS16t-0006ze-Re; Wed, 28 Nov 2018 14:46:39 +0000 Received: from mail-co1nam03on0614.outbound.protection.outlook.com ([2a01:111:f400:fe48::614] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS15M-0004ZL-I5 for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 14:45:17 +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=YlYB4LQjCe9nG5/ORED0SvHXl0itwPxkPPFjc465E+U=; b=frkELlAFKM88lE423vnJnU1EGi72ckukaIPajrxsvBg5fbR4/Y6UVqhJcUWsKTUWADCopGWa/SQMLLBaADXcplnh+wDQkjIVywwxXvsqNBNWNCW4Iv3QwbuXg+W92c2HwsvtNu55eYgX3DMUoXacpagAogGSGlmBAJImm2njxvM= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB4399.namprd07.prod.outlook.com (52.135.91.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.18; Wed, 28 Nov 2018 14:43:37 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::ccc7:d111:7f3d:667d%4]) with mapi id 15.20.1361.018; Wed, 28 Nov 2018 14:43:37 +0000 From: Robert Richter To: Marc Zyngier , Thomas Gleixner , Jason Cooper Subject: [PATCH v2 10/10] irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls Thread-Topic: [PATCH v2 10/10] irqchip/gic-v3-its: Initialize MSIs with subsys_initcalls Thread-Index: AQHUhyi/VHkw8fQ4rEK/I3OXWgLFsQ== Date: Wed, 28 Nov 2018 14:43:37 +0000 Message-ID: <20181128144240.28727-11-rrichter@cavium.com> References: <20181128144240.28727-1-rrichter@cavium.com> In-Reply-To: <20181128144240.28727-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0042.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::19) 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.14.124.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; SN6PR07MB4399; 6:Ud14OQNqkNx7p88hYLIkNJn3V++mGhBQNeukiiPTA/U6E1KARENCYOoRNxyCbp0myauMzroDicbL1VLAXOrd/D63q3kJYHQhXXBuH8JbIrG6D9a69pdcRxVAr5paBLKvY7CBqnyxpaGalAhnyIinyYlAmkMVY/LwFAzVcn66/uOg1PKxrG1IptjLN8/XnffwaYtBp9KFRz/jGEVr/SSt5858Aseg2NBr5ue06emOy+GTRhViwepjz7XjmtJ8i7HZp/PZDjZA36Em76zGd47Ly2SG/npEWQyDhXaTNauUUIJ28zVTote5M1wZQTxMiGyJlV8hB1yY9UzC5pw2S9dYoyPStKyMPQGYyCkvUunGkCV9qWIXbnd3NqINwqA4JPqWizz+u6t5OnfyZY7yYQ3DQiNykTLHcn059BsA6lIRaZY8GIoj7l6+tWyapfGRMz5YpNzOyVgI24j9cTT98HxRqQ==; 5:ZVuo/JWb7nlB5xgln1SBMrPI5I34IwCaG3FWTO0nm7NHjYQBTyaaycMZCesrQtiL8dxDZLvqfoiNmKWKWZqzt2KIjqP0dCNNOaOwD36IbeF6eFdnQjhMZRh313zJnjEAi/tx3pc92p5W56jgEKQzu0gG/ah85yGmCF52AtIf6Eo=; 7:KhAxfenpa2zsZKjshVGoX4To8yvQ7vcUMpPVCsw9IZDjq1GMnMUliGShi229bS2DED6phmk2P7t9hTkjFHhQOo5kGn6zxRKYxrDJT48Ius9k++JZzZ/B5ecT2OM64CNu94YUe9Oapr6u9EzFjXn2gA== x-ms-office365-filtering-correlation-id: b702a889-2a02-41c2-e982-08d6553fe18a x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4399; x-ms-traffictypediagnostic: SN6PR07MB4399: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:SN6PR07MB4399; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4399; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(366004)(39860400002)(136003)(199004)(189003)(97736004)(14444005)(256004)(105586002)(4326008)(106356001)(81156014)(8936002)(66066001)(2906002)(54906003)(110136005)(71190400001)(81166006)(6486002)(316002)(14454004)(8676002)(39060400002)(36756003)(76176011)(52116002)(68736007)(186003)(6116002)(7416002)(25786009)(71200400001)(53936002)(478600001)(99286004)(6512007)(446003)(11346002)(6436002)(26005)(305945005)(486006)(575784001)(7736002)(102836004)(72206003)(3846002)(2616005)(6506007)(5660300001)(386003)(476003)(1076002)(48284002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4399; H:SN6PR07MB5326.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 15W3rr9wDrkw9azFn9zAcsFvXsX3te500vUhJRYOMlMYshMI/3OJ5Ihd7+pEZDuTWpezs2TBRhfiHfj59SaTqp7UWqBl9III9avWL8riedlGq+Owydft5st97PnjaOOHP3Yckr8iCLfVuSlJSStHmCMdz5I0o3tSYrjvne/NaL5VlMzV4m3TYE/IUhbjoxUti2SVlYYZjyXvIB7XuPsUcqJl84SA0Gk3DqWqnYaoa34c7R0SfFUzwIbMJ7W4/EPvguoC1RHGSENsV9JW3JatbQcSsGvwANdjpH15UaU52W/KYjhu6aaD3b2CIrouUxDkf8buNbmgNYHHaFwED1ZgO5MsL5hKUKhB21nNr7P7Qcc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: b702a889-2a02-41c2-e982-08d6553fe18a X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 14:43:37.7438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_064504_803626_856C79F2 X-CRM114-Status: GOOD ( 12.65 ) 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 , Julien Thierry , 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 81dfc534ded8..f6df5ea16aef 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);