Re: pci_enable_device()

From: Martin Mares (mj@suse.cz)
Date: Thu Mar 09 2000 - 06:41:50 EST


Hi Petr,

> for current matroxfb release I read through PCI docs and decided that
> doing pci_enable_device() is right thing to do even for me. Unfortunately,
> now I have problem how to find, which of VGA devices was primary and which
> not.
> Is there some recommended solution for this task or should I return back
> to my old code, which thought that if device is not enabled, it is second
> head (and needs full initialization) and if it is enabled, it is primary
> head (initialized by BIOS and doing primary console)? I need this because
> of matroxfb cannot initialize all types of hardware around, so it
> initializes it only when it really needs.

   You really should call pci_enable_device(), because it not only toggles
command register bits, but also assigns resources and does other important
stuff. Just save contents of the command register before you enable the
device and then check it to see whether the device was primary or secondary
and possibly disable the I/O decoders again.

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"hAS ANYONE SEEN MY cAPSLOCK KEY?"

- 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/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:15 EST