Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754178AbdCFPmC (ORCPT ); Mon, 6 Mar 2017 10:42:02 -0500 Received: from mail-by2nam03on0067.outbound.protection.outlook.com ([104.47.42.67]:51328 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753837AbdCFPly (ORCPT ); Mon, 6 Mar 2017 10:41:54 -0500 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=cavium.com; From: Robert Richter To: Marc Zyngier Cc: Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Richter Subject: [PATCH v2 5/8] irqchip/gic-v3-its: Prevent its init ordering dependencies Date: Mon, 6 Mar 2017 13:57:36 +0100 Message-Id: <20170306125739.19445-6-rrichter@cavium.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170306125739.19445-1-rrichter@cavium.com> References: <20170306125739.19445-1-rrichter@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [92.224.60.20] X-ClientProxiedBy: VI1PR0501CA0018.eurprd05.prod.outlook.com (10.172.9.156) To SN1PR07MB2351.namprd07.prod.outlook.com (10.169.127.17) X-MS-Office365-Filtering-Correlation-Id: 5ed4c316-5dc1-46a7-418d-08d464908237 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2351; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;3:XpBYvcixWW2f9irFVrXS5cQYymRrjTxIuZtJqezlLXO+2dIiSSmxBlVxEy1jv8yvkG2Tsf4lbIpcWUGmUZ6A7p11X7Mj+FP2ytMEe0nn1qC5XBwaN8HaC1YaSgqQKV+G/M6jXuv7tPVKKGLz680uBawU+cI0CkhFXzAfYG4LHpy6WAC8e1gICINDY4EdZaxWy+9ITM2JYmzQAFvDS9ilsRElTxWbWKDLCvbE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Rz5N+dvL3nUyKCj4FE+jGQS12HqCa5Zxq/3jiudj32qGroIvmmiO2V3dEa69q+iA4KvlB0PreAdQGkHDEQ/XWWgu6piKjqfcoyIs6vq2A/bfuGCrINEvxJMXWtavRxpwh22S3rEyA2z1aRHL4RUJ8r5qgGU5Ph2QM8tL/lMhyf0sKpEvNn53e94MKYX9sxvjkiZj6V0YNK0znI9r2bOz13nciPgdOLu0ijjcBSvUoNw858M+1z X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123558025)(20161123560025)(6072148);SRVR:SN1PR07MB2351;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2351; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;4:6H/v9IQyiSeKMXKgTLDil67Tal8i+Gp+ZlnX5aAMDXLDjEOHNTWne+eeMnq8VxOiiNBsUq9oQCIwBMXSy8ulv1ok9zC/5lVui04S1uO/mfuWuGC35UOmqAOh45K9NnAlUf5sYM0MpOzkdtjCoaA9SjrlAAJLfNcwxep2HInmDaxI4nXxvSXP8NKLnLZnb3sIxc9EQ4jbvUquPYtvuPJbjSzs7SXJN98/BzI0j1Ts+zUYLgfALkpOBanwQRQh4C/uxUBtmqsz16dHdfmvlBw6B47e7gQiwmaeBqMQdIRPYFDHDOU1htFMZpo5pDpnLVOmRU9gTwi/FXuKej9aYKg057DvjbCp+gqTqX4cYyaHKG9LV6pJS5V6ycaw01JHpcYQwMtLXwuZX9B5xeyNvX9/Q5/Xf9sb7DY4zHTlY97IVpvEm2VRTfv2cKN5+Z2eOanpp3MjYTKe8O3LYc0f+2fQgqIGrHN35YJIERHh8UkN6rVLEXl28WWjBPF0wUzJk4t/SzM2tZUjeC9EslAwQkS1a6QWGg75JbLvcpW6JlhdlGJyzp7AHs6E81FaC3wGNqhsb6UaWFnXSYziull1bSUUd0e9QmrS7/x7He/ogw75Pt4= X-Forefront-PRVS: 0238AEEDB0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(6116002)(3846002)(2906002)(76176999)(7736002)(1076002)(47776003)(5003940100001)(6506006)(25786008)(6486002)(66066001)(92566002)(5660300001)(305945005)(4326008)(33646002)(50986999)(81166006)(50226002)(230783001)(6916009)(48376002)(42186005)(53936002)(54906002)(6512007)(50466002)(189998001)(36756003)(38730400002)(110136004)(8676002)(2950100002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2351;H:rric.localdomain;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;23:7toL5ohR5mzZwj4Xq0lsMHfYkgvno4jLUwoIIOzjWmleImImHLI2leh7SmKDAASZkzEw/s7u3szb1kHDWi5LdI6AbppwFceLOwvjDj+ppuzOkjEOGjCelP8IDHGcjaDFOrrSFI0E2OAT5+9H+m/ByhUoHGAnFG4B5gim9d8FcmmZzvItWw0zHvFHpQvPzeFYMYE5I4Rs1eKQiXnVCcCP9kPOner3kkQqQ1mXTeOjtQlpBH8mK60zEwbQyKCCUoiTbum+/03JYyGvNbyXnbP62FCK3GKF6AItUYZv8anfWqjnvEpaJcLlhPCQxCWuPKESm3fHUJpgkaTvuPoHpeh5hhjLvdgnexX8fI+GsRRi0/UZIjtVXfqfSYkDAP5DoWb43GwPjvM92ElVwtI7hq3H78vKLqBCTCUeA0O0bLi1IyehHwieMwRPn8e3xhyGo4pPE4+NmXUc0CEqv9QjYh+ef88vj7SiuswkQtKNQyL8bXxecxTEmrGcc5/COxO8J56uHx2oCXaJJn9gqxT4THVLz9fYP0Yx6zN8ZTMFuFsIhRlSqhPguw8YjxV/5YC7KN4uPYIEa7ngqAqTp9Yd2BZDB59wfpuFF3g05o/VsSXsx/AAoKjOPFR8zRVR6dYNw2ubZJbAgf7qC0DiJM6fMqfnqYpwTYKYkvvLwnac1JMs2QHkyClssBHZ0YtTgAhs6YYZoe6nWzJ/0t0f/CuCs86bVR1VZebE6DpbibCv6dweDKbC7FpD6xVeBBVZ/XP5NVbDTtVW+REpbztmA1raxDR8VJG8PhlWLwMpIxCo6SPQMWtQfXWqZi7igVUjoPbwSRo/SJo0lws197T23S1yZc3Toohl+MBou3oSNSU8yRU9Jvcq2NWRuyGVeue3ICOnvxdbMWboU7W4mk1o2qJoVjRJdXuZ0ljWTDAcvy0BBDW5LR0e6Jcn1kmNIE5tZpjXTWjx X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;6:xfrZf2+Un9JsMuhZ/XcOuJkTJRzxxicqpVD6qOMOPAI+vEQpoQ0C6/R5NzLH9Ph8qs5mt5eQB+OrzwTUfSIyq3fpE89WTOy3NZg5dAjjnGOU1qeDKcevcfblRalMHtvfB61DtC5qHzAGzTDpzxzUmMuMUq5ODe3D75p7BYXiOjAMS4DIMViWWKd8nBACr5xM6HoBuRRZs7xz+Yb9C9M4boG9+OhnFgZsMBI6ceGmSVwupFKUjDNCSqvG4/syzsVi3ok1LNc4rg2Qwcp4yk7tMkolWK6174srZvq7Iqk32QLMqbX91I6SGLsx5E8uchwbZ58xJrUGMvqminSj6oFXSddx66yICv8+bn4QxZ9zOWso5SP6MUzLFOiIoszxCNcJuRtM4irllmriEPsyX4on0Q==;5:C120htKF00bYw/Sz/4dfv/YtN0mlcLNiA2RybVDERBaXQbF/oLyhSemDo1oWmRmC+njQUnPE7zxqG8gxjJQy66j9QijtfRilEf+TzOkQMuCYM2hTD8scLbzrhMsF1S4lzUlTKRh2mvK/DuX99FcMEw==;24:MEqixk/GaEpzqUALL+29fchu2VGVChfUWFH8YmYvOxv8OVDacVm38WRWMols8Qn69i6ggdT0m+hWmIXnc/yULzHjvEpwq+KqdnK5nRkOqpI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2351;7:oXLNoYzsznNRhL9XnWPT+Cd3yVu68vFBp2TXNyjG1tv9S8syL9dYfRzy46rOA+C50F8vjL1FN2XzpunNzF2Hin+xC5Ywd4H8wemy52UPnc1iWZVDynEc5kHUYAwDcl04vLSYNMDy0O+z+pc4VphB6sUrLR90cYaEZDiYTD8XXslrpSINxl5XBtgh38Cg187y0ED/Bcmr1I1mz7OqlLOM/iyTBZlMbCY5FppD7JBhSUUjzA6/ajnbfktjhQNNHxbY92WkzSRoXRW6tkGWjkkbokDkT3QSdLoDECgUS2X42c01gzifesIlOodOpaFwyHj44h5YjuooFi4u4mWn0MWn+g== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 12:58:37.5215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2351 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2025 Lines: 56 Right now its_init() must be called before pci and platform init. Remove ordering dependencies to allow all initialization functions being called with the same initcall type. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 4 +++- drivers/irqchip/irq-gic-v3-its-platform-msi.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index dace9bc4ef8d..afe78f224181 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -77,6 +77,8 @@ static int its_pci_msi_prepare(struct irq_domain *domain, struct device *dev, return -EINVAL; msi_info = msi_get_domain_info(domain->parent); + if (!msi_info) + return -ENODEV; pdev = to_pci_dev(dev); dev_alias.pdev = pdev; @@ -113,7 +115,7 @@ static int __init its_pci_msi_init_one(struct fwnode_handle *handle, struct irq_domain *parent; parent = irq_find_matching_fwnode(handle, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { + if (!parent) { pr_err("%s: Unable to locate ITS domain\n", name); return -ENXIO; } diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index 7d8c19973766..22ba1dfed8ba 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -32,6 +32,8 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev, int ret, index = 0; msi_info = msi_get_domain_info(domain->parent); + if (!msi_info) + return -ENODEV; /* Suck the DeviceID out of the msi-parent property */ do { @@ -84,7 +86,7 @@ static int __init its_pmsi_init(void) continue; parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { + if (!parent) { pr_err("%s: unable to locate ITS domain\n", np->full_name); continue; -- 2.11.0