mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
PCI: mvebu: Check that PCI bridge specified in DT has function number zero
Driver cannot handle PCI bridges at non-zero function address. So add appropriate check. Currently all in-tree kernel DTS files set PCI bridge function to zero. Link: https://lore.kernel.org/r/20211125124605.25915-4-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
This commit is contained in:
parent
5d18d702e5
commit
489bfc5187
@ -845,6 +845,11 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie,
|
||||
port->devfn = of_pci_get_devfn(child);
|
||||
if (port->devfn < 0)
|
||||
goto skip;
|
||||
if (PCI_FUNC(port->devfn) != 0) {
|
||||
dev_err(dev, "%s: invalid function number, must be zero\n",
|
||||
port->name);
|
||||
goto skip;
|
||||
}
|
||||
|
||||
ret = mvebu_get_tgt_attr(dev->of_node, port->devfn, IORESOURCE_MEM,
|
||||
&port->mem_target, &port->mem_attr);
|
||||
|
Loading…
Reference in New Issue
Block a user