All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Shawn Anastasio <shawn@anastas.io>
Cc: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	bhelgaas@google.com, mpe@ellerman.id.au, aik@ozlabs.ru,
	benh@kernel.crashing.org, sbobroff@linux.ibm.com,
	oohall@gmail.com
Subject: Re: [PATCH 0/2] Fix IOMMU setup for hotplugged devices on pseries
Date: Thu, 5 Sep 2019 11:38:41 +0200	[thread overview]
Message-ID: <20190905093841.mkpvzkcrafwpo5lj@wunner.de> (raw)
In-Reply-To: <20190905042215.3974-1-shawn@anastas.io>

On Wed, Sep 04, 2019 at 11:22:13PM -0500, Shawn Anastasio wrote:
> If anybody has more insight or a better way to fix this, please let me know.

Have you considered moving the invocation of pcibios_setup_device()
to pcibios_bus_add_device()?

The latter is called from pci_bus_add_device() in drivers/pci/bus.c.
At this point device_add() has been called, so the device exists in
sysfs.

Basically when adding a PCI device, the order is:

* pci_device_add() populates struct pci_dev, calls device_add(),
  binding the device to a driver is prevented
* after pci_device_add() has been called for all discovered devices,
  resources are allocated
* pci_bus_add_device() is called for each device,
  calls pcibios_bus_add_device() and binds the device to a driver

Thanks,

Lukas

  parent reply	other threads:[~2019-09-05  9:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05  4:22 [PATCH 0/2] Fix IOMMU setup for hotplugged devices on pseries Shawn Anastasio
2019-09-05  4:22 ` Shawn Anastasio
2019-09-05  4:22 ` [PATCH 1/2] PCI: Introduce pcibios_fixup_dev() Shawn Anastasio
2019-09-05  4:22   ` Shawn Anastasio
2019-09-05  4:22 ` [PATCH 2/2] powerpc/pci: Fix IOMMU setup for hotplugged devices on pseries Shawn Anastasio
2019-09-05  4:22   ` Shawn Anastasio
2019-09-05  9:08 ` [PATCH 0/2] " Alexey Kardashevskiy
2019-09-05  9:08   ` Alexey Kardashevskiy
2019-09-05 17:59   ` Shawn Anastasio
2019-09-05 17:59     ` Shawn Anastasio
2019-09-05  9:38 ` Lukas Wunner [this message]
2019-09-05 18:42   ` Shawn Anastasio
2019-09-05 18:42     ` Shawn Anastasio

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=20190905093841.mkpvzkcrafwpo5lj@wunner.de \
    --to=lukas@wunner.de \
    --cc=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=oohall@gmail.com \
    --cc=sbobroff@linux.ibm.com \
    --cc=shawn@anastas.io \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.