From patchwork Fri Dec 14 16:33:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE62D6C5 for ; Fri, 14 Dec 2018 16:33:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72B9F2D064 for ; Fri, 14 Dec 2018 16:33:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 661D72D76D; Fri, 14 Dec 2018 16:33:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 116212D064 for ; Fri, 14 Dec 2018 16:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729672AbeLNQdW (ORCPT ); Fri, 14 Dec 2018 11:33:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:52570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeLNQdW (ORCPT ); Fri, 14 Dec 2018 11:33:22 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38ADE2070B; Fri, 14 Dec 2018 16:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805202; bh=p9qvVHV9nKGHqNLq+91oTrAC9ljetBkDKMlNDrEsRaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L21JEqC+IMz3A18ouQqhIfY4mJNBO1nDlAZPV8wcFKrOB6W9XNdNcaUYz1yGd36bt A+B3DG/n8wZxXb1pXalT5V/oQipfHbbuL+sDLni4UwIoZKBBA7NSHzsoxKvW4hb4pf NNIWvyQpYoJCTdrK8J1T1HY3OSb0z6VV66vhczpw= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , "Rafael J. Wysocki" , Len Brown , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 1/6] ACPI: Allow CONFIG_PCI to be unset for reboot Date: Fri, 14 Dec 2018 16:33:14 +0000 Message-Id: <20181214163319.27479-2-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make PCI reboot conditional on PCI support being present on the kernel configuration. Signed-off-by: Sinan Kaya --- drivers/acpi/reboot.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c index 6fa9c2a4cfe9..d75e637ee36a 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) @@ -44,8 +47,9 @@ void acpi_reboot(void) /* Write the value that resets us. */ pci_bus_write_config_byte(bus0, devfn, (rr->address & 0xffff), reset_value); +#endif break; - + } case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_IO: printk(KERN_DEBUG "ACPI MEMORY or I/O RESET_REG.\n"); From patchwork Fri Dec 14 16:33:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E33466C5 for ; Fri, 14 Dec 2018 16:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6806F28683 for ; Fri, 14 Dec 2018 16:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C3E2286DE; Fri, 14 Dec 2018 16:33:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07BCC28683 for ; Fri, 14 Dec 2018 16:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729619AbeLNQdY (ORCPT ); Fri, 14 Dec 2018 11:33:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:52590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbeLNQdX (ORCPT ); Fri, 14 Dec 2018 11:33:23 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DBD5206C2; Fri, 14 Dec 2018 16:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805203; bh=huE7+kw7prZWjnTByz2rTYX+7JxBV1By3zjE6tcZvOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=agUKoaGTcQWuS+T9PeKIBgitIfVNvYYV44o10nXUh8uLq/mue8n2VSc+8VQlUa2fG uxuTbpwr0KMcvKBOYtzuYU6Ka7nIgm2+EzqS3b0P/o5GwZKM1ixR4yCjpYZzhHnhF4 BldSWJKI+0ArleQBPyZ+ev2dvih+uoX4Jn2Zw5iY= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , "Rafael J. Wysocki" , Len Brown , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 2/6] ACPI / OSL: Stub out acpi_os_(read/write)_pci_configurations() Date: Fri, 14 Dec 2018 16:33:15 +0000 Message-Id: <20181214163319.27479-3-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Getting ready to allow CONFIG_PCI to be unset with ACPI enabled. Stub out acpi_os_read_pci_configuration and acpi_os_write_pci_configuration functions when CONFIG_PCI is not defined. Signed-off-by: Sinan Kaya --- drivers/acpi/osl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index b48874b8e1ea..524fd5f33ea4 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,19 @@ acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, *value = value32; return (result ? AE_ERROR : AE_OK); +#else + int rc; + + rc = pr_warn_once("PCI configuration space access is not supported\n"); + return rc ? AE_SUPPORT : AE_OK; +#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 +834,12 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, reg, size, value); return (result ? AE_ERROR : AE_OK); +#else + int rc; + + rc = pr_warn_once("PCI configuration space access is not supported\n"); + return rc ? AE_SUPPORT : AE_OK; +#endif } static void acpi_os_execute_deferred(struct work_struct *work) From patchwork Fri Dec 14 16:33:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC7FE6C5 for ; Fri, 14 Dec 2018 16:33:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BBB62D064 for ; Fri, 14 Dec 2018 16:33:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4842D75A; Fri, 14 Dec 2018 16:33:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 983F72D064 for ; Fri, 14 Dec 2018 16:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730042AbeLNQd3 (ORCPT ); Fri, 14 Dec 2018 11:33:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:52650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730036AbeLNQd2 (ORCPT ); Fri, 14 Dec 2018 11:33:28 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8436F206E0; Fri, 14 Dec 2018 16:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805208; bh=ROevhMeyWXDwNDM5BjziXs57IerK+hHEjBuLv1h13UE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TOMo/AjP0QLzXbB4lrgYMJbwagVKYmZnz3HM+CxqtDLVFL0wCMNZhkcEN5ZH4+Q5H 8fv6FFQPkCuTy7dfA/omNQ/0yA+O5n0YiDSauVE80CetfY7fWjDN1PK8XJabZB+DdA DycR1vKWTHgVZSUd4UVC3JyRH4uR5VdJ5tMJBm0c= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "Rafael J. Wysocki" , Len Brown , Bjorn Helgaas , Robert Moore , Erik Schmauss , Jan Kiszka , Andy Shevchenko , Otavio Pontes , " =?utf-8?q?Christian_K=C3=B6nig?= " , linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)), linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM), devel@acpica.org (open list:ACPI COMPONENT ARCHITECTURE (ACPICA)) Subject: [PATCH v9 3/6] PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set Date: Fri, 14 Dec 2018 16:33:16 +0000 Message-Id: <20181214163319.27479-4-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Bjorn Helgaas # PCI parts --- 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); From patchwork Fri Dec 14 16:33:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9941B14E5 for ; Fri, 14 Dec 2018 16:33:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D19828683 for ; Fri, 14 Dec 2018 16:33:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10F73286DE; Fri, 14 Dec 2018 16:33:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A98B128683 for ; Fri, 14 Dec 2018 16:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729465AbeLNQdn (ORCPT ); Fri, 14 Dec 2018 11:33:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:52716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730060AbeLNQda (ORCPT ); Fri, 14 Dec 2018 11:33:30 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0942206C2; Fri, 14 Dec 2018 16:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805210; bh=JSnqW4EVNCLR8clO+ZtGh9AaHwHlbjePrfHlvSYS+c0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cbFLoC31wyljnQlOL0hdIgQjejb6YbQeg9Fkcs1YB5Zo62MZrnHCS9/Zg7EvXbWBL frjrmEBKsm6I2cbbPKjanC5Ti6jMgcq9GTTCvTiBe/exits+ecrrWpuPyUxjd0/EDO +41AEt1F/sduB2dfDTodQWOr02tCYah1Olk7vpJY= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , Robert Moore , Erik Schmauss , "Rafael J. Wysocki" , Len Brown , Lv Zheng , Anuj Mittal , Sebastian Andrzej Siewior , devel@acpica.org (open list:ACPI COMPONENT ARCHITECTURE (ACPICA)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 4/6] ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset Date: Fri, 14 Dec 2018 16:33:17 +0000 Message-Id: <20181214163319.27479-5-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we allow CONFIG_PCI to be unset, remove useless code from ACPICA too. Signed-off-by: Sinan Kaya --- drivers/acpi/acpica/Makefile | 2 +- drivers/acpi/acpica/achware.h | 9 +++++++++ include/acpi/platform/aclinux.h | 4 ++++ 3 files changed, 14 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..ef99e2fc37f8 100644 --- a/drivers/acpi/acpica/achware.h +++ b/drivers/acpi/acpica/achware.h @@ -106,11 +106,20 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block, void *context); +#ifdef ACPI_PCI_CONFIGURED /* * hwpci - PCI configuration support */ 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__ */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 7451b3bca83a..e3d21d014fcc 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -33,6 +33,10 @@ /* Kernel specific ACPICA configuration */ +#ifdef CONFIG_PCI +#define ACPI_PCI_CONFIGURED +#endif + #ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY #define ACPI_REDUCED_HARDWARE 1 #endif From patchwork Fri Dec 14 16:33:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD98A14E5 for ; Fri, 14 Dec 2018 16:33:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62D4228683 for ; Fri, 14 Dec 2018 16:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56FDB286DE; Fri, 14 Dec 2018 16:33:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A1C928683 for ; Fri, 14 Dec 2018 16:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730092AbeLNQdb (ORCPT ); Fri, 14 Dec 2018 11:33:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:52738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbeLNQdb (ORCPT ); Fri, 14 Dec 2018 11:33:31 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0833A2070B; Fri, 14 Dec 2018 16:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805211; bh=1GRqsbYVwLz59qJD38TH6xczEZFBWO9wSJvd2hbyTvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uXPXU9NmFNixZ7FR3wxhx7WmO5nXHykKThWuy0d/xn3YSPPU3RfDuji1Fg8A66P32 M5eTuYkgETZIvCXTYZ+n+1busycQ/DU8D33zv6MoGlOao/T5ytTDYpfe8L8F8EpkZu ylVqLy6kistTAsuKLX8JzSkFdXCD5PGl3IkD4Y4g= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 5/6] arm64: select ACPI PCI code only both features are enabled Date: Fri, 14 Dec 2018 16:33:18 +0000 Message-Id: <20181214163319.27479-6-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPI and PCI are no longer coupled to each other. Specify requirements for both when pulling in code. Signed-off-by: Sinan Kaya --- arch/arm64/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ea2ab0330e3a..bcb6262044d8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -5,7 +5,7 @@ config ARM64 select ACPI_GTDT if ACPI select ACPI_IORT if ACPI select ACPI_REDUCED_HARDWARE_ONLY if ACPI - select ACPI_MCFG if ACPI + select ACPI_MCFG if (ACPI && PCI) select ACPI_SPCR_TABLE if ACPI select ACPI_PPTT if ACPI select ARCH_CLOCKSOURCE_DATA @@ -163,7 +163,7 @@ config ARM64 select OF select OF_EARLY_FLATTREE select OF_RESERVED_MEM - select PCI_ECAM if ACPI + select PCI_ECAM if (ACPI && PCI) select POWER_RESET select POWER_SUPPLY select REFCOUNT_FULL From patchwork Fri Dec 14 16:33:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10731411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 799F96C5 for ; Fri, 14 Dec 2018 16:33:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F148828683 for ; Fri, 14 Dec 2018 16:33:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E331F286DE; Fri, 14 Dec 2018 16:33:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C1AE28683 for ; Fri, 14 Dec 2018 16:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730168AbeLNQde (ORCPT ); Fri, 14 Dec 2018 11:33:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:52754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730145AbeLNQdc (ORCPT ); Fri, 14 Dec 2018 11:33:32 -0500 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [23.96.30.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFF702075B; Fri, 14 Dec 2018 16:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544805212; bh=Bs2xI0cuLFCzGAKEs9CWjrvwd+ItlwUs4IvLfjseGHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WXKPs1OJvnjBRCubA+PDaiFRJMeGL5vNJSgUQZNL3Pyy2xtnILby9JuggUX+aROA6 QsFF4jYYBhn4zCG7/blAL1OOdYRXCk+ePoZQpIa/Y7t06GlZflWT3mB572cJXZPzkn dyj94DdLha9JrUbBvsu+KT0My2cLaWP5Ft2g2sTU= From: Sinan Kaya To: linux-acpi@vger.kernel.org Cc: Sinan Kaya , Bjorn Helgaas , linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 6/6] PCI: Stub out pci_request_acs() when CONFIG_PCI is not set Date: Fri, 14 Dec 2018 16:33:19 +0000 Message-Id: <20181214163319.27479-7-okaya@kernel.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181214163319.27479-1-okaya@kernel.org> References: <20181214163319.27479-1-okaya@kernel.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPI IORT table code relies on pci_request_acs() to be present. Define a stub function when CONFI_PCI is not set. Signed-off-by: Sinan Kaya --- include/linux/pci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 51a5a5217667..f0f2f55ea93c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2101,7 +2101,11 @@ static inline struct pci_dev *pcie_find_root_port(struct pci_dev *dev) return NULL; } +#ifdef CONFIG_PCI void pci_request_acs(void); +#else +static inline void pci_request_acs(void) {} +#endif bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags); bool pci_acs_path_enabled(struct pci_dev *start, struct pci_dev *end, u16 acs_flags);