Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "David Oberhollenzer" <david.oberhollenzer@sigma-star.at>
Cc: neil.armstrong@linaro.org, conor+dt@kernel.org,
	linux-phy@lists.infradead.org, vkoul@kernel.org,
	olteanv@gmail.com, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode
Date: Thu, 06 Aug 2026 09:24:02 +0000	[thread overview]
Message-ID: <20260806092402.C99EA1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260806091112.164695-3-david.oberhollenzer@sigma-star.at>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver mishandles errors from the `ti,syscon-acspcie-tx-rx` property lookup, breaking probe deferral and silently swallowing configuration failures.
--

--- Patch [2]: [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode ---
commit 1cbf4349932708c2c097de105a5c13d7baeaeb61
Author: David Oberhollenzer <david.oberhollenzer@sigma-star.at>

phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode

This commit allows configuring the ACSPCIe TX/RX mode for PCIe PHYs.
It reads the syscon property from the device tree and updates the mode
selection bits in the specified register.

> --- a/drivers/phy/ti/phy-ti-pipe3.c
> +++ b/drivers/phy/ti/phy-ti-pipe3.c

[ ... ]

> @@ -785,6 +788,24 @@ static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy)
>  	return PTR_ERR_OR_ZERO(phy->pll_ctrl_base);
>  }
>  
> +static int ti_pipe3_acspcie_tx_rx_mode(struct ti_pipe3 *phy)
> +{
> +	struct device_node *np = phy->dev->of_node;
> +	struct regmap *regmap;
> +	unsigned int args[2];
> +
> +	regmap = syscon_regmap_lookup_by_phandle_args(np,
> +						      "ti,syscon-acspcie-tx-rx",
> +						      2, args);
> +	if (IS_ERR(regmap)) {
> +		dev_warn(phy->dev, "can't get ti,syscon-acspcie-tx-rx\n");
> +		return -EINVAL;
> +	}

[Severity: High]
Does converting all syscon lookup errors to -EINVAL break probe deferral?

If syscon_regmap_lookup_by_phandle_args() returns -EPROBE_DEFER because the
syscon driver probes later, this converts the error to -EINVAL and prevents
the driver from deferring properly.

Additionally, if this property is optional on older device trees, would an
-ENOENT return cause spurious warnings in the kernel log?

> +
> +	return regmap_update_bits(regmap, args[0], PCIE_TX_RX_CTRL_MASK,
> +				  args[1] << PCIE_TX_RX_CTRL_SHIFT);
> +}
> +
>  static int ti_pipe3_probe(struct platform_device *pdev)
>  {
>  	struct ti_pipe3 *phy;

[ ... ]

> @@ -807,6 +828,12 @@ static int ti_pipe3_probe(struct platform_device *pdev)
>  	phy->dpll_map = data->dpll_map;
>  	phy->settings = data->settings;
>  
> +	if (phy->mode == PIPE3_MODE_PCIE) {
> +		ret = ti_pipe3_acspcie_tx_rx_mode(phy);
> +		if (ret)
> +			dev_warn(dev, "failed to set ACSPCIe TX/RX mode\n");
> +	}
> +
>  	ret = ti_pipe3_get_pll_base(phy);
>  	if (ret)
>  		return ret;

[Severity: High]
Does this sequence silently swallow the configuration failure?

The error code from ti_pipe3_acspcie_tx_rx_mode() is captured in ret and
logged, but probe execution continues.

Because ti_pipe3_get_pll_base() unconditionally returns 0 for PCIe mode
right after this check, the value in ret is immediately overwritten, and the
probe will not abort.

Could this leave the PCIe bus in a non-functional state without explicitly
failing the driver probe?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260806091112.164695-1-david.oberhollenzer@sigma-star.at?part=2

  reply	other threads:[~2026-08-06  9:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06  9:11 [PATCH v2 0/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer
2026-08-06  9:11 ` [PATCH v2 1/2] dt-bindings: phy: ti,phy-usb3: Add aspcie reference clock setting David Oberhollenzer
2026-08-12  2:20   ` Rob Herring
2026-08-06  9:11 ` [PATCH v2 2/2] phy: ti: ti-pipe3: allow configuring ACSPCIe TX/RX mode David Oberhollenzer
2026-08-06  9:24   ` sashiko-bot [this message]
2026-08-10  7:48     ` David Oberhollenzer

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=20260806092402.C99EA1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=david.oberhollenzer@sigma-star.at \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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