Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/77091?usp=email )
Change subject: Revert "acpi: Call acpi_fill_ssdt() only for enabled devices" ......................................................................
Revert "acpi: Call acpi_fill_ssdt() only for enabled devices"
This reverts commit d1c0f958d1986a94ac55ae1d196ba286c311b90f.
Reverting this commit as it did not take into account, and does not provide a workaround for, ACPI devices which use the function implementing .acpi_fill_ssdt to set the status of the device. Not calling .acpi_fill_ssdt for those devices means they do not have a status method (_STA) implemented, which the OS assumes means enabled and present (0xF).
Since almost all drivers do not work this way, and implement their entire ACPI device code via .acpi_fill_ssdt, ensure that all functions implementing .acpi_fill_ssdt have checks for !dev->enabled.
TEST=build/boot any AMD SoC board, dump ACPI tables, and verify that only UARTs enabled in board devicetree have _STA of 0xF, and that others have _STA of 0x0.
Change-Id: I8703f5e3539e09c14ad332b537d6561f3dd06a55 Signed-off-by: Matt DeVillier matt.devillier@amd.corp-partner.google.com --- M src/acpi/acpi.c M src/drivers/acpi/thermal_zone/thermal_zone.c M src/drivers/crb/tis.c M src/drivers/generic/adau7002/adau7002.c M src/drivers/generic/alc1015/alc1015.c M src/drivers/generic/gpio_keys/gpio_keys.c M src/drivers/generic/max98357a/max98357a.c M src/drivers/gfx/generic/generic.c M src/drivers/i2c/cs35l53/cs35l53.c M src/drivers/i2c/cs42l42/cs42l42.c M src/drivers/i2c/da7219/da7219.c M src/drivers/i2c/designware/dw_i2c.c M src/drivers/i2c/generic/generic.c M src/drivers/i2c/gpiomux/bus/bus.c M src/drivers/i2c/gpiomux/mux/mux.c M src/drivers/i2c/max98373/max98373.c M src/drivers/i2c/max98390/max98390.c M src/drivers/i2c/max98396/max98396.c M src/drivers/i2c/max98927/max98927.c M src/drivers/i2c/nau8825/nau8825.c M src/drivers/i2c/rt1011/rt1011.c M src/drivers/i2c/rt5663/rt5663.c M src/drivers/i2c/rv3028c7/rv3028c7.c M src/drivers/i2c/rx6110sa/rx6110sa.c M src/drivers/i2c/sx9310/sx9310.c M src/drivers/i2c/sx9324/sx9324.c M src/drivers/i2c/sx9360/sx9360.c M src/drivers/i2c/tpm/chip.c M src/drivers/intel/dptf/dptf.c M src/drivers/intel/ish/ish.c M src/drivers/intel/mipi_camera/camera.c M src/drivers/intel/pmc_mux/conn/conn.c M src/drivers/intel/pmc_mux/mux.c M src/drivers/intel/soundwire/soundwire.c M src/drivers/intel/usb4/retimer/retimer.c M src/drivers/ipmi/ipmi_kcs_ops.c M src/drivers/net/r8168.c M src/drivers/nxp/uwb/uwb.c M src/drivers/pc80/tpm/tis.c M src/drivers/pcie/rtd3/device/chip.c M src/drivers/soundwire/alc5682/alc5682.c M src/drivers/soundwire/alc711/alc711.c M src/drivers/soundwire/cs42l42/cs42l42.c M src/drivers/soundwire/max98363/max98363.c M src/drivers/soundwire/max98373/max98373.c M src/drivers/spi/acpi/acpi.c M src/drivers/uart/acpi/acpi.c M src/drivers/usb/acpi/usb_acpi.c M src/drivers/usb/hub/acpi.c M src/drivers/usb/pci_xhci/pci_xhci.c M src/drivers/wifi/generic/acpi.c M src/drivers/wwan/fm/acpi_fm350gl.c M src/ec/google/chromeec/audio_codec/audio_codec.c M src/ec/google/chromeec/ec_acpi.c M src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c M src/ec/google/chromeec/mux/conn/conn.c M src/ec/google/chromeec/mux/mux.c M src/ec/google/wilco/chip.c M src/soc/intel/common/block/scs/sd.c M src/soc/intel/common/block/usb4/pcie.c M src/soc/intel/common/block/usb4/usb4.c 61 files changed, 96 insertions(+), 46 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/77091/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index c385b58..5783017 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -318,7 +318,7 @@ { struct device *dev; for (dev = all_devices; dev; dev = dev->next) - if (dev->enabled && dev->ops && dev->ops->acpi_fill_ssdt) + if (dev->ops && dev->ops->acpi_fill_ssdt) dev->ops->acpi_fill_ssdt(dev); current = (unsigned long)acpigen_get_current(); } diff --git a/src/drivers/acpi/thermal_zone/thermal_zone.c b/src/drivers/acpi/thermal_zone/thermal_zone.c index 1a52997..f19183f 100644 --- a/src/drivers/acpi/thermal_zone/thermal_zone.c +++ b/src/drivers/acpi/thermal_zone/thermal_zone.c @@ -40,6 +40,9 @@
assert(dev->path.type == DEVICE_PATH_GENERIC);
+ if (!dev->enabled) + return; + if (config->use_acpi1_thermal_zone_scope) scope = TZ_DEVICE_PATH; else @@ -117,7 +120,7 @@ .read_resources = noop_read_resources, .set_resources = noop_set_resources, .acpi_name = thermal_zone_acpi_name, - .acpi_fill_ssdt = thermal_zone_fill_ssdt, + . = thermal_zone_fill_ssdt, };
static void thermal_zone_enable_dev(struct device *dev) diff --git a/src/drivers/crb/tis.c b/src/drivers/crb/tis.c index a7d4fa7..d457e53 100644 --- a/src/drivers/crb/tis.c +++ b/src/drivers/crb/tis.c @@ -83,6 +83,9 @@
static void crb_tpm_fill_ssdt(const struct device *dev) { + if (!dev->enabled) + return; + const char *path = acpi_device_path(dev); if (!path) { path = "\_SB_.TPM"; diff --git a/src/drivers/generic/adau7002/adau7002.c b/src/drivers/generic/adau7002/adau7002.c index 26da09b..88ee34d 100644 --- a/src/drivers/generic/adau7002/adau7002.c +++ b/src/drivers/generic/adau7002/adau7002.c @@ -17,7 +17,7 @@ struct drivers_generic_adau7002_config *config; struct acpi_dp *dp;
- if (!dev) + if (!dev || !dev->enabled) return;
const char *scope = acpi_device_scope(dev); diff --git a/src/drivers/generic/alc1015/alc1015.c b/src/drivers/generic/alc1015/alc1015.c index ca685d6..f6ba9c7 100644 --- a/src/drivers/generic/alc1015/alc1015.c +++ b/src/drivers/generic/alc1015/alc1015.c @@ -13,7 +13,7 @@ const char *path; struct acpi_dp *dp;
- if (!config) + if (!dev->enabled || !config) return;
const char *scope = acpi_device_scope(dev); diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c index 75ce09f..03e11f5 100644 --- a/src/drivers/generic/gpio_keys/gpio_keys.c +++ b/src/drivers/generic/gpio_keys/gpio_keys.c @@ -57,7 +57,7 @@ const char *drv_string = config->is_polled ? "gpio-keys-polled" : "gpio-keys";
- if (!scope || !path || !config->gpio.pin_count) + if (!dev->enabled || !scope || !path || !config->gpio.pin_count) return;
/* Device */ diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c index 7a18b98..6590505 100644 --- a/src/drivers/generic/max98357a/max98357a.c +++ b/src/drivers/generic/max98357a/max98357a.c @@ -16,7 +16,7 @@ const char *path; struct acpi_dp *dp;
- if (!config) + if (!dev->enabled || !config) return;
const char *scope = acpi_device_scope(dev); diff --git a/src/drivers/gfx/generic/generic.c b/src/drivers/gfx/generic/generic.c index 0ab1676..ff2ee95 100644 --- a/src/drivers/gfx/generic/generic.c +++ b/src/drivers/gfx/generic/generic.c @@ -105,7 +105,7 @@
const char *scope = acpi_device_scope(dev);
- if (!scope) + if (!scope || !dev->enabled) return;
acpigen_write_scope(scope); diff --git a/src/drivers/i2c/cs35l53/cs35l53.c b/src/drivers/i2c/cs35l53/cs35l53.c index 9857203..4fc47c6 100644 --- a/src/drivers/i2c/cs35l53/cs35l53.c +++ b/src/drivers/i2c/cs35l53/cs35l53.c @@ -26,7 +26,7 @@ struct acpi_dp *dsd; int gpio_index = 0;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/cs42l42/cs42l42.c b/src/drivers/i2c/cs42l42/cs42l42.c index dcf83e0..41e1c00 100644 --- a/src/drivers/i2c/cs42l42/cs42l42.c +++ b/src/drivers/i2c/cs42l42/cs42l42.c @@ -26,7 +26,7 @@ struct acpi_dp *dsd; int gpio_index = 0;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/da7219/da7219.c b/src/drivers/i2c/da7219/da7219.c index 80c5272..fe632a6 100644 --- a/src/drivers/i2c/da7219/da7219.c +++ b/src/drivers/i2c/da7219/da7219.c @@ -27,7 +27,7 @@ }; struct acpi_dp *dsd, *aad;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c index 3bcb51a..9cca77c 100644 --- a/src/drivers/i2c/designware/dw_i2c.c +++ b/src/drivers/i2c/designware/dw_i2c.c @@ -820,6 +820,9 @@ const char *path; unsigned int speed, i;
+ if (!dev->enabled) + return; + bus = dw_i2c_soc_dev_to_bus(dev);
if (bus < 0) diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 1a3ec40..9764225 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -58,7 +58,7 @@ int reset_gpio_index = -1, enable_gpio_index = -1, irq_gpio_index = -1; const char *path = acpi_device_path(dev);
- if (!scope) + if (!dev->enabled || !scope) return;
if (!config->hid) { diff --git a/src/drivers/i2c/gpiomux/bus/bus.c b/src/drivers/i2c/gpiomux/bus/bus.c index 2bdb103..d80a15d 100644 --- a/src/drivers/i2c/gpiomux/bus/bus.c +++ b/src/drivers/i2c/gpiomux/bus/bus.c @@ -22,7 +22,7 @@ const char *scope = acpi_device_scope(dev); const char *path = acpi_device_path(dev);
- if (!dev || !scope || !path) + if (!dev || !dev->enabled || !scope || !path) return;
/* Device */ diff --git a/src/drivers/i2c/gpiomux/mux/mux.c b/src/drivers/i2c/gpiomux/mux/mux.c index fa1b18c..25667d1 100644 --- a/src/drivers/i2c/gpiomux/mux/mux.c +++ b/src/drivers/i2c/gpiomux/mux/mux.c @@ -27,7 +27,7 @@ struct acpi_gpio_res_params param[MAX_NUM_MUX_GPIOS]; int i;
- if (!scope || !path) + if (!dev->enabled || !scope || !path) return;
/* Device */ diff --git a/src/drivers/i2c/max98373/max98373.c b/src/drivers/i2c/max98373/max98373.c index eb5590d..a2d44a8 100644 --- a/src/drivers/i2c/max98373/max98373.c +++ b/src/drivers/i2c/max98373/max98373.c @@ -23,7 +23,7 @@ }; struct acpi_dp *dp;
- if (!scope) { + if (!dev->enabled || !scope) { printk(BIOS_ERR, "%s: dev not enabled\n", __func__); return; } diff --git a/src/drivers/i2c/max98390/max98390.c b/src/drivers/i2c/max98390/max98390.c index 11acd22..03c1823 100644 --- a/src/drivers/i2c/max98390/max98390.c +++ b/src/drivers/i2c/max98390/max98390.c @@ -29,7 +29,7 @@ uint64_t r0_value, temp_value; char dsm_name[80] = {};
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/max98396/max98396.c b/src/drivers/i2c/max98396/max98396.c index 5288c4f..590daf9 100644 --- a/src/drivers/i2c/max98396/max98396.c +++ b/src/drivers/i2c/max98396/max98396.c @@ -24,7 +24,7 @@ struct acpi_dp *dp; const char *path = acpi_device_path(dev);
- if (!scope) { + if (!dev->enabled || !scope) { printk(BIOS_ERR, "%s: dev not enabled\n", __func__); return; } diff --git a/src/drivers/i2c/max98927/max98927.c b/src/drivers/i2c/max98927/max98927.c index e80f569f..fae8508 100644 --- a/src/drivers/i2c/max98927/max98927.c +++ b/src/drivers/i2c/max98927/max98927.c @@ -23,7 +23,7 @@ }; struct acpi_dp *dp;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/nau8825/nau8825.c b/src/drivers/i2c/nau8825/nau8825.c index 060df7c..c8294ac 100644 --- a/src/drivers/i2c/nau8825/nau8825.c +++ b/src/drivers/i2c/nau8825/nau8825.c @@ -29,7 +29,7 @@ }; struct acpi_dp *dp = NULL;
- if (!scope) + if (!dev->enabled || !scope) return; if (config->sar_threshold_num > NAU8825_MAX_BUTTONS) return; diff --git a/src/drivers/i2c/rt1011/rt1011.c b/src/drivers/i2c/rt1011/rt1011.c index 9a21748..edaf970 100644 --- a/src/drivers/i2c/rt1011/rt1011.c +++ b/src/drivers/i2c/rt1011/rt1011.c @@ -27,7 +27,7 @@ struct acpi_dp *dp; uint64_t r0_value, temp_value;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/rt5663/rt5663.c b/src/drivers/i2c/rt5663/rt5663.c index 9949566..af18b04 100644 --- a/src/drivers/i2c/rt5663/rt5663.c +++ b/src/drivers/i2c/rt5663/rt5663.c @@ -26,7 +26,7 @@ }; struct acpi_dp *dp;
- if (!scope) + if (!dev->enabled || !scope) return;
/* Device */ diff --git a/src/drivers/i2c/rv3028c7/rv3028c7.c b/src/drivers/i2c/rv3028c7/rv3028c7.c index 87cbc24..a3331d6 100644 --- a/src/drivers/i2c/rv3028c7/rv3028c7.c +++ b/src/drivers/i2c/rv3028c7/rv3028c7.c @@ -185,7 +185,7 @@ struct drivers_i2c_rv3028c7_config *config = dev->chip_info; enum i2c_speed bus_speed;
- if (!scope) + if (!dev->enabled || !scope) return;
switch (config->bus_speed) { diff --git a/src/drivers/i2c/rx6110sa/rx6110sa.c b/src/drivers/i2c/rx6110sa/rx6110sa.c index 02b3d9f..c43c77b 100644 --- a/src/drivers/i2c/rx6110sa/rx6110sa.c +++ b/src/drivers/i2c/rx6110sa/rx6110sa.c @@ -173,7 +173,7 @@ const char *scope = acpi_device_scope(dev); enum i2c_speed bus_speed;
- if (!scope) + if (dev->enabled || !scope) return;
switch (config->bus_speed) { diff --git a/src/drivers/i2c/sx9310/sx9310.c b/src/drivers/i2c/sx9310/sx9310.c index d9e5a14..afadd79 100644 --- a/src/drivers/i2c/sx9310/sx9310.c +++ b/src/drivers/i2c/sx9310/sx9310.c @@ -36,7 +36,7 @@ struct acpi_dp *dsd; struct acpi_dp *combined_sensors;
- if (!scope || !config) + if (!dev->enabled || !scope || !config) return;
if (config->speed) diff --git a/src/drivers/i2c/sx9324/sx9324.c b/src/drivers/i2c/sx9324/sx9324.c index 3678491..97eef18 100644 --- a/src/drivers/i2c/sx9324/sx9324.c +++ b/src/drivers/i2c/sx9324/sx9324.c @@ -28,7 +28,7 @@ }; struct acpi_dp *dsd;
- if (!scope || !config) + if (!dev->enabled || !scope || !config) return;
if (config->speed) diff --git a/src/drivers/i2c/sx9360/sx9360.c b/src/drivers/i2c/sx9360/sx9360.c index 9ea4c8b..47e50a0 100644 --- a/src/drivers/i2c/sx9360/sx9360.c +++ b/src/drivers/i2c/sx9360/sx9360.c @@ -24,7 +24,7 @@ }; struct acpi_dp *dsd;
- if (!scope || !config) + if (!dev->enabled || !scope || !config) return;
if (config->speed) diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c index 07052f6..ea55b97 100644 --- a/src/drivers/i2c/tpm/chip.c +++ b/src/drivers/i2c/tpm/chip.c @@ -21,7 +21,7 @@ .resource = scope, };
- if (!scope) + if (!dev->enabled || !scope) return;
if (!config->hid) { diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c index fb7cb85..48c80b6 100644 --- a/src/drivers/intel/dptf/dptf.c +++ b/src/drivers/intel/dptf/dptf.c @@ -615,6 +615,9 @@ { struct drivers_intel_dptf_config *config = config_of(dev);
+ if (!dev->enabled) + return; + write_device_definitions(dev); write_policies(config); write_controls(config); diff --git a/src/drivers/intel/ish/ish.c b/src/drivers/intel/ish/ish.c index a84be5b..591a8a0 100644 --- a/src/drivers/intel/ish/ish.c +++ b/src/drivers/intel/ish/ish.c @@ -15,7 +15,7 @@ struct device *root = dev->bus->dev; struct acpi_dp *dsd;
- if (!config) + if (!dev->enabled || !config) return;
acpigen_write_scope(acpi_device_path(root)); diff --git a/src/drivers/intel/mipi_camera/camera.c b/src/drivers/intel/mipi_camera/camera.c index ec89971..8e4ef3e 100644 --- a/src/drivers/intel/mipi_camera/camera.c +++ b/src/drivers/intel/mipi_camera/camera.c @@ -934,6 +934,9 @@ const char *scope = NULL; const struct device *pdev;
+ if (!dev->enabled) + return; + if (config->has_power_resource) { pdev = dev->bus->dev; if (!pdev || !pdev->enabled) diff --git a/src/drivers/intel/pmc_mux/conn/conn.c b/src/drivers/intel/pmc_mux/conn/conn.c index de8f2be..795b21d 100644 --- a/src/drivers/intel/pmc_mux/conn/conn.c +++ b/src/drivers/intel/pmc_mux/conn/conn.c @@ -101,6 +101,9 @@ const char *scope; const char *name;
+ if (!dev->enabled) + return; + /* Reference the existing scope and write CONx device */ scope = acpi_device_scope(dev); name = acpi_device_name(dev); diff --git a/src/drivers/intel/pmc_mux/mux.c b/src/drivers/intel/pmc_mux/mux.c index e209915..166dd59 100644 --- a/src/drivers/intel/pmc_mux/mux.c +++ b/src/drivers/intel/pmc_mux/mux.c @@ -16,7 +16,7 @@ const char *scope = acpi_device_scope(dev); const char *name = acpi_device_name(dev);
- if (!scope || !name) + if (!dev->enabled || !scope || !name) return;
acpigen_write_scope(scope); diff --git a/src/drivers/intel/soundwire/soundwire.c b/src/drivers/intel/soundwire/soundwire.c index c7e84a5..34ecd86 100644 --- a/src/drivers/intel/soundwire/soundwire.c +++ b/src/drivers/intel/soundwire/soundwire.c @@ -50,7 +50,7 @@ struct intel_soundwire_controller *controller; const char *scope = acpi_device_scope(dev);
- if (!scope) + if (!dev->enabled || !scope) return;
if (soc_fill_soundwire_controller(&controller) < 0 || !controller) diff --git a/src/drivers/intel/usb4/retimer/retimer.c b/src/drivers/intel/usb4/retimer/retimer.c index 7fb600d..a8cc841 100644 --- a/src/drivers/intel/usb4/retimer/retimer.c +++ b/src/drivers/intel/usb4/retimer/retimer.c @@ -374,7 +374,7 @@ int ec_port = 0;
usb4_retimer_scope = acpi_device_scope(dev); - if (!usb4_retimer_scope || !config) + if (!dev->enabled || !usb4_retimer_scope || !config) return;
/* Scope */ diff --git a/src/drivers/ipmi/ipmi_kcs_ops.c b/src/drivers/ipmi/ipmi_kcs_ops.c index 2e5378f..707dc92 100644 --- a/src/drivers/ipmi/ipmi_kcs_ops.c +++ b/src/drivers/ipmi/ipmi_kcs_ops.c @@ -211,6 +211,9 @@ const char *scope = acpi_device_scope(dev); struct drivers_ipmi_config *conf = dev->chip_info;
+ if (!dev->enabled) + return; + if (!scope) { printk(BIOS_ERR, "IPMI: Missing ACPI scope for %s\n", dev_path(dev)); diff --git a/src/drivers/net/r8168.c b/src/drivers/net/r8168.c index f21edd0..20334dd 100644 --- a/src/drivers/net/r8168.c +++ b/src/drivers/net/r8168.c @@ -367,7 +367,7 @@ const char *path = acpi_device_path(dev->bus->dev); u32 address;
- if (!path || !config) + if (!dev->enabled || !path || !config) return;
/* Device */ diff --git a/src/drivers/nxp/uwb/uwb.c b/src/drivers/nxp/uwb/uwb.c index 978edeb..d6db92b 100644 --- a/src/drivers/nxp/uwb/uwb.c +++ b/src/drivers/nxp/uwb/uwb.c @@ -61,7 +61,7 @@ int ce_gpio_index = -1; int ri_gpio_index = -1;
- if (!scope) + if (!dev->enabled || !scope) return;
if (spi_acpi_get_bus(dev) == -1) { diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c index ed9c8d0..ff2cbe1 100644 --- a/src/drivers/pc80/tpm/tis.c +++ b/src/drivers/pc80/tpm/tis.c @@ -745,6 +745,9 @@ /* Windows 11 requires the following path for TPM to be detected */ const char *path = "\_SB_.PCI0";
+ if (!dev->enabled) + return; + /* Device */ acpigen_write_scope(path); acpigen_write_device(acpi_device_name(dev)); diff --git a/src/drivers/pcie/rtd3/device/chip.c b/src/drivers/pcie/rtd3/device/chip.c index 88b85f1..63a87d8 100644 --- a/src/drivers/pcie/rtd3/device/chip.c +++ b/src/drivers/pcie/rtd3/device/chip.c @@ -91,6 +91,9 @@ assert(name); assert(scope);
+ if (!dev->enabled) + return; + printk(BIOS_INFO, "%s.%s: Enable RTD3 for %s (%s)\n", scope, name, dev_path(dev), dev->chip_ops->name);
diff --git a/src/drivers/soundwire/alc5682/alc5682.c b/src/drivers/soundwire/alc5682/alc5682.c index c1aaff6..12f4b7f 100644 --- a/src/drivers/soundwire/alc5682/alc5682.c +++ b/src/drivers/soundwire/alc5682/alc5682.c @@ -128,7 +128,7 @@ const char *scope = acpi_device_scope(dev); struct acpi_dp *dsd;
- if (!scope) + if (!dev->enabled || !scope) return;
acpigen_write_scope(scope); diff --git a/src/drivers/soundwire/alc711/alc711.c b/src/drivers/soundwire/alc711/alc711.c index 34d55c7..6859d2a 100644 --- a/src/drivers/soundwire/alc711/alc711.c +++ b/src/drivers/soundwire/alc711/alc711.c @@ -105,7 +105,7 @@ const char *scope = acpi_device_scope(dev); struct acpi_dp *dsd;
- if (!scope) + if (!dev->enabled || !scope) return;
acpigen_write_scope(scope); diff --git a/src/drivers/soundwire/cs42l42/cs42l42.c b/src/drivers/soundwire/cs42l42/cs42l42.c index 111844c..77e6e9b 100644 --- a/src/drivers/soundwire/cs42l42/cs42l42.c +++ b/src/drivers/soundwire/cs42l42/cs42l42.c @@ -134,7 +134,7 @@ struct acpi_dp *dsd; int gpio_index = 0;
- if (!scope) + if (!dev->enabled || !scope) return;
acpigen_write_scope(scope); diff --git a/src/drivers/soundwire/max98363/max98363.c b/src/drivers/soundwire/max98363/max98363.c index 2963cda..2990c71 100644 --- a/src/drivers/soundwire/max98363/max98363.c +++ b/src/drivers/soundwire/max98363/max98363.c @@ -91,7 +91,7 @@ const char *scope = acpi_device_scope(dev); struct acpi_dp *dsd;
- if (!scope) + if (!dev->enabled || !scope) return;
acpigen_write_scope(scope); diff --git a/src/drivers/soundwire/max98373/max98373.c b/src/drivers/soundwire/max98373/max98373.c index fb202fe..7bc8f2b 100644 --- a/src/drivers/soundwire/max98373/max98373.c +++ b/src/drivers/soundwire/max98373/max98373.c @@ -114,7 +114,7 @@ const char *scope = acpi_device_scope(dev); struct acpi_dp *dsd;
- if (!scope) + if (!dev->enabled || !scope) return;
acpigen_write_scope(scope); diff --git a/src/drivers/spi/acpi/acpi.c b/src/drivers/spi/acpi/acpi.c index 9b6fd80..4f3385b 100644 --- a/src/drivers/spi/acpi/acpi.c +++ b/src/drivers/spi/acpi/acpi.c @@ -77,7 +77,7 @@ int reset_gpio_index = -1; int enable_gpio_index = -1;
- if (!scope) + if (!dev->enabled || !scope) return;
if (spi_acpi_get_bus(dev) == -1) { diff --git a/src/drivers/uart/acpi/acpi.c b/src/drivers/uart/acpi/acpi.c index c43dc52..21f33d7 100644 --- a/src/drivers/uart/acpi/acpi.c +++ b/src/drivers/uart/acpi/acpi.c @@ -46,7 +46,7 @@ int reset_gpio_index = -1; int enable_gpio_index = -1;
- if (!scope) + if (!dev->enabled || !scope) return;
if (!config->hid) { diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c index b95ebc9..0add4db 100644 --- a/src/drivers/usb/acpi/usb_acpi.c +++ b/src/drivers/usb/acpi/usb_acpi.c @@ -41,7 +41,7 @@ struct acpi_pld pld; struct dsm_usb_config usb_cfg;
- if (!path || !config) + if (!dev->enabled || !path || !config) return;
/* Don't generate output for hubs, only ports */ diff --git a/src/drivers/usb/hub/acpi.c b/src/drivers/usb/hub/acpi.c index 10e38fb6..e5154aa 100644 --- a/src/drivers/usb/hub/acpi.c +++ b/src/drivers/usb/hub/acpi.c @@ -59,6 +59,9 @@ const char *scope = acpi_device_scope(dev); const char *name = acpi_device_name(dev);
+ if (!dev->enabled) + return; + acpigen_write_scope(scope); acpigen_write_device(name); acpigen_write_ADR(0); diff --git a/src/drivers/usb/pci_xhci/pci_xhci.c b/src/drivers/usb/pci_xhci/pci_xhci.c index 6d022d1..95f431e 100644 --- a/src/drivers/usb/pci_xhci/pci_xhci.c +++ b/src/drivers/usb/pci_xhci/pci_xhci.c @@ -190,7 +190,7 @@ const char *scope = acpi_device_scope(dev); const char *name = acpi_device_name(dev);
- if (!scope || !name) + if (!dev->enabled || !scope || !name) return;
printk(BIOS_DEBUG, "xHCI SSDT generation\n"); diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 3996739..7ef6b7c 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -586,6 +586,9 @@ { const char *path;
+ if (!is_dev_enabled(dev)) + return; + path = acpi_device_path(dev); if (!path) return; @@ -610,6 +613,9 @@ if (!dev) return;
+ if (!is_dev_enabled(dev)) + return; + path = acpi_device_path(dev->bus->dev); if (!path) return; diff --git a/src/drivers/wwan/fm/acpi_fm350gl.c b/src/drivers/wwan/fm/acpi_fm350gl.c index 139fd15..b6307e5 100644 --- a/src/drivers/wwan/fm/acpi_fm350gl.c +++ b/src/drivers/wwan/fm/acpi_fm350gl.c @@ -274,6 +274,8 @@ printk(BIOS_ERR, "%s: root port not enabled\n", __func__); return; } + if (!dev->enabled) + return; if (!scope) { printk(BIOS_ERR, "%s: root port scope not found\n", __func__); return; diff --git a/src/ec/google/chromeec/audio_codec/audio_codec.c b/src/ec/google/chromeec/audio_codec/audio_codec.c index 53037eb..612b1f6 100644 --- a/src/ec/google/chromeec/audio_codec/audio_codec.c +++ b/src/ec/google/chromeec/audio_codec/audio_codec.c @@ -15,7 +15,7 @@ const char *scope = acpi_device_scope(dev); struct ec_google_chromeec_audio_codec_config *cfg = dev->chip_info;
- if (!scope || !cfg) + if (!dev->enabled || !scope || !cfg) return;
acpigen_write_scope(scope); diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 53a4e75..a827d93 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -268,6 +268,9 @@ struct device_path path; struct device *ec;
+ if (!dev->enabled) + return; + /* Set up a minimal EC0 device to pass to the DPTF helpers */ path.type = DEVICE_PATH_GENERIC; path.generic.id = 0; diff --git a/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c b/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c index e61ecfd8..ec8bdfc 100644 --- a/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c +++ b/src/ec/google/chromeec/i2c_tunnel/i2c_tunnel.c @@ -17,7 +17,7 @@ struct ec_google_chromeec_i2c_tunnel_config *cfg = dev->chip_info; struct acpi_dp *dsd;
- if (!scope || !cfg) + if (!dev->enabled || !scope || !cfg) return;
acpigen_write_scope(scope); diff --git a/src/ec/google/chromeec/mux/conn/conn.c b/src/ec/google/chromeec/mux/conn/conn.c index e179c33..74a7f18 100644 --- a/src/ec/google/chromeec/mux/conn/conn.c +++ b/src/ec/google/chromeec/mux/conn/conn.c @@ -16,7 +16,7 @@ const struct ec_google_chromeec_mux_conn_config *config = dev->chip_info; const char *name; name = acpi_device_name(dev); - if (!name) + if (!dev->enabled || !name) return;
acpigen_write_scope(acpi_device_scope(dev)); diff --git a/src/ec/google/chromeec/mux/mux.c b/src/ec/google/chromeec/mux/mux.c index 9324d2e..cc792c4 100644 --- a/src/ec/google/chromeec/mux/mux.c +++ b/src/ec/google/chromeec/mux/mux.c @@ -7,6 +7,9 @@
static void mux_fill_ssdt(const struct device *dev) { + if (!dev->enabled) + return; + acpigen_write_scope(acpi_device_scope(dev)); acpigen_write_device(GOOGLE_CHROMEEC_MUX_DEVICE_NAME); acpigen_write_name_string("_HID", GOOGLE_CHROMEEC_MUX_DEVICE_HID); diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c index 7d85c6f..e8d0d13 100644 --- a/src/ec/google/wilco/chip.c +++ b/src/ec/google/wilco/chip.c @@ -184,6 +184,9 @@ void *region_ptr; size_t ucsi_alloc_region_len;
+ if (!dev->enabled) + return; + ucsi_alloc_region_len = ucsi_region_len < UCSI_MIN_ALLOC_REGION_LEN ? UCSI_MIN_ALLOC_REGION_LEN : ucsi_region_len; region_ptr = cbmem_add(CBMEM_ID_ACPI_UCSI, ucsi_alloc_region_len); diff --git a/src/soc/intel/common/block/scs/sd.c b/src/soc/intel/common/block/scs/sd.c index eee0200..cdd7b35 100644 --- a/src/soc/intel/common/block/scs/sd.c +++ b/src/soc/intel/common/block/scs/sd.c @@ -12,6 +12,9 @@ struct acpi_gpio default_gpio = { 0 }; struct acpi_dp *dp;
+ if (!dev->enabled) + return; + if (sd_fill_soc_gpio_info(&default_gpio, dev) != 0) return;
diff --git a/src/soc/intel/common/block/usb4/pcie.c b/src/soc/intel/common/block/usb4/pcie.c index 0139647..27c9d12 100644 --- a/src/soc/intel/common/block/usb4/pcie.c +++ b/src/soc/intel/common/block/usb4/pcie.c @@ -25,7 +25,7 @@ return; }
- if (!parent->enabled) + if (!dev->enabled || !parent->enabled) return;
config = config_of(dev); diff --git a/src/soc/intel/common/block/usb4/usb4.c b/src/soc/intel/common/block/usb4/usb4.c index a90a35a..ef63277 100644 --- a/src/soc/intel/common/block/usb4/usb4.c +++ b/src/soc/intel/common/block/usb4/usb4.c @@ -28,7 +28,7 @@ { struct acpi_dp *dsd, *pkg;
- if (tcss_ops.valid_tbt_auth && !tcss_ops.valid_tbt_auth()) + if (!dev->enabled || (tcss_ops.valid_tbt_auth && !tcss_ops.valid_tbt_auth())) return;
acpigen_write_scope(acpi_device_path(dev));