pcib: Clear any pending slot status events during attach

Any events left over from boot firmware, etc. are not meaningful so
clear pending events during attach.  If they are still pending they
should remain asserted when the slot status register is re-read.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D49950

(cherry picked from commit ff45e4759a38f44a0199b2948b7b1e987e7c71da)
This commit is contained in:
John Baldwin 2025-04-21 22:08:17 -04:00
parent 4373c15f1f
commit 14cb463635

View file

@ -1449,6 +1449,7 @@ pcib_setup_hotplug(struct pcib_softc *sc)
/* Clear any events previously pending. */
pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2);
sc->pcie_slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2);
/* Enable HotPlug events. */
mask = PCIEM_SLOT_CTL_DLLSCE | PCIEM_SLOT_CTL_HPIE |