Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andrew Gigena" <mail@andrewgigena.dev>
Cc: devicetree@vger.kernel.org, linux-phy@lists.infradead.org,
	robh@kernel.org, conor+dt@kernel.org, media-ci@linuxtv.org,
	vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v3 6/7] phy: qcom-mipi-csi2: Add SM8150 CSI2 DPHY support
Date: Fri, 06 Nov 2026 18:50:18 +0000	[thread overview]
Message-ID: <sashiko-outbox-202106@kernel.org> (raw)
In-Reply-To: <20261106-sm8150-v7.4-rc1-camss-v3-6-0103e8a0bbcd@andrewgigena.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] phy: qcom-mipi-csi2: wrong SM8150 lane polarity offsets in
  lanes_enable()
--

commit 8f49680e61ed7e381ce9eb5db34d5783dd1ae930
Author: Andrew Gigena <mail@andrewgigena.dev>

phy: qcom-mipi-csi2: Add SM8150 CSI2 DPHY support

This commit adds SM8150 platform configuration and lane initialization tables
to the Qualcomm MIPI CSI2 DPHY driver, along with support for a fixed timer
clock rate and single power domain attachment.

> diff --git a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> index 966d79c98f9b2..b8b6589cee35d 100644
> --- a/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c
> +++ b/drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c

[ ... ]

> @@ -352,6 +419,36 @@ static const struct mipi_csi2phy_hw_ops phy_qcom_mipi_csi2_ops_3ph_1_0 = {
>  	.lanes_disable = phy_qcom_mipi_csi2_lanes_disable,
>  };
>  
> +static const char * const sm8150_clks[] = {
> +	"core",
> +	"timer"
> +};
> +
> +static const char * const sm8150_supplies[] = {
> +	"vdda-phy",
> +	"vdda-pll"
> +};
> +
> +static struct mipi_csi2_genpd sm8150_genpds[] = {
> +	{ .name = "top", .scaled = false },
> +};
> +
> +const struct mipi_csi2phy_soc_cfg mipi_csi2_dphy_sm8150 = {
> +	.ops = &phy_qcom_mipi_csi2_ops_3ph_1_0,
> +	.reg_info = {
> +		.init_seq = lane_regs_sm8150,
> +		.lane_array_size = ARRAY_SIZE(lane_regs_sm8150),
> +		.common_regs_offset = 0x800,
> +	},

[Severity: Medium]
Does phy_qcom_mipi_csi2_lanes_enable() write lane polarity inversion to the
wrong register offsets on SM8150?

In lane_regs_sm8150[], the physical lane register blocks use a 0x100-byte
stride (data lanes at 0x0000, 0x0200, 0x0400, 0x0600 and the clock lane at
0x0700) with common registers starting at 0x0800.  However,
phy_qcom_mipi_csi2_lanes_enable() programs CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(),
which hardcodes X1E80100's 0x200-byte per-lane stride:

drivers/phy/qualcomm/phy-qcom-mipi-csi2-3ph-dphy.c:
    #define CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(n)		((0x200 * (n)) + 0x24)
    ...
    phy_qcom_mipi_csi2_lanes_enable() {
        ...
	/* Lane configuration for polarity @ CSIPHY-base + CTRL9 */
	for (i = 0; i < cfg->num_data_lanes; i++) {
		if (lane_cfg->data[i].pol) {
			u8 pos = lane_cfg->data[i].pos;

			writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(pos * 2));
		}
	}

	if (lane_cfg->clk.pol)
		writel(BIT(2), csi2phy->base + CSIPHY_2PH_LN_CSI_2PHASE_CTRL9n(lane_cfg->clk.pos));

When a board configures non-zero lane-polarities on SM8150, data lanes 1..3
and the clock lane write to 0x0424, 0x0824, 0x0c24, and 0x0e24 instead of
0x0224, 0x0424, 0x0624, and 0x0724, leaving those lanes uninverted and
overwriting CSI_COMMON_CTRL9 at 0x0824 when data lane 2 is inverted.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-sm8150-v7.4-rc1-camss-v3-0-0103e8a0bbcd@andrewgigena.dev?part=6

  reply	other threads:[~2026-11-06 18:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 18:35 [PATCH v3 0/7] media: qcom: camss: Add SM8150 CAMSS support Andrew Gigena via B4 Relay
2026-11-06 18:35 ` [PATCH v3 1/7] dt-bindings: i2c: qcom-cci: Document SM8150 compatible Andrew Gigena via B4 Relay
2026-11-06 21:26   ` Vladimir Zapolskiy
2026-11-07 14:14   ` Wolfram Sang
2026-11-06 18:35 ` [PATCH v3 2/7] dt-bindings: media: qcom,sm8150-camss: Add SM8150 CAMSS Andrew Gigena via B4 Relay
2026-11-06 21:38   ` Vladimir Zapolskiy
2026-11-10 23:46     ` Andrew Gigena
2026-11-09 10:44   ` Krzysztof Kozlowski
2026-11-10 15:43     ` Andrew Gigena
2026-11-06 18:35 ` [PATCH v3 3/7] dt-bindings: phy: qcom,sm8150-csi2-phy: Add SM8150 CSI2 PHY Andrew Gigena via B4 Relay
2026-11-06 21:24   ` Vladimir Zapolskiy
2026-11-10 23:52     ` Andrew Gigena
2026-11-06 22:32   ` Bryan O'Donoghue
2026-11-06 18:35 ` [PATCH v3 4/7] media: qcom: camss: Match VFE lite clocks by name prefix Andrew Gigena via B4 Relay
2026-11-06 18:49   ` sashiko-bot
2026-11-06 22:34   ` Bryan O'Donoghue
2026-11-06 18:35 ` [PATCH v3 5/7] media: qcom: camss: Add support for SM8150 Andrew Gigena via B4 Relay
2026-11-06 18:53   ` sashiko-bot
2026-11-06 21:50   ` Vladimir Zapolskiy
2026-11-11  1:27     ` Andrew Gigena
2026-11-06 22:35   ` Bryan O'Donoghue
2026-11-06 18:35 ` [PATCH v3 6/7] phy: qcom-mipi-csi2: Add SM8150 CSI2 DPHY support Andrew Gigena via B4 Relay
2026-11-06 18:50   ` sashiko-bot [this message]
2026-11-06 22:29   ` Bryan O'Donoghue
2026-11-07 14:03     ` Bryan O'Donoghue
2026-11-10 23:56       ` Andrew Gigena
2026-11-06 18:35 ` [PATCH v3 7/7] arm64: dts: qcom: sm8150: Add CAMSS and CCI nodes Andrew Gigena via B4 Relay
2026-11-06 18:59   ` sashiko-bot

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=sashiko-outbox-202106@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mail@andrewgigena.dev \
    --cc=media-ci@linuxtv.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