Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932916AbdHVNIH (ORCPT ); Tue, 22 Aug 2017 09:08:07 -0400 Received: from mail-by2nam03on0058.outbound.protection.outlook.com ([104.47.42.58]:8699 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932787AbdHVNIF (ORCPT ); Tue, 22 Aug 2017 09:08:05 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Tue, 22 Aug 2017 15:07:46 +0200 From: Robert Richter To: Marc Zyngier Cc: Thomas Gleixner , Jason Cooper , Shanker Donthineni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi Subject: Re: [PATCH v3 6/8] irqchip/gic-v3-its: Initialize its nodes later Message-ID: <20170822130746.GH17961@rric.localdomain> References: <20170808122259.6299-1-rrichter@cavium.com> <20170808122259.6299-7-rrichter@cavium.com> <02849da3-f4a9-562d-ee2c-e08a563c3908@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02849da3-f4a9-562d-ee2c-e08a563c3908@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [77.179.251.232] X-ClientProxiedBy: HE1PR09CA0055.eurprd09.prod.outlook.com (10.174.50.23) To CY1PR07MB2347.namprd07.prod.outlook.com (10.166.194.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b43dfb9d-2621-40fa-5538-08d4e95ed1ae 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:CY1PR07MB2347; X-Microsoft-Exchange-Diagnostics: 1;CY1PR07MB2347;3:1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lXOuu4XTcf0A+sJSKGDdiEJS4aDqrAItqPgQI9WxEnHmIJkxLhg3eeQ29c15HlvbVLBJerYvywjOXA5DpPx7kOW/LWqeOiJ8DbRYlF4Zs0iPpT0BgrYNDG5fcJ5FCioN1iZf7TEaqBQSCbAA3g1XQxBYnaip19pto1RambwI4Y4dl6RJ/3QNkWlv7At3XGtPWmkI9TCVHn6XgJBL7B81EhToKPth7utt5mscLyKJtUNbryOuOdx3DUXzSTMi2sWRRxDw3FvyQmzNW6FdJmAEEPOrB4038NAnmDaHqjYTpterRUX2kgdLjA/Qdn8qOhqeyxDo2twbFEsnSnaSPT8LIs7mgBdAhS;4:r6+mKnsYzbl6og2xnAnHJkvsLFjbOlsTc64mvbGaiGGs4QjV3mZrTWiv8I+f7mUoDe2r2nb030dmKjeoNFrtXSPeb1gwml3mg5nVqiiwVgrRO0DBWmEdnridoEWjNiws9V3mg+fjaB+KsXslQw9C7de2CyentrqjIXzzFH94ehBzUULkuyz6lIszut5/wM8Lj/EpdPqQ2H4DaS4DftHd8ZvAVKZg6yX/SwjKlyuLGV41Wbo+ya02HNEax8NYSqNC 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)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR07MB2347;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR07MB2347; X-Forefront-PRVS: 04073E895A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(189002)(199003)(24454002)(68736007)(50466002)(4326008)(25786009)(72206003)(97736004)(4001350100001)(53936002)(229853002)(66066001)(9686003)(47776003)(3846002)(6116002)(6506006)(83506001)(1076002)(23726003)(53546010)(2906002)(189998001)(5660300001)(110136004)(8676002)(101416001)(230783001)(7736002)(2950100002)(478600001)(6916009)(6666003)(106356001)(86362001)(54906002)(7350300001)(81156014)(305945005)(33656002)(55016002)(42186005)(81166006)(105586002)(76176999)(50986999)(54356999)(6246003)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR07MB2347;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR07MB2347;23:ozvHlxwlx99G7tNIm6l9pXTHoUnu7gss8rup10Zxu?= =?us-ascii?Q?2txY1jHsR9duLNEDoeNed/tJ8iqx5IU3bMx3ZkT0qS6mO1AcUzQ/SwKceP7C?= =?us-ascii?Q?zwFo7k5s1BAEHhgxf6iqJvlS+r6shq7S+arO5VgpJXtjyOlX4af/tnUOQFR0?= =?us-ascii?Q?oJ0hDCA6yVlNfNzEWq8rJ6KO+cVC3WJxAvFZuFt+/QiU6Jum++JOL2CarM9l?= =?us-ascii?Q?HcnH9N1JlK5guheOq8WquRKY9HfDDueoYfEr26eU4UOAbZIwRY9N9HxXsbqw?= =?us-ascii?Q?b9AsTqkZgaykBkCMWR5fxRjf2k05ccHZWE4MjSAupf8Ukm65nj6yTvKV1AM7?= =?us-ascii?Q?2eli162wueqblXnWHR/jvL8E4OGYARb56EqoEYtO8rSVn0p6vW3GKW8vfXc6?= =?us-ascii?Q?VBH9+1cB/kDL9vsHxUhOAoZIKpL4oJEs0QQ8rle1a5D+MG7FDHRnEn17OYOB?= =?us-ascii?Q?ajfLIIQLe+irbysGsYfb0Uwg7dgbs16FTY+ppyq6VkD7DrWlUzge9ZtTOF14?= =?us-ascii?Q?NSIZc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EPEshy8p6TrJZFhrCu9oNDOVbvCwTKp0cRIF+2UE0KhF7HIDA/sW4yLHRZci2QRlg0N/bEiAiwGUkAwe5YUxEOBk1iAbwSS2Bvy5fEXcl7Sfh2pmB/MpRcdMgC6zBzCKpqhkclhQrNJI9swGIuCJx7J3wnjOeaHBWqJnm0LO/Xkbr81ixcbmd6jsMrwEdqzJ2TL0c9YKvKXkoYaw4xvZgd+oLdNPEU5peJZdJLTXrg==;5:hDuG+1X5ohfSoGzM7tpZoWtzUFfGOXxJp24pTYDUmVMDTMh6DRzp2+FM2Vwkwb6ykvdWCNQd0InUgWKGKvIKy3xiuty3PtD3mnKGI9lYhoAe1UrQI1Tssz5L1/Fl0oC0j+CUFsQz1qv0K/xoKWSyIg==;24:dHK7MkCv2Bjs/PRHRzXi1Lj83tLLTZ3aDw1SHTSTyGVrnARD95SlNQ6Z/474E9QQKDcfhuI3LNZYn+9gNOJXioFlgH07frkXFSCSXdmqrXY=;7:78dYCIf/Opi4JagX63nGUGT1zBLmMClwmJEZASUzDcpRsLza3j32aWJjYuGQIHL9LvlTNjipeZvTOAcugG8pRjlbqQ+vMKa2pV90yXU0leru1log2bTioDqInJzKd+EQ/afe/MBCDtA0MqHgWp1jhqPFcqty63JE6bEivnSeg7SKLeA9GldYrJ55zSY0/SnCU8JVdD2toM+WCaVYiDYG3ReR/fG/3ztN9G3Jx19sW98= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2017 13:07:59.9673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2347 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3104 Lines: 87 Marc, thanks for your review. On 21.08.17 09:30:24, Marc Zyngier wrote: > +Lorenzo > > On 08/08/17 13:22, Robert Richter wrote: > > Use an initcall to initialize its. This allows us to use the device > > framework during initialization that is up at this point. We use > > subsys_initcall() here since we need the arch to be initialized > > first. It is before pci and platform device probe where devices are > > bound to msi interrupts. > > > > Signed-off-by: Robert Richter > > --- > > drivers/irqchip/irq-gic-v3-its.c | 3 ++- > > drivers/irqchip/irq-gic-v3.c | 5 ----- > > include/linux/irqchip/arm-gic-v3.h | 1 - > > 3 files changed, 2 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > > index 5e2d4f2876d8..488f811d5978 100644 > > --- a/drivers/irqchip/irq-gic-v3-its.c > > +++ b/drivers/irqchip/irq-gic-v3-its.c > > @@ -1994,7 +1994,7 @@ int __init its_probe(struct fwnode_handle *handle, struct rdists *rdists, > > return 0; > > } > > > > -int __init its_init(void) > > +static int __init its_init(void) > > { > > struct its_node *its, *tmp; > > int err = 0, err2; > > @@ -2036,3 +2036,4 @@ int __init its_init(void) > > > > return 0; > > } > > +subsys_initcall(its_init); > > *ding*! > > I'm sorry, but that's a total NAK. We're trading hard to maintain > hardcoded dependencies for even more difficult to deal with, link-order > driven dependencies. That's exactly what Lorenzo and I have been > fighting against in the XGene ACPI case, and I'm not going to introduce > more of this. > > We need to break the dependency between the HW and the associated MSI > domains, not making it tighter. Let the HW be probed at some time, and > the MSI domains lazily created as needed once the end-points are probed. I see your point here. the ordering of initialization functions using initcalls is fragile. > I'm also pretty worried that (as mentioned in my reply to patch #2) that > this "make it happen later" games with the initcalls are breaking stuff > (see how platform devices are instantiated on the back of an > arch_initcall_sync). As far as I can tell, non-PCI MSI is dead after > patch #2. Yes, I missed that as you pointed out in #2. Even if we change it to a subsys_initcall (not sure if that would generally work for this), there still would be link order dependencies. I have tested it and even pci msi has order dependencies that are not guaranteed: ffff000008c14e60 t __initcall_its_init4 ffff000008c14e68 t __initcall_its_pci_msi_init4 ffff000008c14e70 t __initcall_its_pmsi_init4 With a different order the intialization would fail here. > I think there is a number of things to fix in the core code before we > can start playing that kind of tricks. The major issue I see is that MSI > domains are expected to be available way too early, at device discovery > time rather than at driver probe time. This has a cascading effect which > we should solve first. > > I'll try to prototype something... I will look into this too. Thanks, -Robert