Attention is currently required from: Angel Pons, Arthur Heymans, Felix Held, Kyösti Mälkki, Michał Żygowski, Nico Huber, Patrick Rudolph.
Krystian Hebel 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 11:
(4 comments)
File src/device/pciexp_device.c:
https://review.coreboot.org/c/coreboot/+/77338/comment/34f0ccc4_7b202c1b : PS11, Line 594: root_devcap The name no longer describes what this variable holds.
https://review.coreboot.org/c/coreboot/+/77338/comment/a4dee813_1d3a4cd3 : PS11, Line 598: awlays always
https://review.coreboot.org/c/coreboot/+/77338/comment/059ccb24_7eeb1a46 : PS11, Line 608: & PCI_EXP_DEVCAP_PAYLOAD No need to mask it here, it was already masked right after reading.
https://review.coreboot.org/c/coreboot/+/77338/comment/6e5a16dd_9e217dc7 : PS11, Line 630: root->max_payload_set = 1; I think this still doesn't catch case where two endpoints have different max payload sizes, for example: - root has max size = 5, there are two endpoints directly below root, A and B (they may be whole chains, but let's keep it simple), scanned in that order - endpoint A has max size = 4, the code sees it and limits root's payload size to 4 - endpoint B has max size = 3, the code sees it and limits root's payload size to 3
At this point endpoint A and root have different max payload sizes configured. I think this would be fixed by restarting the loop in `pciexp_scan_bus()` (in fact, `pciexp_configure_max_payload_size()` would be enough) `if ((root->max_payload_set == 1) && (max_payload < root_max_payload))`. Best not to do this recurrently though, with many devices a lot of stack space could be wasted.