From: Hou Zhiqiang Date: Fri, 5 Jul 2019 09:56:39 +0000 (+0800) Subject: PCI: mobiveil: Fix devfn check in mobiveil_pcie_valid_device() X-Git-Tag: android-x86-9.0-r1~1^2~123^2~170 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=27df2bc894f62da1644e0770ad62822357b62936;p=android-x86%2Fkernel.git PCI: mobiveil: Fix devfn check in mobiveil_pcie_valid_device() [ Upstream commit cbd50b3ca3964c79dac65fda277637577e029e8c ] 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 Signed-off-by: Lorenzo Pieralisi Reviewed-by: Minghuan Lian Signed-off-by: Sasha Levin --- diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index dc228eb500ed..476be4f3c7f6 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -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 * 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 true;