Commit 18db1b6d authored by Thomas Gleixner's avatar Thomas Gleixner

Revert "Loongarch: Support loongarch avec"

This reverts commit 760d7e71.

This results in build failures and has other issues according to Tianyang.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Tianyang Zhang <zhangtianyang@loongson.cn>
Closes: https://lore.kernel.org/oe-kbuild-all/202406240451.ygBFNyJ3-lkp@intel.com/
parent f2605e17
...@@ -83,7 +83,6 @@ config LOONGARCH ...@@ -83,7 +83,6 @@ config LOONGARCH
select GENERIC_ENTRY select GENERIC_ENTRY
select GENERIC_GETTIMEOFDAY select GENERIC_GETTIMEOFDAY
select GENERIC_IOREMAP if !ARCH_IOREMAP select GENERIC_IOREMAP if !ARCH_IOREMAP
select GENERIC_IRQ_MATRIX_ALLOCATOR
select GENERIC_IRQ_MULTI_HANDLER select GENERIC_IRQ_MULTI_HANDLER
select GENERIC_IRQ_PROBE select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
......
...@@ -65,6 +65,5 @@ ...@@ -65,6 +65,5 @@
#define cpu_has_guestid cpu_opt(LOONGARCH_CPU_GUESTID) #define cpu_has_guestid cpu_opt(LOONGARCH_CPU_GUESTID)
#define cpu_has_hypervisor cpu_opt(LOONGARCH_CPU_HYPERVISOR) #define cpu_has_hypervisor cpu_opt(LOONGARCH_CPU_HYPERVISOR)
#define cpu_has_ptw cpu_opt(LOONGARCH_CPU_PTW) #define cpu_has_ptw cpu_opt(LOONGARCH_CPU_PTW)
#define cpu_has_avecint cpu_opt(LOONGARCH_CPU_AVECINT)
#endif /* __ASM_CPU_FEATURES_H */ #endif /* __ASM_CPU_FEATURES_H */
...@@ -99,7 +99,6 @@ enum cpu_type_enum { ...@@ -99,7 +99,6 @@ enum cpu_type_enum {
#define CPU_FEATURE_GUESTID 24 /* CPU has GuestID feature */ #define CPU_FEATURE_GUESTID 24 /* CPU has GuestID feature */
#define CPU_FEATURE_HYPERVISOR 25 /* CPU has hypervisor (running in VM) */ #define CPU_FEATURE_HYPERVISOR 25 /* CPU has hypervisor (running in VM) */
#define CPU_FEATURE_PTW 26 /* CPU has hardware page table walker */ #define CPU_FEATURE_PTW 26 /* CPU has hardware page table walker */
#define CPU_FEATURE_AVECINT 27 /* CPU has avec interrupt */
#define LOONGARCH_CPU_CPUCFG BIT_ULL(CPU_FEATURE_CPUCFG) #define LOONGARCH_CPU_CPUCFG BIT_ULL(CPU_FEATURE_CPUCFG)
#define LOONGARCH_CPU_LAM BIT_ULL(CPU_FEATURE_LAM) #define LOONGARCH_CPU_LAM BIT_ULL(CPU_FEATURE_LAM)
...@@ -128,6 +127,5 @@ enum cpu_type_enum { ...@@ -128,6 +127,5 @@ enum cpu_type_enum {
#define LOONGARCH_CPU_GUESTID BIT_ULL(CPU_FEATURE_GUESTID) #define LOONGARCH_CPU_GUESTID BIT_ULL(CPU_FEATURE_GUESTID)
#define LOONGARCH_CPU_HYPERVISOR BIT_ULL(CPU_FEATURE_HYPERVISOR) #define LOONGARCH_CPU_HYPERVISOR BIT_ULL(CPU_FEATURE_HYPERVISOR)
#define LOONGARCH_CPU_PTW BIT_ULL(CPU_FEATURE_PTW) #define LOONGARCH_CPU_PTW BIT_ULL(CPU_FEATURE_PTW)
#define LOONGARCH_CPU_AVECINT BIT_ULL(CPU_FEATURE_AVECINT)
#endif /* _ASM_CPU_H */ #endif /* _ASM_CPU_H */
...@@ -9,16 +9,6 @@ ...@@ -9,16 +9,6 @@
extern atomic_t irq_err_count; extern atomic_t irq_err_count;
/*
* 256 vectors Map:
*
* 0 - 15: mapping legacy IPs, e.g. IP0-12.
* 16 - 255: mapping a vector for external IRQ.
*
*/
#define NR_VECTORS 256
#define IRQ_MATRIX_BITS NR_VECTORS
#define NR_LEGACY_VECTORS 16
/* /*
* interrupt-retrigger: NOP for now. This may not be appropriate for all * interrupt-retrigger: NOP for now. This may not be appropriate for all
* machines, we'll see ... * machines, we'll see ...
......
...@@ -65,7 +65,7 @@ extern struct acpi_vector_group msi_group[MAX_IO_PICS]; ...@@ -65,7 +65,7 @@ extern struct acpi_vector_group msi_group[MAX_IO_PICS];
#define LOONGSON_LPC_LAST_IRQ (LOONGSON_LPC_IRQ_BASE + 15) #define LOONGSON_LPC_LAST_IRQ (LOONGSON_LPC_IRQ_BASE + 15)
#define LOONGSON_CPU_IRQ_BASE 16 #define LOONGSON_CPU_IRQ_BASE 16
#define LOONGSON_CPU_LAST_IRQ (LOONGSON_CPU_IRQ_BASE + 15) #define LOONGSON_CPU_LAST_IRQ (LOONGSON_CPU_IRQ_BASE + 14)
#define LOONGSON_PCH_IRQ_BASE 64 #define LOONGSON_PCH_IRQ_BASE 64
#define LOONGSON_PCH_ACPI_IRQ (LOONGSON_PCH_IRQ_BASE + 47) #define LOONGSON_PCH_ACPI_IRQ (LOONGSON_PCH_IRQ_BASE + 47)
...@@ -101,16 +101,6 @@ int pch_msi_acpi_init(struct irq_domain *parent, ...@@ -101,16 +101,6 @@ int pch_msi_acpi_init(struct irq_domain *parent,
struct acpi_madt_msi_pic *acpi_pchmsi); struct acpi_madt_msi_pic *acpi_pchmsi);
int pch_pic_acpi_init(struct irq_domain *parent, int pch_pic_acpi_init(struct irq_domain *parent,
struct acpi_madt_bio_pic *acpi_pchpic); struct acpi_madt_bio_pic *acpi_pchpic);
#ifdef CONFIG_ACPI
int __init pch_msi_acpi_init_v2(struct irq_domain *parent,
struct acpi_madt_msi_pic *pch_msi_entry);
int __init loongarch_avec_acpi_init(struct irq_domain *parent);
void complete_irq_moving(void);
void loongarch_avec_offline_cpu(unsigned int cpu);
void loongarch_avec_online_cpu(unsigned int cpu);
#endif
int find_pch_pic(u32 gsi); int find_pch_pic(u32 gsi);
struct fwnode_handle *get_pch_msi_handle(int pci_segment); struct fwnode_handle *get_pch_msi_handle(int pci_segment);
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#define CPUCFG1_RPLV BIT(23) #define CPUCFG1_RPLV BIT(23)
#define CPUCFG1_HUGEPG BIT(24) #define CPUCFG1_HUGEPG BIT(24)
#define CPUCFG1_CRC32 BIT(25) #define CPUCFG1_CRC32 BIT(25)
#define CPUCFG1_MSGINT BIT(26)
#define LOONGARCH_CPUCFG2 0x2 #define LOONGARCH_CPUCFG2 0x2
#define CPUCFG2_FP BIT(0) #define CPUCFG2_FP BIT(0)
...@@ -251,8 +252,8 @@ ...@@ -251,8 +252,8 @@
#define CSR_ESTAT_EXC_WIDTH 6 #define CSR_ESTAT_EXC_WIDTH 6
#define CSR_ESTAT_EXC (_ULCAST_(0x3f) << CSR_ESTAT_EXC_SHIFT) #define CSR_ESTAT_EXC (_ULCAST_(0x3f) << CSR_ESTAT_EXC_SHIFT)
#define CSR_ESTAT_IS_SHIFT 0 #define CSR_ESTAT_IS_SHIFT 0
#define CSR_ESTAT_IS_WIDTH 15 #define CSR_ESTAT_IS_WIDTH 14
#define CSR_ESTAT_IS (_ULCAST_(0x7fff) << CSR_ESTAT_IS_SHIFT) #define CSR_ESTAT_IS (_ULCAST_(0x3fff) << CSR_ESTAT_IS_SHIFT)
#define LOONGARCH_CSR_ERA 0x6 /* ERA */ #define LOONGARCH_CSR_ERA 0x6 /* ERA */
...@@ -998,18 +999,10 @@ ...@@ -998,18 +999,10 @@
#define CSR_FWPC_SKIP_SHIFT 16 #define CSR_FWPC_SKIP_SHIFT 16
#define CSR_FWPC_SKIP (_ULCAST_(1) << CSR_FWPC_SKIP_SHIFT) #define CSR_FWPC_SKIP (_ULCAST_(1) << CSR_FWPC_SKIP_SHIFT)
#define LOONGARCH_CSR_IRR0 0xa0
#define LOONGARCH_CSR_IRR1 0xa1
#define LOONGARCH_CSR_IRR2 0xa2
#define LOONGARCH_CSR_IRR3 0xa3
#define LOONGARCH_CSR_IRR_BASE LOONGARCH_CSR_IRR0
#define LOONGARCH_CSR_ILR 0xa4
/* /*
* CSR_ECFG IM * CSR_ECFG IM
*/ */
#define ECFG0_IM 0x00005fff #define ECFG0_IM 0x00001fff
#define ECFGB_SIP0 0 #define ECFGB_SIP0 0
#define ECFGF_SIP0 (_ULCAST_(1) << ECFGB_SIP0) #define ECFGF_SIP0 (_ULCAST_(1) << ECFGB_SIP0)
#define ECFGB_SIP1 1 #define ECFGB_SIP1 1
...@@ -1052,7 +1045,6 @@ ...@@ -1052,7 +1045,6 @@
#define IOCSRF_EIODECODE BIT_ULL(9) #define IOCSRF_EIODECODE BIT_ULL(9)
#define IOCSRF_FLATMODE BIT_ULL(10) #define IOCSRF_FLATMODE BIT_ULL(10)
#define IOCSRF_VM BIT_ULL(11) #define IOCSRF_VM BIT_ULL(11)
#define IOCSRF_AVEC BIT_ULL(15)
#define LOONGARCH_IOCSR_VENDOR 0x10 #define LOONGARCH_IOCSR_VENDOR 0x10
...@@ -1063,7 +1055,6 @@ ...@@ -1063,7 +1055,6 @@
#define LOONGARCH_IOCSR_MISC_FUNC 0x420 #define LOONGARCH_IOCSR_MISC_FUNC 0x420
#define IOCSR_MISC_FUNC_TIMER_RESET BIT_ULL(21) #define IOCSR_MISC_FUNC_TIMER_RESET BIT_ULL(21)
#define IOCSR_MISC_FUNC_EXT_IOI_EN BIT_ULL(48) #define IOCSR_MISC_FUNC_EXT_IOI_EN BIT_ULL(48)
#define IOCSR_MISC_FUNC_AVEC_EN BIT_ULL(51)
#define LOONGARCH_IOCSR_CPUTEMP 0x428 #define LOONGARCH_IOCSR_CPUTEMP 0x428
...@@ -1384,10 +1375,9 @@ __BUILD_CSR_OP(tlbidx) ...@@ -1384,10 +1375,9 @@ __BUILD_CSR_OP(tlbidx)
#define INT_TI 11 /* Timer */ #define INT_TI 11 /* Timer */
#define INT_IPI 12 #define INT_IPI 12
#define INT_NMI 13 #define INT_NMI 13
#define INT_AVEC 14
/* ExcCodes corresponding to interrupts */ /* ExcCodes corresponding to interrupts */
#define EXCCODE_INT_NUM (INT_AVEC + 1) #define EXCCODE_INT_NUM (INT_NMI + 1)
#define EXCCODE_INT_START 64 #define EXCCODE_INT_START 64
#define EXCCODE_INT_END (EXCCODE_INT_START + EXCCODE_INT_NUM - 1) #define EXCCODE_INT_END (EXCCODE_INT_START + EXCCODE_INT_NUM - 1)
......
...@@ -69,11 +69,9 @@ extern int __cpu_logical_map[NR_CPUS]; ...@@ -69,11 +69,9 @@ extern int __cpu_logical_map[NR_CPUS];
#define ACTION_BOOT_CPU 0 #define ACTION_BOOT_CPU 0
#define ACTION_RESCHEDULE 1 #define ACTION_RESCHEDULE 1
#define ACTION_CALL_FUNCTION 2 #define ACTION_CALL_FUNCTION 2
#define ACTION_CLEAR_VECT 3
#define SMP_BOOT_CPU BIT(ACTION_BOOT_CPU) #define SMP_BOOT_CPU BIT(ACTION_BOOT_CPU)
#define SMP_RESCHEDULE BIT(ACTION_RESCHEDULE) #define SMP_RESCHEDULE BIT(ACTION_RESCHEDULE)
#define SMP_CALL_FUNCTION BIT(ACTION_CALL_FUNCTION) #define SMP_CALL_FUNCTION BIT(ACTION_CALL_FUNCTION)
#define SMP_CLEAR_VECT BIT(ACTION_CLEAR_VECT)
struct secondary_data { struct secondary_data {
unsigned long stack; unsigned long stack;
......
...@@ -106,6 +106,7 @@ static void cpu_probe_common(struct cpuinfo_loongarch *c) ...@@ -106,6 +106,7 @@ static void cpu_probe_common(struct cpuinfo_loongarch *c)
elf_hwcap |= HWCAP_LOONGARCH_CRC32; elf_hwcap |= HWCAP_LOONGARCH_CRC32;
} }
config = read_cpucfg(LOONGARCH_CPUCFG2); config = read_cpucfg(LOONGARCH_CPUCFG2);
if (config & CPUCFG2_LAM) { if (config & CPUCFG2_LAM) {
c->options |= LOONGARCH_CPU_LAM; c->options |= LOONGARCH_CPU_LAM;
...@@ -175,8 +176,6 @@ static void cpu_probe_common(struct cpuinfo_loongarch *c) ...@@ -175,8 +176,6 @@ static void cpu_probe_common(struct cpuinfo_loongarch *c)
c->options |= LOONGARCH_CPU_EIODECODE; c->options |= LOONGARCH_CPU_EIODECODE;
if (config & IOCSRF_VM) if (config & IOCSRF_VM)
c->options |= LOONGARCH_CPU_HYPERVISOR; c->options |= LOONGARCH_CPU_HYPERVISOR;
if (config & IOCSRF_AVEC)
c->options |= LOONGARCH_CPU_AVECINT;
config = csr_read32(LOONGARCH_CSR_ASID); config = csr_read32(LOONGARCH_CSR_ASID);
config = (config & CSR_ASID_BIT) >> CSR_ASID_BIT_SHIFT; config = (config & CSR_ASID_BIT) >> CSR_ASID_BIT_SHIFT;
......
...@@ -234,9 +234,6 @@ static irqreturn_t loongson_ipi_interrupt(int irq, void *dev) ...@@ -234,9 +234,6 @@ static irqreturn_t loongson_ipi_interrupt(int irq, void *dev)
per_cpu(irq_stat, cpu).ipi_irqs[IPI_CALL_FUNCTION]++; per_cpu(irq_stat, cpu).ipi_irqs[IPI_CALL_FUNCTION]++;
} }
if (action & SMP_CLEAR_VECT)
complete_irq_moving();
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -391,7 +388,6 @@ int loongson_cpu_disable(void) ...@@ -391,7 +388,6 @@ int loongson_cpu_disable(void)
irq_migrate_all_off_this_cpu(); irq_migrate_all_off_this_cpu();
clear_csr_ecfg(ECFG0_IM); clear_csr_ecfg(ECFG0_IM);
local_irq_restore(flags); local_irq_restore(flags);
loongarch_avec_offline_cpu(cpu);
local_flush_tlb_all(); local_flush_tlb_all();
return 0; return 0;
...@@ -570,7 +566,6 @@ asmlinkage void start_secondary(void) ...@@ -570,7 +566,6 @@ asmlinkage void start_secondary(void)
* early is dangerous. * early is dangerous.
*/ */
WARN_ON_ONCE(!irqs_disabled()); WARN_ON_ONCE(!irqs_disabled());
loongarch_avec_online_cpu(cpu);
loongson_smp_finish(); loongson_smp_finish();
cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
......
...@@ -110,7 +110,7 @@ obj-$(CONFIG_LS1X_IRQ) += irq-ls1x.o ...@@ -110,7 +110,7 @@ obj-$(CONFIG_LS1X_IRQ) += irq-ls1x.o
obj-$(CONFIG_TI_SCI_INTR_IRQCHIP) += irq-ti-sci-intr.o obj-$(CONFIG_TI_SCI_INTR_IRQCHIP) += irq-ti-sci-intr.o
obj-$(CONFIG_TI_SCI_INTA_IRQCHIP) += irq-ti-sci-inta.o obj-$(CONFIG_TI_SCI_INTA_IRQCHIP) += irq-ti-sci-inta.o
obj-$(CONFIG_TI_PRUSS_INTC) += irq-pruss-intc.o obj-$(CONFIG_TI_PRUSS_INTC) += irq-pruss-intc.o
obj-$(CONFIG_IRQ_LOONGARCH_CPU) += irq-loongarch-cpu.o irq-loongarch-avec.o obj-$(CONFIG_IRQ_LOONGARCH_CPU) += irq-loongarch-cpu.o
obj-$(CONFIG_LOONGSON_LIOINTC) += irq-loongson-liointc.o obj-$(CONFIG_LOONGSON_LIOINTC) += irq-loongson-liointc.o
obj-$(CONFIG_LOONGSON_EIOINTC) += irq-loongson-eiointc.o obj-$(CONFIG_LOONGSON_EIOINTC) += irq-loongson-eiointc.o
obj-$(CONFIG_LOONGSON_HTPIC) += irq-loongson-htpic.o obj-$(CONFIG_LOONGSON_HTPIC) += irq-loongson-htpic.o
......
This diff is collapsed.
...@@ -138,9 +138,7 @@ static int __init acpi_cascade_irqdomain_init(void) ...@@ -138,9 +138,7 @@ static int __init acpi_cascade_irqdomain_init(void)
if (r < 0) if (r < 0)
return r; return r;
if (cpu_has_avecint) return 0;
r = loongarch_avec_acpi_init(irq_domain);
return r;
} }
static int __init cpuintc_acpi_init(union acpi_subtable_headers *header, static int __init cpuintc_acpi_init(union acpi_subtable_headers *header,
......
...@@ -359,9 +359,6 @@ static int __init acpi_cascade_irqdomain_init(void) ...@@ -359,9 +359,6 @@ static int __init acpi_cascade_irqdomain_init(void)
if (r < 0) if (r < 0)
return r; return r;
if (cpu_has_avecint)
return 0;
r = acpi_table_parse_madt(ACPI_MADT_TYPE_MSI_PIC, pch_msi_parse_madt, 1); r = acpi_table_parse_madt(ACPI_MADT_TYPE_MSI_PIC, pch_msi_parse_madt, 1);
if (r < 0) if (r < 0)
return r; return r;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/slab.h> #include <linux/slab.h>
static int nr_pics; static int nr_pics;
struct pch_msi_data { struct pch_msi_data {
struct mutex msi_map_lock; struct mutex msi_map_lock;
phys_addr_t doorbell; phys_addr_t doorbell;
...@@ -99,17 +100,6 @@ static struct irq_chip middle_irq_chip = { ...@@ -99,17 +100,6 @@ static struct irq_chip middle_irq_chip = {
.irq_compose_msi_msg = pch_msi_compose_msi_msg, .irq_compose_msi_msg = pch_msi_compose_msi_msg,
}; };
static struct irq_chip pch_msi_irq_chip_v2 = {
.name = "MSI",
.irq_ack = irq_chip_ack_parent,
};
static struct msi_domain_info pch_msi_domain_info_v2 = {
.flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX,
.chip = &pch_msi_irq_chip_v2,
};
static int pch_msi_parent_domain_alloc(struct irq_domain *domain, static int pch_msi_parent_domain_alloc(struct irq_domain *domain,
unsigned int virq, int hwirq) unsigned int virq, int hwirq)
{ {
...@@ -278,9 +268,6 @@ struct fwnode_handle *get_pch_msi_handle(int pci_segment) ...@@ -278,9 +268,6 @@ struct fwnode_handle *get_pch_msi_handle(int pci_segment)
{ {
int i; int i;
if (cpu_has_avecint)
return pch_msi_handle[0];
for (i = 0; i < MAX_IO_PICS; i++) { for (i = 0; i < MAX_IO_PICS; i++) {
if (msi_group[i].pci_segment == pci_segment) if (msi_group[i].pci_segment == pci_segment)
return pch_msi_handle[i]; return pch_msi_handle[i];
...@@ -302,32 +289,4 @@ int __init pch_msi_acpi_init(struct irq_domain *parent, ...@@ -302,32 +289,4 @@ int __init pch_msi_acpi_init(struct irq_domain *parent,
return ret; return ret;
} }
int __init pch_msi_acpi_init_v2(struct irq_domain *parent,
struct acpi_madt_msi_pic *msi_entry)
{
struct irq_domain *msi_domain;
if (pch_msi_handle[0])
return 0;
pch_msi_handle[0] = irq_domain_alloc_named_fwnode("msipic-v2");
if (!pch_msi_handle[0]) {
pr_err("Unable to allocate domain handle\n");
kfree(pch_msi_handle[0]);
return -ENOMEM;
}
msi_domain = pci_msi_create_irq_domain(pch_msi_handle[0],
&pch_msi_domain_info_v2,
parent);
if (!msi_domain) {
pr_err("Failed to create PCI MSI domain\n");
kfree(pch_msi_handle[0]);
return -ENOMEM;
}
pr_info("IRQ domain MSIPIC-V2 init done.\n");
return 0;
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment