Bug 15903 - PNP resource assignment fails
Summary: PNP resource assignment fails
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: PNP (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Bjorn Helgaas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-03 15:23 UTC by Bjorn Helgaas
Modified: 2010-05-20 03:05 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.34-rc6
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
dmesg showing failure (44.22 KB, text/plain)
2010-05-03 15:31 UTC, Bjorn Helgaas
Details
test patch to ignore window resources (820 bytes, patch)
2010-05-03 15:33 UTC, Bjorn Helgaas
Details | Diff
dmesg with patch (success) (46.72 KB, text/plain)
2010-05-03 15:48 UTC, Bjorn Helgaas
Details
lspci -vvv (6.85 KB, text/plain)
2010-05-09 14:26 UTC, Pavel Kysilka
Details

Description Bjorn Helgaas 2010-05-03 15:23:42 UTC
Pavel wrote:
> i am playing with old PIII computer (HP Vectra VE) and ISA soundcards.
> Soundcards are PNP(yamaha,opti,ess,...) and no PNP (multisound).
> Machine
> is old, but ACPI compliant - old BIOS.
> 
> Computer booting OK. PNP0 devices allocate resources OK, but PNP1
> devices (one ISA slot) not. PNP soundcard driver is not correctly
> loaded
> - soundcard device not created.

> 2.6.33 kernel working without problem.
Comment 1 Bjorn Helgaas 2010-05-03 15:31:40 UTC
Created attachment 26204 [details]
dmesg showing failure

Here's the problem (I think):

  pnp 00:01: parse allocated resources
  pnp 00:01:   add [bus 00-ff flags 0x1000]
  pnp 00:01:   add [io  0x0000-0x0cf7 flags 0x200101]
  pnp 00:01: Plug and Play ACPI device, IDs PNP0a03 (active)

This PNP0a03 PCI host bridge has a window [io  0x0000-0x0cf7] that is
forwarded to the PCI bridge.  This is perfectly normal, but in 2.6.33,
PNPACPI ignored that window, so it didn't appear as a PNP resource of
the bridge.

  cmi8330 01:01.00: pnp_assign_resources, try dependent set 0
  cmi8330 01:01.00: trying to assign [??? 0x00000530-0x00000537 flags 0x40000001]
  cmi8330 01:01.00: check whether [??? 0x00000530-0x00000537 flags 0x40000001] is available
  cmi8330 01:01.00: conflict with 00:01 resource 1 [io  0x0000-0x0cf7 flags 0x200101]
  cmi8330 01:01.00:   couldn't assign io 0 (min 0x530 max 0x530)

Now we come along and try to assign [io  0x0530-0x0537] to the cmi8330
device.  The last piece of pnp_check_port() checks it against all
resources of other PNP devices, including the PNP0a03 host bridge
window.  We should ignore windows, because the bridge doesn't *consume*
that range, it only *forwards* it, so it's still available for devices
to use.

But we currently check against windows, so the [io  0x0530-0x0537] resource apppears to conflict with the host bridge window, and the assignment fails.
Comment 2 Bjorn Helgaas 2010-05-03 15:33:00 UTC
Created attachment 26205 [details]
test patch to ignore window resources
Comment 3 Bjorn Helgaas 2010-05-03 15:48:41 UTC
Created attachment 26206 [details]
dmesg with patch (success)

This boot succeeded and the sound card worked.  Here's a sample assignment:

cmi8330 01:01.00: pnp_assign_resources, try dependent set 0
cmi8330 01:01.00: trying to assign [??? 0x00000530-0x00000537 flags 0x40000001]
cmi8330 01:01.00: check whether [??? 0x00000530-0x00000537 flags 0x40000001] is available
cmi8330 01:01.00:   add [io  0x0530-0x0537 flags 0x40000101]
cmi8330 01:01.00: trying to assign [??? 0x00000388-0x0000038f flags 0x40000001]
cmi8330 01:01.00: check whether [??? 0x00000388-0x0000038f flags 0x40000001] is available
cmi8330 01:01.00:   add [io  0x0388-0x038f flags 0x40000101]
cmi8330 01:01.00:   add [irq 11 flags 0x40000401]
cmi8330 01:01.00:   add [dma 0 flags 0x40000808]
cmi8330 01:01.00: pnp_assign_resources succeeded: current resources:
cmi8330 01:01.00: [io  0x0530-0x0537 flags 0x40000101]
cmi8330 01:01.00: [io  0x0388-0x038f flags 0x40000101]
cmi8330 01:01.00: [irq 11 flags 0x40000401]
cmi8330 01:01.00: [dma 0 flags 0x40000808]
Comment 4 Pavel Kysilka 2010-05-09 14:26:45 UTC
Created attachment 26299 [details]
lspci -vvv
Comment 5 Len Brown 2010-05-20 03:05:22 UTC
commit 11439a6fd90b4861df64b4f983726e1c54977ab7
Author: Bjorn Helgaas <bjorn.helgaas@hp.com>
Date:   Mon May 3 10:47:21 2010 -0600

    PNP: don't check for conflicts with bridge windows


shipped in 2.6.34
closed.

Note You need to log in before you can comment on or make changes to this bug.