Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2182368pxp; Mon, 21 Mar 2022 13:14:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIpzd4S17RfzGvwoLkjS/5kfRi+STDZT5LbFJP3xwAYO94jRAkQw/GbWcTWJpJVwfXfBU8 X-Received: by 2002:a17:907:2cc4:b0:6df:a036:a025 with SMTP id hg4-20020a1709072cc400b006dfa036a025mr20809164ejc.554.1647893699177; Mon, 21 Mar 2022 13:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647893699; cv=none; d=google.com; s=arc-20160816; b=sxuEfpRVgoVG5gnQIq/YEjy79uhzQfhtHuw0p6qNEIuFMTTGY367gzawftxrd6fQax M8ftkKzN6RkdS0356SoFv38sp198yQD1631kCcjk4eLhonw17gT1d/TandCqgZJ4yYkb ynNWHEMjcvB2F4h/HGCz1u60iHTV8NaL64DYYOyjLZB+GQVN2nqG4XSHRVabEnbcF29W Z8Y+wa2UBUFeW/2SPqXUHNK61w+j/u/oIgRAkuxJpLtZ21nJFF8Cx7N7ckDsmUGpc8D3 FqSl9MJcTpjCNEJLzBYD2DAEcehAHk7AXOh1/oZzmlpUTl1YByDL3So7iSKY5CDkGTKD CTLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=ravb4CGRERGp0XK0aF/S9HRY9UhNiVL1SSNV7W8EexU=; b=r9krOAGGo/ph9b54XRIdM4287nxSjQImyX9zLLTV0p3GXHTyUJcU4d+7hC0r9J4mE3 4kbGO/9fgJV8kk+MXy8qEq7Jmq5qW6ftR6ftFviTrs/VhsvOGyStCoW9dHSvunbi1g0s 411Tf+IxIO9fR/PLrICFDDWaBPi8YhoSw7o5YAy2IcZpcNPigvskq2FYSWCo7iqLEUrC jEpA6MspkE6ar0AYIbqY47CVZdU1k3UcDpjsMZy77jZZsFmzRxakuWo/WkifxOV7eky3 aMUeD2UDNo+rnfK2udt0HkVgI/cxdUJjSrWHC/MTwSqukanyhcggbKMp70A2PQrhSIVb LjOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQbsZBRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a50d7c3000000b00418c2b5be82si9340951edj.356.2022.03.21.13.14.33; Mon, 21 Mar 2022 13:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQbsZBRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351244AbiCUQhi (ORCPT + 99 others); Mon, 21 Mar 2022 12:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351234AbiCUQhh (ORCPT ); Mon, 21 Mar 2022 12:37:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 540094A3F4; Mon, 21 Mar 2022 09:36:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0090B8184C; Mon, 21 Mar 2022 16:36:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0963C340E8; Mon, 21 Mar 2022 16:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647880565; bh=dBXNJk4k4ynl1kpfdDo3ulLplUYqQLK5nh1qo/Cjtgc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XQbsZBRpCWaVUaP1+gpARV4ZRo3gXV3mQipEsvt+A03/5xmRsAvcD4zbzC+sfMepO WTA8tRsDWPenBbBMwstq36LswmoJG7n5D6lIkSoic2BJfYQudrNUGl/sJBD1orR6I+ ByHzhkMtLTVA5mY8yfM55Z7N2GMXWU+vZcuz3uYkwuSHaaEx+11YRI7SrO/JiXw6F1 9GIPTNntglLkodVk4eOgqp7Z6gT5Wciluy5a3/4m38ZI2mMZgrHTgCbnN51qjB5BsA rJ7Rd47fC3UY6Q83pTaDJSieOyBSmKAaoiuxssQdae5ntYaMo+IWY/K+nJs/4zuSks xFw1fxzVJiFsA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nWL0l-00G0ji-4p; Mon, 21 Mar 2022 16:36:03 +0000 Date: Mon, 21 Mar 2022 16:36:02 +0000 Message-ID: <87h77rxnyl.wl-maz@kernel.org> From: Marc Zyngier To: Rob Herring Cc: "linux-kernel@vger.kernel.org" , linux-arm-kernel , PCI , Toan Le , Lorenzo Pieralisi , Krzysztof =?UTF-8?B?V2lsY3p5xYRz?= =?UTF-8?B?a2k=?= , Bjorn Helgaas , =?UTF-8?B?U3TDqXBoYW5l?= Graber , dann frazier , Android Kernel Team Subject: Re: [PATCH v2 0/2] PCI: xgene: Restore working PCIe functionnality In-Reply-To: References: <20220321104843.949645-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: robh@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, toan@os.amperecomputing.com, lorenzo.pieralisi@arm.com, kw@linux.com, bhelgaas@google.com, stgraber@ubuntu.com, dann.frazier@canonical.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Mar 2022 15:17:34 +0000, Rob Herring wrote: > > On Mon, Mar 21, 2022 at 5:49 AM Marc Zyngier wrote: > > > > Since 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") was > > merged in the 5.5 time frame, PCIe on the venerable XGene platform has > > been unusable: 6dce5aa59e0b broke both XGene-1 (Mustang and m400) and > > XGene-2 (Merlin), while the addition of c7a75d07827a ("PCI: xgene: Fix > > IB window setup") fixed XGene-2, but left the rest of the zoo > > unusable. > > > > It is understood that this systems come with "creative" DTs that don't > > match the expectations of modern kernels. However, there is little to > > be gained by forcing these changes on users -- the firmware is not > > upgradable, and the current owner of the IP will deny that these > > machines have ever existed. > > The gain for fixing this properly is not having drivers do their own > dma-ranges parsing. We've seen what happens when drivers do their own > parsing of standard properties (e.g. interrupt-map). We have, and we added the required exceptions for the legacy platforms that the code base supported until then. We didn't leave things broken just because we didn't like the way things were done a long time ago. > Currently, we don't have any drivers doing their own parsing: > > $ git grep of_pci_dma_range_parser_init > drivers/of/address.c:int of_pci_dma_range_parser_init(struct > of_pci_range_parser *parser, > drivers/of/address.c:EXPORT_SYMBOL_GPL(of_pci_dma_range_parser_init); > drivers/of/address.c:#define of_dma_range_parser_init > of_pci_dma_range_parser_init > drivers/of/unittest.c: if (of_pci_dma_range_parser_init(&parser, np)) { > drivers/pci/of.c: err = of_pci_dma_range_parser_init(&parser, dev_node); > include/linux/of_address.h:extern int > of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, > include/linux/of_address.h:static inline int > of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, > > And we can probably further refactor this to be private to drivers/pci/of.c. > > For XGene-2 the issue is simply that the driver depends on the order > of dma-ranges entries. > > For XGene-1, I'd still like to understand what the issue is. Reverting > the first fix and fixing 'dma-ranges' should have fixed it. I need a > dump of how the IB registers are initialized in both cases. I'm not > saying changing 'dma-ranges' in the firmware is going to be required > here. There's a couple of other ways we could fix that without a > firmware change, but first I need to understand why it broke. Reverting 6dce5aa59e0b was enough for me, without changing anything else. m400 probably uses an even older firmware (AFAIR, it was stuck with an ancient version of u-boot that HP never updated, while Mustang had a few updates). In any case, that DT cannot be changed. > > Rob > > P.S. We're carrying ACPI and DT support for these platforms. It seems > the few users are using DT, so can we drop the ACPI support? Or do I > need to break it first and wait a year? ;) I'm not sure people on the list are representative of all the users, and I didn't realise the plan was "let's break everything we don't like and see if someone wakes up" either. That definitely puts things in a different perspective. M. -- Without deviation from the norm, progress is not possible.