linux/include/acpi
Andy Shevchenko 7385e438e1 ACPI: scan: Use unique number for instance_no
[ Upstream commit eb50aaf960 ]

The decrementation of acpi_device_bus_id->instance_no
in acpi_device_del() is incorrect, because it may cause
a duplicate instance number to be allocated next time
a device with the same acpi_device_bus_id is added.

Replace above mentioned approach by using IDA framework.

While at it, define the instance range to be [0, 4096).

Fixes: e49bd2dd5a ("ACPI: use PNPID:instance_no as bus_id of ACPI device")
Fixes: ca9dc8d42b ("ACPI / scan: Fix acpi_bus_id_list bookkeeping")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: 4.10+ <stable@vger.kernel.org> # 4.10+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:37:02 +02:00
..
platform ACPICA: provide abstraction for raw_spinlock_t 2018-05-10 17:18:45 +02:00
acbuffer.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
acconfig.h ACPICA: Reference Counts: increase max to 0x4000 for large servers 2018-08-14 23:49:13 +02:00
acexcep.h ACPICA: Fix exception code class checks 2021-03-04 09:39:33 +01:00
acnames.h ACPICA: Improve error messages for the namespace root node 2018-05-15 10:16:10 +02:00
acoutput.h ACPICA: AML Parser: Add debug option to dump parse trees 2018-06-06 08:53:42 +02:00
acpi_bus.h ACPI: scan: Use unique number for instance_no 2021-03-30 14:37:02 +02:00
acpi_drivers.h ACPI / EC: Fix regression related to PM ops support in ECDT device 2017-11-21 00:13:02 +01:00
acpi_io.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acpi_lpat.h ACPI / LPAT: Common table processing functions 2015-01-29 21:02:10 +08:00
acpi_numa.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acpi.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
acpiosxf.h ACPICA: provide abstraction for raw_spinlock_t 2018-05-10 17:18:45 +02:00
acpixf.h ACPICA: Update version to 20180810 2018-08-14 23:49:13 +02:00
acrestyp.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
actbl1.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
actbl2.h ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags 2019-10-17 13:45:33 -07:00
actbl3.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
actbl.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
actypes.h ACPICA: Introduce ACPI_ACCESS_BYTE_WIDTH() macro 2020-03-05 16:42:17 +01:00
acuuid.h ACPICA: adding SPDX headers 2018-03-18 19:08:05 +01:00
apei.h Merge branches 'acpi-pmic', 'acpi-apei' and 'acpi-x86' 2017-11-13 01:37:17 +01:00
battery.h battery: Add the battery hooking API 2018-02-21 23:27:13 +01:00
button.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cppc_acpi.h ACPI / CPPC: Add support for CPPC v3 2018-04-24 12:33:28 +02:00
ghes.h arm64 / ACPI: clean the additional checks before calling ghes_notify_sea() 2018-08-09 10:55:18 +02:00
hed.h ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
nfit.h acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle 2018-03-14 12:43:50 +01:00
pcc.h mailbox: PCC: Move the MAX_PCC_SUBSPACES definition to header file 2017-11-09 00:39:53 +01:00
pdc_intel.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor.h x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:30:20 +02:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
video.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00