Re: a7839e96 (PNP: increase max resources) breaks my ALSA intel8x0 sound card



On Thursday 14 February 2008 02:37:15 pm Linus Torvalds wrote:

On Thu, 14 Feb 2008, Bjorn Helgaas wrote:

That means the PNP system driver has to be registered after the PCI
driver.

After the PCI *subsystem*

Here's the actual problem:

[ 31.133141] PCI: Unable to reserve mem region #1:4000@febf8000 for device 0000:00:1b.0

and here is what the resource tree *should* look like:

febf8000-febfbfff : 0000:00:1b.0
febf8000-febfbfff : ICH HD audio

that's with a working sound driver.

Notice how there is *two* resources there: there's the PCI bus resource
itself, the one called 0000:00:1b.0 (which was active at boot), and there
is the "driver resource" that nests inside of it ("ICH HD audio").

The PCI bus resource is created and inserted into the resource when the
PCI bus discovery happens - long before the driver comes along at all.

And the problem is this ABSOLUTE CRAP that happened much earlier:

[ 22.906610] system 00:08: iomem range 0xfebfe000-0xfebfec00 has been reserved
[ 22.906654] system 00:08: iomem range 0xfebfa000-0xfebfac00 has been reserved

which happens
(a) before the PCI bus probing

I don't think so. pci_scan_bus_parented() happened earlier, here:

[ 22.875359] ACPI: PCI Root Bridge [PCI0] (0000:00)

and pcibios_init() is a subsys_initcall() that happens before the PNP
system driver registers via fs_initcall() (I had this order wrong in a
previous email).

This has everything to do with the fact that the PnP layer is a piece of
crap and overrides/messes with the *correct* resources that we found
during PCI bus probing.

There are clearly problems with PNP. I'm trying to help improve the
situation.

So here is (for the *fifth* time) what PnP should do:

- only try to insert its resources *after* the PCI bus probing has
happened

That already happens.

- and if that fails, LET THE CRAP FAIL instead of making the *good* code
fail!

The PNP resource fits entirely inside the PCI bus resource, so the PNP
insertion will only fail if the sound driver has already been loaded.

It seems like we're talking past each other. Would anybody else like
to step in and help explain this to me? Maybe a fresh viewpoint will
help me find a clue.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: About using IoCompleteRequest and iostatus blocks Status Field.
    ... You cannot pend most PNP IRP's you need to complete them, ... return STATUS_PENDING or complete the IRP with IoCompleteRequest. ... Your driver doesn't specifiy the resources, ... How can I make sure that, the default resource descriptors, ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH] smsc-ircc2: Add PnP support.
    ... >>and the pnp probe failed and it disable the resource, ... > even if the serial driver has grabbed the regions. ...
    (Linux-Kernel)
  • Re: [bisected][resend] pnp: Huge number of "io resource overlap" messages
    ... The commit that changed this was: ... PNP: replace pnp_resource_table with dynamically allocated resources ... about "io resource overlaps" for pnp 00:08 in my dmesg, ... Generally, you need it -- if PnP grabs an I/O resource, PCI can no longer do so (making the driver fail) which is the same problem that quirk_system_pci_resourcesupto that point solved for mem resources only. ...
    (Linux-Kernel)
  • Re: [PATCH] PNP support for i8042 driver
    ... >>It is better to keep pnp driver loaded because when it unload, ... > after unloading the driver with PNP? ... With that the device won't be disabled (no resource ...
    (Linux-Kernel)
  • Re: [BUG 2.6.31-rc1] HIGHMEM64G causes hang in PCI init on 32-bit x86
    ... We _could_ have a RAM resource that crosses the 4GB boundary, ... 00000000-0009ebff: System RAM ... bff00000-dfefffff: PCI Bus 0000:01 ... e0000000-efffffff: pnp 00:0e ...
    (Linux-Kernel)