Skip to content

Commit 5827e17

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: vmd: Correct PCI Header Type Register's multi-function check
vmd_domain_reset() attempts to find whether the device may contain multiple functions by checking 0x80 (Multi-Function Device), however, the hdr_type variable has already been masked with PCI_HEADER_TYPE_MASK so the check can never true. To fix the issue, don't mask the read with PCI_HEADER_TYPE_MASK. Fixes: 6aab562 ("PCI: vmd: Clean up domain before enumeration") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Nirmal Patel <[email protected]>
1 parent b5fc040 commit 5827e17

File tree

1 file changed

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

1 file changed

+1
-2
lines changed

drivers/pci/controller/vmd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ static void vmd_domain_reset(struct vmd_dev *vmd)
525525
base = vmd->cfgbar + PCIE_ECAM_OFFSET(bus,
526526
PCI_DEVFN(dev, 0), 0);
527527

528-
hdr_type = readb(base + PCI_HEADER_TYPE) &
529-
PCI_HEADER_TYPE_MASK;
528+
hdr_type = readb(base + PCI_HEADER_TYPE);
530529

531530
functions = (hdr_type & 0x80) ? 8 : 1;
532531
for (fn = 0; fn < functions; fn++) {

0 commit comments

Comments
 (0)