Skip to contentSkip to conversation

Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

PATCH In review Weidong Cui 4 participants 11 messages Feb 9, 2021 – Mar 25, 2021 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
drivers/acpi/acpica/evhandler.c +2 -0
index 5884eba04..4c25ad433 100644
@@ -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
 };
 
include/acpi/acconfig.h +4 -0
index a225eff49..790999028 100644
@@ -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 */
 
Signature · 1 line
2.24.3 (Apple Git-128)
#1 lore raw
Quoted 3 lines · Weidong Cui
Signed-off-by Weidong Cui <weidongcui(a)gmail.com>
Signed-off-by Xinyang Ge <aegiryy(a)gmail.com>

ACPICA material, left to Erik & Bob, thanks!

Quoted 38 lines
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
drivers/acpi/acpica/evhandler.c +2 -0
index 5884eba04..4c25ad433 100644
@@ -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
 };
 
include/acpi/acconfig.h +4 -1
index a225eff49..790999028 100644
@@ -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.24.3 (Apple Git-128)

A message that is not in the archive (sent off-list or not yet received): CADFYyO63S4xZHJh9Cw1NYa7W=D8h=ZtUG1qPeLxfQ88kvW7MRQ@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): MWHPR11MB159925DE73F89A71D5E67113F0859@MWHPR11MB1599.namprd11.prod.outlook.com

#4 lore raw
Quoted 1 line

Hi, I’ll take a look next week.. Sorry about the delay

Hi Erik,

I would like to gently ping you about this patch. Please let us know if you have any questions.

Thanks!
Weidong

Quoted 66 lines

From: Weidong Cui <[email protected]>
Sent: Wednesday, February 17, 2021 6:55 PM
To: Rafael J. Wysocki <[email protected]>
Cc: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>; Xinyang Ge <[email protected]>; ACPI Devel Maling List <[email protected]>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA) <[email protected]>; Linux Kernel Mailing List <[email protected]>
Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Erik and Bob, please let us know if you have any questions or comments.

Thanks,

Weidong

On Tue, Feb 9, 2021 at 6:35 AM Rafael J. Wysocki <[email protected]> wrote:

Quoted 3 lines · Weidong Cui

ACPICA material, left to Erik & Bob, thanks!

Quoted 38 lines
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
drivers/acpi/acpica/evhandler.c +2 -0
index 5884eba04..4c25ad433 100644
@@ -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
 };
 
include/acpi/acconfig.h +4 -1
index a225eff49..790999028 100644
@@ -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.24.3 (Apple Git-128)

#5 lore raw
In reply to Weidong Cui

This looks good to me. Bob, do you have any comments?

Erik

Quoted 52 lines

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>
Cc: Weidong Cui <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
drivers/acpi/acpica/evhandler.c +2 -0
index 5884eba04..4c25ad433 100644
@@ -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
 };
 
include/acpi/acconfig.h +4 -1
index a225eff49..790999028 100644
@@ -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.24.3 (Apple Git-128)

#6 lore raw

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

