Linux Power Management development
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: linux-pm@vger.kernel.org
Cc: Thomas Renninger <trenn@suse.de>, rafael@kernel.org, msuchanek@suse.com
Subject: [PATCH 3/3] ACPI: Properly map BERT and CCEL acpi tables to their data tables
Date: Wed,  8 Jul 2026 10:37:49 +0200	[thread overview]
Message-ID: <20260708083803.80734-4-trenn@suse.de> (raw)
In-Reply-To: <20260708083803.80734-1-trenn@suse.de>

In case of multiple BERT ACPI tables one gets:
sysfs: cannot create duplicate filename '/firmware/acpi/tables/data/BERT'

This is because both:
/firmware/acpi/tables/BERT1
/firmware/acpi/tables/BERT2
are tried to be mapped to the same data table:
/firmware/acpi/tables/data/BERT

This patch fixes this problem by passing and using the same filename
for data tables.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Reported-by: Michal Suchanek <msuchanek@suse.com>
Closes: https://bugzilla.suse.com/show_bug.cgi?id=1270211
---
 drivers/acpi/sysfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 16eaa0af7d0b..265fbdb10aeb 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -316,6 +316,7 @@ struct acpi_table_attr {
 struct acpi_data_attr {
 	struct bin_attribute attr;
 	u64	addr;
+	char filename[ACPI_NAMESEG_SIZE+ACPI_INST_SIZE];
 };
 
 static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj,
@@ -453,7 +454,6 @@ static int acpi_bert_data_init(void *th, struct acpi_data_attr *data_attr)
 	}
 	data_attr->addr = bert->address;
 	data_attr->attr.size = bert->region_length;
-	data_attr->attr.attr.name = "BERT";
 
 	return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr);
 }
@@ -469,7 +469,6 @@ static int acpi_ccel_data_init(void *th, struct acpi_data_attr *data_attr)
 	}
 	data_attr->addr = ccel->log_area_start_address;
 	data_attr->attr.size = ccel->log_area_minimum_length;
-	data_attr->attr.attr.name = "CCEL";
 
 	return sysfs_create_bin_file(tables_data_kobj, &data_attr->attr);
 }
@@ -504,6 +503,8 @@ static int acpi_table_data_init(struct acpi_table_attr *table_attr)
 			sysfs_attr_init(&data_attr->attr.attr);
 			data_attr->attr.read = acpi_data_show;
 			data_attr->attr.attr.mode = 0400;
+			strscpy(data_attr->filename, table_attr->filename);
+			data_attr->attr.attr.name = data_attr->filename;
 			return acpi_data_objs[i].fn(th, data_attr);
 		}
 	}
-- 
2.54.0


  parent reply	other threads:[~2026-07-08  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  8:37 [PATCH 0/3] Fix sysfs duplicate filename if multiple BERT tables exist Thomas Renninger
2026-07-08  8:37 ` [PATCH 1/3] Use correct region size for BERT region size check Thomas Renninger
2026-07-08  8:37 ` [PATCH 2/3] ACPI: Pass table_attr instead of table_header to create acpi data tables Thomas Renninger
2026-07-08  8:37 ` Thomas Renninger [this message]
2026-07-09 14:08 ` [PATCH 0/3] Fix sysfs duplicate filename if multiple BERT tables exist Rafael J. Wysocki (Intel)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260708083803.80734-4-trenn@suse.de \
    --to=trenn@suse.de \
    --cc=linux-pm@vger.kernel.org \
    --cc=msuchanek@suse.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox