Skip to content

Commit 3cde1c3

Browse files
committed
Merge branch 'pci/of'
- Leave parent unit address 0 in 'interrupt-map' so we can build this property even when interrupt controllers lack 'reg' properties (Lorenzo Pieralisi) * pci/of: PCI: of: Update parent unit address generation in of_pci_prop_intr_map()
2 parents 5c16adf + fad8e97 commit 3cde1c3

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

drivers/pci/of_property.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,21 @@ static int of_pci_prop_intr_map(struct pci_dev *pdev, struct of_changeset *ocs,
279279
mapp++;
280280
*mapp = out_irq[i].np->phandle;
281281
mapp++;
282-
if (addr_sz[i]) {
283-
ret = of_property_read_u32_array(out_irq[i].np,
284-
"reg", mapp,
285-
addr_sz[i]);
286-
if (ret)
287-
goto failed;
288-
}
282+
283+
/*
284+
* A device address does not affect the device <->
285+
* interrupt-controller HW connection for all
286+
* modern interrupt controllers; moreover, the
287+
* kernel (i.e., of_irq_parse_raw()) ignores the
288+
* values in the parent unit address cells while
289+
* parsing the interrupt-map property because they
290+
* are irrelevant for interrupt mapping in modern
291+
* systems.
292+
*
293+
* Leave the parent unit address initialized to 0 --
294+
* just take into account the #address-cells size
295+
* to build the property properly.
296+
*/
289297
mapp += addr_sz[i];
290298
memcpy(mapp, out_irq[i].args,
291299
out_irq[i].args_count * sizeof(u32));

0 commit comments

Comments
 (0)