LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Paul Mackerras <paulus@samba.org>,
	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: Wed, 6 Jul 2022 12:23:43 +0200	[thread overview]
Message-ID: <20220706102343.7vui5ymz5kr5sexi@pali> (raw)
In-Reply-To: <87edzxc6r7.fsf@mpe.ellerman.id.au>

On Friday 10 June 2022 17:33:32 Michael Ellerman wrote:
> 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

I sent another proposal in V2, now also with "linux,pci-domain" support.

      parent reply	other threads:[~2022-07-06 10:24 UTC|newest]

Thread overview: 18+ 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 22:10     ` Tyrel Datwyler
2022-05-05 22:33       ` Pali Rohár
2022-05-24  9:17         ` Pali Rohár
2022-06-09 10:19           ` Pali Rohár
2022-06-09 16:22         ` Bjorn Helgaas
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:50                     ` Tyrel Datwyler
2022-06-10  7:33 ` Michael Ellerman
2022-06-10  7:35   ` Pali Rohár
2022-07-06 10:23   ` Pali Rohár [this message]

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=20220706102343.7vui5ymz5kr5sexi@pali \
    --to=pali@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox