Skip to content

Commit 0960a3c

Browse files
committed
Merge branches 'acpi-scan', 'acpi-tad', 'acpi-extlog' and 'acpi-misc'
Merge ACPI device enumeration changes, ACPI TAD and extlog drivers updates, and miscellaneous ACPI-related changes for 6.6-rc1: - Defer enumeration of devices with _DEP pointing to IVSC (Wentong Wu). - Install SystemCMOS address space handler for ACPI000E (TAD) to meet platform firmware expectations on some platforms (Zhang Rui). - Fix finding the generic error data in the ACPi extlog driver for compatibility with old and new firmware interface versions (Xiaochun Lee). - Remove assorted unused declarations of functions (Yue Haibing). - Move AMBA bus scan handling into arm64 specific directory (Sudeep Holla). * acpi-scan: ACPI: scan: Defer enumeration of devices with a _DEP pointing to IVSC device * acpi-tad: ACPI: TAD: Install SystemCMOS address space handler for ACPI000E * acpi-extlog: ACPI: extlog: Fix finding the generic error data for v3 structure * acpi-misc: ACPI: Remove assorted unused declarations of functions ACPI: Remove unused extern declaration acpi_paddr_to_node() ACPI: Move AMBA bus scan handling into arm64 specific directory
5 parents 0c2ec0f + 7f6fd06 + 596ca52 + ae769fb + 638f139 commit 0960a3c

File tree

13 files changed

+58
-28
lines changed

13 files changed

+58
-28
lines changed

drivers/acpi/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ acpi-$(CONFIG_PCI) += acpi_lpss.o
5050
acpi-y += acpi_apd.o
5151
acpi-y += acpi_platform.o
5252
acpi-y += acpi_pnp.o
53-
acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
5453
acpi-y += power.o
5554
acpi-y += event.o
5655
acpi-y += evged.o

drivers/acpi/acpi_cmos_rtc.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
5151
return AE_OK;
5252
}
5353

