linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
To: Ian Munsie <imunsie@au1.ibm.com>
Cc: mikey <mikey@neuling.org>,
	Michael C Hollinger <mchollin@us.ibm.com>,
	Frederic Barrat <frederic.barrat@fr.ibm.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
	gwshan <gwshan@linux.vnet.ibm.com>,
	Manoj Kumar <kumarmn@us.ibm.com>, paulus <paulus@samba.org>,
	"andrew.donnellan" <andrew.donnellan@au1.ibm.com>,
	bhelgaas <bhelgaas@google.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH v4] powerpc/pci: Assign fixed PHB number based on device-tree properties
Date: Wed, 6 Apr 2016 18:51:43 -0300	[thread overview]
Message-ID: <570584EF.1010904@linux.vnet.ibm.com> (raw)
In-Reply-To: <1459971134-sup-6269@x230.ozlabs.ibm.com>

On 04/06/2016 04:38 PM, Ian Munsie wrote:
>> +    /* 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.

This is a very interesting case I didn't think before. Thanks for 
pointing this Ian.

We can, as you suggested, set the bitmap in any case to avoid conflicts 
with virtual PHBs.

And in the case a virtual PHB grabs the bitmap before, we just need to 
add Michael's suggested check and fallback to bitmap PHB numbering in 
this case.

Do you think this is enough to avoid issues with cxl'a virtual PHBs?

Thanks,


Guilherme


  reply	other threads:[~2016-04-06 21:51 UTC|newest]

Thread overview: 9+ 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 ` [PATCH v4] " Ian Munsie
2016-04-06 21:51   ` Guilherme G. Piccoli [this message]
2016-04-07  2:08     ` Ian Munsie

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=570584EF.1010904@linux.vnet.ibm.com \
    --to=gpiccoli@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=frederic.barrat@fr.ibm.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=imunsie@au1.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).