From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 30C7C313E13; Tue, 16 Dec 2025 11:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765884316; cv=none; b=gn6YrFT1Rv6deAXD8i+9h+Nb3igSZ4FpI1c4Ir6x5hjFw8BVDuaxrTxR1YO162ooQLiO4wh/XemzYLWyG+fxigYryzXe0ZBZVre8ugaruZ0G45da8XPbRPb26WzQhYFFZFDsT4kjfMHy3VCjoRBa0GWwsWMpRyZ0W5pHlLGc7iY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765884316; c=relaxed/simple; bh=wr0oJk0GriS2Uzy5rBPEBk5AmOTEEu05cElB42kWu/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EFpC6F1JG6yZNauQ5jQu6g+oN3eWb+AEiYipxzMkInNh9e0moeCmS80l8qBUqBpX95BpO+SQZp4efij+qzvePTYSxQmisNdeZHmy94M006tRBllswwVzJrMHOyWr79SVAFO28gB4voTrbtBflLLpMGvz3808s6unFjN7sQ9v9f8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0bBYMgi5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0bBYMgi5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 953CDC4CEF5; Tue, 16 Dec 2025 11:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765884316; bh=wr0oJk0GriS2Uzy5rBPEBk5AmOTEEu05cElB42kWu/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0bBYMgi5eobIgTQxbPf2yRqtgu6stlGpyTGwCrXia7I+ZEcP4qA7V7/lfajtnsvPp qmIZ0/gmAqkSL5oWzKLXTbM9/mw36+ytj2JqJeyNdk9Mh+6zza5EdMdM5jkujx3Efp M2JERlzxqgi9SQGe7xTLxMLHQmM6cNq807XgnwR8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Siddharth Vadapalli , Manivannan Sadhasivam , Bjorn Helgaas , Sasha Levin Subject: [PATCH 6.12 156/354] PCI: keystone: Exit ks_pcie_probe() for invalid mode Date: Tue, 16 Dec 2025 12:12:03 +0100 Message-ID: <20251216111326.567238238@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111320.896758933@linuxfoundation.org> References: <20251216111320.896758933@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Siddharth Vadapalli [ Upstream commit 95d9c3f0e4546eaec0977f3b387549a8463cd49f ] 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 Platforms") Signed-off-by: Siddharth Vadapalli Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Link: https://patch.msgid.link/20251029080547.1253757-4-s-vadapalli@ti.com Signed-off-by: Sasha Levin --- 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/controller/dwc/pci-keystone.c index 4f75d13fe1dee..1c34ea8e7c61e 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -1339,6 +1339,8 @@ static int ks_pcie_probe(struct platform_device *pdev) break; default: dev_err(dev, "INVALID device type %d\n", mode); + ret = -EINVAL; + goto err_get_sync; } ks_pcie_enable_error_irq(ks_pcie); -- 2.51.0