Re: Buggy PCI drivers - do not mark pci_device_id as discardable data

Russell King
2003-09-09T21:34:06Z

On Tue, Sep 09, 2003 at 10:22:59PM +0100, Alan Cox wrote:
> On Maw, 2003-09-09 at 22:04, Russell King wrote:
> > I want this to be foolproof, because its me people bug when their cardbus
> > cards oops when they insert the damned things. If people are happy to
> > ignore this issue, I'm happy to ignore the bug reports.
> >
> > It basically isn't something I want to deal with, and we need to find a
> > way to stop these stupidities appearing in the first place.
> >
> > Any ideas?
>
> You've already got symbols for initdata start and end, just check the
> pointers in the pci_register code. I guess you want a per platform
>
> BUG_IF_INIT(x)

That would work for built-in drivers. We could couple that with an idea
Kai came up with (in private mail) to catch them in modpost. However,
the problem with modpost is that it gets false positives for these
drivers which explicitly want to discard their module device id tables.

As we currently stand, there seem to be only four drivers which want to
discard their driver id tables. Is it really worth adding extra code
to the kernel to try to trap these, or just not mark the device id
tables with __initdata or __devinitdata and detect the bad guys with
a grep?

--
Russell King (rmk@arm.linux.org.uk) http://www.arm.linux.org.uk/personal/
Linux kernel maintainer of:
2.6 ARM Linux - http://www.arm.linux.org.uk/
2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core