Re: ((struct pci_dev*)dev)->resource[...].start

Jonathan Lundell (jlundell@pobox.com)
Wed, 16 May 2001 16:06:51 -0700


At 5:37 PM -0400 2001-05-16, Jeff Garzik wrote:
>This is not a safe assumption, because the OS may reprogram the PCI BARs
>at certain times. The rule is: ALWAYS read from dev->resource[] unless
>you are a bus driver (PCI bridges, for example, need to assign
>resources).

Would you please elaborate? If I understand what you're saying, you
can't rely on the "pointer" returned by ioremap() because the OS
might reprogram the relevant BAR out from under you. So one would
need to know: when does a driver have to re-ioremap() due to the BAR
having been (potentially) changed? I'd expect the answer to be: for
all practical purposes never.

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