Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk, Peter Marheine. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59278 )
Change subject: programmer.h: Make pacc global state static local ......................................................................
Patch Set 3:
(1 comment)
File programmer.h:
https://review.coreboot.org/c/flashrom/+/59278/comment/e21f2b88_3838eb07 PS3, Line 122: // FIXME: Fix chipset_enable.c usage and remove pcidev_set_pacc().
Even if `pacc` no longer has global visibility, it's still global state. […]
The alternative would be to place a dedicated shutdown function around everything that may encounter the naughty Intel spi dev. I originally decided against it, because that would mean we have to avoid rpci_write* functions in places where it's not obvious why we do that. For instance, we could end up placing a comment above every affacted pci_write* call.
However, I'm not even sure if we can get rid of the `pacc` global without adding parameters (no matter the Intel kludge). Which brings me to another awkward solution: drop the whole rpci_write* infrastructure. I'm not sure if it solves more problems than it invites. Eventually these functions would even need a flashrom context parameter to register their shutdown things (because that's also a place where we need to get rid of global state).