From nobody Tue Feb 10 03:45:29 2026 Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A24A30F7FA; Wed, 22 Oct 2025 09:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761127082; cv=none; b=WQ4XkPrjvE9BkQmMyhnpcGj2LJDDkSqORxQ2Obw2G7OuqExsh/2OqovQu4QMemGwsLZI8zbzBsGPpTlGcQmZNuKKebIBJ3t5NOQ+jJHNJEWu+UopT+3q5tKHBT5vIVE6claJRtYEajvUj1a9m5Y9VFEDNwo0dhltIRO/oK6ErbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761127082; c=relaxed/simple; bh=FogAesqd4Mt9NZ8wTSC3H2sOn2SaiE/yS5P0bR1bJAE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lk8WEz9wZYjynu6MxAlmLQBcQoV04DDgDhw2rvWdeSqOkhkLuzk6h9ijpmqvuOLRxpMh5dVji0xEuLbJBi6+d/Fr+jVdA7VW1Mu1jTkVXFa3H3QX76sUyDyAT2TVagIdXYfCwPElq+z84e8/BLO7u91lU6mhzVykroBOMCj2dyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=vybDvVQO; arc=none smtp.client-ip=198.47.23.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="vybDvVQO" Received: from fllvem-sh04.itg.ti.com ([10.64.41.54]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 59M9vePT1387171; Wed, 22 Oct 2025 04:57:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1761127060; bh=eDEFhReKOWDZEG0hPcEbmy3jugGDtcCK/G1R5eTHmUw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vybDvVQOA5GclChffIno+kpK+HI6inDgKmoQLvRdfmTckKCoU+Fh5JwwNYdVsKXWi QV7z3WuZvfywmKhqlzA7WS+zW4FeTPW86v6YkUfjfUOvu57uQ5hOaKHIgYwWnngCep 1krRW0KzRCZbOf6ivAUTNbVN2/5auQH7xgEdRLpc= Received: from DFLE206.ent.ti.com (dfle206.ent.ti.com [10.64.6.64]) by fllvem-sh04.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 59M9venf1511720 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Oct 2025 04:57:40 -0500 Received: from DFLE203.ent.ti.com (10.64.6.61) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Wed, 22 Oct 2025 04:57:40 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE203.ent.ti.com (10.64.6.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Wed, 22 Oct 2025 04:57:40 -0500 Received: from toolbox.dhcp.ti.com (uda0492258.dhcp.ti.com [10.24.73.74]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 59M9vFcY1029418; Wed, 22 Oct 2025 04:57:34 -0500 From: Siddharth Vadapalli To: , , , , , , , , , , , , , , <18255117159@163.com>, , CC: , , , , Subject: [PATCH v4 3/4] PCI: keystone: Exit ks_pcie_probe() for invalid mode Date: Wed, 22 Oct 2025 15:27:11 +0530 Message-ID: <20251022095724.997218-4-s-vadapalli@ti.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251022095724.997218-1-s-vadapalli@ti.com> References: <20251022095724.997218-1-s-vadapalli@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Commit under Fixes introduced support for PCIe EP mode on AM654x platforms. When the mode happens to be either "DW_PCIE_RC_TYPE" or "DW_PCIE_EP_TYPE", the PCIe Controller is configured accordingly. However, when the mode is neither of them, an error message is displayed but the driver probe succeeds. Since this "invalid" mode is not associated with a functional PCIe Controller, the probe should fail. Fix the behavior by exiting "ks_pcie_probe()" with the return value of "-EINVAL" in addition to displaying the existing error message when the mode is invalid. Fixes: 23284ad677a9 ("PCI: keystone: Add support for PCIe EP in AM654x Plat= forms") Signed-off-by: Siddharth Vadapalli --- NOTE: As stated in the v3 patch, although a Fixes tag has been added, the patch doesn't have to be backported. Hence, 'stable' hasn't been CCed on purpose. v3: https://lore.kernel.org/r/20250922071222.2814937-4-s-vadapalli@ti.com/ Changes since v3: - Rebased patch on 6.18-rc1 tag of Mainline Linux. Regards, Siddharth. drivers/pci/controller/dwc/pci-keystone.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/contro= ller/dwc/pci-keystone.c index eb00aa380722..25b8193ffbcf 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -1337,6 +1337,8 @@ static int ks_pcie_probe(struct platform_device *pdev) break; default: dev_err(dev, "INVALID device type %d\n", mode); + ret =3D -EINVAL; + goto err_get_sync; } =20 ks_pcie_enable_error_irq(ks_pcie); --=20 2.51.0