Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1239558imu; Wed, 28 Nov 2018 06:44:33 -0800 (PST) X-Google-Smtp-Source: AJdET5el9IgbVQE6laxAR4eNVnqqIJD3qb+f73v36AXfn4kZNl13ehxSX7TOxcqcLZqUgerprCrq X-Received: by 2002:a62:9989:: with SMTP id t9-v6mr37294689pfk.179.1543416273111; Wed, 28 Nov 2018 06:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543416273; cv=none; d=google.com; s=arc-20160816; b=fGYIh+PafZs/dPej3xhdvSTT85DTnPuxGLHsEw3oBXV4vXQNPDc+ijwD3dJNVgMJfC Mnr7DOJjYTAzpRPVsX1XJ99qFLQnyC3ECXxqFpAE9VqWvtsxskfAPuK8jW0aEG8hRUwe v/idO4SM0ew9aOLmk85SXrGsdec4XWdu9gnGzHFFH/isYuNgpMdHl4e239egTHbWtz93 l593QWoS61N7Z5/QsWZBL4YLUJuVmi8Y7zqbXezVEOnJc36bvdKPJcxx/Y5JhllRL7+O mqdmfEX8f2KP4esrOvSUzsLm72RNrIcdw4vPOiSw3gmeWX/ATyTV69ZNBWhGcd7JpsBk QmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=cb2JuV/VRNxx02cKKRzEH34nqnmavH+4S6QRZ7rDHdA=; b=f0lJUz+yNjtabK52leCZxJK0Ys/3geoN9NsnUkZOZHvEUjcedeS2GT0uQBUlxYe2RK XI2pPTjExTs+s2Hj1SZ07e88Bkf6WGAs7IqEMdvniPZCFHYCrrKQoQrn/p6u3If0rK8Q egdMqePxXEbAm0ONk0rEPJyzWNht3sw2+g3wDqhvNwdgJ8W2cx+dEOGDt9O8VrQ9Zek0 iNRiE0pOjn3T0uMMqMjN3OFuGFT6Ck17l3ziyQ/h+zamJhJgKIcNj/tcPkqRHXe+T4J/ d5J7TY9O5vfSfxw63llOWTJrMaZM83gpEAMXo05cwibdHVE2X18bsoI8POFy0djjfMe1 RvPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=AA6ETgT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si7471721pgr.383.2018.11.28.06.44.16; Wed, 28 Nov 2018 06:44:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=AA6ETgT0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728898AbeK2BpN (ORCPT + 99 others); Wed, 28 Nov 2018 20:45:13 -0500 Received: from mail-eopbgr690089.outbound.protection.outlook.com ([40.107.69.89]:49833 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728867AbeK2BpN (ORCPT ); Wed, 28 Nov 2018 20:45:13 -0500 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 CC: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Stuart Yoder , Laurentiu Tudor , Matthias Brugger , Will Deacon , Lorenzo Pieralisi , "Richter, Robert" , Julien Thierry 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 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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[] =3D { {}, }; =20 +static int __init its_fsl_create_irq_domain(struct irq_domain *parent, + void *priv) +{ + struct device_node *np =3D 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 =3D 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 =3D 0; =20 for (np =3D of_find_matching_node(NULL, its_device_id); np; np =3D 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; =20 - parent =3D 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 =3D 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 =3D 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); } =20 return 0; --=20 2.11.0