diff options
author | Sergei Miroshnichenko <s.miroshnichenko@yadro.com> | 2020-12-18 16:47:31 +0300 |
---|---|---|
committer | Sergei Miroshnichenko <s.miroshnichenko@yadro.com> | 2021-01-13 15:19:47 +0300 |
commit | f5d1f72205f723754e3b11e8e3ff1e555873a1fd (patch) | |
tree | 9f633adf1b0ab287954063b147a899d6d2eaf5a1 | |
parent | e180ebb13710a20798929467f9c37d0570ab9acc (diff) |
PCI/portdrv: Declare support of movable BARs
Currently there are no reliable way to determine if a driver uses BARs of
its devices (their struct resource don't always have a child), so if it
doesn't explicitly support movable BARs, they are considered fixed.
The portdrv driver for PCI switches don't use BARs, so add a new hook
.bar_fixed() { return false; } to increase the chances to allocate new
BARs for new devices.
Signed-off-by: Sergei Miroshnichenko <s.miroshnichenko@yadro.com>
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 0b250bc5f405..3043f7e4d3c1 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -212,6 +212,11 @@ static const struct pci_error_handlers pcie_portdrv_err_handler = { .resume = pcie_portdrv_err_resume, }; +static bool pcie_portdrv_bar_fixed(struct pci_dev *pdev, int resno) +{ + return false; +} + static struct pci_driver pcie_portdriver = { .name = "pcieport", .id_table = &port_pci_ids[0], @@ -222,6 +227,8 @@ static struct pci_driver pcie_portdriver = { .err_handler = &pcie_portdrv_err_handler, + .bar_fixed = pcie_portdrv_bar_fixed, + .driver.pm = PCIE_PORTDRV_PM_OPS, }; |