]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Revert "arm64: kernel: implement ACPI parking protocol"
authorPaolo Pisati <paolo.pisati@canonical.com>
Mon, 7 Mar 2016 14:49:53 +0000 (15:49 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Sep 2017 08:07:38 +0000 (10:07 +0200)
This reverts commit 72196fb6d7ab50bc99e6223fac76daaec0c1c18f.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/arm64/Kconfig
arch/arm64/include/asm/acpi.h
arch/arm64/include/asm/hardirq.h
arch/arm64/include/asm/smp.h
arch/arm64/kernel/Makefile
arch/arm64/kernel/acpi_parking_protocol.c [deleted file]
arch/arm64/kernel/cpu_ops.c
arch/arm64/kernel/smp.c

index cdf69715c5c84f1a81fc8ce60f4fb27c5571fe70..150df01c324688fbf34a18ac82d72659be7dab0f 100644 (file)
@@ -756,15 +756,6 @@ endmenu
 
 menu "Boot options"
 
-config ARM64_ACPI_PARKING_PROTOCOL
-       bool "Enable support for the ARM64 ACPI parking protocol"
-       depends on ACPI
-       help
-         Enable support for the ARM64 ACPI parking protocol. If disabled
-         the kernel will not allow booting through the ARM64 ACPI parking
-         protocol even if the corresponding data is present in the ACPI
-         MADT table.
-
 config CMDLINE
        string "Default kernel command string"
        default ""
index 0a11cd502dbc8ed4875913306a3cb7d167f5136f..40d1351e7573af51608e5b5007b864e72799bace 100644 (file)
@@ -87,26 +87,9 @@ void __init acpi_init_cpus(void);
 static inline void acpi_init_cpus(void) { }
 #endif /* CONFIG_ACPI */
 
-#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
-bool acpi_parking_protocol_valid(int cpu);
-void __init
-acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor);
-#else
-static inline bool acpi_parking_protocol_valid(int cpu) { return false; }
-static inline void
-acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor)
-{}
-#endif
-
 static inline const char *acpi_get_enable_method(int cpu)
 {
-       if (acpi_psci_present())
-               return "psci";
-
-       if (acpi_parking_protocol_valid(cpu))
-               return "parking-protocol";
-
-       return NULL;
+       return acpi_psci_present() ? "psci" : NULL;
 }
 
 #ifdef CONFIG_ACPI_APEI
index 8740297dac775dac5bac2bb9260fca62df7d0fb9..a57601f9d17cdffb1122e2864ae5353273eb59ee 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/threads.h>
 #include <asm/irq.h>
 
-#define NR_IPI 6
+#define NR_IPI 5
 
 typedef struct {
        unsigned int __softirq_pending;
index 2013a4dc5124a55c5c304306b41908f16a0e5d64..d9c3d6a6100ac5d68e9b412113daccd1e43d8371 100644 (file)
@@ -64,15 +64,6 @@ extern void secondary_entry(void);
 extern void arch_send_call_function_single_ipi(int cpu);
 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
 
-#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
-extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask);
-#else
-static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask)
-{
-       BUILD_BUG();
-}
-#endif
-
 extern int __cpu_disable(void);
 
 extern void __cpu_die(unsigned int cpu);
index c4e2f70c0aa0b7ba7521cd7e4dec05048c2f4b5e..474691f8b13ab893cf403b8c1737a91aeff87bc0 100644 (file)
@@ -41,7 +41,6 @@ arm64-obj-$(CONFIG_EFI)                       += efi.o efi-entry.stub.o
 arm64-obj-$(CONFIG_PCI)                        += pci.o
 arm64-obj-$(CONFIG_ARMV8_DEPRECATED)   += armv8_deprecated.o
 arm64-obj-$(CONFIG_ACPI)               += acpi.o
-arm64-obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL)        += acpi_parking_protocol.o
 
 obj-y                                  += $(arm64-obj-y) vdso/
 obj-m                                  += $(arm64-obj-m)