-----Original Message-----
From: Kaneda, Erik <erik.kaneda(a)intel.com>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <weidongcui(a)gmail.com>; Moore, Robert <robert.moore(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>
Cc: Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; Len Brown <lenb(a)kernel.org>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 52 lines

-----Original Message-----
From: Weidong Cui <weidongcui(a)gmail.com>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <robert.moore(a)intel.com>; Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Len Brown <lenb(a)kernel.org>
Cc: Weidong Cui <weidongcui(a)gmail.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux- kernel(a)vger.kernel.org
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Signed-off-by Weidong Cui <weidongcui(a)gmail.com>
Signed-off-by Xinyang Ge <aegiryy(a)gmail.com>
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -1
@@ -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.24.3 (Apple Git-128)

#7 lore raw
Quoted 7 lines

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

Thank you for the comments, Erik and Bob!

ACPI_PCI_CONFIGURED is defined in aclinux.h (see below) and used in several places in evhandler.c and exregion.c.
I'm not sure why we want to introduce ACPI_PCI_NOT_CONFIGURED. Bob, I don't understand your concerns
about "have to be defined by each current host". Can you please shed some light on it?

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 64 lines

-----Original Message-----
From: Kaneda, Erik <[email protected]>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <[email protected]>; Moore, Robert <[email protected]>; Wysocki, Rafael J <[email protected]>
Cc: Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 52 lines

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>
Cc: Weidong Cui <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -1
@@ -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.24.3 (Apple Git-128)

#8 lore raw

-----Original Message-----
From: Weidong Cui <weidongcui(a)gmail.com>
Sent: Thursday, March 04, 2021 9:06 AM
To: Moore, Robert <robert.moore(a)intel.com>
Cc: Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; Len Brown <lenb(a)kernel.org>
Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Quoted 7 lines

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

Thank you for the comments, Erik and Bob!

ACPI_PCI_CONFIGURED is defined in aclinux.h (see below) and used in several places in evhandler.c and exregion.c.
I'm not sure why we want to introduce ACPI_PCI_NOT_CONFIGURED. Bob, I don't understand your concerns about "have to be defined by each current host". Can you please shed some light on it?

It is required in aclinux.h, and thus it is required in every host-dependent configuration file (acfreebsd.h, acmacosx.h, acnetbsd.h, achaiku.h, etc.) I would rather not force these host-specific header files to change. Bob

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 70 lines

-----Original Message-----
From: Kaneda, Erik <erik.kaneda(a)intel.com>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <weidongcui(a)gmail.com>; Moore, Robert <robert.moore(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>
Cc: Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; Len Brown <lenb(a)kernel.org>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 52 lines

-----Original Message-----
From: Weidong Cui <weidongcui(a)gmail.com>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <robert.moore(a)intel.com>; Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Len Brown <lenb(a)kernel.org>
Cc: Weidong Cui <weidongcui(a)gmail.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux- kernel(a)vger.kernel.org
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Signed-off-by Weidong Cui <weidongcui(a)gmail.com>
Signed-off-by Xinyang Ge <aegiryy(a)gmail.com>
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -1
@@ -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.24.3 (Apple Git-128)

#9 lore raw
Quoted 2 lines · Robert

It is required in aclinux.h, and thus it is required in every host-dependent configuration file (acfreebsd.h, acmacosx.h, acnetbsd.h, achaiku.h, etc.) I would rather not force these host-specific header files to change. Bob

Hi Bob,

I don't know the reason for ACPI_PCI_CONFIGURED to be introduced into aclinux.h. That patch introduced the bug I'm trying to fix: if CONFIG_PCI is not enabled, the kernel will crash. Would it be okay to accept this patch first to fix this kernel crash bug? We can come up a plan to fix this host-dependent configuration issue in a separate patch. What do you think?

@Erik, I would love to hear your thoughts on this.

Thank you!
Weidong

Quoted 70 lines
Quoted 70 lines

-----Original Message-----
From: Kaneda, Erik <[email protected]>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <[email protected]>; Moore, Robert <[email protected]>; Wysocki, Rafael J <[email protected]>
Cc: Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 52 lines

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>
Cc: Weidong Cui <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -1
@@ -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.24.3 (Apple Git-128)

#10 lore raw
In reply to Moore, Robert

After giving this some thought, I think we can #define ACPI_PCI_CONFIGURED in the global configuration file (I think it is acconfig.h) - and document why and when it should be removed. Bob

-----Original Message-----
From: Moore, Robert <robert.moore(a)intel.com>
Sent: Thursday, March 04, 2021 9:37 AM
To: weidongcui(a)gmail.com
Cc: Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org
Subject: [Devel] Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

-----Original Message-----
From: Weidong Cui <weidongcui(a)gmail.com>
Sent: Thursday, March 04, 2021 9:06 AM
To: Moore, Robert <robert.moore(a)intel.com>
Cc: Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; Len Brown <lenb(a)kernel.org>
Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Quoted 7 lines

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

Thank you for the comments, Erik and Bob!

ACPI_PCI_CONFIGURED is defined in aclinux.h (see below) and used in several places in evhandler.c and exregion.c.
I'm not sure why we want to introduce ACPI_PCI_NOT_CONFIGURED. Bob, I don't understand your concerns about "have to be defined by each current host". Can you please shed some light on it?

It is required in aclinux.h, and thus it is required in every host-dependent configuration file (acfreebsd.h, acmacosx.h, acnetbsd.h, achaiku.h, etc.) I would rather not force these host-specific header files to change. Bob

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 65 lines

-----Original Message-----
From: Kaneda, Erik <erik.kaneda(a)intel.com>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <weidongcui(a)gmail.com>; Moore, Robert <robert.moore(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>
Cc: Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; Len Brown <lenb(a)kernel.org>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 48 lines

-----Original Message-----
From: Weidong Cui <weidongcui(a)gmail.com>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <robert.moore(a)intel.com>; Kaneda, Erik <erik.kaneda(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Len Brown <lenb(a)kernel.org>
Cc: Weidong Cui <weidongcui(a)gmail.com>; Xinyang Ge <aegiryy(a)gmail.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux- kernel(a)vger.kernel.org
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Signed-off-by Weidong Cui <weidongcui(a)gmail.com>
Signed-off-by Xinyang Ge <aegiryy(a)gmail.com>
---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -0
@@ -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
 
Quoted 5 lines
Quoted 4 lines
include/acpi/acconfig.h +0 -1
 /* Array sizes.  Used for range checking also */
 
--

2.24.3 (Apple Git-128)

_______________________________________________
Devel mailing list -- devel(a)acpica.org
To unsubscribe send an email to devel-leave(a)acpica.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#11 lore raw
Quoted 3 lines · Robert

After giving this some thought, I think we can #define ACPI_PCI_CONFIGURED in the global configuration file (I think it is acconfig.h) - and document why and when it should be removed. Bob

Hi Bob,

Thank you very much for your new suggestion! Let me make sure I understand it.

1. We should move the following define from aclinux.h to acconfig.h.

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

2. We should add a comment there to "document why and when it should be removed".
I don't really know "why and when" since I'm not an expert on ACPI (we were just trying
to fix a bug :-)).

Thanks!
Weidong

Quoted 110 lines

-----Original Message-----
From: Moore, Robert <[email protected]>
Sent: Thursday, March 04, 2021 9:37 AM
To: [email protected]
Cc: Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [Devel] Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Thursday, March 04, 2021 9:06 AM
To: Moore, Robert <[email protected]>
Cc: Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Quoted 7 lines

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

Thank you for the comments, Erik and Bob!

ACPI_PCI_CONFIGURED is defined in aclinux.h (see below) and used in several places in evhandler.c and exregion.c.
I'm not sure why we want to introduce ACPI_PCI_NOT_CONFIGURED. Bob, I don't understand your concerns about "have to be defined by each current host". Can you please shed some light on it?

It is required in aclinux.h, and thus it is required in every host-dependent configuration file (acfreebsd.h, acmacosx.h, acnetbsd.h, achaiku.h, etc.) I would rather not force these host-specific header files to change. Bob

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 65 lines

-----Original Message-----
From: Kaneda, Erik <[email protected]>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <[email protected]>; Moore, Robert <[email protected]>; Wysocki, Rafael J <[email protected]>
Cc: Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 48 lines

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>
Cc: Weidong Cui <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -0
@@ -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
 
Quoted 5 lines
Quoted 4 lines
include/acpi/acconfig.h +0 -1
 /* Array sizes.  Used for range checking also */
 
--

2.24.3 (Apple Git-128)

_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#12 lore raw

Hi Bob and Erik,

Quoted 10 lines

Hi Bob,

Thank you very much for your new suggestion! Let me make sure I understand it.

1. We should move the following define from aclinux.h to acconfig.h.

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 8 lines

2. We should add a comment there to "document why and when it should be removed".
I don't really know "why and when" since I'm not an expert on ACPI (we were just trying
to fix a bug :-)).

Thanks!
Weidong

Hi Bob and Erik,

I would like to ping you about my two questions above. Can you please advise on how I should proceed?

Thanks!
Weidong

Quoted 111 lines
Quoted 111 lines

-----Original Message-----
From: Moore, Robert <[email protected]>
Sent: Thursday, March 04, 2021 9:37 AM
To: [email protected]
Cc: Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [Devel] Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Thursday, March 04, 2021 9:06 AM
To: Moore, Robert <[email protected]>
Cc: Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

Quoted 7 lines

Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:

Quoted 1 line

+#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

Quoted 1 line

+#ifdef ACPI_PCI_NOT_CONFIGURED

Thank you for the comments, Erik and Bob!

ACPI_PCI_CONFIGURED is defined in aclinux.h (see below) and used in several places in evhandler.c and exregion.c.
I'm not sure why we want to introduce ACPI_PCI_NOT_CONFIGURED. Bob, I don't understand your concerns about "have to be defined by each current host". Can you please shed some light on it?

It is required in aclinux.h, and thus it is required in every host-dependent configuration file (acfreebsd.h, acmacosx.h, acnetbsd.h, achaiku.h, etc.) I would rather not force these host-specific header files to change. Bob

#ifdef CONFIG_PCI
#define ACPI_PCI_CONFIGURED
#endif

Quoted 65 lines

-----Original Message-----
From: Kaneda, Erik <[email protected]>
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <[email protected]>; Moore, Robert <[email protected]>; Wysocki, Rafael J <[email protected]>
Cc: Xinyang Ge <[email protected]>; [email protected]; [email protected]; [email protected]; Len Brown <[email protected]>
Subject: RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

This looks good to me. Bob, do you have any comments?

Erik

Quoted 48 lines

-----Original Message-----
From: Weidong Cui <[email protected]>
Sent: Monday, February 8, 2021 7:18 PM
To: Moore, Robert <[email protected]>; Kaneda, Erik <[email protected]>; Wysocki, Rafael J <[email protected]>; Len Brown <[email protected]>
Cc: Weidong Cui <[email protected]>; Xinyang Ge <[email protected]>; [email protected]; [email protected]; linux- [email protected]
Subject: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined

---
 drivers/acpi/acpica/evhandler.c | 2 ++
 include/acpi/acconfig.h         | 4 ++++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/acpi/acpica/evhandler.c index 5884eba04..4c25ad433 100644

drivers/acpi/acpica/evhandler.c +2 -0
@@ -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
 };
 
include/acpi/acconfig.h index renamed from include/acpi/acconfig.h +0 -0

a225eff49..790999028 100644

include/acpi/acconfig.h +4 -0
@@ -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
 
Quoted 5 lines
Quoted 4 lines
include/acpi/acconfig.h +0 -1
 /* Array sizes.  Used for range checking also */
 
--

2.24.3 (Apple Git-128)

_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s