All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: rafael.j.wysocki@intel.com
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Alison Schofield <alison.schofield@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH 2/6] ACPI: Teach ACPI table parsing about the CEDT header format
Date: Fri, 29 Oct 2021 12:51:37 -0700	[thread overview]
Message-ID: <163553709742.2509508.5177761945441327574.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <163553708697.2509508.16523059414830959692.stgit@dwillia2-desk3.amr.corp.intel.com>

The CEDT adds yet one more unique subtable header type where the length
is a 16-bit value. Extend the subtable helpers to detect this scenario.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/tables.c |    9 +++++++++
 include/linux/acpi.h  |    1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 29d44fe19ef0..b1514fde11bc 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -40,6 +40,7 @@ enum acpi_subtable_type {
 	ACPI_SUBTABLE_COMMON,
 	ACPI_SUBTABLE_HMAT,
 	ACPI_SUBTABLE_PRMT,
+	ACPI_SUBTABLE_CEDT,
 };
 
 struct acpi_subtable_entry {
@@ -225,6 +226,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry)
 		return entry->hdr->hmat.type;
 	case ACPI_SUBTABLE_PRMT:
 		return 0;
+	case ACPI_SUBTABLE_CEDT:
+		return entry->hdr->cedt.type;
 	}
 	return 0;
 }
@@ -239,6 +242,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry)
 		return entry->hdr->hmat.length;
 	case ACPI_SUBTABLE_PRMT:
 		return entry->hdr->prmt.length;
+	case ACPI_SUBTABLE_CEDT:
+		return entry->hdr->cedt.length;
 	}
 	return 0;
 }
@@ -253,6 +258,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry)
 		return sizeof(entry->hdr->hmat);
 	case ACPI_SUBTABLE_PRMT:
 		return sizeof(entry->hdr->prmt);
+	case ACPI_SUBTABLE_CEDT:
+		return sizeof(entry->hdr->cedt);
 	}
 	return 0;
 }
@@ -264,6 +271,8 @@ acpi_get_subtable_type(char *id)
 		return ACPI_SUBTABLE_HMAT;
 	if (strncmp(id, ACPI_SIG_PRMT, 4) == 0)
 		return ACPI_SUBTABLE_PRMT;
+	if (strncmp(id, ACPI_SIG_CEDT, 4) == 0)
+		return ACPI_SUBTABLE_CEDT;
 	return ACPI_SUBTABLE_COMMON;
 }
 
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 509b72676e2e..cbee050f4b1d 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -133,6 +133,7 @@ union acpi_subtable_headers {
 	struct acpi_subtable_header common;
 	struct acpi_hmat_structure hmat;
 	struct acpi_prmt_module_header prmt;
+	struct acpi_cedt_header cedt;
 };
 
 typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);


  parent reply	other threads:[~2021-10-29 19:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 19:51 [PATCH 0/6] Introduce acpi_table_parse_cedt and extra nodes for CXL.mem Dan Williams
2021-10-29 19:51 ` [PATCH 1/6] ACPI: Keep sub-table parsing infrastructure available for modules Dan Williams
2021-10-29 19:51 ` Dan Williams [this message]
2021-10-29 19:51 ` [PATCH 3/6] ACPI: Add a context argument for table parsing handlers Dan Williams
2021-10-29 19:51 ` [PATCH 4/6] cxl/acpi: Convert CFMWS parsing to ACPI sub-table helpers Dan Williams
2021-10-29 19:51 ` [PATCH 5/6] cxl/test: Mock acpi_table_parse_cedt() Dan Williams
2021-10-29 19:51 ` [PATCH 6/6] ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT Dan Williams
2021-11-18 13:12   ` Jonathan Cameron
2021-11-18 17:14     ` Dan Williams
2021-11-18 17:53       ` Jonathan Cameron
2021-11-18 18:10         ` Dan Williams
2021-11-18 18:18           ` Jonathan Cameron
2021-11-01 12:00 ` [PATCH 0/6] Introduce acpi_table_parse_cedt and extra nodes for CXL.mem Jonathan Cameron
2021-11-02  3:41   ` Dan Williams
2021-11-02 17:44     ` Jonathan Cameron
2021-11-05 15:07       ` Rafael J. Wysocki

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=163553709742.2509508.5177761945441327574.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.