linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Simek <monstr@monstr.eu>,
	Hiroo Matsumoto <matsumoto.hiroo@jp.fujitsu.com>,
	microblaze-uclinux@itee.uq.edu.au,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	Jesse Larrew <jlarrew@linux.vnet.ibm.com>,
	jbarnes@virtuousgeek.org,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 1/2] powerpc/PCI: move DMA & IRQ init to device_add() notification path
Date: Tue, 19 Jun 2012 08:55:43 +1000	[thread overview]
Message-ID: <1340060143.2372.50.camel@pasglop> (raw)
In-Reply-To: <CAErSpo6mbzqMuewBySk5kA8E9RwOVZqOEcnM4Hy541B3pta9SQ@mail.gmail.com>

On Mon, 2012-06-18 at 15:06 -0600, Bjorn Helgaas wrote:
> We're moving the CardBus IRQ config from before pci_bus_add_devices()
> to after.  I see why you did that: we're proposing to do the powerpc
> DMA & IRQ setup in pci_bus_add_devices(), so we don't want to have the
> powerpc IRQ init clobber the CardBus IRQ config.
> 
> But a driver can claim the device as soon as we call
> pci_bus_add_devices(), so we're potentially changing dev->irq after a
> driver has already looked at it, which sounds like a bug.
> 
> There are only five possibilities for powerpc pci_irq_fixup:
> 
>       ppc47x_pci_irq_fixup
>       mpc85xx_cds_pci_irq_fixup
>       maple_pci_irq_fixup
>       pmac_pci_irq_fixup
>       rtas_msi_pci_irq_fixup
> 
> If these were normal PCI header quirks instead, they could run
> earlier, and we wouldn't need to move this
> cardbus_config_irq_and_cls() call.  Is it possible to make these
> quirks, Ben?

Wait ... why are those fixups relevant ? They have to run after
pci_read_irq_line() (which should have been called pcibios_read_irq_line
really) but that's fine, we call both back to back....

The problem has to do with the fact that we setup pdev->irq inside
pci_bus_add_devices() with the new proposed code (the fixup itself is
just a detail).

You want cardbus to "quirk" the irq after that's been fixed up... maybe
that's a case for moving cardbus_config_irq_and_cls() to
pci_enable_device() ? Or add another hook inside
pci_bus_add_devices()...

Cheers,
Ben.

  reply	other threads:[~2012-06-18 22:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 22:36 [PATCH v3 0/2] archdata init in device_add() notifier Bjorn Helgaas
2012-05-23 22:37 ` [PATCH v3 1/2] powerpc/PCI: move DMA & IRQ init to device_add() notification path Bjorn Helgaas
2012-05-25  3:00   ` Benjamin Herrenschmidt
2012-05-25  3:08     ` Bjorn Helgaas
2012-05-25  3:38       ` Benjamin Herrenschmidt
2012-06-07 12:58       ` Hiroo Matsumoto
2012-06-18 21:06   ` Bjorn Helgaas
2012-06-18 22:55     ` Benjamin Herrenschmidt [this message]
2012-10-12 18:03       ` Bjorn Helgaas
2012-05-23 22:37 ` [PATCH v3 2/2] microblaze/PCI: " Bjorn Helgaas

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=1340060143.2372.50.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jlarrew@linux.vnet.ibm.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matsumoto.hiroo@jp.fujitsu.com \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=monstr@monstr.eu \
    /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).