* [PATCH v3 0/2] media: qcom: camss: Fix Glymur CSIPHY topology
@ 2026-11-19 15:04 Nihal Kumar Gupta
2026-11-19 15:04 ` [PATCH v3 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta
2026-11-19 15:04 ` [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta
0 siblings, 2 replies; 4+ messages in thread
From: Nihal Kumar Gupta @ 2026-11-19 15:04 UTC (permalink / raw)
To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Bryan O'Donoghue
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel,
Suresh Vankadara, Vikram Sharma, Nihal Kumar Gupta
Glymur reuses the X1E80100 CAMSS block resources, but has only three
CSI2 PHYs instead of four.
Update the binding to describe three logical CAMSS input ports, and add
Glymur-specific CSIPHY resources for the PHYs present on Glymur while
continuing to reuse the common X1E80100 CAMSS resources.
The Glymur DTS is still under review, so this updates the schema and
example before the old port@3 example is used.
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
Changes in v3:
- Clarify the binding ABI change and why the old port@3 ABI worked - Krzysztof
- Explain in commit dropping port@3 does not affect in-tree users because
Glymur DTS support is still under review - Loic
- Link to v2: https://lore.kernel.org/r/20261113-glymur_camss-v2-0-b1b76509c744@oss.qualcomm.com
Changes in v2:
- Rebase on next-20261112
- Use logical CAMSS ports 0-2 in the Glymur binding example - Krzysztof
- Add Glymur-specific CSIPHY resources for the three available PHYs.
- Link to v1: https://lore.kernel.org/r/20261102-glymur_camss-v1-0-fcb619fc7319@oss.qualcomm.com
---
Nihal Kumar Gupta (2):
dt-bindings: media: qcom,glymur-camss: Use linear CSI ports
media: qcom: camss: Add Glymur-specific resources
.../bindings/media/qcom,glymur-camss.yaml | 6 ++--
drivers/media/platform/qcom/camss/camss.c | 42 +++++++++++++++++++++-
2 files changed, 44 insertions(+), 4 deletions(-)
---
base-commit: 6d582d78fad9d828e575ca0cdcff8ea47a77220b
change-id: 20261102-glymur_camss-1cf83f4a447f
Best regards,
--
Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v3 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports 2026-11-19 15:04 [PATCH v3 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta @ 2026-11-19 15:04 ` Nihal Kumar Gupta 2026-11-19 15:04 ` [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta 1 sibling, 0 replies; 4+ messages in thread From: Nihal Kumar Gupta @ 2026-11-19 15:04 UTC (permalink / raw) To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bryan O'Donoghue Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, Suresh Vankadara, Vikram Sharma, Nihal Kumar Gupta Glymur has three CSI2 PHY connections: CSIPHY0, CSIPHY1 and CSIPHY4. The existing ABI used port@3 for CSIPHY4 because the driver reused the X1E80100 CSIPHY table, where entry 3 maps to hardware PHY id 4. Use linear graph ports 0-2 by replacing port@3 with port@2 for the third CSI2 PHY connection. The matching Glymur driver data maps port@2 to hardware PHY id 4, and there are no in-tree users of the old port@3 ABI yet. Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> --- Documentation/devicetree/bindings/media/qcom,glymur-camss.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,glymur-camss.yaml b/Documentation/devicetree/bindings/media/qcom,glymur-camss.yaml index a0b77edc212319fad69113f3d55ca24f184d4b23..18a38fc4f9025f6b927780f55ed4fab194091c02 100644 --- a/Documentation/devicetree/bindings/media/qcom,glymur-camss.yaml +++ b/Documentation/devicetree/bindings/media/qcom,glymur-camss.yaml @@ -109,7 +109,7 @@ properties: CSI input ports. patternProperties: - "^port@[0-3]$": + "^port@[0-2]$": $ref: /schemas/graph.yaml#/$defs/port-base unevaluatedProperties: false @@ -288,8 +288,8 @@ examples: }; }; - port@3 { - reg = <3>; + port@2 { + reg = <2>; camss_csiphy4_ep: endpoint { data-lanes = <1 2 3 4>; remote-endpoint = <&csiphy4_out>; -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources 2026-11-19 15:04 [PATCH v3 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta 2026-11-19 15:04 ` [PATCH v3 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta @ 2026-11-19 15:04 ` Nihal Kumar Gupta 2026-11-19 15:20 ` sashiko-bot 1 sibling, 1 reply; 4+ messages in thread From: Nihal Kumar Gupta @ 2026-11-19 15:04 UTC (permalink / raw) To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bryan O'Donoghue Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, Suresh Vankadara, Vikram Sharma, Nihal Kumar Gupta Glymur previously reused the X1E80100 CAMSS resources, where port@3 selected CSIPHY4 through x1e80100 csiphy_res[3].csiphy.id. Add Glymur-specific CSIPHY resources so ports 0, 1 and 2 map to hardware PHY ids 0, 1 and 4. The remaining CAMSS resources continue to reuse the X1E80100 CAMSS resources. Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> --- drivers/media/platform/qcom/camss/camss.c | 42 ++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index f8e5cf9f3ff09e96d3b48cd5628489715385cc5c..f3cab9ecef04273e09b81ee0cd4e31ca45d1c915 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -4103,6 +4103,30 @@ static const struct resources_icc icc_res_sa8775p[] = { }, }; +static const struct camss_subdev_resources csiphy_res_glymur[] = { + /* CSIPHY0 */ + { + .csiphy = { + .id = 0, + .formats = &csiphy_formats_sdm845 + }, + }, + /* CSIPHY1 */ + { + .csiphy = { + .id = 1, + .formats = &csiphy_formats_sdm845 + }, + }, + /* CSIPHY4 */ + { + .csiphy = { + .id = 4, + .formats = &csiphy_formats_sdm845 + }, + }, +}; + static const struct camss_subdev_resources csiphy_res_x1e80100[] = { /* CSIPHY0 */ { @@ -5572,6 +5596,22 @@ static void camss_remove(struct platform_device *pdev) camss_genpd_cleanup(camss); } +static const struct camss_resources glymur_resources = { + .version = CAMSS_X1E80100, + .pd_name = "top", + .csiphy_res = csiphy_res_glymur, + .tpg_res = tpg_res_x1e80100, + .csid_res = csid_res_x1e80100, + .vfe_res = vfe_res_x1e80100, + .csid_wrapper_res = &csid_wrapper_res_x1e80100, + .icc_res = icc_res_x1e80100, + .icc_path_num = ARRAY_SIZE(icc_res_x1e80100), + .csiphy_num = ARRAY_SIZE(csiphy_res_glymur), + .tpg_num = ARRAY_SIZE(tpg_res_x1e80100), + .csid_num = ARRAY_SIZE(csid_res_x1e80100), + .vfe_num = ARRAY_SIZE(vfe_res_x1e80100), +}; + static const struct camss_resources msm8916_resources = { .version = CAMSS_8x16, .csiphy_res = csiphy_res_8x16, @@ -5806,6 +5846,7 @@ static const struct camss_resources x1e80100_resources = { }; static const struct of_device_id camss_dt_match[] = { + { .compatible = "qcom,glymur-camss", .data = &glymur_resources }, { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources }, { .compatible = "qcom,msm8939-camss", .data = &msm8939_resources }, { .compatible = "qcom,msm8953-camss", .data = &msm8953_resources }, @@ -5824,7 +5865,6 @@ static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,sm8550-camss", .data = &sm8550_resources }, { .compatible = "qcom,sm8650-camss", .data = &sm8650_resources }, { .compatible = "qcom,x1e80100-camss", .data = &x1e80100_resources }, - { .compatible = "qcom,glymur-camss", .data = &x1e80100_resources }, { } }; -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources 2026-11-19 15:04 ` [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta @ 2026-11-19 15:20 ` sashiko-bot 0 siblings, 0 replies; 4+ messages in thread From: sashiko-bot @ 2026-11-19 15:20 UTC (permalink / raw) To: Nihal Kumar Gupta; +Cc: devicetree, robh, conor+dt, media-ci Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] media: qcom: camss: NULL deref in msm_csiphy_subdev_init_legacy() on Glymur -- commit d70c41f9364c13281ae9244b3389299002ad38d7 Author: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> media: qcom: camss: Add Glymur-specific resources This commit adds Glymur-specific CSIPHY and CAMSS resources so that ports 0, 1 and 2 map to hardware PHY IDs 0, 1 and 4 while reusing X1E80100 resources for the remaining blocks. > diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c > index f8e5cf9f3ff09..f3cab9ecef042 100644 > --- a/drivers/media/platform/qcom/camss/camss.c > +++ b/drivers/media/platform/qcom/camss/camss.c > @@ -4103,6 +4103,30 @@ static const struct resources_icc icc_res_sa8775p[] = { > }, > }; > > +static const struct camss_subdev_resources csiphy_res_glymur[] = { > + /* CSIPHY0 */ > + { > + .csiphy = { > + .id = 0, > + .formats = &csiphy_formats_sdm845 > + }, > + }, > + /* CSIPHY1 */ > + { > + .csiphy = { > + .id = 1, > + .formats = &csiphy_formats_sdm845 > + }, > + }, > + /* CSIPHY4 */ > + { > + .csiphy = { > + .id = 4, > + .formats = &csiphy_formats_sdm845 > + }, > + }, > +}; [Severity: High] Can probing qcom,glymur-camss trigger a NULL pointer dereference in msm_csiphy_subdev_init_legacy() when no CSI2 PHY remote-endpoint is connected in Device Tree? csiphy_res_glymur leaves .csiphy.hw_ops NULL. In camss_init_subdevices(), camss_detect_legacy_phy() defaults camss->legacy_phy to true and only sets it to false if it finds an endpoint with a remote port parent named "phy": drivers/media/platform/qcom/camss/camss.c:camss_detect_legacy_phy() { camss->legacy_phy = true; /* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node(camss->dev->of_node, ep) { remote = of_graph_get_remote_port_parent(ep); if (!remote) continue; camss->legacy_phy = !of_node_name_eq(remote, "phy"); of_node_put(remote); of_node_put(ep); break; } } Because endpoints under ports are optional (for example when using only the internal TPGs or before board endpoints are wired up), camss->legacy_phy remains true when none are present. camss_init_subdevices() then calls msm_csiphy_subdev_init_legacy(), which unconditionally calls csiphy->res->hw_ops->init(csiphy). -- Sashiko AI review · https://sashiko.dev/#/patchset/20261119-glymur_camss-v3-0-71ab966c41c9@oss.qualcomm.com?part=2 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-19 15:20 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-11-19 15:04 [PATCH v3 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta 2026-11-19 15:04 ` [PATCH v3 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta 2026-11-19 15:04 ` [PATCH v3 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta 2026-11-19 15:20 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox