PCI: vmd: Correct PCI Header Type Register's multi-function check
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 3 Oct 2023 12:52:58 +0000 (15:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:52:05 +0000 (11:52 +0100)
commitaa804deca1c3f4bc101789560d3a6222683b4f89
tree3621605906b4588bc3bd9cee8145a47773d3f37b
parented7f07ef84c4a60af7dd7b7ef854a0390fc8251f
PCI: vmd: Correct PCI Header Type Register's multi-function check

[ Upstream commit 5827e17d0555b566c32044b0632b46f9f95054fa ]

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: 6aab5622296b ("PCI: vmd: Clean up domain before enumeration")
Link: https://lore.kernel.org/r/20231003125300.5541-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Nirmal Patel <nirmal.patel@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/vmd.c