Attention is currently required from: Angel Pons, Arthur Heymans, Felix Held, Krystian Hebel, Nico Huber, Patrick Rudolph.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/77338?usp=email )
Change subject: device/pciexp_device.c: Fix setting Max Payload Size ......................................................................
Patch Set 10:
(1 comment)
File src/device/pciexp_device.c:
https://review.coreboot.org/c/coreboot/+/77338/comment/c775a4e8_4eb3f4ee : PS10, Line 709: pciexp_configure_max_payload
It doesn't matter Krystian, because pdev->bus->dev == pdev is true for each loop iteration, so pciex […]
I have added another print:
```C static void pciexp_set_max_payload_size(struct device *root, unsigned int root_cap, struct device *endp, unsigned int endp_cap) { unsigned int endp_max_payload, root_max_payload, max_payload; u16 endp_devctl, root_devctl; u32 endp_devcap, root_devcap;
/* Get max payload size supported by endpoint */ endp_devcap = pci_read_config32(endp, endp_cap + PCI_EXP_DEVCAP); endp_max_payload = endp_devcap & PCI_EXP_DEVCAP_PAYLOAD;
/* Get max payload size supported by root port */ root_devcap = pci_read_config32(root, root_cap + PCI_EXP_DEVCAP); root_max_payload = root_devcap & PCI_EXP_DEVCAP_PAYLOAD;
printk(BIOS_DEBUG, "Max Paylaod Size %s device %d and %s parent %d\n", dev_path(endp), endp_max_payload, dev_path(root), root_max_payload); ```
ANd it looks like dev_path is simply returning wrong results (thge call for device 1:00.0 return different max paylaod for parent and current device): https://paste.dasharo.com/?54e7462a1e60f279#9vbFt6McBoBA6Yw4XnAV7LwsXmE4qwVT...
So I got misled byt his and the walk up works. The real problem is that the order of pcie_tune_dev calls is inversed (it is called from endpoint to root port instead of from rootport to each new downstream device discovered). Furthermore I have an ideal situation where all devices behind the switch have the same payload size, but it may happen that there are different devices, so the max paylaod must propagate to each child of given bridge, plus to upstream bus and their children...