diff --git a/arch/arm64/kernel/acpi_parking_protocol.c b/arch/arm64/kernel/acpi_parking_protocol.c
deleted file mode 100644 (file)
index 4b1e5a7..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * ARM64 ACPI Parking Protocol implementation
- *
- * Authors: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
- *         Mark Salter <msalter@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-#include <linux/acpi.h>
-#include <linux/types.h>
-
-#include <asm/cpu_ops.h>
-
-struct cpu_mailbox_entry {
-       phys_addr_t mailbox_addr;
-       u8 version;
-       u8 gic_cpu_id;
-};
-
-static struct cpu_mailbox_entry cpu_mailbox_entries[NR_CPUS];
-
-void __init acpi_set_mailbox_entry(int cpu,
-                                  struct acpi_madt_generic_interrupt *p)
-{
-       struct cpu_mailbox_entry *cpu_entry = &cpu_mailbox_entries[cpu];
-
-       cpu_entry->mailbox_addr = p->parked_address;
-       cpu_entry->version = p->parking_version;
-       cpu_entry->gic_cpu_id = p->cpu_interface_number;
-}
-
-bool acpi_parking_protocol_valid(int cpu)
-{
-       struct cpu_mailbox_entry *cpu_entry = &cpu_mailbox_entries[cpu];
-
-       return cpu_entry->mailbox_addr && cpu_entry->version;
-}
-
-static int acpi_parking_protocol_cpu_init(unsigned int cpu)
-{
-       pr_debug("%s: ACPI parked addr=%llx\n", __func__,
-                 cpu_mailbox_entries[cpu].mailbox_addr);
-
-       return 0;
-}
-
-static int acpi_parking_protocol_cpu_prepare(unsigned int cpu)
-{
-       return 0;
-}
-
-struct parking_protocol_mailbox {
-       __le32 cpu_id;
-       __le32 reserved;
-       __le64 entry_point;
-};
-
-static int acpi_parking_protocol_cpu_boot(unsigned int cpu)
-{
-       struct cpu_mailbox_entry *cpu_entry = &cpu_mailbox_entries[cpu];
-       struct parking_protocol_mailbox __iomem *mailbox;
-       __le32 cpu_id;
-
-       /*
-        * Map mailbox memory with attribute device nGnRE (ie ioremap -
-        * this deviates from the parking protocol specifications since
-        * the mailboxes are required to be mapped nGnRnE; the attribute
-        * discrepancy is harmless insofar as the protocol specification
-        * is concerned).
-        * If the mailbox is mistakenly allocated in the linear mapping
-        * by FW ioremap will fail since the mapping will be prevented
-        * by the kernel (it clashes with the linear mapping attributes
-        * specifications).
-        */
-       mailbox = ioremap(cpu_entry->mailbox_addr, sizeof(*mailbox));
-       if (!mailbox)
-               return -EIO;
-
-       cpu_id = readl_relaxed(&mailbox->cpu_id);
-       /*
-        * Check if firmware has set-up the mailbox entry properly
-        * before kickstarting the respective cpu.
-        */
-       if (cpu_id != ~0U) {
-               iounmap(mailbox);
-               return -ENXIO;
-       }
-
-       /*
-        * We write the entry point and cpu id as LE regardless of the
-        * native endianness of the kernel. Therefore, any boot-loaders
-        * that read this address need to convert this address to the
-        * Boot-Loader's endianness before jumping.
-        */
-       writeq_relaxed(__pa(secondary_entry), &mailbox->entry_point);
-       writel_relaxed(cpu_entry->gic_cpu_id, &mailbox->cpu_id);
-
-       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
-
-       iounmap(mailbox);
-
-       return 0;
-}
-
-static void acpi_parking_protocol_cpu_postboot(void)
-{
-       int cpu = smp_processor_id();
-       struct cpu_mailbox_entry *cpu_entry = &cpu_mailbox_entries[cpu];
-       struct parking_protocol_mailbox __iomem *mailbox;
-       __le64 entry_point;
-
-       /*
-        * Map mailbox memory with attribute device nGnRE (ie ioremap -
-        * this deviates from the parking protocol specifications since
-        * the mailboxes are required to be mapped nGnRnE; the attribute
-        * discrepancy is harmless insofar as the protocol specification
-        * is concerned).
-        * If the mailbox is mistakenly allocated in the linear mapping
-        * by FW ioremap will fail since the mapping will be prevented
-        * by the kernel (it clashes with the linear mapping attributes
-        * specifications).
-        */
-       mailbox = ioremap(cpu_entry->mailbox_addr, sizeof(*mailbox));
-       if (!mailbox)
-               return;
-
-       entry_point = readl_relaxed(&mailbox->entry_point);
-       /*
-        * Check if firmware has cleared the entry_point as expected
-        * by the protocol specification.
-        */
-       WARN_ON(entry_point);
-
-       iounmap(mailbox);
-}
-
-const struct cpu_operations acpi_parking_protocol_ops = {
-       .name           = "parking-protocol",
-       .cpu_init       = acpi_parking_protocol_cpu_init,
-       .cpu_prepare    = acpi_parking_protocol_cpu_prepare,
-       .cpu_boot       = acpi_parking_protocol_cpu_boot,
-       .cpu_postboot   = acpi_parking_protocol_cpu_postboot
-};
index c7cfb8fe06f94c7f5113abf0cb624980e4227127..b6bd7d4477683393fb34dc6b055b07382e8ab050 100644 (file)
 #include <asm/smp_plat.h>
 
 extern const struct cpu_operations smp_spin_table_ops;
