Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2309583pxp; Mon, 21 Mar 2022 16:33:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9nHY+c4MYi9YnAouZ+G6sqdRquDyxTBviOmSnu/JTMhdIGqkM8Web9x6Vsq93tGGPqdo4 X-Received: by 2002:a17:902:6903:b0:151:6781:9397 with SMTP id j3-20020a170902690300b0015167819397mr15559472plk.137.1647905613677; Mon, 21 Mar 2022 16:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905613; cv=none; d=google.com; s=arc-20160816; b=hSFvWX7eXVefmTjXq5399YTMnZbcxp14Ofw/uZbhP0e+V1vk3IdjI0XWcY7s1oP67f 2NZfz4yOWBKtr6j5kTZDI8TMqk5XG1DvP4pwGT+Aq1BkzhBxzkOzHOMn2h6u4zfuUJO2 PTL/HSGJmnbnT+FFIe1eEtUjs/g/Yn3w/dri4EXHiMid/2AmZUXblGXNuNO9rr1aU70l XV35pvDOF3kNaVOkq7RoAAqQ8RTDPE+bnYNAj2/0nkCERI1Nw8IAZQJF05B99Hzv3kcS DvJB4WaZM9BlQCXMrpF8eqIbf/OCrTBCdS6w7RBkIQRhZjBny4w0L84d/OoWmlJFB0uP l5Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PH1bVwJW+65ZSg7ht8UKbv2/JhG2Jc27AqWMKxMcUUs=; b=YFvB/m6aJhCtlr/v4dmZRBCn7/XCpNdOjrH6Mpt9LJxFCbM45JCAl7078Hm56Xa0hD oAdtnA2DiaDii1ewdmNcKAZPtwsTUQ1d0usr2PU7UVDszVYA/nFP94VCdv7OEOPDfnXM WEkFYXLiD3nZwDWab0BautmStPsx3VojWUKA/ejo8U/PmBAHwH51FOfzh2NFeTGWSmNX 0VdYAHdVfkBYbqsuyYeNFwLlEAYT7YTDJf7DNc6qJg92/XGohRYVFo6SF6rEbcEdOchE Mfo4zhZQdJuvRLYSwGrm/RLk7hTnj2IoYRCJ86lQAszB6fkxrXGpm64eAPY92m2UeWSi Ciew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="v2Pf/TMp"; 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=canonical.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o6-20020a656146000000b0038217505808si12331452pgv.119.2022.03.21.16.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:33:33 -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=@canonical.com header.s=20210705 header.b="v2Pf/TMp"; 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=canonical.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5309D47BCCA; Mon, 21 Mar 2022 15:24:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiCUVII (ORCPT + 99 others); Mon, 21 Mar 2022 17:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231962AbiCUVIB (ORCPT ); Mon, 21 Mar 2022 17:08:01 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E10D19CCDF for ; Mon, 21 Mar 2022 14:06:35 -0700 (PDT) Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 790B73F1C0 for ; Mon, 21 Mar 2022 21:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1647896793; bh=PH1bVwJW+65ZSg7ht8UKbv2/JhG2Jc27AqWMKxMcUUs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=v2Pf/TMp2Bx/d966rcN7a3d+na287rj4pBvLDWaD8Xi6eU4klRJIWqdLxFhZ6WZGY MI5dKZlE5O5hdHLSuJfoFsroLDmAvcPN5jxLR/rkkSLb4uBGG0p37gOQqWMkVPlOdV MU+MwleWHIY0VI8FvXZVjGPB4lHa4Wmf7ec2zmducEMQ6JB7IC/9kh87ZSGQN0LnHu DF4VvEVvu7McCYAO4XX/WNnG6j5x5GywjF69N/5Yo+nzonSvXX3Yzs/jTUKE8aLnrd CvI5tF9+OEXeYzZ0HLiJfVEWg0FgJYQGY+wH6suo/WPSJ0ECVqyflYazq5wivkRebG NEFfU5TkdKy+g== Received: by mail-il1-f200.google.com with SMTP id v11-20020a92c80b000000b002c7e3b707caso6161695iln.15 for ; Mon, 21 Mar 2022 14:06:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PH1bVwJW+65ZSg7ht8UKbv2/JhG2Jc27AqWMKxMcUUs=; b=Hi71naWQPhA908QLy7A7P4D/0nlmIrN1FEkjnAzK4/Bj79RCot9WE66IUnbvkLBuPM klM8t/7OCnXRkIYlWY/ZlXzhU34EL4C6JszPf+kaw4QLUyZfD2s+3OhqNB4GldB3Fl9I AOZkOXn0+g/77IOYHIGJM++F2ZPhTnxDzwJoN8ihaTZCcZJg+hnthgBV16va2c2eIylb atQrYySI04qoDfhd797+V8CA6KGnq9YjmECMjv5SUH5mRRkeVVMj7ZlMiEdsWS4DQSNb NI9ladpm7fqf3S7/JuWfs67x48Ufhn5xQ+SIFHhMjnKsw7A9Cfh8Phh/O2NzMy4Fjijz NWbw== X-Gm-Message-State: AOAM531hYcpbU+gcM20yJwJq4YfCrzfJaYbrWIVwygBsHIrvCy0lbKVH XA7d1SzBJ8TBy90n/T+vxpFKCnFhQCt3j840dR9vT5VLK3E8l3cE7wMNDK+jfKGOAg9vS5KwkpW Tod0I0deGJMyP9lWQsJonnULZLVr4eFexOFB2ZSULZQ== X-Received: by 2002:a05:6638:dd3:b0:317:c9aa:b38f with SMTP id m19-20020a0566380dd300b00317c9aab38fmr12574953jaj.9.1647896792320; Mon, 21 Mar 2022 14:06:32 -0700 (PDT) X-Received: by 2002:a05:6638:dd3:b0:317:c9aa:b38f with SMTP id m19-20020a0566380dd300b00317c9aab38fmr12574930jaj.9.1647896792018; Mon, 21 Mar 2022 14:06:32 -0700 (PDT) Received: from xps13.dannf (c-73-14-97-161.hsd1.co.comcast.net. [73.14.97.161]) by smtp.gmail.com with ESMTPSA id m2-20020a056e021c2200b002c837530587sm1069585ilh.60.2022.03.21.14.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:06:31 -0700 (PDT) Date: Mon, 21 Mar 2022 15:06:29 -0600 From: dann frazier To: Rob Herring Cc: Marc Zyngier , "linux-kernel@vger.kernel.org" , linux-arm-kernel , PCI , Toan Le , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , =?iso-8859-1?Q?St=E9phane?= Graber , Android Kernel Team Subject: Re: [PATCH v2 0/2] PCI: xgene: Restore working PCIe functionnality Message-ID: References: <20220321104843.949645-1-maz@kernel.org> <87h77rxnyl.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 01:03:27PM -0500, Rob Herring wrote: > On Mon, Mar 21, 2022 at 11:36 AM Marc Zyngier wrote: > > > > 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. > > Meaning c7a75d07827a didn't matter for you. I'm not sure that it would. > > Can you tell me what 'dma-ranges' contains on your system? > > > 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. > > How is Dann changing it then? I assume he's not changing the firmware, > but overriding it. That could be a possible solution. Correct, I'm just overriding it for testing. I'm using the pxelinux emulation provided by the m400's u-boot, which supports an FDT field: --------- $ cat /srv/tftp/pxelinux.cfg/default DEFAULT default LABEL default KERNEL uImage APPEND initrd=uInitrd console=ttyS0,9600n8r ro root=LABEL=cloudimg-rootfs FDT m400.dtb --------- This loads the specified file into ${fdt_addr_r}, overriding the blob that the firmware had already loaded there. > Do the DT's in the kernel tree correspond to anything anyone is > using? Upstream apm-mustang.dtb is what Ubuntu uses for Mustang boards w/ u-boot firmware. That used to work fine, but I haven't tried lately. -dann