public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Dan Williams <dan.j.williams@intel.com>,
	<linux-acpi@vger.kernel.org>, <linux-cxl@vger.kernel.org>
Cc: <rafael@kernel.org>, <lenb@kernel.org>, <ira.weiny@intel.com>,
	<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
	<lukas@wunner.de>, <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2 1/4] acpi: Move common tables helper functions to common lib
Date: Mon, 22 May 2023 15:13:00 -0700	[thread overview]
Message-ID: <19907ea8-85bf-6e31-0798-ef8a1e4b842a@intel.com> (raw)
In-Reply-To: <646bdf21b9329_33fb329410@dwillia2-xfh.jf.intel.com.notmuch>


On 5/22/23 14:31, Dan Williams wrote:
> Dave Jiang wrote:
>> Some of the routines in ACPI tables.c can be shared with parsing CDAT.
> s,ACPI tables.c,driver/acpi/tables.c,
>
>> However, CDAT is used by CXL and can exist on platforms that do not use
>> ACPI.
> Clarify that CDAT is not an ACPI table:
>
> CDAT is a device-provided data structure that is formatted similar to a
> platform-provided ACPI table.
>
>> Split out the common routine from ACPI to accomodate platforms that
>> do not support ACPI. The common routines can be built outside of ACPI if
>> ACPI_TABLES_LIB is selected.
> Might be just me but I get confused where this is indicating "ACPI" the
> platform vs "CONFIG_ACPI" the code. How about just:
>
> Refactor the table parsing routines in driver/acpi/tables.c into helpers
> that can be shared with the CXL driver even in the CONFIG_ACPI=n case.
>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>>   drivers/Makefile          |    2
>>   drivers/acpi/Kconfig      |    4 +
>>   drivers/acpi/Makefile     |    3 +
>>   drivers/acpi/tables.c     |  173 ----------------------------------------
>>   drivers/acpi/tables_lib.c |  194 +++++++++++++++++++++++++++++++++++++++++++++
>>   include/linux/acpi.h      |   63 +++++++++------
>>   6 files changed, 241 insertions(+), 198 deletions(-)
>>   create mode 100644 drivers/acpi/tables_lib.c
> Conversion looks ok to me. Even though the cover letter said "Hi Rafael,
> Please consider these for 6.5 merge window" my expectation is to take
> these through CXL with ACPI acks.

I thought you wanted Rafael to take the ACPI patches. But going to the 
CXL tree works.

>
> One question below:
>
>> diff --git a/drivers/Makefile b/drivers/Makefile
>> index 20b118dca999..1824797f7dfe 100644
>> --- a/drivers/Makefile
>> +++ b/drivers/Makefile
>> @@ -31,7 +31,7 @@ obj-y				+= idle/
>>   # IPMI must come before ACPI in order to provide IPMI opregion support
>>   obj-y				+= char/ipmi/
>>   
>> -obj-$(CONFIG_ACPI)		+= acpi/
>> +obj-y				+= acpi/
>>   
>>   # PnP must come after ACPI since it will eventually need to check if acpi
>>   # was used and do nothing if so
>> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
>> index ccbeab9500ec..ce74a20dc42f 100644
>> --- a/drivers/acpi/Kconfig
>> +++ b/drivers/acpi/Kconfig
>> @@ -6,12 +6,16 @@
>>   config ARCH_SUPPORTS_ACPI
>>   	bool
>>   
>> +config ACPI_TABLES_LIB
>> +	bool
>> +
>>   menuconfig ACPI
>>   	bool "ACPI (Advanced Configuration and Power Interface) Support"
>>   	depends on ARCH_SUPPORTS_ACPI
>>   	select PNP
>>   	select NLS
>>   	select CRC32
>> +	select ACPI_TABLES_LIB
>>   	default y if X86
>>   	help
>>   	  Advanced Configuration and Power Interface (ACPI) support for
>> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
>> index feb36c0b9446..4558e2876823 100644
>> --- a/drivers/acpi/Makefile
>> +++ b/drivers/acpi/Makefile
>> @@ -13,6 +13,9 @@ tables.o: $(src)/../../include/$(CONFIG_ACPI_CUSTOM_DSDT_FILE) ;
>>   
>>   endif
>>   
>> +obj-$(CONFIG_ACPI_TABLES_LIB)	+= acpi_tables_lib.o
>> +acpi_tables_lib-y := tables_lib.o
> Why is a separate object name needed?

Not all code in tables.c will be shared. There are ACPI table parsing 
specific code in tables.c that CXL does not care about. Or do you mean 
just do

obj-$(CONFIG_ACPI_TABLES_LIB) += tables_lib.o

?



  reply	other threads:[~2023-05-22 22:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 18:32 [PATCH v2 0/4] acpi: Add CDAT parsing support to ACPI tables code Dave Jiang
2023-05-18 18:33 ` [PATCH v2 1/4] acpi: Move common tables helper functions to common lib Dave Jiang
2023-05-22 21:31   ` Dan Williams
2023-05-22 22:13     ` Dave Jiang [this message]
2023-05-22 22:25       ` Dan Williams
2023-05-23 10:38         ` Rafael J. Wysocki
2023-06-01 14:50   ` Jonathan Cameron
2023-06-01 15:38     ` Dave Jiang
2023-05-18 18:33 ` [PATCH v2 2/4] acpi: tables: Add CDAT table parsing support Dave Jiang
2023-05-22 23:12   ` Dan Williams
2023-05-23 10:43     ` Rafael J. Wysocki
2023-05-18 18:33 ` [PATCH v2 3/4] acpi: fix misnamed define for CDAT DSMAS Dave Jiang
2023-05-22 23:23   ` Dan Williams
2023-05-23 10:46     ` Rafael J. Wysocki
2023-05-23 14:54       ` Dave Jiang
2023-05-23 15:16         ` Rafael J. Wysocki
2023-05-18 18:33 ` [PATCH v2 4/4] acpi: Add defines for CDAT SSLBIS Dave Jiang
2023-05-22 23:24   ` Dan Williams
2023-05-23 10:49     ` 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=19907ea8-85bf-6e31-0798-ef8a1e4b842a@intel.com \
    --to=dave.jiang@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=rafael@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /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