linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Oliver O'Halloran" <oohall@gmail.com>
To: Sam Bobroff <sbobroff@linux.ibm.com>
Cc: Tyrel Datwyler <tyreld@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 5/6] powerpc/eeh: Make early EEH init pseries specific
Date: Fri, 7 Feb 2020 14:56:13 +1100	[thread overview]
Message-ID: <CAOSf1CEjdt_RVH4YvDscCR_kjS9-Gv0MvwJkY+QaCoYYb1+RrQ@mail.gmail.com> (raw)
In-Reply-To: <CAOSf1CEBuv-5GLbOX6Kaux1zA2uNVheXRtDfjVkbx+wcKtZHng@mail.gmail.com>

On Fri, Feb 7, 2020 at 2:35 PM Oliver O'Halloran <oohall@gmail.com> wrote:
>
> On Fri, Feb 7, 2020 at 1:24 PM Sam Bobroff <sbobroff@linux.ibm.com> wrote:
> >
> > On Mon, Feb 03, 2020 at 07:35:20PM +1100, Oliver O'Halloran wrote:
> > > The eeh_ops->probe() function is called from two different contexts:
> > >
> > > 1. On pseries, where set set EEH_PROBE_MODE_DEVTREE, it's called in
> > "set set" -> "we set"
> > >    eeh_add_device_early() which is supposed to run before we create
> > >    a pci_dev.
> > >
> > > 2. On PowerNV, where we set EEH_PROBE_MODE_DEV, it's called in
> > >    eeh_device_add_late() which is supposed to run *after* the
> > >    pci_dev is created.
> > >
> > > The "early" probe is required because PAPR requires that we perform an RTAS
> > > call to enable EEH support on a device before we start interacting with it
> > > via config space or MMIO. This requirement doesn't exist on PowerNV and
> > > shoehorning two completely separate initialisation paths into a common
> > > interface just results in a convoluted code everywhere.
> > >
> > > Additionally the early probe requires the probe function to take an pci_dn
> > > rather than a pci_dev argument. We'd like to make pci_dn a pseries specific
> > > data structure since there's no real requirement for them on PowerNV. To
> > > help both goals move the early probe into the pseries containment zone
> > > so the platform depedence is more explicit.
> > >
> > I had a look around near your comment:
> > > +                     // XXX: uh, do we have the rescan lock held here?
> > And we definitely don't have the lock when it gets called via the module
> > init path (as rpaphp is loaded) -- I tried it and there was no deadlock.
> > I don't think we have the lock in other situations but I haven't
> > unravelled it all enough yet to tell, either.
>
> The other hotplug drivers seem to be taking the lock manually in their
> enable_slot() callback. So I guess we need to be doing it there too.
> I'll fix it in another patch since this one is a bit big.

On closer inspection I think we'll need to have a deeper look at this.
This function isn't used for operations on the hotplug slot. Instead
it's used for DLPAR operations including adding / removing whole PHBs.
There doesn't appear to be any code in the DLPAR add / remove paths
which takes the PCI rescan / remove lock so I think we'll need to have
a careful look at what's going on there. Great stuff...

  reply	other threads:[~2020-02-07  3:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  8:35 EEH init cleanup Oliver O'Halloran
2020-02-03  8:35 ` [PATCH 1/6] powerpc/eeh: Add sysfs files in late probe Oliver O'Halloran
2020-02-06  4:13   ` Sam Bobroff
2020-02-07  3:22     ` Oliver O'Halloran
2020-02-03  8:35 ` [PATCH 2/6] powerpc/eeh: Remove eeh_add_device_tree_late() Oliver O'Halloran
2020-02-06  4:23   ` Sam Bobroff
2020-02-03  8:35 ` [PATCH 3/6] powerpc/eeh: Do early EEH init only when required Oliver O'Halloran
2020-02-06  5:22   ` Sam Bobroff
2020-02-03  8:35 ` [PATCH 4/6] powerpc/eeh: Remove PHB check in probe Oliver O'Halloran
2020-02-06  5:30   ` Sam Bobroff
2020-02-03  8:35 ` [PATCH 5/6] powerpc/eeh: Make early EEH init pseries specific Oliver O'Halloran
2020-02-07  2:24   ` Sam Bobroff
2020-02-07  3:35     ` Oliver O'Halloran
2020-02-07  3:56       ` Oliver O'Halloran [this message]
2020-02-03  8:35 ` [PATCH 6/6] powerpc/eeh: Rework eeh_ops->probe() Oliver O'Halloran
2020-02-07  2:37   ` Sam Bobroff

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=CAOSf1CEjdt_RVH4YvDscCR_kjS9-Gv0MvwJkY+QaCoYYb1+RrQ@mail.gmail.com \
    --to=oohall@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sbobroff@linux.ibm.com \
    --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).