All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Pali Rohár" <pali@kernel.org>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>
Cc: 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
Date: Fri, 10 Jun 2022 17:33:32 +1000	[thread overview]
Message-ID: <87edzxc6r7.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20220504175718.29011-1-pali@kernel.org>

Pali Rohár <pali@kernel.org> 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

  parent reply	other threads:[~2022-06-10  7:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 17:57 [PATCH] powerpc/pci: Add config option for using OF 'reg' for PCI domain Pali Rohár
2022-05-05  7:16 ` Christophe Leroy
2022-05-05  9:31   ` Pali Rohár
2022-05-05  9:31     ` Pali Rohár
2022-05-05 22:10     ` Tyrel Datwyler
2022-05-05 22:10       ` Tyrel Datwyler
2022-05-05 22:33       ` Pali Rohár
2022-05-05 22:33         ` Pali Rohár
2022-05-24  9:17         ` Pali Rohár
2022-05-24  9:17           ` Pali Rohár
2022-06-09 10:19           ` Pali Rohár
2022-06-09 10:19             ` Pali Rohár
2022-06-09 16:22         ` Bjorn Helgaas
2022-06-09 16:22           ` Bjorn Helgaas
2022-06-09 16:27           ` Pali Rohár
2022-06-09 16:27             ` Pali Rohár
2022-06-09 17:10             ` Bjorn Helgaas
2022-06-09 18:05               ` Pali Rohár
2022-06-09 19:34                 ` Bjorn Helgaas
2022-06-09 19:41                   ` Pali Rohár
2022-06-09 20:21                   ` Guilherme G. Piccoli
2022-06-09 20:21                     ` Guilherme G. Piccoli
2022-06-09 20:50                     ` Tyrel Datwyler
2022-06-09 20:50                       ` Tyrel Datwyler
2022-06-10  7:33 ` Michael Ellerman [this message]
2022-06-10  7:35   ` Pali Rohár
2022-06-10  7:35     ` Pali Rohár
2022-07-06 10:23   ` Pali Rohár
2022-07-06 10:23     ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edzxc6r7.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=pali@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.