Skip to content

Commit a6b533a

Browse files
committed
LoongArch: Don't panic if no valid cache info for PCI
If there is no valid cache info detected (may happen in virtual machine) for pci_dfl_cache_line_size, kernel shouldn't panic. Because in the PCI core it will be evaluated to (L1_CACHE_BYTES >> 2). Cc: <[email protected]> Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 863a320 commit a6b533a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/loongarch/pci/pci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ static int __init pcibios_init(void)
5050
*/
5151
lsize = cpu_last_level_cache_line_size();
5252

53-
BUG_ON(!lsize);
53+
if (lsize) {
54+
pci_dfl_cache_line_size = lsize >> 2;
5455

55-
pci_dfl_cache_line_size = lsize >> 2;
56-
57-
pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize);
56+
pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize);
57+
}
5858

5959
return 0;
6060
}

0 commit comments

Comments
 (0)