Attention is currently required from: Arthur Heymans, Jérémy Compostella, Lean Sheng Tan, Patrick Rudolph.
Shuo Liu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/81108?usp=email )
Change subject: device: Add dev_find_device_filter ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: I move this patch out from my dependency chain due to compatibility issue, however, I personally think the usage model of this patch might be worthwhile for a discussion.
The ideal model could be,
struct device *dev_find_all_devices_on_stack(uint8_t socket, uint8_t stack, u16 vendor, u16 device, struct device *from) { int filter_device_on_stack(struct device *dev) { struct device *domain = dev_get_pci_domain(dev); if (!domain) return 0;
union xeon_domain_path dn; dn.domain_path = domain->path.domain.domain; if (socket != XEONSP_SOCKET_MAX && dn.socket != socket) return 0; if (stack != XEONSP_STACK_MAX && dn.stack != stack) return 0; if (vendor != XEONSP_VENDOR_MAX && dev->vendor != vendor) return 0; if (device != XEONSP_DEVICE_MAX && dev->device != device) return 0;
return 1; };
return dev_find_device_filter(filter_device_on_stack, from); }
This is allowed by my C99 compiler for intel/archercity, but not fit for all platform configurations. Not sure if this still has values to be adopted in some cases.