From: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Bryan O'Donoghue <bod@kernel.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Felipe Balbi <balbi@ti.com>,
Vikram Sharma <vikram.sharma@oss.qualcomm.com>,
Suresh Vankadara <svankada@qti.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linux-phy@lists.infradead.org,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH v17 5/5] media: qcom: camss: Use data-lanes starting at 1 for new CSIPHY mode
Date: Sun, 6 Sep 2026 21:17:43 +0530 [thread overview]
Message-ID: <b0089142-45eb-4cf7-be6f-45c9889b3756@oss.qualcomm.com> (raw)
In-Reply-To: <20260906-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v17-5-e2197a3e2551@linaro.org>
On 06-09-2026 19:47, Bryan O'Donoghue wrote:
> Introducing a dedicated CSIPHY driver community feedback was both to move
> to data-lanes starting at index 1 on the PHY side and also to match that
> indexing scheme in the CSI decoder - CSID.
>
> CSID consumes the data-lanes property to determine which CSID lanes to
> switch on. For indexes starting at 1 we need to amend the logic somewhere.
> The PHY side code normalises the input data to register level meanings so,
> replicate that logic on the CSID side.
>
> Introduce a simple flag to differentiate between legacy indexing @ 0 and
> new indexing @ 1.
>
> Existing bindings are not affected.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> drivers/media/platform/qcom/camss/camss.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 84097d82d99c9..07b3cddca5840 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4742,7 +4742,8 @@ static const struct parent_dev_ops vfe_parent_dev_ops = {
> */
> static int camss_parse_endpoint_node(struct device *dev,
> struct fwnode_handle *ep,
> - struct camss_async_subdev *csd)
> + struct camss_async_subdev *csd,
> + u8 lane_base)
> {
> struct csiphy_lanes_cfg *lncfg = &csd->interface.csi2.lane_cfg;
> struct v4l2_mbus_config_mipi_csi2 *mipi_csi2;
> @@ -4777,7 +4778,14 @@ static int camss_parse_endpoint_node(struct device *dev,
> return -ENOMEM;
>
> for (i = 0; i < lncfg->num_data; i++) {
> - lncfg->data[i].pos = mipi_csi2->data_lanes[i];
> + u8 lane = mipi_csi2->data_lanes[i];
> +
> + if (lane < lane_base || lane - lane_base >= lncfg->num_data) {
> + dev_err(dev, "invalid data-lane %u\n", lane);
> + return -EINVAL;
> + }
> +
> + lncfg->data[i].pos = mipi_csi2->data_lanes[i] - lane_base;
> lncfg->data[i].pol = mipi_csi2->lane_polarities[i + 1];
> }
>
> @@ -4794,6 +4802,7 @@ static int camss_parse_ports(struct camss *camss)
> {
> struct device *dev = camss->dev;
> struct fwnode_handle *fwnode = dev_fwnode(dev), *ep;
> + u8 lane_base = camss->legacy_phy ? 0 : 1;
> int ret;
>
> fwnode_graph_for_each_endpoint(fwnode, ep) {
> @@ -4841,7 +4850,7 @@ static int camss_parse_ports(struct camss *camss)
> goto err_cleanup;
> }
>
> - ret = camss_parse_endpoint_node(dev, ep, csd);
> + ret = camss_parse_endpoint_node(dev, ep, csd, lane_base);
> if (ret < 0)
> goto err_cleanup;
> }
>
Reviewed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Tested-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> # Glymur CRD
---
Regards,
Nihal Kumar Gupta
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Bryan O'Donoghue <bod@kernel.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Felipe Balbi <balbi@ti.com>,
Vikram Sharma <vikram.sharma@oss.qualcomm.com>,
Suresh Vankadara <svankada@qti.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linux-phy@lists.infradead.org,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH v17 5/5] media: qcom: camss: Use data-lanes starting at 1 for new CSIPHY mode
Date: Sun, 6 Sep 2026 21:17:43 +0530 [thread overview]
Message-ID: <b0089142-45eb-4cf7-be6f-45c9889b3756@oss.qualcomm.com> (raw)
In-Reply-To: <20260906-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v17-5-e2197a3e2551@linaro.org>
On 06-09-2026 19:47, Bryan O'Donoghue wrote:
> Introducing a dedicated CSIPHY driver community feedback was both to move
> to data-lanes starting at index 1 on the PHY side and also to match that
> indexing scheme in the CSI decoder - CSID.
>
> CSID consumes the data-lanes property to determine which CSID lanes to
> switch on. For indexes starting at 1 we need to amend the logic somewhere.
> The PHY side code normalises the input data to register level meanings so,
> replicate that logic on the CSID side.
>
> Introduce a simple flag to differentiate between legacy indexing @ 0 and
> new indexing @ 1.
>
> Existing bindings are not affected.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> drivers/media/platform/qcom/camss/camss.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 84097d82d99c9..07b3cddca5840 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -4742,7 +4742,8 @@ static const struct parent_dev_ops vfe_parent_dev_ops = {
> */
> static int camss_parse_endpoint_node(struct device *dev,
> struct fwnode_handle *ep,
> - struct camss_async_subdev *csd)
> + struct camss_async_subdev *csd,
> + u8 lane_base)
> {
> struct csiphy_lanes_cfg *lncfg = &csd->interface.csi2.lane_cfg;
> struct v4l2_mbus_config_mipi_csi2 *mipi_csi2;
> @@ -4777,7 +4778,14 @@ static int camss_parse_endpoint_node(struct device *dev,
> return -ENOMEM;
>
> for (i = 0; i < lncfg->num_data; i++) {
> - lncfg->data[i].pos = mipi_csi2->data_lanes[i];
> + u8 lane = mipi_csi2->data_lanes[i];
> +
> + if (lane < lane_base || lane - lane_base >= lncfg->num_data) {
> + dev_err(dev, "invalid data-lane %u\n", lane);
> + return -EINVAL;
> + }
> +
> + lncfg->data[i].pos = mipi_csi2->data_lanes[i] - lane_base;
> lncfg->data[i].pol = mipi_csi2->lane_polarities[i + 1];
> }
>
> @@ -4794,6 +4802,7 @@ static int camss_parse_ports(struct camss *camss)
> {
> struct device *dev = camss->dev;
> struct fwnode_handle *fwnode = dev_fwnode(dev), *ep;
> + u8 lane_base = camss->legacy_phy ? 0 : 1;
> int ret;
>
> fwnode_graph_for_each_endpoint(fwnode, ep) {
> @@ -4841,7 +4850,7 @@ static int camss_parse_ports(struct camss *camss)
> goto err_cleanup;
> }
>
> - ret = camss_parse_endpoint_node(dev, ep, csd);
> + ret = camss_parse_endpoint_node(dev, ep, csd, lane_base);
> if (ret < 0)
> goto err_cleanup;
> }
>
Reviewed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Tested-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> # Glymur CRD
---
Regards,
Nihal Kumar Gupta
next prev parent reply other threads:[~2026-09-06 15:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 14:17 [PATCH v17 0/5] Add phy_get_by_of_node and devm helper Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:17 ` [PATCH v17 1/5] phy: core: Fix use-after-free in phy_get paths Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:17 ` [PATCH v17 2/5] phy: core: Add phy_get_by_of_node() Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:31 ` sashiko-bot
2026-09-06 14:31 ` sashiko-bot
2026-09-06 14:17 ` [PATCH v17 3/5] phy: core: Add devm_phy_get_by_of_node() Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:17 ` [PATCH v17 4/5] media: qcom: camss: Add support for PHY API devices Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:32 ` sashiko-bot
2026-09-06 14:32 ` sashiko-bot
2026-09-06 14:17 ` [PATCH v17 5/5] media: qcom: camss: Use data-lanes starting at 1 for new CSIPHY mode Bryan O'Donoghue
2026-09-06 14:17 ` Bryan O'Donoghue
2026-09-06 14:28 ` sashiko-bot
2026-09-06 14:28 ` sashiko-bot
2026-09-06 15:47 ` Nihal Kumar Gupta [this message]
2026-09-06 15:47 ` Nihal Kumar Gupta
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=b0089142-45eb-4cf7-be6f-45c9889b3756@oss.qualcomm.com \
--to=nihal.gupta@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=balbi@ti.com \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=svankada@qti.qualcomm.com \
--cc=todor.too@gmail.com \
--cc=vikram.sharma@oss.qualcomm.com \
--cc=vkoul@kernel.org \
--cc=vladimir.zapolskiy@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.