* [PATCH v3 1/3] ACPI: Allow PCI to be disabled for reboot @ 2018-12-10 18:13 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi; +Cc: Sinan Kaya, Rafael J. Wysocki, Len Brown, open list Make PCI reboot conditional on PCI support being present on the kernel configuration. Signed-off-by: Sinan Kaya <okaya@kernel.org> --- drivers/acpi/reboot.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c index 6fa9c2a4cfe9..9aa367f098a6 100644 --- a/drivers/acpi/reboot.c +++ b/drivers/acpi/reboot.c @@ -7,8 +7,6 @@ void acpi_reboot(void) { struct acpi_generic_address *rr; - struct pci_bus *bus0; - unsigned int devfn; u8 reset_value; if (acpi_disabled) @@ -33,6 +31,11 @@ void acpi_reboot(void) * on a device on bus 0. */ switch (rr->space_id) { case ACPI_ADR_SPACE_PCI_CONFIG: + { +#ifdef CONFIG_PCI + unsigned int devfn; + struct pci_bus *bus0; + /* The reset register can only live on bus 0. */ bus0 = pci_find_bus(0, 0); if (!bus0) @@ -45,7 +48,10 @@ void acpi_reboot(void) pci_bus_write_config_byte(bus0, devfn, (rr->address & 0xffff), reset_value); break; - +#else + return; +#endif + } case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_IO: printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n"); -- 2.19.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 1/3] ACPI: Allow PCI to be disabled for reboot @ 2018-12-10 18:13 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi; +Cc: Sinan Kaya, Rafael J. Wysocki, Len Brown, open list Make PCI reboot conditional on PCI support being present on the kernel configuration. Signed-off-by: Sinan Kaya <okaya@kernel.org> --- drivers/acpi/reboot.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c index 6fa9c2a4cfe9..9aa367f098a6 100644 --- a/drivers/acpi/reboot.c +++ b/drivers/acpi/reboot.c @@ -7,8 +7,6 @@ void acpi_reboot(void) { struct acpi_generic_address *rr; - struct pci_bus *bus0; - unsigned int devfn; u8 reset_value; if (acpi_disabled) @@ -33,6 +31,11 @@ void acpi_reboot(void) * on a device on bus 0. */ switch (rr->space_id) { case ACPI_ADR_SPACE_PCI_CONFIG: + { +#ifdef CONFIG_PCI + unsigned int devfn; + struct pci_bus *bus0; + /* The reset register can only live on bus 0. */ bus0 = pci_find_bus(0, 0); if (!bus0) @@ -45,7 +48,10 @@ void acpi_reboot(void) pci_bus_write_config_byte(bus0, devfn, (rr->address & 0xffff), reset_value); break; - +#else + return; +#endif + } case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_IO: printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n"); -- 2.19.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-10 18:13 ` Sinan Kaya @ 2018-12-10 18:13 ` Sinan Kaya -1 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi; +Cc: Sinan Kaya, Rafael J. Wysocki, Len Brown, open list Getting ready to allow PCI to be disabled with ACPI enabled. Stub out calls that depend on PCI. Signed-off-by: Sinan Kaya <okaya@kernel.org> --- drivers/acpi/osl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index b48874b8e1ea..0d3ed659cfe8 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -773,6 +773,7 @@ acpi_status acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 *value, u32 width) { +#ifdef CONFIG_PCI int result, size; u32 value32; @@ -799,12 +800,16 @@ acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, *value = value32; return (result ? AE_ERROR : AE_OK); +#else + return AE_SUPPORT; +#endif } acpi_status acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 value, u32 width) { +#ifdef CONFIG_PCI int result, size; switch (width) { @@ -826,6 +831,9 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, reg, size, value); return (result ? AE_ERROR : AE_OK); +#else + return AE_SUPPORT; +#endif } static void acpi_os_execute_deferred(struct work_struct *work) -- 2.19.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled @ 2018-12-10 18:13 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi; +Cc: Sinan Kaya, Rafael J. Wysocki, Len Brown, open list Getting ready to allow PCI to be disabled with ACPI enabled. Stub out calls that depend on PCI. Signed-off-by: Sinan Kaya <okaya@kernel.org> --- drivers/acpi/osl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index b48874b8e1ea..0d3ed659cfe8 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -773,6 +773,7 @@ acpi_status acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 *value, u32 width) { +#ifdef CONFIG_PCI int result, size; u32 value32; @@ -799,12 +800,16 @@ acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, *value = value32; return (result ? AE_ERROR : AE_OK); +#else + return AE_SUPPORT; +#endif } acpi_status acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, u64 value, u32 width) { +#ifdef CONFIG_PCI int result, size; switch (width) { @@ -826,6 +831,9 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, reg, size, value); return (result ? AE_ERROR : AE_OK); +#else + return AE_SUPPORT; +#endif } static void acpi_os_execute_deferred(struct work_struct *work) -- 2.19.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-10 18:13 ` Sinan Kaya (?) @ 2018-12-11 10:07 ` Rafael J. Wysocki 2018-12-11 16:52 ` Sinan Kaya -1 siblings, 1 reply; 16+ messages in thread From: Rafael J. Wysocki @ 2018-12-11 10:07 UTC (permalink / raw) To: okaya Cc: ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On Mon, Dec 10, 2018 at 7:13 PM Sinan Kaya <okaya@kernel.org> wrote: > > Getting ready to allow PCI to be disabled with ACPI enabled. Stub > out calls that depend on PCI. I would prefer the subject to say something like "Allow CONFIG_PCI to be unset" or "Allow PCI to be disabled in Kconfig". It is somewhat ambiguous otherwise and one has to look at the patch to see what it really is about. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 10:07 ` Rafael J. Wysocki @ 2018-12-11 16:52 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-11 16:52 UTC (permalink / raw) To: Rafael J. Wysocki Cc: ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On 12/11/2018 5:07 AM, Rafael J. Wysocki wrote: > On Mon, Dec 10, 2018 at 7:13 PM Sinan Kaya <okaya@kernel.org> wrote: >> >> Getting ready to allow PCI to be disabled with ACPI enabled. Stub >> out calls that depend on PCI. > > I would prefer the subject to say something like "Allow CONFIG_PCI to > be unset" or "Allow PCI to be disabled in Kconfig". > > It is somewhat ambiguous otherwise and one has to look at the patch to > see what it really is about. > Makes sense. I'll update. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-10 18:13 ` Sinan Kaya (?) (?) @ 2018-12-11 17:09 ` Christoph Hellwig 2018-12-11 17:37 ` Sinan Kaya -1 siblings, 1 reply; 16+ messages in thread From: Christoph Hellwig @ 2018-12-11 17:09 UTC (permalink / raw) To: Sinan Kaya; +Cc: linux-acpi, Rafael J. Wysocki, Len Brown, open list On Mon, Dec 10, 2018 at 06:13:14PM +0000, Sinan Kaya wrote: > Getting ready to allow PCI to be disabled with ACPI enabled. Stub > out calls that depend on PCI. I think you want to skip building at least all of hwpci.c if CONFIG_PCI is disabled. Or replace that whole stiking pile of crap with something resembling C code.. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 17:09 ` Christoph Hellwig @ 2018-12-11 17:37 ` Sinan Kaya 2018-12-11 21:46 ` Rafael J. Wysocki 0 siblings, 1 reply; 16+ messages in thread From: Sinan Kaya @ 2018-12-11 17:37 UTC (permalink / raw) To: Christoph Hellwig; +Cc: linux-acpi, Rafael J. Wysocki, Len Brown, open list On 12/11/2018 12:09 PM, Christoph Hellwig wrote: > On Mon, Dec 10, 2018 at 06:13:14PM +0000, Sinan Kaya wrote: >> Getting ready to allow PCI to be disabled with ACPI enabled. Stub >> out calls that depend on PCI. > > I think you want to skip building at least all of hwpci.c if CONFIG_PCI > is disabled. Or replace that whole stiking pile of crap with something > resembling C code.. > I can give it a try but I'm under the impression that we don't touch ACPICA code in general. Feel free to correct me. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 17:37 ` Sinan Kaya @ 2018-12-11 21:46 ` Rafael J. Wysocki 2018-12-11 21:57 ` Sinan Kaya 0 siblings, 1 reply; 16+ messages in thread From: Rafael J. Wysocki @ 2018-12-11 21:46 UTC (permalink / raw) To: okaya Cc: Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On Tue, Dec 11, 2018 at 6:37 PM Sinan Kaya <okaya@kernel.org> wrote: > > On 12/11/2018 12:09 PM, Christoph Hellwig wrote: > > On Mon, Dec 10, 2018 at 06:13:14PM +0000, Sinan Kaya wrote: > >> Getting ready to allow PCI to be disabled with ACPI enabled. Stub > >> out calls that depend on PCI. > > > > I think you want to skip building at least all of hwpci.c if CONFIG_PCI > > is disabled. Or replace that whole stiking pile of crap with something > > resembling C code.. > > > > I can give it a try but I'm under the impression that we don't touch > ACPICA code in general. > > Feel free to correct me. We don't as a rule, but depending on what the patch looks like, we might not follow the rule this time. I wonder though what we do if some AML wants to access PCI config space via an opregion in there. Have you thought about that? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 21:46 ` Rafael J. Wysocki @ 2018-12-11 21:57 ` Sinan Kaya 2018-12-11 22:16 ` Rafael J. Wysocki 0 siblings, 1 reply; 16+ messages in thread From: Sinan Kaya @ 2018-12-11 21:57 UTC (permalink / raw) To: Rafael J. Wysocki Cc: Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On 12/11/2018 4:46 PM, Rafael J. Wysocki wrote: > On Tue, Dec 11, 2018 at 6:37 PM Sinan Kaya <okaya@kernel.org> wrote: >> >> On 12/11/2018 12:09 PM, Christoph Hellwig wrote: >>> On Mon, Dec 10, 2018 at 06:13:14PM +0000, Sinan Kaya wrote: >>>> Getting ready to allow PCI to be disabled with ACPI enabled. Stub >>>> out calls that depend on PCI. >>> >>> I think you want to skip building at least all of hwpci.c if CONFIG_PCI >>> is disabled. Or replace that whole stiking pile of crap with something >>> resembling C code.. >>> >> >> I can give it a try but I'm under the impression that we don't touch >> ACPICA code in general. >> >> Feel free to correct me. > > We don't as a rule, but depending on what the patch looks like, we > might not follow the rule this time. > OK. Good to know. I'll take a stab at it. > I wonder though what we do if some AML wants to access PCI config > space via an opregion in there. Have you thought about that? > Return an error. AFAIK, ACPI spec says that AML code running on non-existing op-regions to be discarded last time I checked. I know Linux is noisy about these. I did boot QEMU without CONFIG_PCI. There was a bunch of ACPI errors reported during boot as expected but boot succeeded. There was no hard lockup/failure. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 21:57 ` Sinan Kaya @ 2018-12-11 22:16 ` Rafael J. Wysocki 2018-12-11 22:22 ` Sinan Kaya 0 siblings, 1 reply; 16+ messages in thread From: Rafael J. Wysocki @ 2018-12-11 22:16 UTC (permalink / raw) To: okaya Cc: Rafael J. Wysocki, Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On Tue, Dec 11, 2018 at 10:57 PM Sinan Kaya <okaya@kernel.org> wrote: > > On 12/11/2018 4:46 PM, Rafael J. Wysocki wrote: > > On Tue, Dec 11, 2018 at 6:37 PM Sinan Kaya <okaya@kernel.org> wrote: > >> > >> On 12/11/2018 12:09 PM, Christoph Hellwig wrote: > >>> On Mon, Dec 10, 2018 at 06:13:14PM +0000, Sinan Kaya wrote: > >>>> Getting ready to allow PCI to be disabled with ACPI enabled. Stub > >>>> out calls that depend on PCI. > >>> > >>> I think you want to skip building at least all of hwpci.c if CONFIG_PCI > >>> is disabled. Or replace that whole stiking pile of crap with something > >>> resembling C code.. > >>> > >> > >> I can give it a try but I'm under the impression that we don't touch > >> ACPICA code in general. > >> > >> Feel free to correct me. > > > > We don't as a rule, but depending on what the patch looks like, we > > might not follow the rule this time. > > > > OK. Good to know. I'll take a stab at it. > > > I wonder though what we do if some AML wants to access PCI config > > space via an opregion in there. Have you thought about that? > > > > Return an error. > > AFAIK, ACPI spec says that AML code running on non-existing op-regions to be > discarded last time I checked. I guess you mean "disregarded"? So the spec appears to expect the OS to silently ignore the failures in those cases, so why should an error be returned? > I know Linux is noisy about these. > > I did boot QEMU without CONFIG_PCI. There was a bunch of ACPI errors reported > during boot as expected but boot succeeded. There was no hard lockup/failure. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 22:16 ` Rafael J. Wysocki @ 2018-12-11 22:22 ` Sinan Kaya 2018-12-11 22:51 ` Rafael J. Wysocki 0 siblings, 1 reply; 16+ messages in thread From: Sinan Kaya @ 2018-12-11 22:22 UTC (permalink / raw) To: Rafael J. Wysocki Cc: Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On 12/11/2018 5:16 PM, Rafael J. Wysocki wrote: >> AFAIK, ACPI spec says that AML code running on non-existing op-regions to be >> discarded last time I checked. > I guess you mean "disregarded"? > I have seen Linux complain about reads/writes to non-existing I2C opregions before as a read/write failure for every single AML transaction. I was under the impression that we didn't care. > So the spec appears to expect the OS to silently ignore the failures > in those cases, so why should an error be returned? > I can certainly return success for this case when CONFIG_PCI is not present. >> I know Linux is noisy about these. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 22:22 ` Sinan Kaya @ 2018-12-11 22:51 ` Rafael J. Wysocki 2018-12-11 23:00 ` Sinan Kaya 0 siblings, 1 reply; 16+ messages in thread From: Rafael J. Wysocki @ 2018-12-11 22:51 UTC (permalink / raw) To: okaya Cc: Rafael J. Wysocki, Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On Tue, Dec 11, 2018 at 11:22 PM Sinan Kaya <okaya@kernel.org> wrote: > > On 12/11/2018 5:16 PM, Rafael J. Wysocki wrote: > >> AFAIK, ACPI spec says that AML code running on non-existing op-regions to be > >> discarded last time I checked. > > I guess you mean "disregarded"? > > > > I have seen Linux complain about reads/writes to non-existing I2C opregions > before as a read/write failure for every single AML transaction. I was under the > impression that we didn't care. > > > So the spec appears to expect the OS to silently ignore the failures > > in those cases, so why should an error be returned? > > > > I can certainly return success for this case when CONFIG_PCI is not present. > > >> I know Linux is noisy about these. Well, users running kernels with CONFIG_PCI unset on platforms expecting PCI support to be present in the OS may want to know that I suppose, so that would be a good reason to return an error, but perhaps just once rather than on every access (maybe unless debugging is enabled?). ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled 2018-12-11 22:51 ` Rafael J. Wysocki @ 2018-12-11 23:00 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-11 23:00 UTC (permalink / raw) To: Rafael J. Wysocki Cc: Christoph Hellwig, ACPI Devel Maling List, Rafael J. Wysocki, Len Brown, Linux Kernel Mailing List On 12/11/2018 5:51 PM, Rafael J. Wysocki wrote: > Well, users running kernels with CONFIG_PCI unset on platforms > expecting PCI support to be present in the OS may want to know that I > suppose, so that would be a good reason to return an error, but > perhaps just once rather than on every access (maybe unless debugging > is enabled?). Warning once would be a good trade-off. ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v3 3/3] PCI/ACPI: Allow ACPI to be built without PCI support 2018-12-10 18:13 ` Sinan Kaya @ 2018-12-10 18:13 ` Sinan Kaya -1 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi Cc: Sinan Kaya, Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin, maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT, Rafael J. Wysocki, Len Brown, Bjorn Helgaas, Robert Moore, Erik Schmauss, Christian König, Jan Kiszka, Christian König, Otavio Pontes, open list:X86 ARCHITECTURE 32-BIT AND 64-BIT, open list:PCI SUBSYSTEM 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@kernel.org> --- 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 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 3/3] PCI/ACPI: Allow ACPI to be built without PCI support @ 2018-12-10 18:13 ` Sinan Kaya 0 siblings, 0 replies; 16+ messages in thread From: Sinan Kaya @ 2018-12-10 18:13 UTC (permalink / raw) To: linux-acpi Cc: Sinan Kaya, Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Rafael J. Wysocki, Len Brown, Bjorn Helgaas, Robert Moore, Erik Schmauss, Christian König, Jan Kiszka, Christian König, Otavio Pontes, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT), open list:PCI SUBSYSTEM, open list:ACPI COMPONENT ARCHITECTURE (ACPICA) 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@kernel.org> --- 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 ^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2018-12-11 23:00 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-12-10 18:13 [PATCH v3 1/3] ACPI: Allow PCI to be disabled for reboot Sinan Kaya 2018-12-10 18:13 ` Sinan Kaya 2018-12-10 18:13 ` [PATCH v3 2/3] ACPI / OSL: Allow PCI to be disabled Sinan Kaya 2018-12-10 18:13 ` Sinan Kaya 2018-12-11 10:07 ` Rafael J. Wysocki 2018-12-11 16:52 ` Sinan Kaya 2018-12-11 17:09 ` Christoph Hellwig 2018-12-11 17:37 ` Sinan Kaya 2018-12-11 21:46 ` Rafael J. Wysocki 2018-12-11 21:57 ` Sinan Kaya 2018-12-11 22:16 ` Rafael J. Wysocki 2018-12-11 22:22 ` Sinan Kaya 2018-12-11 22:51 ` Rafael J. Wysocki 2018-12-11 23:00 ` Sinan Kaya 2018-12-10 18:13 ` [PATCH v3 3/3] PCI/ACPI: Allow ACPI to be built without PCI support Sinan Kaya 2018-12-10 18:13 ` Sinan Kaya
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.