Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: mobiveil: Fix devfn check in mobiveil_pcie_valid_device()

Current check for devfn number in mobiveil_pci_valid_device() is
wrong in that it flags as invalid functions present in PCI device 0
in the root bus while it is perfectly valid to access all functions
in PCI device 0 in the root bus.

Update the check in mobiveil_pci_valid_device() to fix the issue.

Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver")
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Minghuan Lian <Minghuan.Lian@nxp.com>

authored by

Hou Zhiqiang and committed by
Lorenzo Pieralisi
cbd50b3c 6f3ab451

+1 -1
+1 -1
drivers/pci/controller/pcie-mobiveil.c
··· 283 283 * Do not read more than one device on the bus directly 284 284 * attached to RC 285 285 */ 286 - if ((bus->primary == pcie->root_bus_nr) && (devfn > 0)) 286 + if ((bus->primary == pcie->root_bus_nr) && (PCI_SLOT(devfn) > 0)) 287 287 return false; 288 288 289 289 return true;