Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: <stable@vger.kernel.org>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>

+4 -4
+4 -4
arch/loongarch/pci/pci.c
··· 50 50 */ 51 51 lsize = cpu_last_level_cache_line_size(); 52 52 53 - BUG_ON(!lsize); 53 + if (lsize) { 54 + pci_dfl_cache_line_size = lsize >> 2; 54 55 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 + } 58 58 59 59 return 0; 60 60 }