summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/pci/pci_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/pci/pci_pci.c')
-rw-r--r--freebsd/sys/dev/pci/pci_pci.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/freebsd/sys/dev/pci/pci_pci.c b/freebsd/sys/dev/pci/pci_pci.c
index c6d07157..ed4c1b50 100644
--- a/freebsd/sys/dev/pci/pci_pci.c
+++ b/freebsd/sys/dev/pci/pci_pci.c
@@ -78,7 +78,7 @@ static void pcib_pcie_ab_timeout(void *arg);
static void pcib_pcie_cc_timeout(void *arg);
static void pcib_pcie_dll_timeout(void *arg);
#endif
-static int pcib_request_feature(device_t pcib, device_t dev,
+static int pcib_request_feature_default(device_t pcib, device_t dev,
enum pci_feature feature);
static device_method_t pcib_methods[] = {
@@ -123,7 +123,7 @@ static device_method_t pcib_methods[] = {
DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari),
DEVMETHOD(pcib_ari_enabled, pcib_ari_enabled),
DEVMETHOD(pcib_decode_rid, pcib_ari_decode_rid),
- DEVMETHOD(pcib_request_feature, pcib_request_feature),
+ DEVMETHOD(pcib_request_feature, pcib_request_feature_default),
DEVMETHOD_END
};
@@ -966,8 +966,7 @@ pcib_probe_hotplug(struct pcib_softc *sc)
* Now that we're sure we want to do hot plug, ask the
* firmware, if any, if that's OK.
*/
- if (pcib_request_feature(device_get_parent(device_get_parent(dev)), dev,
- PCI_FEATURE_HP) != 0) {
+ if (pcib_request_feature(dev, PCI_FEATURE_HP) != 0) {
if (bootverbose)
device_printf(dev, "Unable to activate hot plug feature.\n");
return;
@@ -2865,6 +2864,17 @@ pcib_request_feature_allow(device_t pcib, device_t dev,
return (0);
}
+int
+pcib_request_feature(device_t dev, enum pci_feature feature)
+{
+
+ /*
+ * Invoke PCIB_REQUEST_FEATURE of this bridge first in case
+ * the firmware overrides the method of PCI-PCI bridges.
+ */
+ return (PCIB_REQUEST_FEATURE(dev, dev, feature));
+}
+
/*
* Pass the request to use this PCI feature up the tree. Either there's a
* firmware like ACPI that's using this feature that will approve (or deny) the
@@ -2873,7 +2883,8 @@ pcib_request_feature_allow(device_t pcib, device_t dev,
* to make use of the feature or render it harmless.
*/
static int
-pcib_request_feature(device_t pcib, device_t dev, enum pci_feature feature)
+pcib_request_feature_default(device_t pcib, device_t dev,
+ enum pci_feature feature)
{
device_t bus;