linux-stable/drivers/acpi
Hans de Goede d730192ff0 ACPI: scan: Do not increase dep_unmet for already met dependencies
On the Toshiba Encore WT10-A tablet the BATC battery ACPI device depends
on 3 other devices:

            Name (_DEP, Package (0x03)  // _DEP: Dependencies
            {
                I2C1,
                GPO2,
                GPO0
            })

acpi_scan_check_dep() adds all 3 of these to the acpi_dep_list and then
before an acpi_device is created for the BATC handle (and thus before
acpi_scan_dep_init() runs) acpi_scan_clear_dep() gets called for both
GPIO depenencies, with free_when_met not set for the dependencies.

Since there is no adev for BATC yet, there also is no dep_unmet to
decrement. The only result of acpi_scan_clear_dep() in this case is
dep->met getting set.

Soon after acpi_scan_clear_dep() has been called for the GPIO dependencies
the acpi_device gets created for the BATC handle and acpi_scan_dep_init()
runs, this sees 3 dependencies on the acpi_dep_list and initializes
unmet_dep to 3. Later when the dependency for I2C1 is met unmet_dep
becomes 2, but since the 2 GPIO deps where already met it never becomes 0
causing battery monitoring to not work.

Fix this by modifying acpi_scan_dep_init() to not increase dep_met for
dependencies which have already been marked as being met.

Fixes: 3ba12d8de3 ("ACPI: scan: Reduce overhead related to devices with dependencies")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: 6.5+ <stable@vger.kernel.org> # 6.5+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-04-08 16:44:14 +02:00
..
acpica ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields() 2024-03-26 13:06:47 +01:00
apei ACPI: APEI: EINJ: mark remove callback as non-__exit 2024-03-26 12:16:06 +01:00
arm64 ACPI: AGDI: Convert to platform remove callback returning void 2024-02-27 15:57:33 +01:00
dptf ACPI: DPTF: Convert to platform remove callback returning void 2024-02-27 15:57:33 +01:00
nfit ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed() 2024-02-02 17:31:50 +01:00
numa cxl/region: Deal with numa nodes not enumerated by SRAT 2024-03-12 14:54:03 -07:00
pmic
riscv ACPI: RISC-V: Add CPPC driver 2024-03-19 18:30:54 -07:00
x86 Merge branches 'acpi-x86', 'acpi-video', 'acpi-apei' and 'acpi-misc' 2024-03-11 14:42:30 +01:00
ac.c
acpi_adxl.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c
acpi_ffh.c
acpi_fpdt.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c
acpi_pcc.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c Merge branches 'acpi-x86', 'acpi-video', 'acpi-apei' and 'acpi-misc' 2024-03-11 14:42:30 +01:00
acpi_tad.c ACPI: TAD: Convert to platform remove callback returning void 2024-02-27 15:57:33 +01:00
acpi_video.c ACPI: video: Handle fetching EDID that is longer than 256 bytes 2024-02-08 14:03:47 +01:00
acpi_watchdog.c ACPI: use %pe for better readability of errors while printing 2024-02-16 19:31:12 +01:00
battery.c
bgrt.c
blacklist.c
bus.c ACPI: bus: make acpi_bus_type const 2024-02-12 14:42:48 +01:00
button.c
container.c
cppc_acpi.c ACPI updates for 6.9-rc1 2024-03-13 11:54:05 -07:00
debugfs.c
device_pm.c
device_sysfs.c
dock.c ACPI: Document handle_eject_request() arguments 2024-03-13 21:02:33 +01:00
ec.c Revert "ACPI: EC: Use a spin lock without disabing interrupts" 2024-02-22 10:35:54 +01:00
ec_sys.c
event.c
evged.c ACPI: GED: Convert to platform remove callback returning void 2024-02-27 15:57:33 +01:00
fan.h
fan_attr.c
fan_core.c ACPI: fan: Convert to platform remove callback returning void 2024-02-27 15:57:34 +01:00
glue.c
hed.c
internal.h Merge branches 'acpi-tables', 'acpi-processor', 'acpi-property' and 'acpi-thermal' 2024-03-11 14:33:32 +01:00
ioapic.c
irq.c
Kconfig RISC-V Patches for the 6.9 Merge Window 2024-03-22 10:41:13 -07:00
Makefile ACPI: Drop the custom_method debugfs interface 2024-02-22 11:17:48 +01:00
mipi-disco-img.c ACPI: property: Polish ignoring bad data nodes 2024-02-26 17:56:11 +01:00
nvs.c
osi.c
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c ACPI: use %pe for better readability of errors while printing 2024-02-16 19:31:12 +01:00
pfr_telemetry.c ACPI: pfr_telemetry: Convert to platform remove callback returning void 2024-02-27 15:57:34 +01:00
pfr_update.c ACPI: pfr_update: Convert to platform remove callback returning void 2024-02-27 15:57:34 +01:00
platform_profile.c
power.c
pptt.c
prmt.c
proc.c
processor_core.c
processor_driver.c ACPI: cpufreq: Add highest perf change notification 2024-01-31 14:54:50 +01:00
processor_idle.c ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() 2024-02-15 20:26:40 +01:00
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c ACPI: property: Ignore bad graph port nodes on Dell XPS 9315 2024-02-15 21:06:06 +01:00
reboot.c
resource.c ACPI: resource: Use IRQ override on Maibenben X565 2024-03-05 21:33:38 +01:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI: scan: Do not increase dep_unmet for already met dependencies 2024-04-08 16:44:14 +02:00
sleep.c More ACPI updates for 6.9-rc1 2024-03-19 11:15:14 -07:00
sleep.h
spcr.c
sysfs.c
tables.c lib/firmware_table: Provide buffer length argument to cdat_table_parse() 2024-03-13 00:03:21 -07:00
thermal.c ACPI: thermal: Register thermal zones without valid trip points 2024-04-02 21:38:45 +02:00
thermal_lib.c ACPI: thermal_lib: Initialize temp_decik to zero 2024-02-22 20:36:17 +01:00
tiny-power-button.c
utils.c ACPI: utils: Make acpi_handle_path() not static 2024-02-15 21:06:06 +01:00
video_detect.c
viot.c
wakeup.c