Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2299011imw; Wed, 6 Jul 2022 03:39:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tf/hmKGm6llXV8mG7YbwZTZBsbvsJf4MQye7MLCMKsW6O6Lxm0dUlGhv3n9q/xAZ0HwmUy X-Received: by 2002:a63:9142:0:b0:412:93c8:ebf with SMTP id l63-20020a639142000000b0041293c80ebfmr3056730pge.590.1657103968267; Wed, 06 Jul 2022 03:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657103968; cv=none; d=google.com; s=arc-20160816; b=DDF5aspYnxGCjsWirDXZ6fvInxwpGI2pltjfXmwNAB6XLfoFswcBKZ5tJGQe0mllW1 kr/AzTx3pr4qTe8tJS94UVm9Nimn12+GcLQCuw6wkOo3Q9koAfSjfQGhvptH/Z5TGN1J xF8aUWsLgszlyeoe+9apvE/hFG8KYIswzN8dGv3jwGjSbtnTtO9xcCP38dIbO7ulSdfT ZryqnksIeT2T3FwDPkw94Y/wXhRHjBY7v6JXBWK8DNUq8TxtU2WZtPWyj6Y6Zs/c5B0k I/buCneu1majOV7ME1Bo44QVT8bBTvm91tLtf0VHjo5Eu1j1UsFdkIvjlpCFCV5Tbw6u vlLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dVbLKwZJKlBlaYJkPHryBf1yDFWdazUuJGebe/4cC+w=; b=N1vnYLzcYcr1iK/kfDgWtCPUF9OiKqWuxgD+MNm10E06gvIJkJmpgzgc/NKZRJblHa 9iMS/pmzhw4iaGMYyHvZIHcDgLeqjKD5FNgDfT/0mBWNgHnmPcy/JK9xEm91bxcZp7Uz g8S1wiVcvF/+xcjJlOEKbsqmHhedJBMzDhrvta5uvDd1xcXiEDaSxP/7CfT5QPo+2ywt n75SJ9ZuLhVQRC9l9xOM7ifCxDs7gowDC7C2ucnxWGpavjS2olBS9FdGZl0u3AeFy9Yn IhG84kFc1WS6vjN+GT7Xgwnj4tMJ+5q0mF1aTDD8vfLAgBhqPOUi2gxZ+z9pBegvzIZb nAHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r3d8Sn60; 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 w4-20020a656944000000b0041290b29eb4si4836449pgq.757.2022.07.06.03.38.57; Wed, 06 Jul 2022 03:39:28 -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=r3d8Sn60; 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 S231171AbiGFKXt (ORCPT + 99 others); Wed, 6 Jul 2022 06:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbiGFKXs (ORCPT ); Wed, 6 Jul 2022 06:23:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D30023BF4 for ; Wed, 6 Jul 2022 03:23:47 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 29A4061DFE for ; Wed, 6 Jul 2022 10:23:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66378C3411C; Wed, 6 Jul 2022 10:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657103026; bh=dLwzuTcTJxjrJx5KFBvSWF4B9fKuiLNpighCnwFB9SI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r3d8Sn60XaOmiKvgC3MOYMR7aJCPV9sa+ThJL4mLaoaZRDiqrd/YbPttsKHC/cFmP 6Le00OLABS0eTmv+jKnGpO8i24euFEfypI3BW2XauGUgQs3prUv9Whh7a1/5kRP8Gf Kod7Y/M/7P+O3LDOJzpcoyh8JSdYgReYLEWgZHig90B+6lM5QYOqii9xT0BebwEKaG dhzVxVb9N3esvNMkxGqq3Fjnwm2sGpMDZNUt4rMGjzNbQ5rMZoHvXpD8VgqHkv1beg QscILbwGkbSDmdEOg7h3igFNJ1DAyB+GXG5oJMe+1eiuQ1abvvnUxZTUZ5xh3Rw0zQ Up2DHKItPM3EQ== Received: by pali.im (Postfix) id D5C8A7BA; Wed, 6 Jul 2022 12:23:43 +0200 (CEST) Date: Wed, 6 Jul 2022 12:23:43 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Michael Ellerman Cc: Benjamin Herrenschmidt , Paul Mackerras , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/pci: Add config option for using OF 'reg' for PCI domain Message-ID: <20220706102343.7vui5ymz5kr5sexi@pali> References: <20220504175718.29011-1-pali@kernel.org> <87edzxc6r7.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87edzxc6r7.fsf@mpe.ellerman.id.au> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.8 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 Friday 10 June 2022 17:33:32 Michael Ellerman wrote: > Pali Rohár writes: > > Since commit 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on > > device-tree properties"), powerpc kernel always fallback to PCI domain > > assignment from OF / Device Tree 'reg' property of the PCI controller. > > > > PCI code for other Linux architectures use increasing assignment of the PCI > > domain for individual controllers (assign the first free number), like it > > was also for powerpc prior mentioned commit. > > > > Upgrading powerpc kernels from LTS 4.4 version (which does not contain > > mentioned commit) to new LTS versions brings a regression in domain > > assignment. > > I'm sorry this broke your system. But I don't really consider it a > regression, the kernel provides no guarantee about the PCI domain > numbering across LTS releases. > > Prior to the change the numbering was just based on the order the PHBs > were discovered in the device tree, which is not robust. A cosmetic > refactor of the device tree source could cause PHBs to be discovered in > a different order. > > Similarly a change in firmware PCI discovery or device tree generation > could cause the numbering to change. > > If you have scripts that are looking for certain devices they can use > the vendor/device fields in sysfs to find the actual devices they want, > not just whatever happens to be at 0000:01:00.0. > > > Fix this issue by introducing a new option CONFIG_PPC_PCI_DOMAIN_FROM_OF_REG > > When this options is disabled then powerpc kernel would assign PCI domains > > in the similar way like it is doing kernel for other architectures and also > > how it was done prior that commit. > > I really don't want a config option for that. > > There is a device tree property "linux,pci-domain", described in > Documentation/devicetree/bindings/pci/pci.txt. > > Can you try adding that to your device tree and updating > get_phb_number() to look for it? > > cheers I sent another proposal in V2, now also with "linux,pci-domain" support.