]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[pci] Force completion of ECAM configuration space writes
authorMichael Brown <mcb30@ipxe.org>
Wed, 1 Nov 2023 22:03:34 +0000 (22:03 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 1 Nov 2023 22:32:21 +0000 (22:32 +0000)
commitf883203132b3d06ffb354f1b11d1f65a0c70ff42
tree64f7c412a733a8923327a9e37534a633a69dbe6d
parent115707c0edebad65f87525fed583fef73880016d
[pci] Force completion of ECAM configuration space writes

The PCIe specification requires that "processor and host bridge
implementations must ensure that a method exists for the software to
determine when the write using the ECAM is completed by the completer"
but does not specify any particular method to be used.  Some platforms
might treat writes to the ECAM region as non-posted, others might
require reading back from a dedicated (and implementation-specific)
completion register to determine when the configuration space write
has completed.

Since PCI configuration space writes will never be used for any
performance-critical datapath operations (on any sane hardware), a
simple and platform-independent solution is to always read back from
the written register in order to guarantee that the write must have
completed.  This is safe to do, since the PCIe specification defines a
limited set of configuration register types, none of which have read
side effects.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/ecam.c