- Unless we want to review every driver with a `.init` function if it can work without resources or runs into undefined behaviour, we should only call `.init` if `.read_resources` wasn't blocked. I guess we'll have to add some tag to `struct device`. This still means we'd have to review platform code that already avoids our devicetree model and accesses devices directly, e.g. with pci_dev_on_root(). Hmmm, same for `.final`.
I believe .init that only needs to access PCI configuration space should be allowed, even if resource BARs were left unassigned?
Any .init with a need to access registers behind BARs should already be using find_resource(), although it seems like we have cases where this is not followed by res == NULL check, though.
I started to wonder about that (coverity should have complained), and noticed there is die() in find_resource() already. Maybe address that instead of blocking .init calls?
View Change
To view, visit change 36221. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2073d9f8e9297c2b02530821ebb634ea2a5c758e
Gerrit-Change-Number: 36221
Gerrit-PatchSet: 13
Gerrit-Owner: ron minnich <rminnich@gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Jeremy Soller <jeremy@system76.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Lean Sheng Tan <lean.sheng.tan@intel.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Gerrit-Reviewer: Shelley Chen <shchen@google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich@gmail.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Tue, 29 Oct 2019 12:41:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment