Re: [Devel] [PATCH v8 3/4] PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set
by Rafael J. Wysocki
On Fri, Dec 14, 2018 at 4:13 AM Sinan Kaya <okaya(a)kernel.org> wrote:
>
> We are compiling PCI code today for systems with ACPI and no PCI
> device present. Remove the useless code and reduce the tight
> dependency.
>
> Signed-off-by: Sinan Kaya <okaya(a)kernel.org>
Bjorn, any objections here?
> ---
> arch/x86/include/asm/pci_x86.h | 7 +++++++
> drivers/acpi/Kconfig | 1 -
> drivers/acpi/Makefile | 2 +-
> drivers/acpi/internal.h | 5 +++++
> drivers/pci/Makefile | 2 +-
> include/acpi/acpi_drivers.h | 7 +++++++
> include/linux/acpi.h | 7 +++++++
> include/linux/pci.h | 4 ++++
> 8 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
> index 959d618dbb17..73bb404f4d2a 100644
> --- a/arch/x86/include/asm/pci_x86.h
> +++ b/arch/x86/include/asm/pci_x86.h
> @@ -121,7 +121,14 @@ extern void __init dmi_check_pciprobe(void);
> extern void __init dmi_check_skip_isa_align(void);
>
> /* some common used subsys_initcalls */
> +#ifdef CONFIG_PCI
> extern int __init pci_acpi_init(void);
> +#else
> +static inline int __init pci_acpi_init(void)
> +{
> + return -EINVAL;
> +}
> +#endif
> extern void __init pcibios_irq_init(void);
> extern int __init pcibios_init(void);
> extern int pci_legacy_init(void);
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 7cea769c37df..a0abcb3bd673 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -9,7 +9,6 @@ config ARCH_SUPPORTS_ACPI
> menuconfig ACPI
> bool "ACPI (Advanced Configuration and Power Interface) Support"
> depends on ARCH_SUPPORTS_ACPI
> - depends on PCI
> select PNP
> default y if X86
> help
> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> index edc039313cd6..7c6afc111d76 100644
> --- a/drivers/acpi/Makefile
> +++ b/drivers/acpi/Makefile
> @@ -39,7 +39,7 @@ acpi-y += processor_core.o
> acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o
> acpi-y += ec.o
> acpi-$(CONFIG_ACPI_DOCK) += dock.o
> -acpi-y += pci_root.o pci_link.o pci_irq.o
> +acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o
> obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o
> acpi-y += acpi_lpss.o acpi_apd.o
> acpi-y += acpi_platform.o
> diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
> index 530a3f675490..b7060dae2789 100644
> --- a/drivers/acpi/internal.h
> +++ b/drivers/acpi/internal.h
> @@ -25,8 +25,13 @@ int acpi_osi_init(void);
> acpi_status acpi_os_initialize1(void);
> void init_acpi_device_notify(void);
> int acpi_scan_init(void);
> +#ifdef CONFIG_PCI
> void acpi_pci_root_init(void);
> void acpi_pci_link_init(void);
> +#else
> +static inline void acpi_pci_root_init(void) {}
> +static inline void acpi_pci_link_init(void) {}
> +#endif
> void acpi_processor_init(void);
> void acpi_platform_init(void);
> void acpi_pnp_init(void);
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index f2bda77a2df1..657d642fcc67 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -11,6 +11,7 @@ ifdef CONFIG_PCI
> obj-$(CONFIG_PROC_FS) += proc.o
> obj-$(CONFIG_SYSFS) += slot.o
> obj-$(CONFIG_OF) += of.o
> +obj-$(CONFIG_ACPI) += pci-acpi.o
> endif
>
> obj-$(CONFIG_PCI_QUIRKS) += quirks.o
> @@ -20,7 +21,6 @@ obj-$(CONFIG_PCI_MSI) += msi.o
> obj-$(CONFIG_PCI_ATS) += ats.o
> obj-$(CONFIG_PCI_IOV) += iov.o
> obj-$(CONFIG_PCI_BRIDGE_EMUL) += pci-bridge-emul.o
> -obj-$(CONFIG_ACPI) += pci-acpi.o
> obj-$(CONFIG_PCI_LABEL) += pci-label.o
> obj-$(CONFIG_X86_INTEL_MID) += pci-mid.o
> obj-$(CONFIG_PCI_SYSCALL) += syscall.o
> diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
> index 14499757338f..de1804aeaf69 100644
> --- a/include/acpi/acpi_drivers.h
> +++ b/include/acpi/acpi_drivers.h
> @@ -88,7 +88,14 @@ int acpi_pci_link_free_irq(acpi_handle handle);
>
> struct pci_bus;
>
> +#ifdef CONFIG_PCI
> struct pci_dev *acpi_get_pci_dev(acpi_handle);
> +#else
> +static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
> +{
> + return NULL;
> +}
> +#endif
>
> /* Arch-defined function to add a bus to the system */
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index ed80f147bd50..eb1fdf4c196a 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -340,7 +340,14 @@ struct pci_dev;
> int acpi_pci_irq_enable (struct pci_dev *dev);
> void acpi_penalize_isa_irq(int irq, int active);
> bool acpi_isa_irq_available(int irq);
> +#ifdef CONFIG_PCI
> void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
> +#else
> +static inline void acpi_penalize_sci_irq(int irq, int trigger,
> + int polarity)
> +{
> +}
> +#endif
> void acpi_pci_irq_disable (struct pci_dev *dev);
>
> extern int ec_read(u8 addr, u8 *val);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 11c71c4ecf75..51a5a5217667 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1960,7 +1960,11 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
> enum pcie_reset_state state);
> int pcibios_add_device(struct pci_dev *dev);
> void pcibios_release_device(struct pci_dev *dev);
> +#ifdef CONFIG_PCI
> void pcibios_penalize_isa_irq(int irq, int active);
> +#else
> +static inline void pcibios_penalize_isa_irq(int irq, int active) {}
> +#endif
> int pcibios_alloc_irq(struct pci_dev *dev);
> void pcibios_free_irq(struct pci_dev *dev);
> resource_size_t pcibios_default_alignment(void);
> --
> 2.19.0
>
2 years, 2 months
ACPICA version 2018123 released
by Moore, Robert
13 December 2018. Summary of changes for version 20181213:
This release is available at https://acpica.org/downloads
1) ACPICA Kernel-resident Subsystem:
Fixed some buffer length issues with the GenericSerialBus, related to two of the bidirectional protocols: AttribRawProcessBytes and AttribRawBytes, which are rarely seen in the field. For these, the LEN field of the ASL buffer is now ignored. Hans de Goede
Implemented a new object evaluation trace mechanism for control methods and data objects. This includes nested control methods. It is particularly useful for examining the ACPI execution during system initialization since the output is relatively terse. The flag below enables the output of the trace via the ACPI_DEBUG_PRINT_RAW interface:
#define ACPI_LV_EVALUATION 0x00080000
Examples:
Enter evaluation : _SB.PCI0._INI (Method)
Exit evaluation : _SB.PCI0._INI
Enter evaluation : _OSI (Method)
Exit evaluation : _OSI
Enter evaluation : _SB.PCI0.TEST (Method)
Nested method call : _SB.PCI0.NST1
Exit nested method : _SB.PCI0.NST1
Exit evaluation : _SB.PCI0.TEST
Added two recently-defined _OSI strings. See https://docs.microsoft.com/en-us/windows-hardware/drivers/acpi/winacpi-osi.
"Windows 2018"
"Windows 2018.2"
Update for buffer-to-string conversions via the ToHexString ASL operator. A "0x" is now prepended to each of the hex values in the output string. This provides compatibility with other ACPI implementations. The ACPI specification is somewhat vague on this issue.
Example output string after conversion: "0x01,0x02,0x03,0x04,0x05,0x06"
Return a run-time error for TermArg expressions within individual package elements. Although this is technically supported by the ASL grammar, other ACPI implementations do not support this either. Also, this fixes a fault if this type of construct is ever encountered (it never has been).
2) iASL Compiler/Disassembler and Tools:
iASL: Implemented a new compile option (-ww) that will promote individual warnings and remarks to errors. This is intended to enhance the firmware build process.
AcpiExec: Implemented a new command-line option (-eo) to support the new object evaluation trace mechanism described above.
Disassembler: Added support to disassemble OEMx tables as AML/ASL tables instead of a "unknown table" message.
AcpiHelp: Improved support for the "special" predefined names such as _Lxx, _Exx, _EJx, _T_x, etc. For these, any legal hex value can now be used for "xx" and "x".
2 years, 2 months
Re: [Devel] [PATCH v6 5/5] ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset
by Rafael J. Wysocki
On Wed, Dec 12, 2018 at 8:34 PM Sinan Kaya <okaya(a)kernel.org> wrote:
>
> On 12/12/2018 2:02 PM, Schmauss, Erik wrote:
> >> ++ b/drivers/acpi/acpica/achware.h
> >> @@ -109,8 +109,17 @@ acpi_hw_enable_runtime_gpe_block(struct
> >> acpi_gpe_xrupt_info *gpe_xrupt_info,
> > CONFIG_PCI is a Linux-ism. We should stay with the OS-independent nature of
> > ACPICA. Please use ACPI_PCI_CONFIGURED and put it above the comment like so:
> >
> > #ifdef ACPI_PCI_CONFIGURED
>
> Thanks for the feedback. My search for ACPI_PCI_CONFIGURED returned nothing.
>
> git grep ACPI_PCI_CONFIGURED
>
> @Rafael,
>
> How do you want to handle this?
I think what Eric suggested is effectively to introduce a new ACPICA
symbol. Erik?
2 years, 2 months
Re: [Devel] [PATCH v6 5/5] ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset
by Schmauss, Erik
> -----Original Message-----
> From: Sinan Kaya [mailto:okaya@kernel.org]
> Sent: Wednesday, December 12, 2018 9:20 AM
> To: linux-acpi(a)vger.kernel.org
> Cc: Sinan Kaya <okaya(a)kernel.org>; Moore, Robert
> <robert.moore(a)intel.com>; Schmauss, Erik <erik.schmauss(a)intel.com>;
> Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Len Brown
> <lenb(a)kernel.org>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA)
> <devel(a)acpica.org>; open list <linux-kernel(a)vger.kernel.org>
> Subject: [PATCH v6 5/5] ACPICA: Remove PCI bits from ACPICA when
> CONFIG_PCI is unset
>
> Now that we allow CONFIG_PCI to be unset, remove useless code from
> ACPICA too.
>
> Signed-off-by: Sinan Kaya <okaya(a)kernel.org>
> ---
> drivers/acpi/acpica/Makefile | 2 +-
> drivers/acpi/acpica/achware.h | 9 +++++++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index
> b14621da5413..59700433a96e 100644
> --- a/drivers/acpi/acpica/Makefile
> +++ b/drivers/acpi/acpica/Makefile
> @@ -77,13 +77,13 @@ acpi-y += \
> hwacpi.o \
> hwesleep.o \
> hwgpe.o \
> - hwpci.o \
> hwregs.o \
> hwsleep.o \
> hwvalid.o \
> hwxface.o \
> hwxfsleep.o
>
> +acpi-$(CONFIG_PCI) += hwpci.o
> acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
>
> acpi-y += \
> diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
> index 43ce67a9da1f..1c827184fe64 100644
> --- a/drivers/acpi/acpica/achware.h
> +++ b/drivers/acpi/acpica/achware.h
> @@ -109,8 +109,17 @@ acpi_hw_enable_runtime_gpe_block(struct
> acpi_gpe_xrupt_info *gpe_xrupt_info,
CONFIG_PCI is a Linux-ism. We should stay with the OS-independent nature of
ACPICA. Please use ACPI_PCI_CONFIGURED and put it above the comment like so:
#ifdef ACPI_PCI_CONFIGURED
> /*
> * hwpci - PCI configuration support
> */
> +#ifdef CONFIG_PCI
> acpi_status
> acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
> acpi_handle root_pci_device, acpi_handle pci_region);
> +#else
> +static inline acpi_status
> +acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle
> root_pci_device,
> + acpi_handle pci_region)
> +{
> + return AE_SUPPORT;
> +}
> +#endif
>
> #endif /* __ACHWARE_H__ */
> --
> 2.19.0
2 years, 2 months
Re: [Devel] [PATCH v5 5/5] ACPI / OSL: Remove PCI bits from ACPICA when CONFIG_PCI is unset
by Rafael J. Wysocki
On Wed, Dec 12, 2018 at 6:29 AM Sinan Kaya <okaya(a)kernel.org> wrote:
>
> Now that we allow CONFIG_PCI to be unset, remove useless code from ACPICA
> too.
>
> Signed-off-by: Sinan Kaya <okaya(a)kernel.org>
> ---
> drivers/acpi/acpica/Makefile | 2 +-
> drivers/acpi/osl.c | 9 +++++++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
> index b14621da5413..59700433a96e 100644
> --- a/drivers/acpi/acpica/Makefile
> +++ b/drivers/acpi/acpica/Makefile
> @@ -77,13 +77,13 @@ acpi-y += \
> hwacpi.o \
> hwesleep.o \
> hwgpe.o \
> - hwpci.o \
> hwregs.o \
> hwsleep.o \
> hwvalid.o \
> hwxface.o \
> hwxfsleep.o
>
> +acpi-$(CONFIG_PCI) += hwpci.o
> acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
>
> acpi-y += \
> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> index 7b1e58f93f37..8b8eb17df3f2 100644
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -1837,3 +1837,12 @@ acpi_status acpi_os_enter_sleep(u8 sleep_state,
> reg_a_value, reg_b_value);
> return status;
> }
> +
> +#ifndef CONFIG_PCI
> +acpi_status acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
> + acpi_handle root_pci_device, acpi_handle pci_region)
> +{
> + return AE_SUPPORT;
> +}
> +#endif
> +
> --
I would prefer the header to be modified instead. Yes, it is an
ACPICA header, but then the change would complement the Makefile one
in a rather straightforward way.
2 years, 2 months
Re: [Devel] [PATCH v2 3/3] PCI/ACPI: allow ACPI to be built without PCI support
by Andy Shevchenko
On Sat, Dec 8, 2018 at 11:46 PM Sinan Kaya <okaya(a)kernel.org> wrote:
>
> We are compiling PCI code today for systems with ACPI and no PCI
> device present. Remove the useless code and reduce the tight
> dependency.
> +#ifdef CONFIG_PCI
> struct pci_dev *acpi_get_pci_dev(acpi_handle);
> +#else
> +static inline struct pci_dev *acpi_get_pci_dev(acpi_handle hndl)
Can you spell handle fully?
> +{
> + return NULL;
> +}
> +#endif
--
With Best Regards,
Andy Shevchenko
2 years, 2 months