public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
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: Mon, 29 Sep 2008 20:31:22 +0200	[thread overview]
Message-ID: <48E11EFA.8010402@keyaccess.nl> (raw)
In-Reply-To: <alpine.LFD.1.10.0809290912060.3265@nehalem.linux-foundation.org>

On 29-09-08 18:34, Linus Torvalds wrote:

> On Mon, 29 Sep 2008, Bjorn Helgaas wrote:
>>  
>> +			if (!pci_resource_enabled(pdev, i))
>> +				continue;
> 
> I really don't think this is the right approach.
> 
> Maybe the PCI device has been turned off, but the *resource* may still be 
> valid.
> 
> Wouldn't it be much better to just check whether the resource is inserted 
> in the resource tree or not? 
> 
> Quite frankly, it looks like your change will basically cause us to look 
> over *every* system PnP resource, and for each of them, it will look at 
> *every* PCI device, and for each PCI device it will look at *every* BAR, 
> and for each BAR it finds it will read the PCI status register, over and 
> over and over again.
> 
> Now, I doubt you'll be able to wear out the PCI bus, but doesn't this just 
> make you go "umm, that's not pretty, and it doesn't make much sense".
> 
> If we've detected the PCI resource as being valid by the PCI layer, why 
> not just use that information? And afaik, the easy way to check that is 
> just whether it's inserted into the resource tree, which in turn is most 
> trivially done by just checking whether the resource has a parent.
> 
> IOW, why isn't it just doing
> 
> 	struct resource *res = dev->resource[bar];
> 
> 	if (!res->parent)
> 		continue;
> 
> or something? Or what was wrong with just checking the res->start for 
> being zero? Wherever PnP is relevant, resources that start at zero are 
> disabled, no? 

I believe the possible issue is that resources that do _not_ (seem to) 
start at zero might also be disabled.

Bjorn commented that pci_resource_start() returns a CPU address for I/O 
which might not be the actual I/O address on some platforms. I haven't a 
clue if that's actually possible "wherever PnP is relevent" as you put 
it but that seems to otherwise make sense.

If it does though, it might for all I know also be possible to check 
against some ARCH_SPECIFIC_INVALID_IO_ADDRESS instead of plain unadorned 
0 (or just recheck the actual BAR again if not stored anywhere).

But that's the issue as I understood it: we might miss them on some 
platforms if checking against 0...

Rene.

  reply	other threads:[~2008-09-29 18:27 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 [this message]
2008-09-29 19:13       ` Linus Torvalds
2008-09-30  9:19         ` Rene Herman
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=48E11EFA.8010402@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