From patchwork Mon Mar 6 12:57:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 9605981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1228560414 for ; Mon, 6 Mar 2017 13:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 016E228285 for ; Mon, 6 Mar 2017 13:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E954F28415; Mon, 6 Mar 2017 13:11:16 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 7591028285 for ; Mon, 6 Mar 2017 13:11:16 +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:References:In-Reply-To: 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=KBWz5iaTMv2bMGdP3LWmVrGh6PmLdy3z1H3WnL5kaiM=; b=qQ+reXz+3HzvsX EOf6IaFg6lk8HFDmf674TdCXnp3tonaa/ESIvL1t4Q+3FKv9JZOGAhzEfosMD2Bw3+0HBUU+JTUS0 z/SgM9qor1nsMHsV2ISn04xvGBZUl+qZLEPjmMghkXG77NByGbENEf1Mt1u9VqiTK0RJuSzmvCLS6 UIfJ7dkC21cxMu5/0Fm36KZk4fP+ik0OnksZwuVi3NAcsXsRL3hk6NrSvTsRXg5b/za87Ua3lk3cn QUMK8DKrzGM144U0PRplcSGS5/Ost8NKe/+9/QnaUNP+auJAasHThLWtLVyum9D92kSrbFCdHccLc JgsvR63G2+d9LlxaRwZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cksPy-0006jp-IF; Mon, 06 Mar 2017 13:11:14 +0000 Received: from mail-sn1nam01on0061.outbound.protection.outlook.com ([104.47.32.61] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cksE7-0006Z2-BE for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2017 12:59:00 +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; bh=10iIMerScZEP0cL3sO45TzZWuElr8qvzP6vQ0tAOWik=; b=GyfXCUGHapq4hry2IhQPKRjNo9eRRdDTQL+1SPpzWcLY7+zIRNpM5fiM7we0CcYweQ1F9KX2tjPxAGtpf7TH+zTJvkEJJHRAP6vhFK3W6nHexSUmwyqXj+anP+vJX9mzAYgZoD8GAojBMdEAsEvDWADR+qMIpssYXIIE/PzAiOQ= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=cavium.com; Received: from rric.localdomain (92.224.60.20) by SN1PR07MB2351.namprd07.prod.outlook.com (10.169.127.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Mon, 6 Mar 2017 12:58:37 +0000 From: Robert Richter To: Marc Zyngier 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 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+9ITM2JYmzQAFvDS9ilsRElTxWbWKDLCvbEqjVjX4e34xR98OZJdb2reJoJjVgCMLxN7d3HQyV1j5I39pkWew==; 25:cSeLXqR+MCO3wdRn8JSpRYp+I13p5tuxjNMzMME1yV5mXA91rUHylM7bkAXzSKUUwzI347/AkLKrWRfXaJIeOEkJCcJBFGW9cwSqSQsXNW4M+4mfpJ+MjNPFtz4Xh04HtoGscQCwg4qR3+83qtAA1ll1kEgNpu7iUYPGdS9TetBq2G7fBhzFyL3/L/+XP7/GpofBDec0a1JjGX6SQOBKzn01dDL7gHdrRVkUbEA8n7wau3r7F54/Sg81xoeKo5U32wK4dzGCP/Qmgq/lKXBWqMY1O7dOKPZzBuPRlxrmdQ6pwQGgZ1Utf9kok6HnI8ld5sbbThKDpM3X0EgoeEA8ZB7cjVCFeE4ii3oOSM5TMBJe/0sD2ftVfd95JEI6U3WsTLcMixHR7h5DzLtV1z/wQUAX8N9eraPNPtmaNYie++fAvNgZpp/9uBLarlORxgpqiQfVI06KeQHFJBOEsrabMA== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2351; 31:D4yDFG//ykDQFoWMC47LJ5XMZJOzDi6bBQrHmIt1wjadTMQmOyZGQDs5UKPW8kTBjEvNLuGp2qLe/E+mbbC36Bbngx3Y8sKtbMUXVZf+F9El47DAdCrFoTAtYIV8Is0T1qG8DOVpihMttv1kWAkWaP6zNGgMxXLEOHzuxwCXAHQj+XQAC3dLOppD2tJcqaUINtFK5miVx6cMpm+QpgNlX1Fq6qtEximKKc+i3T7/e+Y=; 20:7L51ItPxc0Dnz3W+P2QEL+yu+3r0GOJJPkny9LaOi7hRlGQddvVxo48eGd+7GcjJ0SYy/saeewIM2Y0p0JiH/O73najkTeutUxrkzfuAGK0U0lamPn8bIOGHmx/m/C7px6Wq6j8d5QdcMJLUAysQqZBk3GxAUY+0kam+0JprmKcHbdBwV52g9Ampo7rsvNBtlQP2KSDtDYZfO9WVYFJmDYdG8GV9SWlKZP/ZjqKNKXR/EKEFzpDWfdP3ACw+0i+vdXc1l4KhX4IjLDRz5N+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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: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170306_045859_447722_5C44D8EF X-CRM114-Status: UNSURE ( 8.26 ) X-CRM114-Notice: Please train this message. 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: Robert Richter , Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 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;