qcom_geni_fw_initialise() runs once, at EVT_LAST_STAGE_INIT, and caches whether each GENI SE wrapper still needs firmware at device-bind time. If the firmware partition doesn't exist yet at that point (e.g. first boot, before it has been flashed), it finds nothing to load, and there is no generic way to retry once storage becomes available later in boot.
Patch 1 is a standalone bugfix found while working on this: qcom_geni_fw_initialise() only populates the GENI wrapper's private data if it finds a firmware partition at EVT_LAST_STAGE_INIT. On a board with no MMC/UFS storage and an unprovisioned SPI-NOR, that leaves it NULL, and a later GENI peripheral probe crashes dereferencing it. This affects qcom_geni_load_firmware() regardless of the rest of this series. Patch 2 makes the re-initialization path idempotent by re-checking live hardware state on every call instead of only trusting the flag cached at bind time, exposes qcom_geni_fw_initialise(), and adds a generic 'qcom_geni fw init' command so a retry can be triggered manually or from other subsystems without hardcoding SoC-specific calls into generic code. No existing API signatures are changed. Signed-off-by: Vandhiadevan Karunamoorthy <[email protected]> --- Changes in v2: - Drop the "oem spi-nor-init" fastboot command and the fastboot_oem_spi_nor_reinit() hook - Add a generic 'qcom_geni fw init' command instead, exposing qcom_geni_fw_initialise() directly - Make qcom_geni_fw_initialise() idempotent by re-checking live hardware state instead of only trusting the flag cached at bind time - Rebase directly on current mainline, dropping the dependency on the "oem set-block-target" series - Link to v1: https://lore.kernel.org/u-boot/20260918-series3-oem-spi-nor-init-v1-0-319dfeed6...@oss.qualcomm.com/ --- Vandhiadevan Karunamoorthy (2): misc: qcom_geni: fix NULL pointer dereference in qcom_geni_load_firmware() cmd: qcom_geni: add idempotent qcom_geni fw init command cmd/Kconfig | 9 +++++++++ cmd/Makefile | 1 + cmd/qcom_geni.c | 26 ++++++++++++++++++++++++++ drivers/misc/qcom_geni.c | 28 ++++++++++++++++++++-------- include/soc/qcom/qup-fw-load.h | 7 +++++++ 5 files changed, 63 insertions(+), 8 deletions(-) --- base-commit: ece349ade2973e220f524ce59e59711cc919263f change-id: 20260824-series3-oem-spi-nor-init-2fe96d643af5 Best regards, -- test <[email protected]>
