Commit 27df2bc8 authored by Hou Zhiqiang's avatar Hou Zhiqiang Committed by Greg Kroah-Hartman

PCI: mobiveil: Fix devfn check in mobiveil_pcie_valid_device()

[ Upstream commit cbd50b3c ]

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: 9af6bcb1 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver")
Signed-off-by: default avatarHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarMinghuan Lian <Minghuan.Lian@nxp.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1ca599a6
...@@ -174,7 +174,7 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) ...@@ -174,7 +174,7 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn)
* Do not read more than one device on the bus directly * Do not read more than one device on the bus directly
* attached to RC * attached to RC
*/ */
if ((bus->primary == pcie->root_bus_nr) && (devfn > 0)) if ((bus->primary == pcie->root_bus_nr) && (PCI_SLOT(devfn) > 0))
return false; return false;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment