* [PATCH v5 0/2] media: qcom: camss: Fix Glymur CSIPHY topology
@ 2026-12-03 16:21 Nihal Kumar Gupta
2026-12-03 16:21 ` [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta
2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta
0 siblings, 2 replies; 6+ messages in thread
From: Nihal Kumar Gupta @ 2026-12-03 16:21 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,
Krzysztof Kozlowski, Jesse Casco
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.
This fixes the Glymur CAMSS binding added for v7.4-rc before the old
port@3 ABI appears in a final release.
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
Changes in v5:
- Rebased on next-20261202 and resolved driver file conflict.
- Collected Reviewed-by tags from Krzysztof, Vladimir and Loic.
- Collected Tested-by tag from Jesse.
- Reuse Glymur CSIPHY resources to CAMSS_CSIPHY_RES_PHY_API(); no functional change.
- Link to v4: https://lore.kernel.org/r/20261123-glymur_camss-v4-0-d7db74f59e22@oss.qualcomm.com
Changes in v4:
- Rebase on next-20261120
- Add Fixes tags and clarify that this targets the current v7.4-rc cycle - Krzysztof, Bryan
- Rework commit logs to describe the ABI fix and Glymur CSIPHY resources
- Link to v3: https://lore.kernel.org/r/20261119-glymur_camss-v3-0-71ab966c41c9@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 | 25 +++++++++++++++++++++-
2 files changed, 27 insertions(+), 4 deletions(-)
---
base-commit: 799dd936553182df5770dde7f38d94c8337df75a
change-id: 20261102-glymur_camss-1cf83f4a447f
Best regards,
--
Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports 2026-12-03 16:21 [PATCH v5 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta @ 2026-12-03 16:21 ` Nihal Kumar Gupta 2026-12-03 16:48 ` Bryan O'Donoghue 2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta 1 sibling, 1 reply; 6+ messages in thread From: Nihal Kumar Gupta @ 2026-12-03 16:21 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, Krzysztof Kozlowski Glymur has three CSI2 PHY connections: CSIPHY0, CSIPHY1 and CSIPHY4. The binding documented CSIPHY4 as port@3 because the initial driver data reused the X1E80100 CSIPHY table, where entry 3 maps to hardware PHY id 4. Fix the current v7.4-rc ABI to 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. Fixes: 1e0c8f82d710 ("dt-bindings: media: qcom,glymur-camss: Add Glymur CAMSS") Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> 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] 6+ messages in thread
* Re: [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports 2026-12-03 16:21 ` [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta @ 2026-12-03 16:48 ` Bryan O'Donoghue 0 siblings, 0 replies; 6+ messages in thread From: Bryan O'Donoghue @ 2026-12-03 16:48 UTC (permalink / raw) To: Nihal Kumar Gupta, Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, Suresh Vankadara, Vikram Sharma, Krzysztof Kozlowski On 03/12/2026 16:21, Nihal Kumar Gupta wrote: > Glymur has three CSI2 PHY connections: CSIPHY0, CSIPHY1 and CSIPHY4. > The binding documented CSIPHY4 as port@3 because the initial driver data > reused the X1E80100 CSIPHY table, where entry 3 maps to hardware PHY id 4. > > Fix the current v7.4-rc ABI to 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. > > Fixes: 1e0c8f82d710 ("dt-bindings: media: qcom,glymur-camss: Add Glymur CAMSS") > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> > Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> > 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>; > Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources 2026-12-03 16:21 [PATCH v5 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta 2026-12-03 16:21 ` [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta @ 2026-12-03 16:21 ` Nihal Kumar Gupta 2026-12-03 16:49 ` Bryan O'Donoghue 2026-12-03 17:06 ` sashiko-bot 1 sibling, 2 replies; 6+ messages in thread From: Nihal Kumar Gupta @ 2026-12-03 16:21 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, Jesse Casco Glymur has three CSIPHY instances while X1E80100 has four. Reusing the X1E80100 CSIPHY resources also exposes CSIPHY2, which is not present on Glymur. Add Glymur-specific CSIPHY resources for the three available PHYs while continuing to reuse the common X1E80100 CAMSS resources. Fixes: 09d6c30d3fae ("media: qcom: camss: Add Glymur compatible") Tested-by: Jesse Casco <jesse.casco@gmail.com> # Asus Zenbook A16 Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> --- drivers/media/platform/qcom/camss/camss.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 3a5b7c665d3a913e06489e985348b38af97c2f39..189f4bada15a0c0ae49ce2b39b10268369e1c824 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -4529,6 +4529,13 @@ static const struct resources_icc icc_res_sa8775p[] = { }, }; +static const struct camss_subdev_resources csiphy_res_glymur[] = { + /* CSIPHY0 CSIPHY1 CSIPHY4 */ + { CAMSS_CSIPHY_RES_PHY_API(0, &csiphy_formats_sdm845), }, + { CAMSS_CSIPHY_RES_PHY_API(1, &csiphy_formats_sdm845), }, + { CAMSS_CSIPHY_RES_PHY_API(4, &csiphy_formats_sdm845), }, +}; + static const struct camss_subdev_resources csiphy_res_x1e80100[] = { /* CSIPHY0 */ { @@ -6167,6 +6174,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 kaanapali_resources = { .version = CAMSS_KAANAPALI, .pd_name = "top", @@ -6436,6 +6459,7 @@ static const struct camss_resources x1p42100_resources = { }; static const struct of_device_id camss_dt_match[] = { + { .compatible = "qcom,glymur-camss", .data = &glymur_resources }, { .compatible = "qcom,kaanapali-camss", .data = &kaanapali_resources }, { .compatible = "qcom,msm8916-camss", .data = &msm8916_resources }, { .compatible = "qcom,msm8939-camss", .data = &msm8939_resources }, @@ -6456,7 +6480,6 @@ static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,sm8650-camss", .data = &sm8650_resources }, { .compatible = "qcom,x1e80100-camss", .data = &x1e80100_resources }, { .compatible = "qcom,x1p42100-camss", .data = &x1p42100_resources }, - { .compatible = "qcom,glymur-camss", .data = &x1e80100_resources }, { } }; -- 2.34.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources 2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta @ 2026-12-03 16:49 ` Bryan O'Donoghue 2026-12-03 17:06 ` sashiko-bot 1 sibling, 0 replies; 6+ messages in thread From: Bryan O'Donoghue @ 2026-12-03 16:49 UTC (permalink / raw) To: Nihal Kumar Gupta, Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain, Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, Suresh Vankadara, Vikram Sharma, Jesse Casco On 03/12/2026 16:21, Nihal Kumar Gupta wrote: > Glymur has three CSIPHY instances while X1E80100 has four. Reusing the > X1E80100 CSIPHY resources also exposes CSIPHY2, which is not present on > Glymur. > > Add Glymur-specific CSIPHY resources for the three available PHYs while > continuing to reuse the common X1E80100 CAMSS resources. > > Fixes: 09d6c30d3fae ("media: qcom: camss: Add Glymur compatible") > Tested-by: Jesse Casco <jesse.casco@gmail.com> # Asus Zenbook A16 > Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> > Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> > Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources 2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta 2026-12-03 16:49 ` Bryan O'Donoghue @ 2026-12-03 17:06 ` sashiko-bot 1 sibling, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-12-03 17:06 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 e587f871cdd9e6a0077c83e75057c1e3daa0a4ae Author: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com> media: qcom: camss: Add Glymur-specific resources This commit adds Glymur-specific CSIPHY and CAMSS resource tables for the three CSIPHY instances on Glymur and updates the qcom,glymur-camss match entry to use them instead of x1e80100_resources. > diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c > index 3a5b7c665d3a9..189f4bada15a0 100644 > --- a/drivers/media/platform/qcom/camss/camss.c > +++ b/drivers/media/platform/qcom/camss/camss.c > @@ -4529,6 +4529,13 @@ static const struct resources_icc icc_res_sa8775p[] = { > }, > }; > > +static const struct camss_subdev_resources csiphy_res_glymur[] = { > + /* CSIPHY0 CSIPHY1 CSIPHY4 */ > + { CAMSS_CSIPHY_RES_PHY_API(0, &csiphy_formats_sdm845), }, > + { CAMSS_CSIPHY_RES_PHY_API(1, &csiphy_formats_sdm845), }, > + { CAMSS_CSIPHY_RES_PHY_API(4, &csiphy_formats_sdm845), }, > +}; [Severity: High] Can this cause a NULL pointer dereference on csiphy->res->hw_ops during probe when no remote PHY endpoint is connected? CAMSS_CSIPHY_RES_PHY_API() leaves .csiphy.hw_ops as NULL, while camss_detect_legacy_phy() sets camss->legacy_phy = !!camss->res->csiphy_res and only clears it if an endpoint resolves to a remote node named "phy". On a Glymur device tree with no connected remote "phy" endpoint (such as TPG-only operation with an empty ports node), camss->legacy_phy stays true. camss_init_subdevices() then calls msm_csiphy_subdev_init_legacy(), which dereferences csiphy->res->hw_ops->init(csiphy) and crashes during probe. Before this change, x1e80100_resources populated .hw_ops, so this path failed cleanly with -EINVAL. Should camss_detect_legacy_phy() check that hw_ops is non-NULL before enabling legacy mode? -- Sashiko AI review · https://sashiko.dev/#/patchset/20261203-glymur_camss-v5-0-960a6030ca6b@oss.qualcomm.com?part=2 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-12-03 17:06 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-12-03 16:21 [PATCH v5 0/2] media: qcom: camss: Fix Glymur CSIPHY topology Nihal Kumar Gupta 2026-12-03 16:21 ` [PATCH v5 1/2] dt-bindings: media: qcom,glymur-camss: Use linear CSI ports Nihal Kumar Gupta 2026-12-03 16:48 ` Bryan O'Donoghue 2026-12-03 16:21 ` [PATCH v5 2/2] media: qcom: camss: Add Glymur-specific resources Nihal Kumar Gupta 2026-12-03 16:49 ` Bryan O'Donoghue 2026-12-03 17:06 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox