Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752455AbdHHMXl (ORCPT ); Tue, 8 Aug 2017 08:23:41 -0400 Received: from mail-by2nam01on0046.outbound.protection.outlook.com ([104.47.34.46]:55616 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752430AbdHHMXi (ORCPT ); Tue, 8 Aug 2017 08:23:38 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; From: Robert Richter To: Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: Shanker Donthineni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Richter Subject: [PATCH v3 5/8] irqchip/gic-v3-its: Prevent its init ordering dependencies Date: Tue, 8 Aug 2017 14:22:55 +0200 Message-Id: <20170808122259.6299-6-rrichter@cavium.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170808122259.6299-1-rrichter@cavium.com> References: <20170808122259.6299-1-rrichter@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [78.55.120.224] X-ClientProxiedBy: AM5PR06CA0030.eurprd06.prod.outlook.com (10.167.168.43) To CY1PR07MB2346.namprd07.prod.outlook.com (10.166.194.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c482163c-ad94-4c28-8e5a-08d4de584a98 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR07MB2346; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2346;3:Hi17q8skZ21bgaaCFm/hBr5odBjeQfqHETMJhJ6qdM5EYtBDVPE809IZfHFAuTufbsjKpuJEPX6v2YYOGazoXIomxZIqHDRaIVD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kzkN2fiJRxlifb+AtiqymdO2zntarQw+GCMIcFHQBk8WCWM+KUOOHp4/trzTGMAorynSSUA+ZEivTYw4OzrYhLqK2N2Ux/azQsLdDdyAttbkuexEQdXBWksIEo0/sGdw6B2XQKdkbD7Mjz6llrZQ46tclgURck9wxuLQYAs0zOr0lD0Y0rO8CYY++53j7hLNZM74MP4GZXS4YEio7NnvB8la4MuJubdVEZmLjiY+EgDujPlYfTUScN;4:Gs4OE4Gj9xP9KCaPneQFHGsXLNfaN3km2bxwDR8aNlv8ymii4awGD0lpwRj2oz1OaNH5mwunpzOXZOxZ9R7RHLE5tBgyiMSEcuPc4SGykPFdmKrFNMBXlruELYQ6FvZQ2FwTnoyj99VdSx0xq6jXJbWHag5Qwv496Zhsodie/4HT7Fc2z460aTfTMSV0fzeY5sOZkrAaF8vu2b+A1VUU2yqn+2O6nKO61V8gLKlDoBNRqr/Ne1MnM+Is54ne60r5 X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2346;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2346; X-Forefront-PRVS: 03932714EB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39840400002)(39410400002)(39850400002)(39400400002)(39450400003)(199003)(189002)(33646002)(66066001)(106356001)(68736007)(2950100002)(189998001)(54906002)(6116002)(3846002)(97736004)(72206003)(6666003)(81166006)(50226002)(6486002)(25786009)(5003940100001)(107886003)(38730400002)(4326008)(305945005)(50986999)(101416001)(5660300001)(42186005)(81156014)(230783001)(2906002)(7736002)(6512007)(36756003)(76176999)(1076002)(105586002)(7350300001)(6506006)(48376002)(47776003)(478600001)(53936002)(50466002)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2346;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2346;23:2tf6fQB2IsW9G1DAi4uwJtzwKQ7ePRr1eOZmuL8J7?= =?us-ascii?Q?ZHkf3uyWZWsD/GEGhuud09quvanCaHTV5CpgokOFFAZxOSPJiq6RcRBWBKnA?= =?us-ascii?Q?SlhryQoKk82qVpO7JVFnkfByWxt990HJyZE7RIKKpNTfBjQAPFBileur4AAf?= =?us-ascii?Q?jcfPVJvs6/v8Uwm4DRgsyUSlFsMtYf5Rdxm99BN4nJCOOwe//rpy0i3nEup8?= =?us-ascii?Q?+hmA8xdjWEOzjzl2q5eKyNf5Zx1lXSGE0bs+VUxEhwdlc4IlUkVog+555Uh8?= =?us-ascii?Q?o/OZW8IKXoAB7RZT0MFH5WmSkMn3yem33RbCi3HxR+KaQKRrgamc1Us/uWpI?= =?us-ascii?Q?r8xIVAYDVn2PN2BHBc55rvpkw0v2yp5LggEin9jlxMNKpft4EPdDGCBV+rF6?= =?us-ascii?Q?WhL/iSPFUXtUaA2Lm9hyxMaUTCaTidsCJz7Z90jk7zkzVZpP1Sx6xqLZPOCu?= =?us-ascii?Q?3u/QoYhy9asc8SfjaR0hkOuAHZPYjwxHU0Ga35HcmyslitItfwEk9M2+S6db?= =?us-ascii?Q?kOFgwTU4VguEXWrspLdSMswXTRDfm5OwLFTU+MnLK/1GQQe4NjLrxQ50mw5u?= =?us-ascii?Q?Jr+bVaufomXWOlTccQ4TfLgINv2LINitmUgn4t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4MtZ/GJ6k4QiVNjqbPOS90tu0C420O+ANPFKKwsLHA5r3Yg0SekO0owrkUdroaina2qd//ciGUL9jtmqGkiBluUprYQgdYkCc3czR5tQX5WFajuGQ2LqenEniRbIdp9LthX9olzwcZKsBTK+hezrUtEuNVyuA==;5:X2i+KkN7lvpVFoRmedlCVlhsmeosqE4JhGz6o9KzjYk6BtXmwPGnFyWwIxi//TisBu4z3HZwqmRD0EDDtc+60NMej8GpCfTibGD5vPi1lTCpaE6DIqqHUiKVJVm4YU/Z9D36w8fBYpTbEAvo/jEPHw==;24:Hxz+dr4gp2+uUXMTtsKYwEDMSOYdbWCjy/BhciOqNOImnIx9rdRmF6Ow/u5FznoJYBs26IogkFijpEtBuiKSJPZMiWNRc15EIK5ambVMd0Y=;7:7VJtd0pPAhtRKFDFk4oyoQYpQoxOrEWYahq9uGF/oof28pHpGf42FGHx/4pGgd6wzlZFvSg8fEh8QUvtZoVDEoeJQmhl6I91FsVKVxt02nU+Ofli5hvnkTVfY+rpU1G3WkGOw87B8gqNFDWR9tXiyBoSTdAokes2ez5QGsxiClPQEHLub116dkZmwLkgPdydCMgoWsIoM1L1VgYonkJjmoW/+/dTyeBB00M9ed0uXJM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 12:23:34.0769 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2346 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2034 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 5940fdf0036e..7a8fbb74f2eb 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -72,6 +72,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); /* @@ -112,7 +114,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 6ebc871ac63f..999d3bdc17a6 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -61,6 +61,8 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev, int ret; msi_info = msi_get_domain_info(domain->parent); + if (!msi_info) + return -ENODEV; if (dev->of_node) ret = of_pmsi_get_dev_id(domain, dev, &dev_id); @@ -97,7 +99,7 @@ static int __init its_pmsi_init_one(struct fwnode_handle *fwnode, struct irq_domain *parent; parent = irq_find_matching_fwnode(fwnode, DOMAIN_BUS_NEXUS); - if (!parent || !msi_get_domain_info(parent)) { + if (!parent) { pr_err("%s: unable to locate ITS domain\n", name); return -ENXIO; } -- 2.11.0