mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ruidong Tian <tianruidong@linux.alibaba.com>
To: robert.moore@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org
Cc: linux-acpi@vger.kernel.org,
	acpica-devel@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org, baolin.wang@linux.alibaba.com,
	jkchen@linux.alibaba.com, xueshuai@linux.alibaba.com,
	Ruidong Tian <tianruidong@linux.alibaba.com>
Subject: [PATCH] ACPICA: PCI: Undefined ACPI_ADR_SPACE_PCI_CONFIG when CONFIG_PCI is unset
Date: Thu,  2 Feb 2023 11:48:21 +0800	[thread overview]
Message-ID: <20230202034821.25123-1-tianruidong@linux.alibaba.com> (raw)

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


             reply	other threads:[~2023-02-02  3:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02  3:48 Ruidong Tian [this message]
2023-02-02  9:31 ` Rafael J. Wysocki
2023-02-06  6:52   ` Ruidong Tian

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=20230202034821.25123-1-tianruidong@linux.alibaba.com \
    --to=tianruidong@linux.alibaba.com \
    --cc=acpica-devel@lists.linuxfoundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=jkchen@linux.alibaba.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    --cc=xueshuai@linux.alibaba.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

all inboxes | Powered by JetHome®