Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2980774pxp; Tue, 22 Mar 2022 09:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw89TLBc9/ExUEoevAgjz2Y4D3RqytSDwNkir03apRbjRbtczeEJEf+60GO8F/RARp+8Yv6 X-Received: by 2002:a05:6870:e243:b0:dd:b11d:b461 with SMTP id d3-20020a056870e24300b000ddb11db461mr2136853oac.236.1647967031266; Tue, 22 Mar 2022 09:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647967031; cv=none; d=google.com; s=arc-20160816; b=QH5+mpt4sQvZ2hsGBA+T9R8WYqP+pRPzDO+KM7VFmVSPXXwcTPcCV4MEq3mHHGiSvh ZGCExecisKHKjOQ95BH1+4ya5zsYBWnFsmMsdPbCTAllTYok1eKJor0P1RWSBLfUeOgc P1Uif6kYMoKTaZscLGtME94oWItRoovaxMuLOe5AYWh12Hv4eQS4aA6X/3h9YSaRkCss Xsgpuce4tpBANK5kAdRYDICFOVjIumEA7NzjXPVkN9z1eu3uSSqubZSVRrj+PIB6ypmQ HiaQxHUWUzmw8xsb0TR0dC8UbFs/ICGfqTUYKyso8fw678pxjlkjdkHiQqy0jllGQqk2 nWjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=VNKmCWMK4JJpwCZbIBnMubG14semaTTd11eRc/skfpg=; b=CBtvxCTQ1WdngLE/PriLclfdpOFRkh8/lKq8ni8O05DrSfrPs65y7pKojb8exWDLJN 7QQFSmRALL6qQevlKY4+eo3w/oQ7W9pKTKt/71KTruT9ZEJFdrwoEJtc3cgC74YJ1Z1i saD7unJMg3ZR0m5KroedKFPzWfQtGl7XXmpl+FbHU2eRiHWF4u4lB/+F2VavSVM0nIEL WdnFlDFZshXGOi/PvLPjrRCfaS1YlfuhS5YjL/c7xtcgLxxqC+H94dEzgzNKndB8B/nT GSQRGiFkYKLLZrnWqyOCYDvgZUnu0WzWwvPJTtIYY3Hm/b5Qp+9m6/arAoe/mfvhY0Ox HsYw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a9d754e000000b005cb2fc137bfsi6205854otl.59.2022.03.22.09.36.43; Tue, 22 Mar 2022 09:37:11 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238271AbiCVO6J (ORCPT + 99 others); Tue, 22 Mar 2022 10:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238353AbiCVO6D (ORCPT ); Tue, 22 Mar 2022 10:58:03 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8DBA88A6EA; Tue, 22 Mar 2022 07:56:35 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 425931042; Tue, 22 Mar 2022 07:56:35 -0700 (PDT) Received: from [10.57.43.230] (unknown [10.57.43.230]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 76C6D3F73B; Tue, 22 Mar 2022 07:56:33 -0700 (PDT) Message-ID: Date: Tue, 22 Mar 2022 14:56:29 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 0/2] PCI: xgene: Restore working PCIe functionnality Content-Language: en-GB To: Rob Herring , Marc Zyngier Cc: dann frazier , "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?= , Android Kernel Team References: <20220321104843.949645-1-maz@kernel.org> <87h77rxnyl.wl-maz@kernel.org> <87fsnbxgau.wl-maz@kernel.org> <61809b8f-acaa-bae2-ac5e-aa47c55eea23@arm.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 2022-03-22 14:39, Rob Herring wrote: > On Tue, Mar 22, 2022 at 01:16:35PM +0000, Robin Murphy wrote: >> On 2022-03-21 20:06, Robin Murphy wrote: >>> On 2022-03-21 19:21, Marc Zyngier wrote: >>>> On Mon, 21 Mar 2022 18:03:27 +0000, >>>> 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: >>>>>>>> >>>>>>> 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? >>>> >>>> Each pcie node (all 5 of them) has: >>>> >>>> dma-ranges = <0x42000000 0x80 0x00 0x80 0x00 0x00 0x80000000 >>>> �������������� 0x42000000 0x00 0x00 0x00 0x00 0x80 0x00>; > > This is the same as what St�phane has for Merlin. So c7a75d07827a ("PCI: > xgene: Fix IB window setup") should have fixed Mustang. Unless XGene 1 has some weird implicit requirement on the order in which the registers are programmed, that XGene 2 doesn't. And from looking at the code, I don't see any obvious less-mad possibility to explain the breakage. >>> Hmm, is there anyone other than iommu-dma who actually depends on the >>> resource list being sorted in ascending order of bus address? I recall >>> at the time I pushed for creating the list in sorted order as it was the >>> simplest and most efficient option, but there's no technical reason we >>> couldn't create it in as-found order and defer the sorting until >>> iova_reserve_pci_windows() (at worst that could even operate on a >>> temporary copy if need be). It's just more code, which didn't need to >>> exist without a good reason, but if this is one then exist it certainly >>> may. >> >> Taking a closer look, the Cadence driver is already re-sorting the list >> for its own setup, so iommu-dma can't assume the initial sort is >> preserved and needs to do its own anyway. Does the (untested) diff below >> end up helping X-Gene also? > > There's no IOMMU on X-Gene 1 or 2 based on the upstream dts files, so > how would this matter? Because devm_of_pci_get_host_bridge_resources() is forcing the dma_ranges list to be in a different order from the original DT for iommu-dma's benefit, but whether iommu-dma actually consumes it or not later is immaterial. Robin.