From: Ian Munsie <imunsie@au1.ibm.com>
To: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
linux-pci <linux-pci@vger.kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
benh <benh@kernel.crashing.org>, paulus <paulus@samba.org>,
mikey <mikey@neuling.org>,
"andrew.donnellan" <andrew.donnellan@au1.ibm.com>,
gwshan <gwshan@linux.vnet.ibm.com>,
bhelgaas <bhelgaas@google.com>,
Frederic Barrat <frederic.barrat@fr.ibm.com>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
Manoj Kumar <kumarmn@us.ibm.com>,
Michael C Hollinger <mchollin@us.ibm.com>
Subject: Re: [PATCH v4] powerpc/pci: Assign fixed PHB number based on device-tree properties
Date: Wed, 06 Apr 2016 14:38:55 -0500 [thread overview]
Message-ID: <1459971134-sup-6269@x230.ozlabs.ibm.com> (raw)
In-Reply-To: <1458337746-20337-1-git-send-email-gpiccoli@linux.vnet.ibm.com>
Excerpts from Guilherme G. Piccoli's message of 2016-03-18 16:49:06 -0500:
> +static int get_phb_number(struct device_node *dn)
...
> + /* try fixed PHB numbering first, by checking archs and reading
> + * the respective device-tree property. */
> + if (machine_is(pseries)) {
> + regs = of_get_property(dn, "reg", NULL);
> + if (regs)
> + return (int)(be32_to_cpu(regs[1]) & 0xFFFF);
> + } else if (machine_is(powernv)) {
> + prop64 = of_get_property(dn, "ibm,opal-phbid", NULL);
> + if (prop64)
> + return (int)(be64_to_cpup(prop64) & 0xFFFF);
> + }
I think these cases should still set the bit in phb_bitmap, otherwise a
virtual PHB (e.g. as used in cxl/cxlflash) will be assigned PHB 0, and
since that is already taken it will fail - we're already seeing a
failure in Ubuntu Xenial since Canonical picked this patch up already
(though have not confirmed that this is definitely the cause yet).
There might also be some interesting races to think about here if a
virtual PHB grabs a PHB number before the real one gets a chance.
> +
> + /* if not pSeries nor PowerNV, fallback to dynamic PHB numbering */
> + phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
> + BUG_ON(phb_id >= MAX_PHBS); /* reached maximum number of PHBs */
> + set_bit(phb_id, phb_bitmap);
-Ian
next prev parent reply other threads:[~2016-04-06 20:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 21:49 [PATCH v4] powerpc/pci: Assign fixed PHB number based on device-tree properties Guilherme G. Piccoli
2016-03-25 9:33 ` [v4] " Michael Ellerman
2016-03-28 12:36 ` Guilherme G. Piccoli
2016-05-25 5:45 ` Michael Ellerman
2016-05-25 13:03 ` Guilherme G. Piccoli
[not found] ` <201605251303.u4PCx7bK033656@mx0a-001b2d01.pphosted.com>
2016-05-26 1:00 ` Michael Ellerman
2016-04-06 19:38 ` Ian Munsie [this message]
2016-04-06 21:51 ` [PATCH v4] " Guilherme G. Piccoli
2016-04-07 2:08 ` Ian Munsie
2016-04-06 21:59 ` Michael C Hollinger
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=1459971134-sup-6269@x230.ozlabs.ibm.com \
--to=imunsie@au1.ibm.com \
--cc=andrew.donnellan@au1.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=frederic.barrat@fr.ibm.com \
--cc=gpiccoli@linux.vnet.ibm.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=kumarmn@us.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mchollin@us.ibm.com \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=mrochs@linux.vnet.ibm.com \
--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;
as well as URLs for NNTP newsgroup(s).