Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp121861imu; Wed, 7 Nov 2018 14:04:31 -0800 (PST) X-Google-Smtp-Source: AJdET5fU6R/Ig49frRSgYJ8FoJd1WsBSGRjyMs4SOUfHJPU17oNFR0UM1QPRNDm8IgqswHSt/V6J X-Received: by 2002:a17:902:7b91:: with SMTP id w17-v6mr1974688pll.289.1541628271853; Wed, 07 Nov 2018 14:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541628271; cv=none; d=google.com; s=arc-20160816; b=BcjrSer3invrNi1Kj+9SgGEJ/FXuSR7xn/3Oi+PQABSfA3pDVyUIdmELpfpfgM6ips lDxmZ4X2LwaAtVVWpdHAPV0kVIVIxcCBhyuvmV4AoN7lABJmowQjeq0rSko4cqXMFGKS KaHtBN4FxlgLUC2fajnbHHF7PXKHOQJXr0+PAtr9P7QAMVdy8mhYtG6kHww+zr+yd1BR aqjjshIoDz3UdjDsjNcdcufOL8J2KUaQNLcWJWcFPgBgQ6zLoOxmU5ViqYRjTPau7rOP upULFYGdzcmeEDXDDqIXbiVdDGO4KZ/ZibBqlbQkQrRqCybsZZvwz08Whamx/hVJiVRi 5ygQ== 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=WVJPuN4UrdNuubbuIz76x9ByAl3G3stZh22pOcKjrkg=; b=VJUieat4FVUL4vwFtuiCBpE3blMIdSA8CjpAr8IdGGgeCqbZw+EZbvBDgMR4t0xkHz J8aXB3ta/NU/PR6A1wkHQ6qWm2MuoIsvnaaSUXmiUQgDdj5L/gKphw+BD2CelkR8Ky4d bVHn3wHzem+VaYAk+XIIWQLv7+zF1RaAm/YzyUg+hs2W02/fjheP/HCZbqQiFgz46/FQ NCnBO7Esz0ELvc8XqqnFm3IZ0vhcB6E2FBh85NYJlhCVWkURPJJF/nS7/5hAm7A57uPI r0agUCErODvRU6oo1SAVe/38RLiJWTsGVweYtDZF+O9ENTnmWtDW2l/YQgUQCzQvzAmk PivQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b="CO0/tl/1"; 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 a5-v6si1546091pgw.352.2018.11.07.14.03.59; Wed, 07 Nov 2018 14:04:31 -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="CO0/tl/1"; 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 S1727773AbeKHHfh (ORCPT + 99 others); Thu, 8 Nov 2018 02:35:37 -0500 Received: from mail-by2nam03on0066.outbound.protection.outlook.com ([104.47.42.66]:64096 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727127AbeKHHfg (ORCPT ); Thu, 8 Nov 2018 02:35:36 -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=WVJPuN4UrdNuubbuIz76x9ByAl3G3stZh22pOcKjrkg=; b=CO0/tl/1cc0qOFEFqXrsNlCld54A/sGUnuxUWF6UbXW9aBAMAUOd1rXQq2qRh7epJswAZUc4ycnxc49ja+TYp8v5Fk50vrO/at2WZQC2F5MugGINNEZfCrRmNKnBQl0ms0ijP4iL4ubRk8EcprbQUJv74I8zVe8PfCNC+2Z48BA= Received: from SN6PR07MB5326.namprd07.prod.outlook.com (52.135.105.33) by SN6PR07MB5232.namprd07.prod.outlook.com (52.135.120.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 7 Nov 2018 22:03:15 +0000 Received: from SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149]) by SN6PR07MB5326.namprd07.prod.outlook.com ([fe80::f0b9:acf9:7513:c149%5]) with mapi id 15.20.1294.034; Wed, 7 Nov 2018 22:03:15 +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" Subject: [PATCH 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Topic: [PATCH 02/10] irqchip/gic-v3-its-platform-msi: Remove domain init order dependencies Thread-Index: AQHUduWu+Z2RJeOXo0upX6L9SWCjNA== Date: Wed, 7 Nov 2018 22:03:15 +0000 Message-ID: <20181107220254.6116-3-rrichter@cavium.com> References: <20181107220254.6116-1-rrichter@cavium.com> In-Reply-To: <20181107220254.6116-1-rrichter@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0033.eurprd03.prod.outlook.com (2603:10a6:20b::46) 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.180.181.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR07MB5232;6:4ABxiR3GpVS7fpiswXTxW6X2h6PB8SR0Totn438zpDX/Juf3O74+7cLGiOkR5n+0ydIGlCn24trxHiS8A0l5SzJtkZNHIlo8bQf51Vg+a7bcJq5nHaDTiQJa7nTO1KLqrEJSVqQFrJxatx+sl1LQ0H7BD07WccPmvSLIypR1e8zrRKbnXGjpeeoCJy8hY198rqgwVSXw8XJtAi9+JpmV57StoCnYudikcLmvvixlekuwpwzPfL1E6YZL9+fqczJToALhohLzbLHe59tojFiSTEB3K3d/BKf2kMYB9wXuv56C9m4Nru7gg1Ii4xVCnA8YZWi1doqhZXrsPlvcxBXNk7DH5CPJuLq+oAketzS9KUcU+E40/vqNY5rC6zJLiep0z32QKWwsAgLzU/fx6v2ihtATNZKAdmS24115OaSmjYNblaHdRFh+/fwdBsbzIfGE0uk7SnCzzpJRiOFQgdQq1w==;5:Zbb416Gtm0JVuQ4XU5H1K1XC8okqZTqlsBKSkdsE1TrQ6B1jskv+lnnpYWr8tRW9nyyzK7UAUT8RY4Ls+OEocknAow8AInWaC5DhdrL8J65LeeY1ijxZM3TJQ0jt7CbaSquI3EjwW10+fanIKm3YN9VGvNoPWah8vtNq4DLffnQ=;7:7fEVTQ2w35Ro8ytmGkBj7RYujrkBL2vrQo+k39kHaLhY9qhqtxtcLwUihZd8iUYUVOdYDtkPaBsiAwsTq65BywDEmo2g1gULSBvxUxv2tPcm9SmRg1ueLVd3PqL/GQVDPdswbwMt+74SpBBJzkOk9A== x-ms-office365-filtering-correlation-id: ecf6d9d4-2c72-495f-f882-08d644fcd0e6 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:SN6PR07MB5232; x-ms-traffictypediagnostic: SN6PR07MB5232: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(269456686620040); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:SN6PR07MB5232;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB5232; x-forefront-prvs: 08497C3D99 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(189003)(199004)(71200400001)(7736002)(71190400001)(39060400002)(6486002)(3846002)(66066001)(6436002)(186003)(36756003)(476003)(478600001)(2616005)(53936002)(256004)(14444005)(446003)(305945005)(11346002)(6512007)(54906003)(1076002)(316002)(107886003)(25786009)(110136005)(6116002)(2906002)(97736004)(4326008)(6506007)(386003)(72206003)(105586002)(99286004)(486006)(5660300001)(7416002)(8936002)(102836004)(106356001)(68736007)(8676002)(14454004)(81156014)(76176011)(81166006)(2900100001)(52116002)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB5232;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: vG99BxTyVW9Qed+y4m+ey0/LQDK11td6c0b3tdSju8WaqtW+nK99r2FFOXsY1hplrmujI1JkUcO3kcYu2OBaQAmj5U0vQhBHorUvuxssAOF0//nmiLsbIbpl+4AGSAtZMIRlttCngJSthn8sr7YmuytDm5cKaAAq1Sr84XMUU9FZGDDYL8ruwpP/wmgM5hfD0yb6rKNdqW2ViQDs4L+MLLA1ohf1JbydfE3Y31MDCYIkFX1nNO5tNbo0snwczcQueZvUAtuqnRs63Lp/gHbVFDFa8sDovH/w1xiJquCPCPHP+6AEFzCQt8NbItzGeNelLDzqhpXIa//pyt8Zs3dp5l6NInyM0xNs/xVnbl3jMVw= 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: ecf6d9d4-2c72-495f-f882-08d644fcd0e6 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2018 22:03:15.0581 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5232 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-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/irqchi= p/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[] =3D { {}, }; =20 -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 =3D priv; + int err =3D 0; =20 - parent =3D 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 =3D -ENODEV; + goto out; } =20 - 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 =3D -ENXIO; + goto out; } =20 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 =3D kstrdup(name, GFP_KERNEL); + int err; + + if (!name) { + err =3D -EINVAL; + goto fail; + } + + if (!priv) { + err =3D -ENOMEM; + goto fail; + } + + err =3D 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; } =20 #ifdef CONFIG_ACPI @@ -135,7 +166,6 @@ its_pmsi_parse_madt(struct acpi_subtable_header *header= , } =20 err =3D its_pmsi_init_one(domain_handle, node_name); - out: kfree(node_name); return err; --=20 2.11.0