Skip to contentSkip to conversation

ACPI: GTDT: Put GTDT table after parsing

PATCH Applied Hanjun Guo 2 participants 3 messages May 8, 2020 – May 18, 2020

Subsystems (2)
lore
Share & tools
lore

Hanjun Guo

author maintainer
#0 lore raw

PATCH 1/2 ACPI: GTDT: Put GTDT table after parsing

The mapped GTDT table needs to be released after
the driver init.

---

Patch 1/2 2/2 are based on top of for-next/acpi branch of the ARM64 repo.

 drivers/acpi/arm64/gtdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/acpi/arm64/gtdt.c +3 -1
index 01962c6..f2d0e59 100644
@@ -394,7 +394,7 @@ static int __init gtdt_sbsa_gwdt_init(void)
 	 */
 	ret = acpi_gtdt_init(table, &timer_count);
 	if (ret || !timer_count)
-		return ret;
+		goto out_put_gtdt;
 
 	for_each_platform_timer(platform_timer) {
 		if (is_non_secure_watchdog(platform_timer)) {
@@ -408,6 +408,8 @@ static int __init gtdt_sbsa_gwdt_init(void)
 	if (gwdt_count)
 		pr_info("found %d SBSA generic Watchdog(s).\n", gwdt_count);
 
+out_put_gtdt:
+	acpi_put_table(table);
 	return ret;
 }
 
Signature · 1 line
1.7.12.4
author maintainer
#1 lore raw

PATCH 2/2 ACPI: IORT: Add comments for not calling acpi_put_table()

The iort_table will be used at runtime after acpi_iort_init(), so add some comments to clarify this to make it less confusing.

---
 drivers/acpi/arm64/iort.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/acpi/arm64/iort.c +4 -0
index 6e445bc..619a3e5 100644
@@ -1667,6 +1667,10 @@ void __init acpi_iort_init(void)
 {
 	acpi_status status;
 
+	/* iort_table will be used at runtime after the iort init,
+	 * so we don't need to call acpi_put_table() to release
+	 * the IORT table mapping.
+	 */
 	status = acpi_get_table(ACPI_SIG_IORT, 0, &iort_table);
 	if (ACPI_FAILURE(status)) {
 		if (status != AE_NOT_FOUND) {
Signature · 1 line
1.7.12.4
maintainer Applied
#2 lore raw
In reply to Hanjun Guo
Quoted 2 lines · Hanjun Guo

The mapped GTDT table needs to be released after
the driver init.

Applied to arm64 (for-next/acpi), thanks!

[1/2] ACPI: GTDT: Put GTDT table after parsing

      https://git.kernel.org/arm64/c/5ec605108ff4
[2/2] ACPI: IORT: Add comments for not calling acpi_put_table()
      https://git.kernel.org/arm64/c/701dafe0670c

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev