Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2273960pxp; Mon, 21 Mar 2022 15:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGWvBOTlD3/OxXbmZbk84Ep4ZgP1z5PxtRQb8xw5sMrvX3D5L9Z221f4vIHmBhrPali0to X-Received: by 2002:a17:902:7fc2:b0:153:3c90:17b9 with SMTP id t2-20020a1709027fc200b001533c9017b9mr15133100plb.61.1647902089671; Mon, 21 Mar 2022 15:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647902089; cv=none; d=google.com; s=arc-20160816; b=hp2/VJx8RU04/q1UDeiUAJKQeiJrgGq1Ly9KwtLzzo1byZ0tNToNQxmW0HSrjuKsmv cpvXfoWG5wjxXUAEs6zT1GvfBr+euQpnZiXJ3g2mNrJOfVhSpDskn8DfCZ3wgAI3T0Q9 8ueC2toIY6pkkYzWP+jvjBjPpiX9rnm1IEybWNa3ForccrTvMCnlE9sXFhIiGP9cyN72 eUYNSV3egtK6WaH9vRt+QvGZ5IWHLj4z5GkSiu5EPzAHtr1HapN16c6QHarLyjghBSq+ 7BlRM4U5wXdslr8XUaO+odB82hWPXI5PPDnhqsEefgOajWsGVT+2TWIJ0bUUH9GWFKV9 3aHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a1opQo+YixvdXgte8ZT5248/sxIhrzqTYCedcnszzC4=; b=DYS/7q3NJoMMxWH0tvWrVoUJfpIMwh235usurFPw0Qlev4Rqjb75dyoa4TMoYKuIVK XmzclUZlo6UErKdvtjOD3TEAdIvRM3WwOWOLKPpJS5eJ5HdoCqRi79byaI77cDVtVtDp /MYFJ58rA6nZgCGCefw1OExhKEuVJ5pEkt2whb5Q0w/+EUyJuSKFoL8cLbfPYv6328EO hcrWSINmEBFfklwbTpMTFtJIBkDyr0WXgyaNmVICQLVEsq5fVvOfLe8fhGQLDoJVG3EY s/IT8gIKRzZIGE7d2K0ZP8zUkLm4aTJixsXkZmYtXmLZRyAD7or+Gfao37nbtDzUjLTa 5q3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iY2kM+kk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d136-20020a63368e000000b003816043f0ddsi13855331pga.722.2022.03.21.15.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:34:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iY2kM+kk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19EC53B2FDA; Mon, 21 Mar 2022 14:47:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349991AbiCUPTc (ORCPT + 99 others); Mon, 21 Mar 2022 11:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349933AbiCUPTP (ORCPT ); Mon, 21 Mar 2022 11:19:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2C411174C; Mon, 21 Mar 2022 08:17:50 -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 E7AB2B8175E; Mon, 21 Mar 2022 15:17:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8CB8C340F4; Mon, 21 Mar 2022 15:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647875867; bh=9+FB8FqiPz2INA3LHeEMbXtjaqxdTmkp1xc/rbUvb8g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iY2kM+kk/k9XRIJpOweLDdoV0Qbbb9Le27cicZiqsTWHGuaubJxgJKDF3p7i1Lepy FYDMrEVtCCOqmoUNxkbqmfdx5AiTxkKnBIkQk6jzKZs9e9c60k0BWEr+nsvrJHumw3 SxACHAsrR+7s8jr6tN77OthE9W4ckwlNz898NvR0mYagooAamWfywmFEZMetc7qdD2 dyjCNBNWdbMZxup0DHanVr8Zw/Mhb+fo52hkPUfVWdHUTUDF7OUxwJcZCwFHSzAqfB ssLoyytLEYPe+jy6osPEQVJl6nezkF8xixnZaUIbnwR7xPDdIxNHWawg4zNJnGq2Fs vNSK5qRXUR2SA== Received: by mail-ed1-f42.google.com with SMTP id b24so18220954edu.10; Mon, 21 Mar 2022 08:17:47 -0700 (PDT) X-Gm-Message-State: AOAM530whwR1lYN3L7Ddk6yN4+veqJmt4fcslavZRsLEU6AB8XjqYxrw MsuGad9tbPxR2w6ok5zNYX7SfSOLRxYKGtscLA== X-Received: by 2002:a05:6402:1d51:b0:418:bd81:78b3 with SMTP id dz17-20020a0564021d5100b00418bd8178b3mr22893313edb.46.1647875865787; Mon, 21 Mar 2022 08:17:45 -0700 (PDT) MIME-Version: 1.0 References: <20220321104843.949645-1-maz@kernel.org> In-Reply-To: <20220321104843.949645-1-maz@kernel.org> From: Rob Herring Date: Mon, 21 Mar 2022 10:17:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/2] PCI: xgene: Restore working PCIe functionnality To: Marc Zyngier Cc: "linux-kernel@vger.kernel.org" , linux-arm-kernel , PCI , Toan Le , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , =?UTF-8?Q?St=C3=A9phane_Graber?= , dann frazier , Android Kernel Team Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 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). 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. 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? ;)