Skip to contentSkip to conversation

PCI fixes

GIT PULL Jesse Barnes 3 participants 6 messages Dec 17, 2011 – Jan 7, 2012 PCI

lore
Share & tools
lore
#0 lore raw

The following changes since commit
8e8da023f5af71662867729db5547dc54786093c:

x86: Fix boot failures on older AMD CPU's (2011-12-04 11:57:09 -0800)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci for-linus

Just a few regression fixes. We have a fix for the extra msleep you pointed out last time as well, but I was saving it for -next since it took awhile for Kenji-san and Yinghai to settle on something, and it changes a core behavior.

Ajaykumar Hotchandani (1):
PCI: Set device power state to PCI_D0 for device without native PM support

James Bottomley (1):
PCI: fix ats compile failure

Rafael J. Wysocki (1):
PCI hotplug: Always allow acpiphp to handle non-PCIe bridges

Ram Pai (1):
PCI: defer enablement of SRIOV BARS

 drivers/pci/ats.c                  |    1 +
 drivers/pci/hotplug/acpiphp_glue.c |   30 ++++++++++++------------------
 drivers/pci/iov.c                  |    7 +++++++
 drivers/pci/pci.c                  |    5 ++++-
 4 files changed, 24 insertions(+), 19 deletions(-)

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#1 lore raw
Quoted 2 lines · Jesse Barnes

Ram Pai (1):
     PCI: defer enablement of SRIOV BARS

oh, no!

It seems you let the old version slip into linus tree.

Now we need attached patch get into linus tree.

Thanks

Yinghai Lu

[PATCH] pci: Fix hotplug of Express Module with pci bridges

Found hotplug of one setup does not work with recent change in pci tree.

After checking the bridge conf setup, found bridges get assigned, but not get enabled.

Finally found following commit, simplely ignore bridge resource when enabling pci device.

| commit bbef98ab0f019f1b0c25c1acdf1683c68933d41b
| Author: Ram Pai <[email protected]>
| Date:   Sun Nov 6 10:33:10 2011 +0800
|
|    PCI: defer enablement of SRIOV BARS
|...
|    NOTE: Note, there is subtle change in the pci_enable_device() API.  Any
|    driver that depends on SRIOV BARS to be enabled in pci_enable_device()
|    can fail.

Put back bridge resource and ROM resource checking to fix the problem.

That should fix regression like BIOS does not assign correct resource to bridge.

Discussion can be found at:

	http://www.spinics.net/lists/linux-pci/msg12874.html
---
 drivers/pci/pci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/pci.c +5 -1
Index: linux-2.6/drivers/pci/pci.c
===================================================================
@@ -1139,7 +1139,11 @@ static int __pci_enable_device_flags(str
 	if (atomic_add_return(1, &dev->enable_cnt) > 1)
 		return 0;		/* already enabled */
 
-	for (i = 0; i < PCI_ROM_RESOURCE; i++)
+	/* only skip sriov related */
+	for (i = 0; i <= PCI_ROM_RESOURCE; i++)
+		if (dev->resource[i].flags & flags)
+			bars |= (1 << i);
+	for (i = PCI_BRIDGE_RESOURCES; i < DEVICE_COUNT_RESOURCE; i++)
 		if (dev->resource[i].flags & flags)
 			bars |= (1 << i);
 
#2 lore raw
Quoted 7 lines · Yinghai Lu
Quoted 2 lines · Jesse Barnes

Ram Pai (1):
     PCI: defer enablement of SRIOV BARS

oh, no!

Quoted 7 lines

It seems you let the old version slip into linus tree.

Now we need attached patch get into linus tree.

Thanks

Yinghai Lu

Crap, and after you guys spent so long coming up with a clean version.

Linus, can you just apply this one on top? I think it's the one Yinghai and Ram agreed to.

Thanks,
Jesse

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#3 lore raw
Quoted 4 lines · Jesse Barnes

Crap, and after you guys spent so long coming up with a clean version.

Linus, can you just apply this one on top? I think it's the one Yinghai and Ram agreed to.

Ok, applied, but I have to say that I hate it.

Why don't we just move the stupid iov indexes to the end, and then ignore them by not counting through them in __pci_enable_device_flags()? So the regular PCI code would always walk through the resources 0 .. PCI_BRIDGE_RESOURCES_END or something. And then the magic IOV code could look at its own ones that the generic code apparently doesn't even want to know about.

Hmm?

But as mentioned, in the meantime I applied this.

Linus

#4 lore raw
Quoted 8 lines · On Sun, 18 Dec 2011 14:14:13 -0800 Linus Torvalds…
Quoted 4 lines · Jesse Barnes

Crap, and after you guys spent so long coming up with a clean version.

Linus, can you just apply this one on top? I think it's the one Yinghai and Ram agreed to.

Ok, applied, but I have to say that I hate it.

Quoted 8 lines

Why don't we just move the stupid iov indexes to the end, and then ignore them by not counting through them in __pci_enable_device_flags()? So the regular PCI code would always walk through the resources 0 .. PCI_BRIDGE_RESOURCES_END or something. And then the magic IOV code could look at its own ones that the generic code apparently doesn't even want to know about.

Hmm?

There was some talk awhile back of pulling the SR-IOV resources out of the pci_dev resource array (adding a separate member to track them only if CONFIG_PCI_IOV is enabled), that would probably be the way to go. Then fix up whatever resource walking code that cares about IOV BARs (there isn't much I think).

Any thoughts Yinghai?

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#5 lore raw
Quoted 8 lines · Jesse Barnes

There was some talk awhile back of pulling the SR-IOV resources out of the pci_dev resource array (adding a separate member to track them only if CONFIG_PCI_IOV is enabled), that would probably be the way to go. Then fix up whatever resource walking code that cares about IOV BARs (there isn't much I think).

Any thoughts Yinghai?

We can add helpers like
for_each_resource_for_dev()
for_each_resource_for_dev_bridge()

Thanks

Yinghai