mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset
@ 2023-02-02  3:48 Ruidong Tian
  2023-02-02  9:31 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Ruidong Tian @ 2023-02-02  3:48 UTC (permalink / raw)
  To: robert.moore, rafael.j.wysocki, lenb
  Cc: linux-acpi, acpica-devel, linux-kernel, baolin.wang, jkchen,
	xueshuai, Ruidong Tian

ACPI core subsystem initialization will fail when Kernel disabled PCI but
ACPI tables still have PCI config address spaces.

Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces
only when ACPI_PCI_CONFIGURED is defined.

Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c
index be9a05498adc..86057e39df8c 100644
--- a/drivers/acpi/acpica/evhandler.c
+++ b/drivers/acpi/acpica/evhandler.c
@@ -26,7 +26,9 @@ acpi_ev_install_handler(acpi_handle obj_handle,
 u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
 	ACPI_ADR_SPACE_SYSTEM_MEMORY,
 	ACPI_ADR_SPACE_SYSTEM_IO,
+#ifdef ACPI_PCI_CONFIGURED
 	ACPI_ADR_SPACE_PCI_CONFIG,
+#endif
 	ACPI_ADR_SPACE_DATA_TABLE
 };
 
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 151e40385673..28456120529f 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -162,7 +162,11 @@
 /* Maximum space_ids for Operation Regions */
 
 #define ACPI_MAX_ADDRESS_SPACE          255
+#ifdef ACPI_PCI_CONFIGURED
 #define ACPI_NUM_DEFAULT_SPACES         4
+#else
+#define ACPI_NUM_DEFAULT_SPACES         3
+#endif
 
 /* Array sizes.  Used for range checking also */
 
-- 
2.33.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset
  2023-02-02  3:48 [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset Ruidong Tian
@ 2023-02-02  9:31 ` Rafael J. Wysocki
  2023-02-06  6:52   ` Ruidong Tian
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2023-02-02  9:31 UTC (permalink / raw)
  To: Ruidong Tian
  Cc: robert.moore, rafael.j.wysocki, lenb, linux-acpi, acpica-devel,
	linux-kernel, baolin.wang, jkchen, xueshuai

On Thu, Feb 2, 2023 at 4:48 AM Ruidong Tian
<tianruidong@linux.alibaba.com> wrote:
>
> ACPI core subsystem initialization will fail when Kernel disabled PCI but
> ACPI tables still have PCI config address spaces.
>
> Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces
> only when ACPI_PCI_CONFIGURED is defined.
>
> Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>

As an ACPICA change, this should first be submitted (as a pull
request) to the upstream ACPICA project on GitHub.

Having done that, please resubmit the patch with a Link tag pointing
to the corresponding upstream pull request.

Thanks!

> ---
>  drivers/acpi/acpica/evhandler.c | 2 ++
>  include/acpi/acconfig.h         | 4 ++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c
> index be9a05498adc..86057e39df8c 100644
> --- a/drivers/acpi/acpica/evhandler.c
> +++ b/drivers/acpi/acpica/evhandler.c
> @@ -26,7 +26,9 @@ acpi_ev_install_handler(acpi_handle obj_handle,
>  u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
>         ACPI_ADR_SPACE_SYSTEM_MEMORY,
>         ACPI_ADR_SPACE_SYSTEM_IO,
> +#ifdef ACPI_PCI_CONFIGURED
>         ACPI_ADR_SPACE_PCI_CONFIG,
> +#endif
>         ACPI_ADR_SPACE_DATA_TABLE
>  };
>
> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
> index 151e40385673..28456120529f 100644
> --- a/include/acpi/acconfig.h
> +++ b/include/acpi/acconfig.h
> @@ -162,7 +162,11 @@
>  /* Maximum space_ids for Operation Regions */
>
>  #define ACPI_MAX_ADDRESS_SPACE          255
> +#ifdef ACPI_PCI_CONFIGURED
>  #define ACPI_NUM_DEFAULT_SPACES         4
> +#else
> +#define ACPI_NUM_DEFAULT_SPACES         3
> +#endif
>
>  /* Array sizes.  Used for range checking also */
>
> --
> 2.33.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset
  2023-02-02  9:31 ` Rafael J. Wysocki
@ 2023-02-06  6:52   ` Ruidong Tian
  0 siblings, 0 replies; 3+ messages in thread
From: Ruidong Tian @ 2023-02-06  6:52 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: robert.moore, rafael.j.wysocki, lenb, linux-acpi, acpica-devel,
	linux-kernel, baolin.wang, jkchen, xueshuai

This patch depends on kernel-specific ACPICA configuration, can I submit 
it to ACPICA

projects?

On 2023/2/2 17:31, Rafael J. Wysocki wrote:
> On Thu, Feb 2, 2023 at 4:48 AM Ruidong Tian
> <tianruidong@linux.alibaba.com> wrote:
>> ACPI core subsystem initialization will fail when Kernel disabled PCI but
>> ACPI tables still have PCI config address spaces.
>>
>> Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces
>> only when ACPI_PCI_CONFIGURED is defined.
>>
>> Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
> As an ACPICA change, this should first be submitted (as a pull
> request) to the upstream ACPICA project on GitHub.
>
> Having done that, please resubmit the patch with a Link tag pointing
> to the corresponding upstream pull request.
>
> Thanks!
>
>> ---
>>   drivers/acpi/acpica/evhandler.c | 2 ++
>>   include/acpi/acconfig.h         | 4 ++++
>>   2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c
>> index be9a05498adc..86057e39df8c 100644
>> --- a/drivers/acpi/acpica/evhandler.c
>> +++ b/drivers/acpi/acpica/evhandler.c
>> @@ -26,7 +26,9 @@ acpi_ev_install_handler(acpi_handle obj_handle,
>>   u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
>>          ACPI_ADR_SPACE_SYSTEM_MEMORY,
>>          ACPI_ADR_SPACE_SYSTEM_IO,
>> +#ifdef ACPI_PCI_CONFIGURED
>>          ACPI_ADR_SPACE_PCI_CONFIG,
>> +#endif
>>          ACPI_ADR_SPACE_DATA_TABLE
>>   };
>>
>> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
>> index 151e40385673..28456120529f 100644
>> --- a/include/acpi/acconfig.h
>> +++ b/include/acpi/acconfig.h
>> @@ -162,7 +162,11 @@
>>   /* Maximum space_ids for Operation Regions */
>>
>>   #define ACPI_MAX_ADDRESS_SPACE          255
>> +#ifdef ACPI_PCI_CONFIGURED
>>   #define ACPI_NUM_DEFAULT_SPACES         4
>> +#else
>> +#define ACPI_NUM_DEFAULT_SPACES         3
>> +#endif
>>
>>   /* Array sizes.  Used for range checking also */
>>
>> --
>> 2.33.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-06  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02  3:48 [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset Ruidong Tian
2023-02-02  9:31 ` Rafael J. Wysocki
2023-02-06  6:52   ` Ruidong Tian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®