-extern const struct cpu_operations acpi_parking_protocol_ops;
 extern const struct cpu_operations cpu_psci_ops;
 
 const struct cpu_operations *cpu_ops[NR_CPUS];
 
-static const struct cpu_operations *dt_supported_cpu_ops[] __initconst = {
+static const struct cpu_operations *supported_cpu_ops[] __initconst = {
        &smp_spin_table_ops,
        &cpu_psci_ops,
        NULL,
 };
 
-static const struct cpu_operations *acpi_supported_cpu_ops[] __initconst = {
-#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
-       &acpi_parking_protocol_ops,
-#endif
-       &cpu_psci_ops,
-       NULL,
-};
-
 static const struct cpu_operations * __init cpu_get_ops(const char *name)
 {
-       const struct cpu_operations **ops;
-
-       ops = acpi_disabled ? dt_supported_cpu_ops : acpi_supported_cpu_ops;
+       const struct cpu_operations **ops = supported_cpu_ops;
 
        while (*ops) {
                if (!strcmp(name, (*ops)->name))
@@ -86,16 +75,8 @@ static const char *__init cpu_read_enable_method(int cpu)
                }
        } else {
                enable_method = acpi_get_enable_method(cpu);
-               if (!enable_method) {
-                       /*
-                        * In ACPI systems the boot CPU does not require
-                        * checking the enable method since for some
-                        * boot protocol (ie parking protocol) it need not
-                        * be initialized. Don't warn spuriously.
-                        */
-                       if (cpu != 0)
-                               pr_err("Unsupported ACPI enable-method\n");
-               }
+               if (!enable_method)
+                       pr_err("Unsupported ACPI enable-method\n");
        }
 
        return enable_method;
index 64a3362b10ec5a5e94d0faf9592c0f5f8452ac4e..89fd34ea91f4e0593612b9d53c729a3822bea9b7 100644 (file)
@@ -71,7 +71,6 @@ enum ipi_msg_type {
        IPI_CPU_STOP,
        IPI_TIMER,
        IPI_IRQ_WORK,
-       IPI_WAKEUP
 };
 
 /*
@@ -447,17 +446,6 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
        /* map the logical cpu id to cpu MPIDR */
        cpu_logical_map(cpu_count) = hwid;
 
-       /*
-        * Set-up the ACPI parking protocol cpu entries
-        * while initializing the cpu_logical_map to
-        * avoid parsing MADT entries multiple times for
-        * nothing (ie a valid cpu_logical_map entry should
-        * contain a valid parking protocol data set to
-        * initialize the cpu if the parking protocol is
-        * the only available enable method).
-        */
-       acpi_set_mailbox_entry(cpu_count, processor);
-
        cpu_count++;
 }
 
@@ -642,7 +630,6 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = {
        S(IPI_CPU_STOP, "CPU stop interrupts"),
        S(IPI_TIMER, "Timer broadcast interrupts"),
        S(IPI_IRQ_WORK, "IRQ work interrupts"),
-       S(IPI_WAKEUP, "CPU wake-up interrupts"),
 };
 
 static void smp_cross_call(const struct cpumask *target, unsigned int ipinr)
@@ -686,13 +673,6 @@ void arch_send_call_function_single_ipi(int cpu)
        smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC);
 }
 
-#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
-void arch_send_wakeup_ipi_mask(const struct cpumask *mask)
-{
-       smp_cross_call(mask, IPI_WAKEUP);
-}
-#endif
-
 #ifdef CONFIG_IRQ_WORK
 void arch_irq_work_raise(void)
 {
@@ -770,14 +750,6 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
                break;
 #endif
 
-#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
-       case IPI_WAKEUP:
-               WARN_ONCE(!acpi_parking_protocol_valid(cpu),
-                         "CPU%u: Wake-up IPI outside the ACPI parking protocol\n",
-                         cpu);
-               break;
-#endif
-
        default:
                pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr);
                break;