Skip to content

Commit a1d64eb

Browse files
author
Herton R. Krzesinski
committed
Merge: Volume Management Device (VMD) driver fixes
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1764 This series updates RHEL9's Volume Management Device (VMD) driver with a couple of small, but important, fixes. Both patches apply cleanly with no conflicts. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2136299 Depends: N/A Signed-off-by: Myron Stowe <mstowe@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Lenny Szubowicz <lszubowi@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents cf7c007 + d9005a8 commit a1d64eb

File tree

1 file changed

+25
-2
lines changed
  • drivers/pci/controller

1 file changed

+25
-2
lines changed

drivers/pci/controller/vmd.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
719719
resource_size_t offset[2] = {0};
720720
resource_size_t membar2_offset = 0x2000;
721721
struct pci_bus *child;
722+
struct pci_dev *dev;
722723
int ret;
723724

724725
/*
@@ -859,8 +860,25 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
859860

860861
pci_scan_child_bus(vmd->bus);
861862
vmd_domain_reset(vmd);
862-
list_for_each_entry(child, &vmd->bus->children, node)
863-
pci_reset_bus(child->self);
863+
864+
/* When Intel VMD is enabled, the OS does not discover the Root Ports
865+
* owned by Intel VMD within the MMCFG space. pci_reset_bus() applies
866+
* a reset to the parent of the PCI device supplied as argument. This
867+
* is why we pass a child device, so the reset can be triggered at
868+
* the Intel bridge level and propagated to all the children in the
869+
* hierarchy.
870+
*/
871+
list_for_each_entry(child, &vmd->bus->children, node) {
872+
if (!list_empty(&child->devices)) {
873+
dev = list_first_entry(&child->devices,
874+
struct pci_dev, bus_list);
875+
if (pci_reset_bus(dev))
876+
pci_warn(dev, "can't reset device: %d\n", ret);
877+
878+
break;
879+
}
880+
}
881+
864882
pci_assign_unassigned_bus_resources(vmd->bus);
865883

866884
/*
@@ -980,6 +998,11 @@ static int vmd_resume(struct device *dev)
980998
struct vmd_dev *vmd = pci_get_drvdata(pdev);
981999
int err, i;
9821000

1001+
if (vmd->irq_domain)
1002+
vmd_set_msi_remapping(vmd, true);
1003+
else
1004+
vmd_set_msi_remapping(vmd, false);
1005+
9831006
for (i = 0; i < vmd->msix_count; i++) {
9841007
err = devm_request_irq(dev, vmd->irqs[i].virq,
9851008
vmd_irq, IRQF_NO_THREAD,

0 commit comments

Comments
 (0)