Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Rene Herman <rene.herman@...>, Jesse Barnes <jbarnes@...>, Len Brown <lenb@...>, Frans Pop <elendil@...>, Rafael J. Wysocki <rjw@...>, <linux-kernel@...>, <linux-pci@...>, <linux-acpi@...>, Adam Belay <abelay@...>, Avuton Olrich <avuton@...>, Karl Bellve <karl.bellve@...>, Willem Riede <wriede@...>, Matthew Hall <mhall@...>
Date: Tuesday, September 30, 2008 - 3:12 pm

On Tuesday 30 September 2008 10:29:44 am Linus Torvalds wrote:

Sorry for the delay in responding -- I'm officially on vacation
yesterday and today.

I agree that for 2.6.27 the "res->start == 0 means disabled" check
in the PNP quirk seems safest.

I don't like it long-term, because (a) I'd like that knowledge to at
least be in PCI, not PNP, and (b) res->start is the CPU address, not
necessarily the PCI bus address, and the BAR value (== PCI bus address)
is what we're trying to check.  Even if we looked at the BAR value
instead of res->start, I think zero is a valid PCI bus address on
machines where the root bridge applies an address offset.

So something like the patch below (same as what Rene originally
proposed, I think)?

diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 0bdf9b8..b3319e4 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -254,6 +254,10 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
 
 			pci_start = pci_resource_start(pdev, i);
 			pci_end = pci_resource_end(pdev, i);
+
+			if (!pci_start)
+				continue;
+
 			for (j = 0;
 			     (res = pnp_get_resource(dev, type, j)); j++) {
 				if (res->start == 0 && res->end == 0)

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch 2/2] PNP: don't check disabled PCI BARs for confl..., Bjorn Helgaas, (Tue Sep 30, 3:12 pm)
[patch 1/2] PCI: add pci_resource_enabled(), Bjorn Helgaas, (Mon Sep 29, 11:56 am)