From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 From: Daniil Gnusarev To: devel-kernel@lists.altlinux.org Date: Mon, 14 Oct 2024 18:02:13 +0400 Message-ID: <20241014140221.535985-33-gnusarevda@basealt.ru> X-Mailer: git-send-email 2.42.2 In-Reply-To: <20241014140221.535985-1-gnusarevda@basealt.ru> References: <20241014140221.535985-1-gnusarevda@basealt.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH 32/39] dw-pcie: refuse to load on Baikal-M with recent firmware X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2024 14:02:17 -0000 Archived-At: List-Archive: List-Post: From: Alexey Sheplyakov 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 X-feature-Baikal-M X-DONTUPSTREAM --- drivers/pci/controller/dwc/Makefile | 8 ++++---- drivers/pci/controller/dwc/pcie-designware-plat.c | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/Makefile b/drivers/pci/controller/dwc/Makefile index 4e213d43a517c..3b1cd5ab98dee 100644 --- a/drivers/pci/controller/dwc/Makefile +++ b/drivers/pci/controller/dwc/Makefile @@ -1,9 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_PCIE_BAIKAL) += pcie-baikal.o +pcie-baikal-objs := pcie-baikal-core.o \ + pcie-baikal-tune.o + obj-$(CONFIG_PCIE_DW) += pcie-designware.o obj-$(CONFIG_PCIE_DW_HOST) += pcie-designware-host.o obj-$(CONFIG_PCIE_DW_EP) += pcie-designware-ep.o obj-$(CONFIG_PCIE_DW_PLAT) += pcie-designware-plat.o -obj-$(CONFIG_PCIE_BAIKAL) += pcie-baikal.o obj-$(CONFIG_PCIE_BT1) += pcie-bt1.o obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o @@ -28,9 +31,6 @@ obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o obj-$(CONFIG_PCIE_UNIPHIER_EP) += pcie-uniphier-ep.o obj-$(CONFIG_PCIE_VISCONTI_HOST) += pcie-visconti.o -pcie-baikal-objs := pcie-baikal-core.o \ - pcie-baikal-tune.o - # The following drivers are for devices that use the generic ACPI # pci_root.c driver but don't support standard ECAM config access. # They contain MCFG quirks to replace the generic ECAM accessors with diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c index b625841e98aa0..96d01ebd16137 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; -- 2.42.2