From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Michael Ellerman" <mpe@ellerman.id.au>,
"Guenter Roeck" <linux@roeck-us.net>,
"Pali Rohár" <pali@kernel.org>
Cc: Tyrel Datwyler <tyreld@linux.ibm.com>,
Guowen Shan <gshan@redhat.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
Bjorn Helgaas <helgaas@kernel.org>,
Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias
Date: Fri, 23 Sep 2022 13:21:30 +1000 [thread overview]
Message-ID: <14c592e1d0a6126a66cfab1851d52d097023b74f.camel@kernel.crashing.org> (raw)
In-Reply-To: <874jyevz2g.fsf@mpe.ellerman.id.au>
On Mon, 2022-08-15 at 15:46 +1000, Michael Ellerman wrote:
> Guenter Roeck <linux@roeck-us.net> writes:
> > On Wed, Jul 06, 2022 at 12:21:48PM +0200, Pali Rohár wrote:
> > > Other Linux architectures use DT property 'linux,pci-domain' for specifying
> > > fixed PCI domain of PCI controller specified in Device-Tree.
> > >
> > > And lot of Freescale powerpc boards have defined numbered pci alias in
> > > Device-Tree for every PCIe controller which number specify preferred PCI
> > > domain.
> > >
> > > So prefer usage of DT property 'linux,pci-domain' (via function
> > > of_get_pci_domain_nr()) and DT pci alias (via function of_alias_get_id())
> > > on powerpc architecture for assigning PCI domain to PCI controller.
> > >
> > > Fixes: 63a72284b159 ("powerpc/pci: Assign fixed PHB number based on device-tree properties")
> > > Signed-off-by: Pali Rohár <pali@kernel.org>
> >
> > This patch results in a number of boot warnings with various qemu
> > boot tests.
>
> Thanks for the report.
>
> I have automated qemu boot tests to catch things like this, they even
> have DEBUG_ATOMIC_SLEEP enabled ... but I inadvertantly broke my script
> that checks for "BUG:" in the console log. Sometimes you just can't
> win.
So the problem is
spin_lock(&hose_spinlock);
get_phb_number() relies on it for the phb_bitmap allocation. You can
move it out of the lock but you'll have to either:
- Take the lock inside it to protect the allocation
- Turn find_first_zero_bit/set_bit into a loop of
find_first_zero_bit+test_and_set_bit() which wouldn't require a lock.
Note about the other "reg" numbering conversation ... I'm pretty sure
that breaks some old PowerMac crap which shows nobody really uses these
things considering how long the patch has been there :-)
I'm pretty sure something somewhere assumes the primary bus is 0. Some
old userspace definitely does though that might no longer be relevant.
The whole business with "domain 0" being special and avoiding domain
numbers in /proc relies on this too...
Cheers,
Ben.
next prev parent reply other threads:[~2022-09-23 3:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 10:21 [PATCH v2 1/2] powerpc/pci: Add config option for using OF 'reg' for PCI domain Pali Rohár
2022-07-06 10:21 ` [PATCH v2 2/2] powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias Pali Rohár
2022-08-13 13:57 ` Guenter Roeck
2022-08-15 5:46 ` Michael Ellerman
2022-09-23 3:21 ` Benjamin Herrenschmidt [this message]
2022-07-15 14:55 ` [PATCH v2 1/2] powerpc/pci: Add config option for using OF 'reg' for PCI domain Guilherme G. Piccoli
2022-07-15 17:11 ` Pali Rohár
2022-07-15 18:32 ` Guilherme G. Piccoli
2022-07-16 11:35 ` Pali Rohár
2022-07-27 12:33 ` Michael Ellerman
2022-07-29 13:02 ` Michael Ellerman
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=14c592e1d0a6126a66cfab1851d52d097023b74f.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=gpiccoli@igalia.com \
--cc=gshan@redhat.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=pali@kernel.org \
--cc=paulus@samba.org \
--cc=tyreld@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).