PCI: loongson: Don't access non-existent devices
authorHuacai Chen <chenhuacai@loongson.cn>
Thu, 14 Jul 2022 12:42:13 +0000 (20:42 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 14 Jul 2022 20:29:03 +0000 (15:29 -0500)
commit2410e3301fcc40f6ebda234928c66a22f4257d9f
tree7384211529040cf8f4f7810e77402b8d092bbcdf
parentcd89edda4002b7fb3c0a6765c3a60a60d5b1dc16
PCI: loongson: Don't access non-existent devices

On LS2K/LS7A, config reads to some non-existent devices don't return
0xffffffff (they are hidden devices for debug, and accessing the config
space may cause machine hang). This is a hardware flaw but we can only
avoid it by software now.

Link: https://lore.kernel.org/r/20220714124216.1489304-5-chenhuacai@loongson.cn
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/controller/pci-loongson.c