Commit 0960a3cb authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ acpi-$(CONFIG_PCI) += acpi_lpss.o
acpi-y				+= acpi_apd.o
acpi-y				+= acpi_platform.o
acpi-y				+= acpi_pnp.o
acpi-$(CONFIG_ARM_AMBA)	+= acpi_amba.o
acpi-y				+= power.o
acpi-y				+= event.o
acpi-y				+= evged.o
+18 −7
Original line number Diff line number Diff line
@@ -51,12 +51,11 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
	return AE_OK;
}

static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
		const struct acpi_device_id *id)
int acpi_install_cmos_rtc_space_handler(acpi_handle handle)
{
	acpi_status status;

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

	return 1;
}
EXPORT_SYMBOL_GPL(acpi_install_cmos_rtc_space_handler);

static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
void acpi_remove_cmos_rtc_space_handler(acpi_handle handle)
{
	if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
	if (ACPI_FAILURE(acpi_remove_address_space_handler(handle,
			ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
		pr_err("Error removing CMOS-RTC region handler\n");
}
EXPORT_SYMBOL_GPL(acpi_remove_cmos_rtc_space_handler);

static int acpi_cmos_rtc_attach_handler(struct acpi_device *adev, const struct acpi_device_id *id)
{
	return acpi_install_cmos_rtc_space_handler(adev->handle);
}

static void acpi_cmos_rtc_detach_handler(struct acpi_device *adev)
{
	acpi_remove_cmos_rtc_space_handler(adev->handle);
}

static struct acpi_scan_handler cmos_rtc_handler = {
	.ids = acpi_cmos_rtc_ids,
	.attach = acpi_install_cmos_rtc_space_handler,
	.detach = acpi_remove_cmos_rtc_space_handler,
	.attach = acpi_cmos_rtc_attach_handler,
	.detach = acpi_cmos_rtc_detach_handler,
};

void __init acpi_cmos_rtc_init(void)
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
			fru_text = "";
		sec_type = (guid_t *)gdata->section_type;
		if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
			struct cper_sec_mem_err *mem = (void *)(gdata + 1);
			struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);

			if (gdata->error_data_length >= sizeof(*mem))
				trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
+22 −5
Original line number Diff line number Diff line
@@ -557,6 +557,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
static int acpi_tad_remove(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	acpi_handle handle = ACPI_HANDLE(dev);
	struct acpi_tad_driver_data *dd = dev_get_drvdata(dev);

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

	pm_runtime_put_sync(dev);
	pm_runtime_disable(dev);
	acpi_remove_cmos_rtc_space_handler(handle);
	return 0;
}

@@ -589,6 +591,11 @@ static int acpi_tad_probe(struct platform_device *pdev)
	unsigned long long caps;
	int ret;

	ret = acpi_install_cmos_rtc_space_handler(handle);
	if (ret < 0) {
		dev_info(dev, "Unable to install space handler\n");
		return -ENODEV;
	}
	/*
	 * Initialization failure messages are mostly about firmware issues, so
	 * print them at the "info" level.
@@ -596,22 +603,27 @@ static int acpi_tad_probe(struct platform_device *pdev)
	status = acpi_evaluate_integer(handle, "_GCP", NULL, &caps);
	if (ACPI_FAILURE(status)) {
		dev_info(dev, "Unable to get capabilities\n");
		return -ENODEV;
		ret = -ENODEV;
		goto remove_handler;
	}

	if (!(caps & ACPI_TAD_AC_WAKE)) {
		dev_info(dev, "Unsupported capabilities\n");
		return -ENODEV;
		ret = -ENODEV;
		goto remove_handler;
	}

	if (!acpi_has_method(handle, "_PRW")) {
		dev_info(dev, "Missing _PRW\n");
		return -ENODEV;
		ret = -ENODEV;
		goto remove_handler;
	}

	dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL);
	if (!dd)
		return -ENOMEM;
	if (!dd) {
		ret = -ENOMEM;
		goto remove_handler;
	}

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

fail:
	acpi_tad_remove(pdev);
	/* Don't fallthrough because cmos rtc space handler is removed in acpi_tad_remove() */
	return ret;

remove_handler:
	acpi_remove_cmos_rtc_space_handler(handle);
	return ret;
}

+1 −0
Original line number Diff line number Diff line
@@ -3,4 +3,5 @@ obj-$(CONFIG_ACPI_AGDI) += agdi.o
obj-$(CONFIG_ACPI_IORT) 	+= iort.o
obj-$(CONFIG_ACPI_GTDT) 	+= gtdt.o
obj-$(CONFIG_ACPI_APMT) 	+= apmt.o
obj-$(CONFIG_ARM_AMBA)		+= amba.o
obj-y				+= dma.o init.o
Loading