linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
@ 2021-02-09  3:17 Weidong Cui
  2021-02-09 14:35 ` Rafael J. Wysocki
  2021-03-03 18:29 ` Kaneda, Erik
  0 siblings, 2 replies; 11+ messages in thread
From: Weidong Cui @ 2021-02-09  3:17 UTC (permalink / raw)
  To: Robert Moore, Erik Kaneda, Rafael J. Wysocki, Len Brown
  Cc: Weidong Cui, Xinyang Ge, linux-acpi, devel, linux-kernel

Signed-off-by: Weidong Cui <weidongcui@gmail.com>
Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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 a225eff49..790999028 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.24.3 (Apple Git-128)


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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-02-09  3:17 [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined Weidong Cui
@ 2021-02-09 14:35 ` Rafael J. Wysocki
       [not found]   ` <CADFYyO63S4xZHJh9Cw1NYa7W=D8h=ZtUG1qPeLxfQ88kvW7MRQ@mail.gmail.com>
  2021-03-03 18:29 ` Kaneda, Erik
  1 sibling, 1 reply; 11+ messages in thread
From: Rafael J. Wysocki @ 2021-02-09 14:35 UTC (permalink / raw)
  To: Weidong Cui
  Cc: Robert Moore, Erik Kaneda, Rafael J. Wysocki, Len Brown,
	Xinyang Ge, ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Linux Kernel Mailing List

On Tue, Feb 9, 2021 at 4:22 AM Weidong Cui <weidongcui@gmail.com> wrote:
>
> Signed-off-by: Weidong Cui <weidongcui@gmail.com>
> Signed-off-by: Xinyang Ge <aegiryy@gmail.com>

ACPICA material, left to Erik & Bob, 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 5884eba04..4c25ad433 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 a225eff49..790999028 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.24.3 (Apple Git-128)
>

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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
       [not found]     ` <MWHPR11MB159925DE73F89A71D5E67113F0859@MWHPR11MB1599.namprd11.prod.outlook.com>
@ 2021-03-01 15:10       ` Weidong Cui
  0 siblings, 0 replies; 11+ messages in thread
From: Weidong Cui @ 2021-03-01 15:10 UTC (permalink / raw)
  To: Kaneda, Erik
  Cc: Rafael J. Wysocki, Moore, Robert, Wysocki, Rafael J, Len Brown,
	Xinyang Ge, ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Linux Kernel Mailing List

> 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

>
> From: Weidong Cui <weidongcui@gmail.com>
> Sent: Wednesday, February 17, 2021 6:55 PM
> To: Rafael J. Wysocki <rafael@kernel.org>
> Cc: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>; Xinyang Ge <aegiryy@gmail.com>; ACPI Devel Maling List <linux-acpi@vger.kernel.org>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA) <devel@acpica.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
> 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 <rafael@kernel.org> wrote:
>
> On Tue, Feb 9, 2021 at 4:22 AM Weidong Cui <weidongcui@gmail.com> wrote:
> >
> > Signed-off-by: Weidong Cui <weidongcui@gmail.com>
> > Signed-off-by: Xinyang Ge <aegiryy@gmail.com>
>
> ACPICA material, left to Erik & Bob, 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 5884eba04..4c25ad433 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 a225eff49..790999028 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.24.3 (Apple Git-128)
> >

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

* RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-02-09  3:17 [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined Weidong Cui
  2021-02-09 14:35 ` Rafael J. Wysocki
@ 2021-03-03 18:29 ` Kaneda, Erik
  2021-03-04 16:56   ` Moore, Robert
  1 sibling, 1 reply; 11+ messages in thread
From: Kaneda, Erik @ 2021-03-03 18:29 UTC (permalink / raw)
  To: Weidong Cui, Moore, Robert, Wysocki, Rafael J
  Cc: Xinyang Ge, linux-acpi, devel, linux-kernel, Len Brown

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

Erik

> -----Original Message-----
> From: Weidong Cui <weidongcui@gmail.com>
> Sent: Monday, February 8, 2021 7:18 PM
> To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik
> <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>;
> Len Brown <lenb@kernel.org>
> Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge
> <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-
> kernel@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@gmail.com>
> Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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 a225eff49..790999028 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.24.3 (Apple Git-128)


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

* RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-03 18:29 ` Kaneda, Erik
@ 2021-03-04 16:56   ` Moore, Robert
  2021-03-04 17:06     ` Weidong Cui
  0 siblings, 1 reply; 11+ messages in thread
From: Moore, Robert @ 2021-03-04 16:56 UTC (permalink / raw)
  To: Kaneda, Erik, Weidong Cui, Wysocki, Rafael J
  Cc: Xinyang Ge, linux-acpi, devel, linux-kernel, Len Brown

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

> +#ifdef ACPI_PCI_CONFIGURED

I would rather the logic be reversed:

> +#ifdef ACPI_PCI_NOT_CONFIGURED

-----Original Message-----
From: Kaneda, Erik <erik.kaneda@intel.com> 
Sent: Wednesday, March 03, 2021 10:29 AM
To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert <robert.moore@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>
Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown <lenb@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

> -----Original Message-----
> From: Weidong Cui <weidongcui@gmail.com>
> Sent: Monday, February 8, 2021 7:18 PM
> To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik 
> <erik.kaneda@intel.com>; Wysocki, Rafael J 
> <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge 
> <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; 
> linux- kernel@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@gmail.com>
> Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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 
> a225eff49..790999028 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.24.3 (Apple Git-128)


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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-04 16:56   ` Moore, Robert
@ 2021-03-04 17:06     ` Weidong Cui
  2021-03-04 17:36       ` Moore, Robert
  0 siblings, 1 reply; 11+ messages in thread
From: Weidong Cui @ 2021-03-04 17:06 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel, Len Brown

> Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:
>
> > +#ifdef ACPI_PCI_CONFIGURED
>
> I would rather the logic be reversed:
>
> > +#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

> -----Original Message-----
> From: Kaneda, Erik <erik.kaneda@intel.com>
> Sent: Wednesday, March 03, 2021 10:29 AM
> To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert <robert.moore@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>
> Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown <lenb@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
>
> > -----Original Message-----
> > From: Weidong Cui <weidongcui@gmail.com>
> > Sent: Monday, February 8, 2021 7:18 PM
> > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik
> > <erik.kaneda@intel.com>; Wysocki, Rafael J
> > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge
> > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > linux- kernel@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@gmail.com>
> > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > a225eff49..790999028 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.24.3 (Apple Git-128)
>

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

* RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-04 17:06     ` Weidong Cui
@ 2021-03-04 17:36       ` Moore, Robert
  2021-03-05 14:48         ` Weidong Cui
  2021-03-05 20:46         ` Moore, Robert
  0 siblings, 2 replies; 11+ messages in thread
From: Moore, Robert @ 2021-03-04 17:36 UTC (permalink / raw)
  To: weidongcui
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel, Len Brown



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

> Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:
>
> > +#ifdef ACPI_PCI_CONFIGURED
>
> I would rather the logic be reversed:
>
> > +#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

> -----Original Message-----
> From: Kaneda, Erik <erik.kaneda@intel.com>
> Sent: Wednesday, March 03, 2021 10:29 AM
> To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert 
> <robert.moore@intel.com>; Wysocki, Rafael J 
> <rafael.j.wysocki@intel.com>
> Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; 
> devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown 
> <lenb@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
>
> > -----Original Message-----
> > From: Weidong Cui <weidongcui@gmail.com>
> > Sent: Monday, February 8, 2021 7:18 PM
> > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik 
> > <erik.kaneda@intel.com>; Wysocki, Rafael J 
> > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge 
> > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > linux- kernel@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@gmail.com>
> > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > a225eff49..790999028 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.24.3 (Apple Git-128)
>

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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-04 17:36       ` Moore, Robert
@ 2021-03-05 14:48         ` Weidong Cui
  2021-03-05 20:46         ` Moore, Robert
  1 sibling, 0 replies; 11+ messages in thread
From: Weidong Cui @ 2021-03-05 14:48 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel, Len Brown

On Thu, Mar 4, 2021 at 9:37 AM Moore, Robert <robert.moore@intel.com> wrote:

> 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

> > -----Original Message-----
> > From: Kaneda, Erik <erik.kaneda@intel.com>
> > Sent: Wednesday, March 03, 2021 10:29 AM
> > To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert
> > <robert.moore@intel.com>; Wysocki, Rafael J
> > <rafael.j.wysocki@intel.com>
> > Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org;
> > devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown
> > <lenb@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
> >
> > > -----Original Message-----
> > > From: Weidong Cui <weidongcui@gmail.com>
> > > Sent: Monday, February 8, 2021 7:18 PM
> > > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik
> > > <erik.kaneda@intel.com>; Wysocki, Rafael J
> > > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge
> > > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > > linux- kernel@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@gmail.com>
> > > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > > a225eff49..790999028 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.24.3 (Apple Git-128)
> >

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

* RE: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-04 17:36       ` Moore, Robert
  2021-03-05 14:48         ` Weidong Cui
@ 2021-03-05 20:46         ` Moore, Robert
  2021-03-05 20:55           ` Weidong Cui
  1 sibling, 1 reply; 11+ messages in thread
From: Moore, Robert @ 2021-03-05 20:46 UTC (permalink / raw)
  To: Moore, Robert, weidongcui
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel

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

> Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:
>
> > +#ifdef ACPI_PCI_CONFIGURED
>
> I would rather the logic be reversed:
>
> > +#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

> -----Original Message-----
> From: Kaneda, Erik <erik.kaneda@intel.com>
> Sent: Wednesday, March 03, 2021 10:29 AM
> To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert 
> <robert.moore@intel.com>; Wysocki, Rafael J 
> <rafael.j.wysocki@intel.com>
> Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; 
> devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown 
> <lenb@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
>
> > -----Original Message-----
> > From: Weidong Cui <weidongcui@gmail.com>
> > Sent: Monday, February 8, 2021 7:18 PM
> > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik 
> > <erik.kaneda@intel.com>; Wysocki, Rafael J 
> > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge 
> > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > linux- kernel@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@gmail.com>
> > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > a225eff49..790999028 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.24.3 (Apple Git-128)
>
_______________________________________________
Devel mailing list -- devel@acpica.org
To unsubscribe send an email to devel-leave@acpica.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-05 20:46         ` Moore, Robert
@ 2021-03-05 20:55           ` Weidong Cui
  2021-03-25  1:44             ` Weidong Cui
  0 siblings, 1 reply; 11+ messages in thread
From: Weidong Cui @ 2021-03-05 20:55 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel

On Fri, Mar 5, 2021 at 12:46 PM Moore, Robert <robert.moore@intel.com> wrote:
>
> 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

> -----Original Message-----
> From: Moore, Robert <robert.moore@intel.com>
> Sent: Thursday, March 04, 2021 9:37 AM
> To: weidongcui@gmail.com
> Cc: Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@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@gmail.com>
> Sent: Thursday, March 04, 2021 9:06 AM
> To: Moore, Robert <robert.moore@intel.com>
> Cc: Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown <lenb@kernel.org>
> Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
>
> > Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:
> >
> > > +#ifdef ACPI_PCI_CONFIGURED
> >
> > I would rather the logic be reversed:
> >
> > > +#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
>
> > -----Original Message-----
> > From: Kaneda, Erik <erik.kaneda@intel.com>
> > Sent: Wednesday, March 03, 2021 10:29 AM
> > To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert
> > <robert.moore@intel.com>; Wysocki, Rafael J
> > <rafael.j.wysocki@intel.com>
> > Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org;
> > devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown
> > <lenb@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
> >
> > > -----Original Message-----
> > > From: Weidong Cui <weidongcui@gmail.com>
> > > Sent: Monday, February 8, 2021 7:18 PM
> > > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik
> > > <erik.kaneda@intel.com>; Wysocki, Rafael J
> > > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge
> > > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > > linux- kernel@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@gmail.com>
> > > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > > a225eff49..790999028 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.24.3 (Apple Git-128)
> >
> _______________________________________________
> Devel mailing list -- devel@acpica.org
> To unsubscribe send an email to devel-leave@acpica.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

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

* Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
  2021-03-05 20:55           ` Weidong Cui
@ 2021-03-25  1:44             ` Weidong Cui
  0 siblings, 0 replies; 11+ messages in thread
From: Weidong Cui @ 2021-03-25  1:44 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Kaneda, Erik, Wysocki, Rafael J, Xinyang Ge, linux-acpi, devel,
	linux-kernel

Hi Bob and Erik,

> 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

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

>
> > -----Original Message-----
> > From: Moore, Robert <robert.moore@intel.com>
> > Sent: Thursday, March 04, 2021 9:37 AM
> > To: weidongcui@gmail.com
> > Cc: Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@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@gmail.com>
> > Sent: Thursday, March 04, 2021 9:06 AM
> > To: Moore, Robert <robert.moore@intel.com>
> > Cc: Kaneda, Erik <erik.kaneda@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown <lenb@kernel.org>
> > Subject: Re: [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined
> >
> > > Well, I don't like the fact that PCI_CONFIGURED would have to be defined by each current host:
> > >
> > > > +#ifdef ACPI_PCI_CONFIGURED
> > >
> > > I would rather the logic be reversed:
> > >
> > > > +#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
> >
> > > -----Original Message-----
> > > From: Kaneda, Erik <erik.kaneda@intel.com>
> > > Sent: Wednesday, March 03, 2021 10:29 AM
> > > To: Weidong Cui <weidongcui@gmail.com>; Moore, Robert
> > > <robert.moore@intel.com>; Wysocki, Rafael J
> > > <rafael.j.wysocki@intel.com>
> > > Cc: Xinyang Ge <aegiryy@gmail.com>; linux-acpi@vger.kernel.org;
> > > devel@acpica.org; linux-kernel@vger.kernel.org; Len Brown
> > > <lenb@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
> > >
> > > > -----Original Message-----
> > > > From: Weidong Cui <weidongcui@gmail.com>
> > > > Sent: Monday, February 8, 2021 7:18 PM
> > > > To: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik
> > > > <erik.kaneda@intel.com>; Wysocki, Rafael J
> > > > <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>
> > > > Cc: Weidong Cui <weidongcui@gmail.com>; Xinyang Ge
> > > > <aegiryy@gmail.com>; linux-acpi@vger.kernel.org; devel@acpica.org;
> > > > linux- kernel@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@gmail.com>
> > > > Signed-off-by: Xinyang Ge <aegiryy@gmail.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 5884eba04..4c25ad433 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
> > > > a225eff49..790999028 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.24.3 (Apple Git-128)
> > >
> > _______________________________________________
> > Devel mailing list -- devel@acpica.org
> > To unsubscribe send an email to devel-leave@acpica.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

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

end of thread, other threads:[~2021-03-25  1:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  3:17 [PATCH] Enable ACPI_ADR_SPACE_PCI_CONFIG in acpi_gbl_default_address_spaces only when ACPI_PCI_CONFIGURED is defined Weidong Cui
2021-02-09 14:35 ` Rafael J. Wysocki
     [not found]   ` <CADFYyO63S4xZHJh9Cw1NYa7W=D8h=ZtUG1qPeLxfQ88kvW7MRQ@mail.gmail.com>
     [not found]     ` <MWHPR11MB159925DE73F89A71D5E67113F0859@MWHPR11MB1599.namprd11.prod.outlook.com>
2021-03-01 15:10       ` Weidong Cui
2021-03-03 18:29 ` Kaneda, Erik
2021-03-04 16:56   ` Moore, Robert
2021-03-04 17:06     ` Weidong Cui
2021-03-04 17:36       ` Moore, Robert
2021-03-05 14:48         ` Weidong Cui
2021-03-05 20:46         ` Moore, Robert
2021-03-05 20:55           ` Weidong Cui
2021-03-25  1:44             ` Weidong Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).