Skip to content

Commit

Permalink
PCI: Honor firmware's device disabled status
Browse files Browse the repository at this point in the history
If a device has a firmware node (DT/ACPI), and the device is marked
disabled, that is currently ignored. Add a check for this condition and
bail out creating the pci_dev.

This assumes the config space for the device can still be accessed because
they already have by this point in order to identify the device.

Link: https://lore.kernel.org/r/20230210164351.2687475-1-robh@kernel.org
Tested-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Liu Peibao <liupeibao@loongson.cn>
Cc: Huacai Chen <chenhuacai@loongson.cn>
  • Loading branch information
Rob Herring authored and Bjorn Helgaas committed Feb 13, 2023
1 parent c768f8c commit 6fffbc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,8 @@ int pci_setup_device(struct pci_dev *dev)

pci_set_of_node(dev);
pci_set_acpi_fwnode(dev);
if (dev->dev.fwnode && !fwnode_device_is_available(dev->dev.fwnode))
return -ENODEV;

pci_dev_assign_slot(dev);

Expand Down

0 comments on commit 6fffbc7

Please sign in to comment.