From: Rene Herman <rene.herman@keyaccess.nl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Len Brown <lenb@kernel.org>, Frans Pop <elendil@planet.nl>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-acpi@vger.kernel.org, Adam Belay <abelay@mit.edu>,
Avuton Olrich <avuton@gmail.com>,
Karl Bellve <karl.bellve@umassmed.edu>,
Willem Riede <wriede@riede.org>,
Matthew Hall <mhall@mhcomputing.net>
Subject: Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources()
Date: Tue, 30 Sep 2008 11:19:10 +0200 [thread overview]
Message-ID: <48E1EF0E.8030006@keyaccess.nl> (raw)
In-Reply-To: <alpine.LFD.2.00.0809291211330.3389@nehalem.linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
On 29-09-08 21:13, Linus Torvalds wrote:
>
> On Mon, 29 Sep 2008, Rene Herman wrote:
>> I believe the possible issue is that resources that do _not_ (seem to) start
>> at zero might also be disabled.
>
> But that is irrelevant.
>
> If we have registered them in the resource tree, then PnP must ignore
> them.
>
> The fact is, this is not about being enabled or disabled. This is about
> the PnP tree containing resources that we already parsed from the PCI
> stuff, and once we've seen them as PCI resources, there's not really
> anything valuable in the PnP information.
Well, if you say so...
Just did the attached which might match that intention. Please do not
consider this a submission as I've no idea if this is sensible nor if it
actually helps Frans. Just for discussion. Anything here should arrive
through Bjorn.
Rene.
[-- Attachment #2: quirk_system_pci_resources.diff --]
[-- Type: text/plain, Size: 2153 bytes --]
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 0bdf9b8..0824eed 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -230,7 +230,8 @@ static void quirk_ad1815_mpu_resources(struct pnp_dev *dev)
static void quirk_system_pci_resources(struct pnp_dev *dev)
{
struct pci_dev *pdev = NULL;
- struct resource *res;
+ struct resource *pci_res;
+ struct resource *pnp_res;
resource_size_t pnp_start, pnp_end, pci_start, pci_end;
int i, j;
@@ -247,20 +248,29 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
unsigned int type;
- type = pci_resource_flags(pdev, i) &
- (IORESOURCE_IO | IORESOURCE_MEM);
- if (!type || pci_resource_len(pdev, i) == 0)
+ pci_res = &pdev->resource[i];
+
+ /* have we been registered already? */
+ if (pci_res->parent)
+ continue;
+
+ pci_start = pci_res->start;
+ pci_end = pci_res->end;
+
+ if (pci_end < pci_start || !pci_end)
+ continue;
+
+ type = pci_res->flags & (IORESOURCE_IO | IORESOURCE_MEM);
+ if (!type)
continue;
- pci_start = pci_resource_start(pdev, i);
- pci_end = pci_resource_end(pdev, i);
for (j = 0;
- (res = pnp_get_resource(dev, type, j)); j++) {
- if (res->start == 0 && res->end == 0)
- continue;
+ (pnp_res = pnp_get_resource(dev, type, j)); j++) {
+ pnp_start = pnp_res->start;
+ pnp_end = pnp_res->end;
- pnp_start = res->start;
- pnp_end = res->end;
+ if (pnp_end < pnp_start || !pnp_end)
+ continue;
/*
* If the PNP region doesn't overlap the PCI
@@ -288,13 +298,13 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
dev_warn(&dev->dev, "%s resource "
"(0x%llx-0x%llx) overlaps %s BAR %d "
"(0x%llx-0x%llx), disabling\n",
- pnp_resource_type_name(res),
+ pnp_resource_type_name(pnp_res),
(unsigned long long) pnp_start,
(unsigned long long) pnp_end,
pci_name(pdev), i,
(unsigned long long) pci_start,
(unsigned long long) pci_end);
- res->flags |= IORESOURCE_DISABLED;
+ pnp_res->flags |= IORESOURCE_DISABLED;
}
}
}
next prev parent reply other threads:[~2008-09-30 9:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 15:53 [patch 0/2] don't check disabled PCI BARs for conflicts with PNP devices Bjorn Helgaas
2008-09-29 15:56 ` [patch 1/2] PCI: add pci_resource_enabled() Bjorn Helgaas
2008-09-29 15:57 ` [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources() Bjorn Helgaas
2008-09-29 16:34 ` Linus Torvalds
2008-09-29 18:31 ` Rene Herman
2008-09-29 19:13 ` Linus Torvalds
2008-09-30 9:19 ` Rene Herman [this message]
2008-09-30 14:48 ` Linus Torvalds
2008-09-30 15:57 ` Rene Herman
2008-09-30 16:29 ` Linus Torvalds
2008-09-30 17:10 ` Linus Torvalds
2008-09-30 17:21 ` Linus Torvalds
2008-09-30 19:29 ` Rene Herman
2008-09-30 19:37 ` Rene Herman
2008-09-30 19:44 ` Linus Torvalds
2008-09-30 20:48 ` Rene Herman
2008-09-30 19:38 ` Ingo Molnar
2008-09-30 19:51 ` Linus Torvalds
2008-09-30 19:54 ` Arjan van de Ven
2008-09-30 20:01 ` Ingo Molnar
2008-10-01 6:13 ` Grant Grundler
2008-10-01 8:26 ` Ingo Molnar
2008-10-06 5:34 ` Grant Grundler
2008-10-01 15:14 ` Linus Torvalds
2008-10-01 16:21 ` Yinghai Lu
2008-09-30 20:05 ` Rolf Eike Beer
2008-10-01 8:52 ` Ingo Molnar
2008-09-30 18:01 ` Linus Torvalds
2008-09-30 18:13 ` Linus Torvalds
2008-09-30 19:51 ` Rene Herman
2008-09-30 19:16 ` Bjorn Helgaas
2008-09-30 19:12 ` Bjorn Helgaas
2008-10-01 20:18 ` Bjorn Helgaas
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=48E1EF0E.8030006@keyaccess.nl \
--to=rene.herman@keyaccess.nl \
--cc=abelay@mit.edu \
--cc=avuton@gmail.com \
--cc=bjorn.helgaas@hp.com \
--cc=elendil@planet.nl \
--cc=jbarnes@virtuousgeek.org \
--cc=karl.bellve@umassmed.edu \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mhall@mhcomputing.net \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.org \
--cc=wriede@riede.org \
/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