pci: Arch hook to determine config space size

Matthew Wilcox matthew at wil.cx
Tue Feb 1 06:29:55 EST 2005


On Mon, Jan 31, 2005 at 01:10:46PM -0600, Brian King wrote:
> Greg KH wrote:
> >On Fri, Jan 28, 2005 at 06:52:34PM +0000, Christoph Hellwig wrote:
> >
> >>>+int __attribute__ ((weak)) pcibios_exp_cfg_space(struct pci_dev *dev) { 
> >>>return 1; }
> >>
> >>- prototypes belong to headers
> >>- weak linkage is the perfect way for total obsfucation
> >>
> >>please make this a regular arch hook
> >
> >
> >I agree.  Also, when sending PCI related patches, please cc the
> >linux-pci mailing list.
> 
> How about this?

Thanks for copying linux-pci.  I hate this patch.

Basically, ppc64's config ops are broken and need to check the offset
being read.  Here's i386:

static int pci_conf1_write (int seg, int bus, int devfn, int reg, int len, u32 v
alue)
{
        unsigned long flags;

        if ((bus > 255) || (devfn > 255) || (reg > 255)) 
                return -EINVAL;

I think all the config ops in ppc64 are broken and need to check for these
limits.  Also, it does some checks that are already performed by upper layers:

        if (where & (size - 1))
                return PCIBIOS_BAD_REGISTER_NUMBER;

is checked for in drivers/pci/access.c

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain



More information about the Linuxppc64-dev mailing list