提交 4fcec201 编写于 作者: T Tianli Xiong 提交者: Hongchen Zhang

PCI: Check if entry->offset already exist for mem resource

LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP

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

Fix patch "LoongArch: Add PCI controller support"
Signed-off-by: NTianli Xiong <xiongtianli@loongson.cn>
Change-Id: I796b1224d8990fed952643adac491228d6541696
上级 b8dfd735
...@@ -210,11 +210,13 @@ static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci) ...@@ -210,11 +210,13 @@ static int acpi_prepare_root_resources(struct acpi_pci_root_info *ci)
if (status > 0) { if (status > 0) {
resource_list_for_each_entry_safe(entry, tmp, &ci->resources) { resource_list_for_each_entry_safe(entry, tmp, &ci->resources) {
if (entry->res->flags & IORESOURCE_MEM) { if (entry->res->flags & IORESOURCE_MEM) {
if(!entry->offset) {
entry->offset = ci->root->mcfg_addr & GENMASK_ULL(63, 40); entry->offset = ci->root->mcfg_addr & GENMASK_ULL(63, 40);
entry->res->start |= entry->offset; entry->res->start |= entry->offset;
entry->res->end |= entry->offset; entry->res->end |= entry->offset;
} }
} }
}
return status; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册