54-
static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
55-
const struct acpi_device_id *id)
54+
int acpi_install_cmos_rtc_space_handler(acpi_handle handle)
5655
{
5756
acpi_status status;
5857

59-
status = acpi_install_address_space_handler(adev->handle,
58+
status = acpi_install_address_space_handler(handle,
6059
ACPI_ADR_SPACE_CMOS,
6160
&acpi_cmos_rtc_space_handler,
6261
NULL, NULL);
@@ -67,18 +66,30 @@ static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
6766

6867
return 1;
6968
}
69+
EXPORT_SYMBOL_GPL(acpi_install_cmos_rtc_space_handler);
7070

71-
static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
71+
void acpi_remove_cmos_rtc_space_handler(acpi_handle handle)
7272
{
73-
if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
73+
if (ACPI_FAILURE(acpi_remove_address_space_handler(handle,
7474
ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
7575
pr_err("Error removing CMOS-RTC region handler\n");
7676
}
77+
EXPORT_SYMBOL_GPL(acpi_remove_cmos_rtc_space_handler);
78+
79+
static int acpi_cmos_rtc_attach_handler(struct acpi_device *adev, const struct acpi_device_id *id)
80+
{
81+
return acpi_install_cmos_rtc_space_handler(adev->handle);
82+
}
83+
84+
static void acpi_cmos_rtc_detach_handler(struct acpi_device *adev)
85+
{
86+
acpi_remove_cmos_rtc_space_handler(adev->handle);
87+
}
7788

7889
static struct acpi_scan_handler cmos_rtc_handler = {
7990
.ids = acpi_cmos_rtc_ids,
80-
.attach = acpi_install_cmos_rtc_space_handler,
81-
.detach = acpi_remove_cmos_rtc_space_handler,
91+
.attach = acpi_cmos_rtc_attach_handler,
92+
.detach = acpi_cmos_rtc_detach_handler,
8293
};
8394

8495
void __init acpi_cmos_rtc_init(void)

drivers/acpi/acpi_extlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
172172
fru_text = "";
173173
sec_type = (guid_t *)gdata->section_type;
174174
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
175-
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
175+
struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);
176176

177177
if (gdata->error_data_length >= sizeof(*mem))
178178
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,

drivers/acpi/acpi_tad.c

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
557557
static int acpi_tad_remove(struct platform_device *pdev)
558558
{
559559
struct device *dev = &pdev->dev;
560+
acpi_handle handle = ACPI_HANDLE(dev);
560561
struct acpi_tad_driver_data *dd = dev_get_drvdata(dev);
561562

562563
device_init_wakeup(dev, false);
@@ -577,6 +578,7 @@ static int acpi_tad_remove(struct platform_device *pdev)
577578

578579
pm_runtime_put_sync(dev);
579580
pm_runtime_disable(dev);
581+
acpi_remove_cmos_rtc_space_handler(handle);
580582
return 0;
581583
}
582584

@@ -589,29 +591,39 @@ static int acpi_tad_probe(struct platform_device *pdev)
589591
unsigned long long caps;
590592
int ret;
591593

594+
ret = acpi_install_cmos_rtc_space_handler(handle);
595+
if (ret < 0) {
596+
dev_info(dev, "Unable to install space handler\n");
597+
return -ENODEV;
598+
}
592599
/*
593600
* Initialization failure messages are mostly about firmware issues, so
594601
* print them at the "info" level.
595602
*/
596603
status = acpi_evaluate_integer(handle, "_GCP", NULL, &caps);
597604
if (ACPI_FAILURE(status)) {
598605
dev_info(dev, "Unable to get capabilities\n");
599-
return -ENODEV;
606+
ret = -ENODEV;
607+
goto remove_handler;
600608
}
601609

602610
if (!(caps & ACPI_TAD_AC_WAKE)) {
603611
dev_info(dev, "Unsupported capabilities\n");
604-
return -ENODEV;
612+
ret = -ENODEV;
613+
goto remove_handler;
605614
}
606615

607616
if (!acpi_has_method(handle, "_PRW")) {
608617
dev_info(dev, "Missing _PRW\n");
609-
return -ENODEV;
618+
ret = -ENODEV;
619+
goto remove_handler;
610620
}
611621

612622
dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL);
613-
if (!dd)
614-
return -ENOMEM;
623+
if (!dd) {
624+
ret = -ENOMEM;
625+
goto remove_handler;
626+
}
615627

616628
dd->capabilities = caps;
617629
dev_set_drvdata(dev, dd);
@@ -653,6 +665,11 @@ static int acpi_tad_probe(struct platform_device *pdev)
653665

654666
fail:
655667
acpi_tad_remove(pdev);
668+
/* Don't fallthrough because cmos rtc space handler is removed in acpi_tad_remove() */
669+
return ret;
670+
671+
remove_handler:
672+
acpi_remove_cmos_rtc_space_handler(handle);
656673
return ret;
657674
}
658675

drivers/acpi/arm64/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ obj-$(CONFIG_ACPI_AGDI) += agdi.o
33
obj-$(CONFIG_ACPI_IORT) += iort.o
44
obj-$(CONFIG_ACPI_GTDT) += gtdt.o
55
obj-$(CONFIG_ACPI_APMT) += apmt.o
6+
obj-$(CONFIG_ARM_AMBA) += amba.o
67
obj-y += dma.o init.o

drivers/acpi/acpi_amba.c renamed to drivers/acpi/arm64/amba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <linux/kernel.h>
1818
#include <linux/module.h>
1919

20-
#include "internal.h"
20+
#include "init.h"
2121

2222
static const struct acpi_device_id amba_id_list[] = {
2323
{"ARMH0061", 0}, /* PL061 GPIO Device */

drivers/acpi/arm64/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ void __init acpi_arm_init(void)
1010
acpi_apmt_init();
1111
if (IS_ENABLED(CONFIG_ACPI_IORT))
1212
acpi_iort_init();
13+
if (IS_ENABLED(CONFIG_ARM_AMBA))
14+
acpi_amba_init();
1315
}

drivers/acpi/arm64/init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
void __init acpi_agdi_init(void);
55
void __init acpi_apmt_init(void);
66
void __init acpi_iort_init(void);
7+
void __init acpi_amba_init(void);

drivers/acpi/internal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ void acpi_processor_init(void);
2828
void acpi_platform_init(void);
2929
void acpi_pnp_init(void);
3030
void acpi_int340x_thermal_init(void);
31-
#ifdef CONFIG_ARM_AMBA
32-
void acpi_amba_init(void);
33-
#else
34-
static inline void acpi_amba_init(void) {}
35-
#endif
3631
int acpi_sysfs_init(void);
3732
void acpi_gpe_apply_masked_gpes(void);
3833
void acpi_container_init(void);
@@ -128,7 +123,6 @@ int __acpi_device_uevent_modalias(const struct acpi_device *adev,
128123
/* --------------------------------------------------------------------------
129124
Power Resource
130125
-------------------------------------------------------------------------- */
131-
int acpi_power_init(void);
132126
void acpi_power_resources_list_free(struct list_head *list);
133127
int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
134128
struct list_head *list);

drivers/acpi/scan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@ static const char * const acpi_ignore_dep_ids[] = {
795795
/* List of HIDs for which we honor deps of matching ACPI devs, when checking _DEP lists. */
796796
static const char * const acpi_honor_dep_ids[] = {
797797
"INT3472", /* Camera sensor PMIC / clk and regulator info */
798+
"INTC1059", /* IVSC (TGL) driver must be loaded to allow i2c access to camera sensors */
799+
"INTC1095", /* IVSC (ADL) driver must be loaded to allow i2c access to camera sensors */
800+
"INTC100A", /* IVSC (RPL) driver must be loaded to allow i2c access to camera sensors */
798801
NULL
799802
};
800803

@@ -2616,7 +2619,6 @@ void __init acpi_scan_init(void)
26162619
acpi_watchdog_init();
26172620
acpi_pnp_init();
26182621
acpi_int340x_thermal_init();
2619-
acpi_amba_init();
26202622
acpi_init_lpit();
26212623

26222624
acpi_scan_add_handler(&generic_device_handler);

0 commit comments

Comments
 (0)