Re: pdev_enable_device no longer used ?

From: Martin Mares (mj@suse.cz)
Date: Mon Dec 11 2000 - 15:55:01 EST


Hello Gerard!

> Having to call some pdev_enable_device() to have the cache line size
> configured looks like shit to me. After all, the BARs, INT, LATENCY TIMER,
> etc.. are configured prior to entering driver probe.

Once upon a time, they used to be, but they no longer are. Unfortunately, there
are lots of bogus devices which must be never assigned BARs nor routed
interrupts. You need to call pci_enable_device() after you recognize the device
as handled by your driver to get BARs and interrupts set up. Also, if your
driver uses bus mastering, it should call pci_set_master().

> Why should the cache line size be deferred to some call to some obscure
> mismaned thing ?

See above. I'm also not joyfully jumping when I think of it, but consider
it being a tax on being compatible with the rough world of buggy PCI devices.
Anyway, it's still zillion times better than random drivers modifying such
configuration registers in random manner, knowing nothing about the host
bridge and other such stuff.

(Side note: I'm not saying the method your driver uses was bad at the time
it was designed, I'm only saying that it's wrong wrt. the rest of the kernel
and it should be gone.)

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
CChheecckk yyoouurr dduupplleexx sswwiittcchh..
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:22 EST