linux-stable/drivers/acpi
Hans de Goede 3860152c10 ACPI: scan: Do not increase dep_unmet for already met dependencies
commit d730192ff0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-17 11:19:26 +02:00
..
acpica ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields() 2024-04-10 16:35:42 +02:00
apei ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events 2024-02-05 20:14:15 +00:00
arm64 Char/Misc driver changes for 6.6-rc1 2023-09-01 09:53:54 -07:00
dptf
nfit ACPI: NFIT: Install Notify() handler before getting NFIT table 2023-10-22 12:47:43 +02:00
numa ACPI: NUMA: Fix the logic of getting the fake_pxm value 2024-02-05 20:14:15 +00:00
pmic
riscv drivers/acpi: RISC-V: Add RHCT related code 2023-06-01 08:45:04 -07:00
x86 ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS 2024-04-13 13:07:31 +02:00
Kconfig acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers 2023-08-22 10:39:26 +02:00
Makefile ACPI: Move AMBA bus scan handling into arm64 specific directory 2023-08-01 13:59:25 +02:00
ac.c ACPI: AC: Install Notify() handler directly 2023-07-14 18:58:34 +02:00
acpi_adxl.c
acpi_apd.c ACPI: processor: Check for null return of devm_kzalloc() in fch_misc_setup() 2023-03-20 18:04:58 +01:00
acpi_cmos_rtc.c ACPI: TAD: Install SystemCMOS address space handler for ACPI000E 2023-08-17 20:01:24 +02:00
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: fix NULL pointer dereference check 2024-02-05 20:14:15 +00:00
acpi_ffh.c ACPI: FFH: Drop the inclusion of linux/arm-smccc.h 2023-06-12 19:28:20 +02:00
acpi_fpdt.c ACPI: FPDT: properly handle invalid FPDT subtables 2023-11-28 17:20:03 +00:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI: LPIT: Avoid u32 multiplication overflow 2024-01-25 15:35:14 -08:00
acpi_lpss.c ACPI: LPSS: Fix the fractional clock divider flags 2024-01-25 15:35:15 -08:00
acpi_memhotplug.c mm/memory_hotplug: allow memmap on memory hotplug request to fallback 2023-08-21 13:37:48 -07:00
acpi_pad.c ACPI: PAD: mark Zhaoxin CPUs NONSTOP TSC correctly 2023-06-12 19:25:55 +02:00
acpi_pcc.c
acpi_platform.c ACPI: platform: Move SMB0001 HID to the header and reuse 2023-07-04 19:28:20 +02:00
acpi_pnp.c
acpi_processor.c cpu-hotplug: Provide prototypes for arch CPU registration 2023-10-11 14:27:37 +02:00
acpi_tad.c ACPI: TAD: Install SystemCMOS address space handler for ACPI000E 2023-08-17 20:01:24 +02:00
acpi_video.c ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop 2024-02-05 20:14:15 +00:00
acpi_watchdog.c
battery.c ACPI: battery: Install Notify() handler directly 2023-07-14 18:58:34 +02:00
bgrt.c
blacklist.c
bus.c ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init() 2023-10-18 13:26:30 +02:00
button.c Merge branches 'acpi-thermal' and 'acpi-button' 2023-06-26 17:20:28 +02:00
container.c
cppc_acpi.c ACPI: CPPC: Add auto select register read/write support 2023-03-17 19:06:23 +01:00
custom_method.c
debugfs.c
device_pm.c ACPI: PM: Add acpi_device_fix_up_power_children() function 2023-12-03 07:33:07 +01:00
device_sysfs.c ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() 2023-11-20 11:59:03 +01:00
dock.c
ec.c ACPI: EC: Add quirk for HP 250 G7 Notebook PC 2023-11-28 17:19:38 +00:00
ec_sys.c
event.c
evged.c
fan.h
fan_attr.c
fan_core.c
glue.c
hed.c ACPI: HED: Install Notify() handler directly 2023-07-14 18:58:34 +02:00
internal.h Merge branches 'acpi-scan', 'acpi-tad', 'acpi-extlog' and 'acpi-misc' 2023-08-25 20:49:52 +02:00
ioapic.c
irq.c ACPI: irq: Fix incorrect return value in acpi_register_gsi() 2023-10-18 13:11:04 +02:00
nvs.c
osi.c
osl.c ACPI: OSL: Make should_use_kmap() 0 for RISC-V 2023-06-01 08:45:00 -07:00
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c
pfr_telemetry.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
pfr_update.c
platform_profile.c
power.c ACPI: PM: Do not turn of unused power resources on the Toshiba Click Mini 2023-04-27 18:44:43 +02:00
pptt.c ACPI: PPTT: Fix to avoid sleep in the atomic context when PPTT is absent 2023-03-14 20:34:38 +01:00
prmt.c acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers 2023-08-22 10:39:26 +02:00
proc.c
processor_core.c ACPI: processor: LoongArch: Get physical ID from MADT 2023-08-17 18:39:28 +02:00
processor_driver.c ACPI: processor: Reorder acpi_processor_driver_init() 2023-03-22 15:20:38 +01:00
processor_idle.c ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() 2024-03-26 18:19:30 -04:00
processor_pdc.c ACPI: processor: Fix uninitialized access of buf in acpi_set_pdc_bits() 2023-09-18 12:16:16 +02:00
processor_perflib.c
processor_thermal.c ACPI: processor: thermal: Update CPU cooling devices on cpufreq policy changes 2023-03-22 15:20:38 +01:00
processor_throttling.c
property.c acpi: property: Let args be NULL in __acpi_node_get_property_reference 2024-01-25 15:35:51 -08:00
reboot.c
resource.c ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override 2024-03-26 18:19:35 -04:00
sbs.c ACPI: SBS: Fix handling of Smart Battery Selectors 2023-03-30 19:01:05 +02:00
sbshc.c
sbshc.h
scan.c ACPI: scan: Do not increase dep_unmet for already met dependencies 2024-04-17 11:19:26 +02:00
sleep.c Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" 2024-04-13 13:07:36 +02:00
sleep.h
spcr.c ACPI: SPCR: Amend indentation 2023-03-27 20:50:28 +02:00
sysfs.c ACPI: sysfs: Enable ACPI sysfs support for CCEL records 2023-03-27 20:43:58 +02:00
tables.c ACPI: tables: Print RINTC information when MADT is parsed 2023-06-01 08:44:59 -07:00
thermal.c ACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup 2024-01-10 17:16:55 +01:00
tiny-power-button.c ACPI: tiny-power-button: Eliminate the driver notify callback 2023-06-16 19:48:09 +02:00
utils.c
video_detect.c ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 2023-11-20 11:58:59 +01:00
viot.c ACPI: VIOT: Initialize the correct IOMMU fwspec 2023-03-30 19:20:42 +02:00
wakeup.c