From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Siddharth Vadapalli <s-vadapalli@ti.com>, <lpieralisi@kernel.org>,
<kwilczynski@kernel.org>, <robh@kernel.org>,
<bhelgaas@google.com>, <jingoohan1@gmail.com>,
<christian.bruel@foss.st.com>, <qiang.yu@oss.qualcomm.com>,
<mayank.rana@oss.qualcomm.com>, <thippeswamy.havalige@amd.com>,
<shradha.t@samsung.com>, <quic_schintav@quicinc.com>,
<inochiama@gmail.com>, <cassel@kernel.org>, <kishon@kernel.org>,
<sergio.paracuellos@gmail.com>, <18255117159@163.com>,
<rongqianfeng@vivo.com>, <jirislaby@kernel.org>,
<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <srk@ti.com>
Subject: Re: [PATCH v2 09/10] PCI: keystone: Exit ks_pcie_probe() for the default switch-case of "mode"
Date: Sat, 20 Sep 2025 13:39:22 +0530 [thread overview]
Message-ID: <3f3b2f06-64a3-4e6d-9fa9-c3412b1ca710@ti.com> (raw)
In-Reply-To: <lo2zv3nxek57s3h4hwv2ujzophdx2ubfuam4gqmo5h77t2g4jo@447qpc7a4ub3>
On Sat, Sep 20, 2025 at 12:06:46AM +0530, Manivannan Sadhasivam wrote:
> On Fri, Sep 12, 2025 at 05:46:20PM +0530, Siddharth Vadapalli wrote:
> > In ks_pcie_probe(), the switch-case for the "mode" is used to configure
> > the PCIe Controller for either Root-Complex or Endpoint mode of operation.
> > Prior to the switch-case statement for "mode" an invalid mode will result
> > in probe failure only if "dw_pcie_ver_is_ge(pci, 480A)" is true, which
> > is the case for the AM654 platform. On the other hand, when that is not
> > the case, "ks_pcie_set_mode()" will be invoked, which does not validate
> > the mode. As a result, it is possible for the switch-case statement for
> > "mode" to receive an invalid mode. Currently, an error message is displayed
> > in the "default" case where "mode" is neither "DW_PCIE_RC_TYPE" nor
> > "DW_PCIE_EP_TYPE", but the probe succeeds. However, since the configuration
> > required for Root-Complex and Endpoint mode have not been performed, the
> > Controller is not operational.
> >
> > Fix this by exiting "ks_pcie_probe()" with the return value of "-EINVAL"
> > in addition to displaying the existing error message.
> >
> > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
>
> Fixes tag? And probably CC stable since the controller seems to be not
> operations without this fix.
While I had mentioned the rationale for not including the 'Fixes tag' in
the v1 patch below the tearline, I forgot to add it in this patch. I will
quote the same below:
NOTE: A "Fixes" tag is ommitted on purpose since the fix is not crucial:
1. It doesn't fix a crash or any fatal error
2. It doesn't enable controller functionality by fixing the issue
Therefore, the patch may not be worth backporting.
Prior to this patch, the probe succeeded and the controller was
unusable. Post this patch, the probe will fail and the controller is
still unusable. Behavior is identical from a usability perspective but
the user is aware of the issue since the probe fails.
>
> - Mani
>
> > ---
> >
> > v1: https://lore.kernel.org/r/20250903124505.365913-11-s-vadapalli@ti.com/
> > No changes since v1.
> >
> > 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 2da9feaaf9ee..e85942b4f6be 100644
> > --- a/drivers/pci/controller/dwc/pci-keystone.c
> > +++ b/drivers/pci/controller/dwc/pci-keystone.c
> > @@ -1414,6 +1414,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);
Regards,
Siddharth.
next prev parent reply other threads:[~2025-09-20 8:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 12:16 [PATCH v2 00/10] PCI: Keystone: Enable loadable module support Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 01/10] PCI: Export pci_get_host_bridge_device() for use by pci-keystone Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 02/10] PCI: dwc: Export dw_pcie_allocate_domains() for pci-keystone Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 03/10] PCI: dwc: Add dw_pcie_free_domains() helper for cleanup Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 04/10] PCI: dwc: ep: Export dw_pcie_ep_raise_msix_irq() for pci-keystone Siddharth Vadapalli
2025-09-19 18:30 ` Manivannan Sadhasivam
2025-09-20 7:57 ` Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 05/10] PCI: keystone: Add ks_pcie_free_msi_irq() helper for cleanup Siddharth Vadapalli
2025-09-19 18:32 ` Manivannan Sadhasivam
2025-09-20 8:04 ` Siddharth Vadapalli
2025-09-20 8:14 ` Manivannan Sadhasivam
2025-09-12 12:16 ` [PATCH v2 06/10] PCI: keystone: Add ks_pcie_free_intx_irq() " Siddharth Vadapalli
2025-09-19 18:35 ` Manivannan Sadhasivam
2025-09-20 8:04 ` Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 07/10] PCI: keystone: Add ks_pcie_host_deinit() " Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 08/10] PCI: keystone: Add ks_pcie_disable_error_irq() " Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 09/10] PCI: keystone: Exit ks_pcie_probe() for the default switch-case of "mode" Siddharth Vadapalli
2025-09-19 18:36 ` Manivannan Sadhasivam
2025-09-20 8:09 ` Siddharth Vadapalli [this message]
2025-09-20 8:27 ` Manivannan Sadhasivam
2025-09-20 8:38 ` Siddharth Vadapalli
2025-09-12 12:16 ` [PATCH v2 10/10] PCI: keystone: Add support to build as a loadable module Siddharth Vadapalli
2025-09-19 18:40 ` Manivannan Sadhasivam
2025-09-20 8:11 ` Siddharth Vadapalli
2025-09-20 8:31 ` Manivannan Sadhasivam
2025-09-20 8:40 ` Siddharth Vadapalli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f3b2f06-64a3-4e6d-9fa9-c3412b1ca710@ti.com \
--to=s-vadapalli@ti.com \
--cc=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=christian.bruel@foss.st.com \
--cc=inochiama@gmail.com \
--cc=jingoohan1@gmail.com \
--cc=jirislaby@kernel.org \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mayank.rana@oss.qualcomm.com \
--cc=qiang.yu@oss.qualcomm.com \
--cc=quic_schintav@quicinc.com \
--cc=robh@kernel.org \
--cc=rongqianfeng@vivo.com \
--cc=sergio.paracuellos@gmail.com \
--cc=shradha.t@samsung.com \
--cc=srk@ti.com \
--cc=thippeswamy.havalige@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox