[d-kernel] [PATCH 05/31] dw-pcie: refuse to load on Baikal-M with recent firmware

Alexey Sheplyakov asheplyakov на basealt.ru
Пн Окт 3 17:02:01 MSK 2022

Firmware from SDK-M 5.4 is incompatible with dw-pcie driver.
Yet the DTB (passed to kernel by the firmware) claims otherwise.
Hence refuse to load if device node is compatilbe with
`baikal,bm1000-pcie` (earlier versions of Baikal-M firmware used
a different compatible string).

Signed-off-by: Alexey Sheplyakov <asheplyakov на basealt.ru>
 drivers/pci/controller/dwc/pcie-designware-plat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c
index 1fcfb840f238..4041f330d082 100644
--- a/drivers/pci/controller/dwc/pcie-designware-plat.c
+++ b/drivers/pci/controller/dwc/pcie-designware-plat.c
@@ -112,6 +112,11 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
 	const struct dw_plat_pcie_of_data *data;
 	enum dw_pcie_device_mode mode;
+	if (of_device_is_compatible(dev->of_node, "baikal,bm1000-pcie")) {
+		dev_err(dev, "refusing to load on Baikal-M with SDK-M 5.{4,5}\n");
+		return -ENODEV;
+	}
 	data = of_device_get_match_data(dev);
 	if (!data)
 		return -EINVAL;

Подробная информация о списке рассылки devel-kernel