Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c51c82c authored by Sujith Pandel's avatar Sujith Pandel Committed by Bjorn Helgaas
Browse files

PCI: Add domain number check to find_smbios_instance_string()



The function find_smbios_instance_string() does not consider the
PCI domain number.  As a result, SMBIOS type 41 device type instance
would be exported to sysfs for all the PCI domains which have a
PCI device with same bus/device/function, though PCI bus/device/func
from a specific PCI domain has SMBIOS type 41 device type instance
defined.

Address the issue by making find_smbios_instance_string() check PCI domain
number as well.

Reported-by: default avatarShai Fultheim <Shai@ScaleMP.com>
Suggested-by: default avatarShai Fultheim <Shai@ScaleMP.com>
Tested-by: default avatarShai Fultheim <Shai@ScaleMP.com>
Signed-off-by: default avatarSujith Pandel <sujithpshankar@gmail.com>
Signed-off-by: default avatarNarendra K <Narendra_K@Dell.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 2b2154f9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,9 +43,11 @@ static size_t find_smbios_instance_string(struct pci_dev *pdev, char *buf,
{
	const struct dmi_device *dmi;
	struct dmi_dev_onboard *donboard;
	int domain_nr;
	int bus;
	int devfn;

	domain_nr = pci_domain_nr(pdev->bus);
	bus = pdev->bus->number;
	devfn = pdev->devfn;

@@ -53,7 +55,8 @@ static size_t find_smbios_instance_string(struct pci_dev *pdev, char *buf,
	while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
				      NULL, dmi)) != NULL) {
		donboard = dmi->device_data;
		if (donboard && donboard->bus == bus &&
		if (donboard && donboard->segment == domain_nr &&
				donboard->bus == bus &&
				donboard->devfn == devfn) {
			if (buf) {
				if (attribute == SMBIOS_ATTR_INSTANCE_SHOW)