Re: RFC: pci_write_bits*() convenience functions

From: Grant Grundler
Date: Thu Dec 25 2008 - 03:20:52 EST


On Tue, Dec 23, 2008 at 10:59:38PM +0100, Micha? Miros?aw wrote:
...
> What's interesting, there are 2039 lines where pci_read_config_*() is used
> and in only about 161 the return value is checked (as of current linux-2.6.git
> tree: commit 3d44cc3e01..., quick grep test).

A very few of those config reads are for flushing MMIO commands to devices.
ISTR we had a case where resetting the device would cause MMIO reads to
Master Abort (timeout). It's ok for config cycles to Master Abort.
It's generally NOT OK for MMIO cycles to Master Abort.

However, your point is correct. Most of the time, we (driver writers) assume
the config cycle will either succeed or return ~0 (to indicate Master Abort).
And in some very few and extremely old PCI machines, return 0.

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