summaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorSunil V L <sunilvl@ventanamicro.com>2024-08-12 06:29:18 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-08-27 15:48:35 +0200
commit8cf252737b418c311d1016b0a7956407a235bb8d (patch)
tree2b33ec6c3eb436412c9289ee90512be968ee9f58 /drivers/acpi/scan.c
parent15f210f43e95ffaf87858c6d75339afeebbf8f5c (diff)
ACPI: scan: Define weak function to populate dependencies
Some architectures like RISC-V need to add dependencies without explicit _DEP. Define a weak function which can be implemented by the architecture. Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Tested-by: Björn Töpel <bjorn@rivosinc.com> Link: https://patch.msgid.link/20240812005929.113499-7-sunilvl@ventanamicro.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 944bf4865287..98e55f287bdb 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2077,12 +2077,23 @@ static void acpi_scan_init_hotplug(struct acpi_device *adev)
}
}
+u32 __weak arch_acpi_add_auto_dep(acpi_handle handle) { return 0; }
+
static u32 acpi_scan_check_dep(acpi_handle handle)
{
struct acpi_handle_list dep_devices;
u32 count = 0;
/*
+ * Some architectures like RISC-V need to add dependencies for
+ * all devices which use GSI to the interrupt controller so that
+ * interrupt controller is probed before any of those devices.
+ * Instead of mandating _DEP on all the devices, detect the
+ * dependency and add automatically.
+ */
+ count += arch_acpi_add_auto_dep(handle);
+
+ /*
* Check for _HID here to avoid deferring the enumeration of:
* 1. PCI devices.
* 2. ACPI nodes describing USB ports.