Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34761 )
Change subject: soc/intel/common/gspi: Check device validity before setting state ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34761/1/src/soc/intel/common/block/... File src/soc/intel/common/block/gspi/gspi.c:
https://review.coreboot.org/c/coreboot/+/34761/1/src/soc/intel/common/block/... PS1, Line 455: dev->bus Actually, looks like this is the problem. Can you see if this fixes the issue:
diff --git a/src/soc/intel/common/block/gspi/gspi.c b/src/soc/intel/common/block/gspi/gspi.c index beb12fb231..592071e8ca 100644 --- a/src/soc/intel/common/block/gspi/gspi.c +++ b/src/soc/intel/common/block/gspi/gspi.c @@ -452,15 +452,6 @@ static int gspi_ctrlr_setup(const struct spi_slave *dev) struct gspi_ctrlr_params params, *p = ¶ms; const struct device *device;
- devfn = gspi_soc_bus_to_devfn(dev->bus); - if (devfn < 0) { - printk(BIOS_ERR, "%s: No GSPI controller found on SPI bus %u.\n", - __func__, dev->bus); - return -1; - } - - device = pcidev_path_on_root(devfn); - /* Only chip select 0 is supported. */ if (dev->cs != 0) { printk(BIOS_ERR, "%s: Invalid CS value: cs=%u.\n", __func__, @@ -478,6 +469,15 @@ static int gspi_ctrlr_setup(const struct spi_slave *dev) return -1; }
+ devfn = gspi_soc_bus_to_devfn(p->gspi_bus); + if (devfn < 0) { + printk(BIOS_ERR, "%s: No GSPI controller found on SPI bus %u.\n", + __func__, gspi->bus); + return -1; + } + + device = pcidev_path_on_root(devfn); + /* Ensure controller is in D0 state */ lpss_set_power_state(device, STATE_D0);