提交 4441200a 编写于 作者: Y yangqiming 提交者: openeuler-sync-bot

LoongArch: Fixed EIOINTC structure members

LoongArch inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6MUZX

--------------------------------

Resolve the problem that the multi-node cpus fail to boot.
Signed-off-by: Nyangqiming <yangqiming@loongson.cn>
Signed-off-by: NHongchen Zhang <zhanghongchen@loongson.cn>
Change-Id: I52dce84aef3ed8e28d198d54152d6a8680b414ae
(cherry picked from commit 8f5d5466)
上级 1e30fe10
......@@ -113,13 +113,15 @@ static int bad_pch_pic(unsigned long address)
void register_default_pic(int id, u32 address, u32 irq_base)
{
int idx, entries;
int j, idx, entries, cores;
unsigned long addr;
u64 node_map = 0;
if (bad_pch_pic(address))
return;
idx = nr_io_pics;
cores = (cpu_has_hypervisor ? MAX_CORES_PER_EIO_NODE : CORES_PER_EIO_NODE);
pchpic_default[idx].address = address;
if (idx)
......@@ -138,14 +140,27 @@ void register_default_pic(int id, u32 address, u32 irq_base)
pchmsi_default[idx].start = entries;
pchmsi_default[idx].count = MSI_MSG_DEFAULT_COUNT;
eiointc_default[idx].cascade = 3;
for_each_possible_cpu(j) {
int node = cpu_logical_map(j) / cores;
node_map |= (1 << node);
}
eiointc_default[idx].cascade = 3 + idx;
eiointc_default[idx].node = id;
eiointc_default[idx].node_map = 1;
eiointc_default[idx].node_map = node_map;
if (idx) {
eiointc_default[idx].cascade = 0x4;
eiointc_default[0].node_map = 0x1DF;
eiointc_default[idx].node_map = 0xFE20;
int i;
for (i = 0; i < idx + 1; i++) {
node_map = 0;
for_each_possible_cpu(j) {
int node = cpu_logical_map(j) / cores;
if (((node & 7) < 4) ? !i : i)
node_map |= (1 << node);
}
eiointc_default[i].node_map = node_map;
}
}
acpi_pchpic[idx] = &pchpic_default[idx];
......
......@@ -159,7 +159,7 @@ static int eiointc_router_init(unsigned int cpu)
int i, bit;
uint32_t data;
uint32_t node = cpu_to_eio_node(cpu);
uint32_t index = eiointc_index(node);
int index = eiointc_index(node);
int cores = (cpu_has_hypervisor ? MAX_CORES_PER_EIO_NODE : CORES_PER_EIO_NODE);
if (index < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册