Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3869649pxb; Fri, 11 Feb 2022 09:29:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxB9zYqRR6alddYAlr20ZeZhIdvxZdfqzN8sLbYBPnDr0LQ7jGqVI5cxjEndPfCIMPQPrRM X-Received: by 2002:a17:906:1d0a:: with SMTP id n10mr2316114ejh.337.1644600592132; Fri, 11 Feb 2022 09:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644600592; cv=none; d=google.com; s=arc-20160816; b=IkBhxNNareAWOKkaaAEo0NGv9Mrtn1RHZpDbsRvnWn6vga4AezPUUj/JBrlgTeA63+ s9wrB9DTpi6ikLYSGI/wsmwBNDa6H87oKFO6HQeZaZDObMzpsZXRI3st8KVWw6D095X6 s9/XnFWgiVEmEacgm7xlJGWH9OeAQmP2kKR9Log050RF1ESsWFWGhBVatlK/HvfGDjy4 Amt3gYgn/8gdez5THKpnr3LhEdnpo0Y16XX0i1W63SSqN+blh/N+G87RaTmxVt5tQGOY WmxAsWCd4xaG7Q41kwA297rs712IFsMlmIiXxClC91jcZv2iMUotAwbFqEos01Jn5HkH a/KQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wr917FetGRB+Dwa6hoOdwfA0a1yOjjIVMUk1tc6Vh2Q=; b=T0XX3hoZOd6Zhk/UZyVUQKAJ3p3zOrjttHVHXlmJSB+KkigWRT3prBcDpgoL3zDUos KShcIERyOBqnARpASz6GaZI0WfmIqsryx2S3/roqrmWHqyazcj74yyl6HMFQ6EVKy6cc 70atG+/CLVWoJ/p0eMLfQ1iG6EUjxWbd3XwO6DHYWztvyEEpFcANt/gkF1zJn7KllyBN xk4ix05Q5eqgf2dMVkHqfkMsl3Y+/5Q3a37ufnjKYDe8Kh8byayCX/FzSG9kERF3Ddk4 R2ycJiJ5LTaUnSmrP5Rp70HMGXsRTi6kv0521A4ILq/etK3nCR5YYLL5cFmlGc9t38XH Jm8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=OyiG1OzZ; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4si15794389ejk.541.2022.02.11.09.29.26; Fri, 11 Feb 2022 09:29:52 -0800 (PST) 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=@canonical.com header.s=20210705 header.b=OyiG1OzZ; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347238AbiBKCQa (ORCPT + 99 others); Thu, 10 Feb 2022 21:16:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244843AbiBKCQ2 (ORCPT ); Thu, 10 Feb 2022 21:16:28 -0500 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 563D15FB4 for ; Thu, 10 Feb 2022 18:16:27 -0800 (PST) Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (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 E274E3F1D8 for ; Fri, 11 Feb 2022 02:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644545784; bh=wr917FetGRB+Dwa6hoOdwfA0a1yOjjIVMUk1tc6Vh2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=OyiG1OzZFpsmzdSBlvW6OsEYtQ1ku232EEFC1tf82iJPl7+L+/iDxpsHM2gdUX1wq YBJW709RMbLuXYDXMHHKsq29AH8rAQCLeeFL63g01r7Qxiq1FiedYNV66nhQLO7+S4 5FNjVnHkd4zRLPjIg0OvWBwcWDAq4EtfoLQpXpZ09t3qwn5Q7AEunM51bfSuF5Ng2p Gs4PZEKjVvWYXhD/xZ9W/W3NS/rl2JPb8nZ58NSFqTumqHoh4e43yBbweTA2FdrCx2 ExZEgtwynx/dxkcj0NnVPKlRX3e1yXa7mer3xA+Juvb9j2qNQF+CHPwAoJMeyhSC5c 8d31vFOwKJ7mQ== Received: by mail-il1-f198.google.com with SMTP id h8-20020a056e021b8800b002ba614f7c5dso5204953ili.2 for ; Thu, 10 Feb 2022 18:16:24 -0800 (PST) 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:content-transfer-encoding :in-reply-to; bh=wr917FetGRB+Dwa6hoOdwfA0a1yOjjIVMUk1tc6Vh2Q=; b=OBnljfUyqP3aOp33E3wFAC5EM2aZ/0Jo83oPj0J4Gpdjm7X0OKXr+M7OEy/3gKDlSK Ak02jzxaxYGqV74CjpTz4Nz7Qj00gNJvghUw7IpGVYgQXalRzmf460mFie2hLuL5sXIg Dyl4EZKWvrQowjPl5bxTh3R9dTNk5SXgAKw9mM5HSxcaufIkIDwerkjzNVGsha2OGznI VjjzOD49801WlAuo7k75W3Mn40601tLmqIgSddE6UDdxJTkaRg3PJDCstoEdMrqnovX4 AxzFjRASchAs9rD0SprUoiE/NZdFig8+QVX/ZuU4dMzUwF5fqqoDzS2Ep5WCaF41oUNh cFDQ== X-Gm-Message-State: AOAM5308ZhcOWDZKOI80BtXnPQ3Z8RaxDUpWvytTml9YyEw6xpyBwGK9 2BgK7PRo6+NgM2MCjgHYTsu60bNxidnj513mUd045n8p3a5ruodGQ8DBrBwRQoYAth80+KT+4Rt i0Jv7hxuupOkVYHs5B+jAPFXZssb1vDoVqBgFDnwZSw== X-Received: by 2002:a02:c8c8:: with SMTP id q8mr5221361jao.243.1644545783560; Thu, 10 Feb 2022 18:16:23 -0800 (PST) X-Received: by 2002:a02:c8c8:: with SMTP id q8mr5221351jao.243.1644545783301; Thu, 10 Feb 2022 18:16:23 -0800 (PST) Received: from xps13.dannf (c-71-196-238-11.hsd1.co.comcast.net. [71.196.238.11]) by smtp.gmail.com with ESMTPSA id d2sm4867105iog.42.2022.02.10.18.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 18:16:22 -0800 (PST) Date: Thu, 10 Feb 2022 19:16:19 -0700 From: dann frazier To: Rob Herring Cc: Toan Le , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Andrew Murray , =?iso-8859-1?Q?St=E9phane?= Graber , stable , PCI , linux-arm-kernel , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] PCI: xgene: Fix IB window setup Message-ID: References: <20211129173637.303201-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Tue, Feb 08, 2022 at 08:34:45AM -0600, Rob Herring wrote: > On Mon, Feb 7, 2022 at 7:19 PM dann frazier wrote: > > > > On Mon, Feb 07, 2022 at 10:09:31AM -0600, Rob Herring wrote: > > > On Sat, Feb 5, 2022 at 3:13 PM dann frazier wrote: > > > > > > > > On Sat, Feb 5, 2022 at 9:05 AM Rob Herring wrote: > > > > > > > > > > On Fri, Feb 4, 2022 at 5:01 PM dann frazier wrote: > > > > > > > > > > > > On Mon, Nov 29, 2021 at 11:36:37AM -0600, Rob Herring wrote: > > > > > > > Commit 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") > > > > > > > broke PCI support on XGene. The cause is the IB resources are now sorted > > > > > > > in address order instead of being in DT dma-ranges order. The result is > > > > > > > which inbound registers are used for each region are swapped. I don't > > > > > > > know the details about this h/w, but it appears that IB region 0 > > > > > > > registers can't handle a size greater than 4GB. In any case, limiting > > > > > > > the size for region 0 is enough to get back to the original assignment > > > > > > > of dma-ranges to regions. > > > > > > > > > > > > hey Rob! > > > > > > > > > > > > I've been seeing a panic on HP Moonshoot m400 cartridges (X-Gene1) - > > > > > > only during network installs - that I also bisected down to commit > > > > > > 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup"). I was > > > > > > hoping that this patch that fixed the issue on St?phane's X-Gene2 > > > > > > system would also fix my issue, but no luck. In fact, it seems to just > > > > > > makes it fail differently. Reverting both patches is required to get a > > > > > > v5.17-rc kernel to boot. > > > > > > > > > > > > I've collected the following logs - let me know if anything else would > > > > > > be useful. > > > > > > > > > > > > 1) v5.17-rc2+ (unmodified): > > > > > > http://dannf.org/bugs/m400-no-reverts.log > > > > > > Note that the mlx4 driver fails initialization. > > > > > > > > > > > > 2) v5.17-rc2+, w/o the commit that fixed St?phane's system: > > > > > > http://dannf.org/bugs/m400-xgene2-fix-reverted.log > > > > > > Note the mlx4 MSI-X timeout, and later panic. > > > > > > > > > > > > 3) v5.17-rc2+, w/ both commits reverted (works) > > > > > > http://dannf.org/bugs/m400-both-reverted.log > > > > > > > > > > The ranges and dma-ranges addresses don't appear to match up with any > > > > > upstream dts files. Can you send me the DT? > > > > > > > > Sure: http://dannf.org/bugs/fdt > > > > > > The first fix certainly is a problem. It's going to need something > > > besides size to key off of (originally it was dependent on order of > > > dma-ranges entries). > > > > > > The 2nd issue is the 'dma-ranges' has a second entry that is now ignored: > > > > > > dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00>, <0x00 > > > 0x79000000 0x00 0x79000000 0x00 0x800000>; > > > > > > Based on the flags (3rd addr cell: 0x0), we have an inbound config > > > space which the kernel now ignores because inbound config space > > > accesses make no sense. But clearly some setup is needed. Upstream, in > > > contrast, sets up a memory range that includes this region, so the > > > setup does happen: > > > > > > <0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000> > > > > > > Minimally, I suspect it will work if you change dma-ranges 2nd entry to: > > > > > > <0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000> > > > > Thanks for looking into this Rob. I tried to test that theory, but it > > didn't seem to work. This is what I tried: > > > > --- m400.dts 2022-02-07 20:16:44.840475323 +0000 > > +++ m400.dts.dmaonly 2022-02-08 00:17:54.097132000 +0000 > > @@ -446,7 +446,7 @@ > > reg = <0x00 0x1f2b0000 0x00 0x10000 0xe0 0xd0000000 0x00 0x200000 0x00 0x79e00000 0x00 0x2000000 0x00 0x79000000 0x00 0x800000>; > > reg-names = "csr\0cfg\0msi_gen\0msi_term"; > > ranges = <0x1000000 0x00 0x00 0xe0 0x10000000 0x00 0x10000 0x2000000 0x00 0x30000000 0xe1 0x30000000 0x00 0x80000000>; > > - dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > + dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges-ep = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x79000000 0x00 0x79000000 0x00 0x100000>; > > interrupts = <0x00 0x10 0x04>; > > @@ -471,7 +471,7 @@ > > reg = <0x00 0x1f2c0000 0x00 0x10000 0xd0 0xd0000000 0x00 0x200000 0x00 0x79e00000 0x00 0x2000000 0x00 0x79000000 0x00 0x800000>; > > reg-names = "csr\0cfg\0msi_gen\0msi_term"; > > ranges = <0x1000000 0x00 0x00 0xd0 0x10000000 0x00 0x10000 0x2000000 0x00 0x30000000 0xd1 0x30000000 0x00 0x80000000>; > > - dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > + dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges-ep = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x79000000 0x00 0x79000000 0x00 0x100000>; > > interrupts = <0x00 0x10 0x04>; > > @@ -496,7 +496,7 @@ > > reg = <0x00 0x1f2d0000 0x00 0x10000 0x90 0xd0000000 0x00 0x200000 0x00 0x79e00000 0x00 0x2000000 0x00 0x79000000 0x00 0x800000>; > > reg-names = "csr\0cfg\0msi_gen\0msi_term"; > > ranges = <0x1000000 0x00 0x00 0x90 0x10000000 0x00 0x10000 0x2000000 0x00 0x30000000 0x91 0x30000000 0x00 0x80000000>; > > - dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > + dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges-ep = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x79000000 0x00 0x79000000 0x00 0x100000>; > > interrupts = <0x00 0x10 0x04>; > > @@ -522,7 +522,7 @@ > > reg = <0x00 0x1f500000 0x00 0x10000 0xa0 0xd0000000 0x00 0x200000 0x00 0x79e00000 0x00 0x2000000 0x00 0x79000000 0x00 0x800000>; > > reg-names = "csr\0cfg\0msi_gen\0msi_term"; > > ranges = <0x2000000 0x00 0x30000000 0xa1 0x30000000 0x00 0x80000000>; > > - dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > + dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges-ep = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x79000000 0x00 0x79000000 0x00 0x100000>; > > interrupts = <0x00 0x10 0x04>; > > @@ -547,7 +547,7 @@ > > reg = <0x00 0x1f510000 0x00 0x10000 0xc0 0xd0000000 0x00 0x200000 0x00 0x79e00000 0x00 0x2000000 0x00 0x79000000 0x00 0x800000>; > > reg-names = "csr\0cfg\0msi_gen\0msi_term"; > > ranges = <0x1000000 0x00 0x00 0xc0 0x10000000 0x00 0x10000 0x2000000 0x00 0x30000000 0xc1 0x30000000 0x00 0x80000000>; > > - dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > + dma-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x42000000 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges = <0x42000000 0x40 0x00 0x40 0x00 0x40 0x00 0x00 0x00 0x79000000 0x00 0x79000000 0x00 0x800000>; > > ib-ranges-ep = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x00 0x00 0x00 0x00 0x400000 0x2000000 0x00 0x79000000 0x00 0x79000000 0x00 0x100000>; > > interrupts = <0x00 0x10 0x04>; > > > > And that failed to boot with a 5.17-rc3. Since dma-ranges was > > previously identical to ib-ranges, I also tried making the same change > > to ib-ranges, but with no success. > > Failed to boot at all or just PCIe still didn't work causing boot to > eventually fail? Sorry, I mean PCIe still didn't work, here's the log: http://dannf.org/bugs/m400-tweaked_dtb.log (unmodified kernel source w/ above dtb change) > 'ib-ranges' is unknown to the kernel, so the firmware > is using it somehow? > > You also need to revert the first fix for PCIe to work. Oh, OK. I misunderstood. I tried reverting commit 6dce5aa59e0b "PCI: xgene: Use inbound resources for setup" along with a dtb with the dma-ranges change in the diff above, but PCIe still didn't work. Here's the log: http://dannf.org/bugs/m400-6dce5aa5_reverted+tweaked_dtb.log -dann > > > > While we shouldn't break existing DTs, the moonshot DT doesn't use > > > what's documented upstream. There are multiple differences compared to > > > what's documented. Is upstream supposed to support upstream DTs, > > > downstream DTs, and ACPI for XGene which is an abandoned platform with > > > only a handful of users? > > > > That's a fair question, though it's one of a policy, and I feel I'd be > > overstepping by weighing in. I suppose one option I have is to try > > and create and upstream a dts for these systems and modify our > > boot.scr to always load that over the one provided by firmware. While > > we do have some of these systems in production, they are being retired > > and replaced with newer kit over time, and it's possible we'll never > > need to upgrade them to a modern kernel. > > > > -dann