public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Robert Hancock <hancockr@shaw.ca>,
	Andrew Morton <akpm@linux-foundation.org>,
	avuton@gmail.com, yakui.zhao@intel.com, shaohua.li@intel.com,
	trenn@suse.de,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	alsa-devel@alsa-project.org
Subject: Re: a7839e96 (PNP: increase max resources) breaks my ALSA intel8x0 sound card
Date: Mon, 4 Feb 2008 13:16:52 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.1.00.0802041300170.3034@hp.linux-foundation.org> (raw)
In-Reply-To: <200802041341.37313.bjorn.helgaas@hp.com>



On Mon, 4 Feb 2008, Bjorn Helgaas wrote:
> 
> I'm sure you're right, but I don't understand why yet.  Here's what
> I think is happening; please correct me where I'm going wrong:
> 
>   1) enumerate PNP & ACPI devices
>   2) initialize PNP & ACPI drivers
>      2a) register ACPI PCI root bridge driver, which enumerates PCI
>          devices behind the bridge
>      2b) register PNP system driver and reserve resources (this is
>          where the current quirk skips some reservations)
>   3) initialize PCI drivers
>      3a) register intel8x0 sound driver and reserve conflicting
>          resources

So where in this would you put the

	pcibios_init() -> pcibios_resource_survey()

call (it's a subsys_initcall)?

THAT is the thing that actually registers the PCI resurces we've found 
into the resource tree!

It's very inconveniently placed as-is, since it literally depends on the 
whole initcall ordering (and the link order within that subsys_initcall 
thing), and all of this is architecture-driven rather than driven from 
some central place.

So this is the thing that I think should happen before any PnP or ACPI 
drivers actually start registerign themselves (but obviously needs to 
happen after the PCI buses have been enumerated).

The ACPI/PnP tables shouldn't be able to break the enumeration of the 
actual hardware devices, now should it?

> I think you're suggesting that we should do 2a first, to enumerate all
> PCI devices, and only later do 2b.  But I don't know how to accomplish
> that cleanly.

We should enumerate the PCI devices, then register their resources (and 
no, I'm not at *all* convinced it should happen as a separate 
subsys_initcall), and then register the PnP resources. 

So I think we should have roughly something like:

 - arch_initcall: this could enumerate the ACPI/PnP devices (but not 
   register anything). Alternatively, do it as subsys_initcall, and just
   make sure it happens early with link-order.

 - subsys_initcall: this should do that pcibios_init() thing that surveys 
   the resources (and the PCI enumeration needs to have happened before, 
   probably in the same initcall thanks to link order)

 - PnP/ACPI resource allocation *after* it, but before driver loading 
   (which wll cause new resources to be allocated). This could be 
   fs_initcall, or whatever (that's what things like "acpi_event_init" 
   already do).

 - regular drivers will come along much later, as part of 
   driver_initcall, and by the time this happens, we've now reserved all 
   resources we know about.

Basically, we just want to register the most trust-worthy resources before 
we register anything less trust-worthy. And actual device probing simply 
tends to be more trust-worthy than any randomly broken ACPI/PnP tables.

		Linus

  reply	other threads:[~2008-02-04 21:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.Kmpf0B4W44W1VefIME7+BnfUouY@ifi.uio.no>
2008-01-27 18:17 ` a7839e96 (PNP: increase max resources) breaks my ALSA intel8x0 sound card Robert Hancock
2008-01-31 22:58   ` Andrew Morton
2008-02-01  0:14     ` Robert Hancock
2008-02-01  0:50       ` Linus Torvalds
2008-02-04 17:39         ` Bjorn Helgaas
2008-02-04 18:18           ` Linus Torvalds
2008-02-04 20:41             ` Bjorn Helgaas
2008-02-04 21:16               ` Linus Torvalds [this message]
2008-02-05  7:03                 ` Bjorn Helgaas
2008-02-05 16:46                   ` Avuton Olrich
2008-02-05 18:15                   ` Linus Torvalds
2008-02-05 20:12                     ` Bjorn Helgaas
2008-02-13 22:33                       ` Avuton Olrich
2008-02-14 18:51                       ` Bjorn Helgaas
2008-02-14 19:42                         ` Linus Torvalds
2008-02-14 20:07                           ` Bjorn Helgaas
2008-02-14 20:26                             ` Linus Torvalds
2008-02-14 21:01                               ` Bjorn Helgaas
2008-02-14 21:37                                 ` Linus Torvalds
2008-02-14 22:28                                   ` Bjorn Helgaas
2008-02-14 22:57                                     ` Linus Torvalds
2008-02-14 23:14                                       ` Linus Torvalds
2008-02-15  0:13                                         ` Bjorn Helgaas
2008-02-15  0:40                                           ` Linus Torvalds
2008-02-27 17:43                                             ` Bjorn Helgaas
2008-01-27 14:40 Avuton Olrich
2008-01-27 21:50 ` Linus Torvalds
2008-01-28  1:15   ` Shaohua Li

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=alpine.LFD.1.00.0802041300170.3034@hp.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=avuton@gmail.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=trenn@suse.de \
    --cc=yakui.zhao@intel.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