lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0809300904530.3389@nehalem.linux-foundation.org>
Date:	Tue, 30 Sep 2008 09:29:44 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Rene Herman <rene.herman@...access.nl>
cc:	Bjorn Helgaas <bjorn.helgaas@...com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Len Brown <lenb@...nel.org>, Frans Pop <elendil@...net.nl>,
	"Rafael J. Wysocki" <rjw@...k.pl>, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
	Adam Belay <abelay@....edu>, Avuton Olrich <avuton@...il.com>,
	Karl Bellve <karl.bellve@...ssmed.edu>,
	Willem Riede <wriede@...de.org>,
	Matthew Hall <mhall@...omputing.net>
Subject: Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in
 quirk_system_pci_resources()



On Tue, 30 Sep 2008, Rene Herman wrote:
> 
> > Of course, it may be that the PnP code runs too early, and we have only
> > parsed the PCI resources, not inserted them into the resource tree yet. If
> > so, none of this will work, of course.
> 
> It doesn't. With the test negated it triggers for all PCI resources (and
> ofcourse my soundcard driver fails again).

Oh, ok. Looking at it, it does seem that we actually _insert_ the PCI 
resources too late. We do it in pcibios_allocate_resources(), and there we 
even take care to look at whether it was enabled or disabled (we 
prioritize enabled resources, so that a disabled one will never be 
requested before an enabled one and if they clash, it's always the 
disabled one that loses the resource).

But pcibios_allocate_resources() is called from pcibios_resource_survey(), 
which is called from pcibios_init(), which in turn is caled from 
pci_subsys_init() that is a "subsys_initcall()".

In contrast, the PnP fixup thing is called from pnp_fixup_device, called 
from __pnp_add_device(), called from pnp_add_device() (and 
pnp_add_card(), but that should be later), and those in turn from
pnpacpi_add_device and pnpacpi_init(). 

And pnpacpi_init is _also_ a subsys_initcall, but arch/x86/pci/built-in.o 
gets linked in _after_ drivers/built-in.o. That, in turn, is because it's 
marked as a "driver" in the x86 Makefile, and the main Makefile actually 
ends up forcing "drivers-y" to have drivers/ first.

Just for fun, does this patch make a difference and allow you to just 
take the "is it registered" thing into account?

It's a scary change right now, and I wouldn't commit it as is (I think 
that for 2.6.27 the thing to do is to just do the minimal "zero means 
disabled" thing), but having some random driver level initialize before 
the core architecture-specific PCI code does smell. So something like this 
sounds conceptually right anyway.

		Linus

---
 arch/x86/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index f5631da..97d0e86 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -159,7 +159,7 @@ core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/
 
 # drivers-y are linked after core-y
 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
-drivers-$(CONFIG_PCI)            += arch/x86/pci/
+core-$(CONFIG_PCI)            += arch/x86/pci/
 
 # must be linked after kernel/
 drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