Re: PATCH: IDE PCI init cleanup

David S. Miller (davem@redhat.com)
Thu, 2 Sep 1999 01:22:48 -0700


Date: Wed, 1 Sep 1999 17:02:36 -0700 (PDT)
From: Andre Hedrick <andre@suse.com>

So back to the original issue, I have to have access to the PCI
config space at init and the ablity to update of the pci-config
data. Some of this is for setup, as stated above, while other
places are needed in a read-only mode for feature detection.

May be I am missing something here. Are we discussing the PCI
config status after PCI probing is completed? Or are we at the
entry point for the device sub-systems?

It isn't about PCI config space really, in this specific case
(changing base register values) it's about modifying a resource.

PCI resources are setup by the kernel and allocated carefully such
that there are no conflicts. In the driver you have no apriori
knowledge about whether the new value you want to use will conflict
with the I/O or MEM space usage of another PCI device.

This is the problem. If you want to change base registers you need to
go through the resource allocation mechanism to perform it safely.

If you blindly rewrite a base register and change the
pci_dev->resource[] values, you've also just made the resource tree
inconsistant.

Where your changes really belong is in a pcibios device fixup hook in
arch/i386/kernel/bios32.c In fact all of my ugly Sparc PCI fixups are
going into a similar spot so they can leave the drivers, they do not
belong there.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/