Skip to content

Pakala CAMSS#770

Open
HangxiangMa wants to merge 16 commits into
qualcomm-linux:qcom-6.18.yfrom
HangxiangMa:camss-pakala-topics
Open

Pakala CAMSS#770
HangxiangMa wants to merge 16 commits into
qualcomm-linux:qcom-6.18.yfrom
HangxiangMa:camss-pakala-topics

Conversation

@HangxiangMa

@HangxiangMa HangxiangMa commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Add support for the RDI only CAMSS camera driver on SM8750. Enabling
RDI path involves adding the support for a set of CSIPHY, CSID and TFE
modules, with each TFE having multiple RDI ports. This hardware
architecture requires 'qdss_debug_xo' clock for CAMNOC to be functional.

SM8750 camera subsystem provides:

  • 6 x CSIPHY (CSI Physical Layer)
  • 3 x TPG (Test Pattern Generator)
  • 3 x CSID (CSI Decoder)
  • 2 x CSID Lite
  • 3 x VFE (Video Front End), 5 RDI per VFE
  • 2 x VFE Lite, 4 RDI per VFE Lite

This series has been tested using the following commands with a
downstream driver for S5KJN5 sensor.

  • media-ctl --reset
  • media-ctl -V '"msm_csiphy2":0[fmt:SGBRG10/4096x3072]'
  • media-ctl -V '"msm_csid0":0[fmt:SGBRG10/4096x3072]'
  • media-ctl -V '"msm_vfe0_rdi0":0[fmt:SGBRG10/4096x3072]'
  • media-ctl -l '"msm_csiphy2":1->"msm_csid0":0[1]'
  • media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
  • yavta --capture=20 -I -n 5 -f SGBRG10P -s 4096x3072 -F /dev/video0

Dependencies:

Depends on Taniya's camcc patch series, which hasn't been merged in 6.18-y branch but in upstream

CRs-Fixed: 4577524

Add bindings for Camera Subsystem (CAMSS) on the Qualcomm Kaanapali
platform.

The Kaanapali platform provides:
- 6 x CSIPHY (CSI Physical Layer)
- 3 x TPG (Test Pattern Generator)
- 3 x CSID (CSI Decoder)
- 2 x CSID Lite
- 3 x VFE (Video Front End), 5 RDI per VFE
- 2 x VFE Lite, 4 RDI per VFE Lite

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-kaanapali-camss-v14-1-e76f26aa6691@oss.qualcomm.com/
Add support for Kaanapali in the camss driver. Add high level resource
information along with the bus bandwidth votes. Module level detailed
resource information will be enumerated in the following patches of the
series.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-kaanapali-camss-v14-2-e76f26aa6691@oss.qualcomm.com/
…e CSIPHY

Add more detailed resource information for CSIPHY devices in the camss
driver along with the support for v2.4.0 in the 2 phase CSIPHY driver
that is responsible for the PHY lane register configuration, module
reset and interrupt handling.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-kaanapali-camss-v14-3-e76f26aa6691@oss.qualcomm.com/
Add more detailed resource information for CSID devices along with the
driver for CSID gen4 that is responsible for CSID register configuration,
module reset and IRQ handling for BUF_DONE events.

In this CSID version, RUP and AUP update values are split into two
registers along with a SET register. Accordingly, enhance the CSID
interface to accommodate both the legacy combined reg_update and the
split RUP and AUP updates.

Co-developed-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-kaanapali-camss-v14-4-e76f26aa6691@oss.qualcomm.com/
Add Video Front End (VFE) version gen4 as found on the Kaanapali SoC.

The FULL front end modules in Kaanapali camera subsystem are called TFEs
(Thin Front End), however, retaining the name VFE at places to maintain
consistency and avoid unnecessary code changes.

This change limits the VFE output lines to 3 for now as constrained by
the CAMSS driver framework.

Kaanapali architecture requires for the REG_UPDATE and AUP_UPDATE to be
issued after all of the CSID configuration has been done. Additionally,
the number of AUP_UPDATEs should match the number of buffers enqueued to
the write master while it's being enabled.

Although the real time data from TFE goes through the RT_CAMNOC, we are
required to enable both the camnoc_rt_axi and camnoc_nrt_axi clocks for
the PDX_NOC, that follows both the RT and NRT NOCs in this architecture,
to ensure that both of the latter are idle after reset.

Co-developed-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-kaanapali-camss-v14-5-e76f26aa6691@oss.qualcomm.com/
Add node for the Kaanapali camera subsystem.

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260508-knp-camera-v1-1-a18e289163fd@oss.qualcomm.com/
Qualcomm Kaanapali SoC has three Camera Control Interface (CCI). Each
controller contains two I2C hosts.

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260508-knp-camera-v1-2-a18e289163fd@oss.qualcomm.com/
Define pinctrl definitions to enable camera master clocks on Kaanapali.

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260508-knp-camera-v1-3-a18e289163fd@oss.qualcomm.com/
Add bindings for Camera Subsystem (CAMSS) on the Qualcomm SM8750 platform.

The SM8750 platform provides:
- 6 x CSIPHY (CSI Physical Layer)
- 3 x TPG (Test Pattern Generator)
- 3 x CSID (CSI Decoder)
- 2 x CSID Lite
- 3 x VFE (Video Front End), 5 RDI per VFE
- 2 x VFE Lite, 4 RDI per VFE Lite

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-add-support-for-camss-on-sm8750-v5-1-dac36a190de8@oss.qualcomm.com/
Add support for SM8750 in the camss driver. Add high level resource
information along with the bus bandwidth votes. Module level detailed
resource information will be enumerated in the following patches of the
series.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-add-support-for-camss-on-sm8750-v5-2-dac36a190de8@oss.qualcomm.com/
…e CSIPHY

Add more detailed resource information for CSIPHY devices in the camss
driver along with the support for v2.3.0 in the 2 phase CSIPHY driver
that is responsible for the PHY lane register configuration, module
reset and interrupt handling.

Additionally, generalize the struct name for the lane configuration that
had been added for Kaanapali and use it for SM8750 as well as they share
the settings.

Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-add-support-for-camss-on-sm8750-v5-3-dac36a190de8@oss.qualcomm.com/
Add more detailed resource information for CSID devices along with the
driver for CSID 980 that is responsible for CSID register
configuration, module reset and IRQ handling for BUF_DONE events.

In SM8750, RUP and AUP updates for the CSID Full modules are split into
two registers along with a SET register. However, CSID Lite modules
still use a single register to update RUP and AUP without the additional
SET register. Handled such differences in the driver.

Co-developed-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-add-support-for-camss-on-sm8750-v5-4-dac36a190de8@oss.qualcomm.com/
Add support for Video Front End (VFE) that is on the SM8750 SoCs. VFE
gen4 has support for VFE 980. This change limits SM8750 VFE output lines
to 3 for now as constrained by the CAMSS driver framework.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Co-developed-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Atiya Kailany <atiya.kailany@oss.qualcomm.com>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260601-add-support-for-camss-on-sm8750-v5-5-dac36a190de8@oss.qualcomm.com/
Add node for the SM8750 camera subsystem.

Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260618-pakala-camera-v2-1-9fbb729fd242@oss.qualcomm.com/
Qualcomm SM8750 SoC has three Camera Control Interface (CCI). Each
controller contains two I2C hosts.

Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260618-pakala-camera-v2-2-9fbb729fd242@oss.qualcomm.com/
Define pinctrl definitions to enable camera master clocks on SM8750.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260618-pakala-camera-v2-3-9fbb729fd242@oss.qualcomm.com/
@HangxiangMa HangxiangMa requested review from a team, Komal-Bajaj, aiquny and shashim-quic June 25, 2026 02:50
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

1 similar comment
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No CR Numbers Found

Error: No Change Request numbers were found.

Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests.

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4577524 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4577524
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@sgaud-quic

Copy link
Copy Markdown
Contributor

PR #770 — validate-patch

PR: #770

Verdict Issues Detailed Report
⚠️ 0 Full report

Final Summary

  1. Lore link present: Yes — all 16 commits carry a Link: https://lore.kernel.org/... tag
  2. Lore link matches PR commits: ⚠️ Partial — content is faithful to the lore series, but the PR uses newer revision IDs (v14/v5/v2) than what qcom-next already carries (v13/v3); minor formatting differences in P03, P04, P12 are consistent with later revisions
  3. Upstream patch status: ⏳ Decision Pending — all 16 patches are FROMLIST: (posted to mailing list, not yet merged into Linus's tree); patches 01–05 and 09–13 are already integrated into the Qualcomm qcom-next staging tree
  4. PR present in qcom-next: Partial — patches 01–13 (driver + binding) are present in qcom-next as 11ba45a33a18, 499f79d582b1, c93f3d0c127b, c252d1bc8aa2, 078a34a0fc02, 5c809096d7f2, 7e6df2deab45, 3a8ba0a4439b, b74bc189948b, b9a32dcb4b4b; patches 06–08 (Kaanapali DTS) and 14–16 (SM8750 DTS) are not yet in qcom-next
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: PR #770 — CAMSS support for Kaanapali and SM8750 (16 patches)
Upstream commits: Multiple lore.kernel.org series (see per-patch table)
Verdict: ⚠️ PARTIAL


Commit Message

All 16 commits carry the FROMLIST: prefix. Per skill rules, From: may be the submitter; only the original lore author's Signed-off-by: is required.

# Check Status Note
All Subject matches upstream Subjects match lore series titles exactly
All Body preserves rationale Commit bodies are complete and accurate
All Fixes tag present/correct ✅ N/A No bug-fix patches; new feature additions
All Authorship preserved From: Hangxiang Ma (submitter); lore author's Signed-off-by: present in all commits
04, 05, 12, 13 Co-developed-by usage Co-developed-by: Atiya Kailany with matching Signed-off-by: — correct usage
All Backport note ✅ N/A FROMLIST: — no backport note required
01–05 Lore link revision ⚠️ PR links to v14 (kaanapali-camss-v14); qcom-next carries v13 (kaanapali-camss-v13)
09–13 Lore link revision ⚠️ PR links to v5 (add-support-for-camss-on-sm8750-v5); qcom-next carries v3 (add-support-for-camss-on-sm8750-v3)
06–08 Lore link revision ⚠️ PR links to v1 (knp-camera-v1); not yet in qcom-next — may have newer revisions
14–16 Lore link revision ⚠️ PR links to v2 (pakala-camera-v2); not yet in qcom-next

Diff

Patches 1–5 and 9–13 are already present in qcom-next (as earlier revisions). Diff comparison is against those qcom-next commits.

File Status Notes
Documentation/devicetree/bindings/media/qcom,kaanapali-camss.yaml (P01) Identical to qcom-next 11ba45a33a18
drivers/media/platform/qcom/camss/camss.c + camss.h (P02) Identical to qcom-next 499f79d582b1
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c + camss.c (P03) ⚠️ 5 hex-literal case differences: PR uses 0xD1; qcom-next uses 0xd1 (lowercase). Cosmetic only — same value
drivers/media/platform/qcom/camss/camss-csid-gen4.h + camss.c (P04) ⚠️ Three issues vs qcom-next c252d1bc8aa2: (1) CSID_RDI_CFG0/CTRL/CFG1 macros use multi-line ternary style in PR vs single-line in qcom-next; (2) CSI2_RX_CFG0_PHY_SEL_BASE_IDX define has extra leading tabs in PR; (3) qcom-next removes an old duplicate #define that is absent from the PR diff context — indicates PR is based on a newer lore revision (v14) that refactored these macros
drivers/media/platform/qcom/camss/camss-vfe-gen4.c + camss.c (P05) Identical to qcom-next 078a34a0fc02
arch/arm64/boot/dts/qcom/kaanapali.dtsi (P06) ✅ N/A Not in qcom-next; lore link present (knp-camera-v1-1); no upstream baseline to compare
arch/arm64/boot/dts/qcom/kaanapali.dtsi (P07) ✅ N/A Not in qcom-next; lore link present (knp-camera-v1-2)
arch/arm64/boot/dts/qcom/kaanapali.dtsi (P08) ✅ N/A Not in qcom-next; lore link present (knp-camera-v1-3)
Documentation/devicetree/bindings/media/qcom,sm8750-camss.yaml (P09) Identical to qcom-next 5c809096d7f2
drivers/media/platform/qcom/camss/camss.c + camss.h (P10) Identical to qcom-next 7e6df2deab45
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c + camss.c (P11) Identical to qcom-next 3a8ba0a4439b
drivers/media/platform/qcom/camss/camss-csid-980.h + camss.c (P12) ⚠️ PR adds #define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1 with extra leading tabs; qcom-next b74bc189948b does not include this line — indicates PR is from a newer lore revision (v5 vs v3)
drivers/media/platform/qcom/camss/camss-vfe-980.c + camss.c (P13) Identical to qcom-next b9a32dcb4b4b
arch/arm64/boot/dts/qcom/sm8750.dtsi (P14) ✅ N/A Not in qcom-next; lore link present (pakala-camera-v2-1)
arch/arm64/boot/dts/qcom/sm8750.dtsi (P15) ✅ N/A Not in qcom-next; lore link present (pakala-camera-v2-2)
arch/arm64/boot/dts/qcom/sm8750.dtsi (P16) ✅ N/A Not in qcom-next; lore link present (pakala-camera-v2-3)

Issues

  1. Lore link revision mismatch — Patches 01–05 (Kaanapali driver): PR links to kaanapali-camss-v14 but qcom-next already carries kaanapali-camss-v13. The diff content for patches 01, 02, 05 is identical to qcom-next. Patches 03 and 04 show minor formatting differences (hex case, macro style) consistent with v14 being a later revision. The Link: tags in the PR should ideally match what was actually applied to qcom-next (v13), or the qcom-next commits should be updated to v14 links.

  2. Lore link revision mismatch — Patches 09–13 (SM8750 driver): PR links to add-support-for-camss-on-sm8750-v5 but qcom-next carries v3. Patches 09–11, 13 are content-identical; patch 12 has one extra #define line. Same situation as above.

  3. Patch 03 — hex literal case (0xD1 vs 0xd1): PR uses uppercase hex in 5 register value entries in camss-csiphy-3ph-1-0.c. Kernel coding style prefers lowercase hex. This is a cosmetic difference from qcom-next but is a style issue.

  4. Patch 04 — macro formatting divergence: CSID_RDI_CFG0, CSID_RDI_CTRL, CSID_RDI_CFG1 macros use a multi-line ternary style with extra indentation in the PR vs the cleaner single-line form in qcom-next. The PR version (v14) is a later revision; the macro reformatting is intentional but diverges from what is already in qcom-next.

  5. Patch 12 — extra #define with inconsistent whitespace: #define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1 appears in the PR with leading tabs (alignment inconsistency). This define is absent from the qcom-next v3 commit, suggesting it was added in v4 or v5.

  6. Patches 06–08 (Kaanapali DTS) — v1 lore links: These patches link to the very first revision (knp-camera-v1). If newer revisions were posted to the mailing list, the Link: tags should be updated to the latest revision. Cannot verify without network access.


Verdict

Patches 01–05 and 09–13 are functionally equivalent to what is already in qcom-next (minor formatting differences in P03/P04/P12 reflect a newer lore revision); patches 06–08 and 14–16 (DTS nodes) are new additions not yet in qcom-next. The PR is mergeable with the following recommended fixes: (1) update Link: tags in P01–P05 to match the v13 revision already in qcom-next, or update qcom-next commits to v14 links; (2) fix uppercase hex literals in P03; (3) align macro formatting in P04 with the qcom-next style; (4) verify P06–P08 lore links point to the latest posted revision.


Final Summary

  1. Lore link present: Yes — all 16 commits carry a Link: https://lore.kernel.org/... tag
  2. Lore link matches PR commits: ⚠️ Partial — content is faithful to the lore series, but the PR uses newer revision IDs (v14/v5/v2) than what qcom-next already carries (v13/v3); minor formatting differences in P03, P04, P12 are consistent with later revisions
  3. Upstream patch status: ⏳ Decision Pending — all 16 patches are FROMLIST: (posted to mailing list, not yet merged into Linus's tree); patches 01–05 and 09–13 are already integrated into the Qualcomm qcom-next staging tree
  4. PR present in qcom-next: Partial — patches 01–13 (driver + binding) are present in qcom-next as 11ba45a33a18, 499f79d582b1, c93f3d0c127b, c252d1bc8aa2, 078a34a0fc02, 5c809096d7f2, 7e6df2deab45, 3a8ba0a4439b, b74bc189948b, b9a32dcb4b4b; patches 06–08 (Kaanapali DTS) and 14–16 (SM8750 DTS) are not yet in qcom-next

@sgaud-quic

Copy link
Copy Markdown
Contributor

PR #770 — checker-log-analyzer

PR: #770
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/28143632726

Checker Result Summary
Checker Result Summary
checkpatch 3 CHECK-level warnings in commit 4 (camss-csid-gen4.c); exit code 1
dt-binding-check Both new YAML schemas pass dt_binding_check + dtbs_check
dtb-check kaanapali-mtp.dtb fails to build — missing qcom,kaanapali-camcc.h header; exit code 1
sparse-check sparse-check.sh passed
check-uapi-headers check-uapi-headers.sh passed
check-patch-compliance check-patch-compliance.sh passed
tag-check All 16 commits carry FROMLIST: prefix — correct for a FROMLIST PR
qcom-next-check All commits are FROMLIST: — tag requirement satisfied

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #770 — CAMSS support for Kaanapali and SM8750 (16 commits, FROMLIST: prefix, base: qcom-6.18.y)
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/28143632726
Overall CI status:failure (kernel-checker check posted to SHA 166e8a7f4f71)

Checker Result Summary
checkpatch 3 CHECK-level warnings in commit 4 (camss-csid-gen4.c); exit code 1
dt-binding-check Both new YAML schemas pass dt_binding_check + dtbs_check
dtb-check kaanapali-mtp.dtb fails to build — missing qcom,kaanapali-camcc.h header; exit code 1
sparse-check sparse-check.sh passed
check-uapi-headers check-uapi-headers.sh passed
check-patch-compliance check-patch-compliance.sh passed
tag-check All 16 commits carry FROMLIST: prefix — correct for a FROMLIST PR
qcom-next-check All commits are FROMLIST: — tag requirement satisfied

❌ checkpatch

Root cause: Commit 4 (2ff7450771ff — "FROMLIST: media: qcom: camss: csid: Add support for CSID gen4") uses macros where the argument rdi appears more than once in the expansion, triggering checkpatch's CHECK: Macro argument reuse warning.

Failure details:

CHECK: Macro argument reuse 'rdi' - possible side-effects?
#119: FILE: drivers/media/platform/qcom/camss/camss-csid-gen4.c:74:
+#define CSID_RDI_CFG0(rdi)  (csid_is_lite(csid) ?\
+                    (0x3080 + 0x200 * (rdi)) :\
+                    (0x5480 + 0x200 * (rdi)))

CHECK: Macro argument reuse 'rdi' - possible side-effects?
#131: FILE: drivers/media/platform/qcom/camss/camss-csid-gen4.c:86:
+#define CSID_RDI_CTRL(rdi)  ...

CHECK: Macro argument reuse 'rdi' - possible side-effects?
#136: FILE: drivers/media/platform/qcom/camss/camss-csid-gen4.c:91:
+#define CSID_RDI_CFG1(rdi)  ...

2ff7450771ff total: 0 errors, 0 warnings, 3 checks, 498 lines checked

Exit code 1 is raised because checkpatch treats any CHECK finding as a non-zero exit in strict mode.

Fix: The rdi argument is used twice in each ternary branch (once in the condition via csid_is_lite(csid) — which doesn't use rdi — and once in each branch). The real concern is that rdi is evaluated twice. Wrap the argument in a local variable using a do { } while(0) helper, or restructure as an inline function, or use __builtin_constant_p guard. The simplest kernel-style fix is to convert these three macros to static inline functions:

static inline u32 csid_rdi_cfg0(struct camss_csid *csid, u32 rdi)
{
    return csid_is_lite(csid) ? (0x3080 + 0x200 * rdi)
                              : (0x5480 + 0x200 * rdi);
}

Apply the same pattern for CSID_RDI_CTRL and CSID_RDI_CFG1.

Reproduce locally:

./scripts/checkpatch.pl --strict --summary-file --ignore FILE_PATH_CHANGES \
  --git c9744addfb04eec214121e1fc11040e828576da4..6d2b341d9f450bc52f3b5e0377f3b44b02213491

❌ dtb-check

Root cause: The DTS file arch/arm64/boot/dts/qcom/kaanapali.dtsi (added by commit 6, "FROMLIST: arm64: dts: qcom: kaanapali: Add camss node") references clock and power-domain constants from dt-bindings/clock/qcom,kaanapali-camcc.h, but that header has not been added to the tree in this PR. The DTC preprocessor cannot resolve the symbols, producing dozens of Lexical error: Unexpected 'CAM_CC_*' errors and a FATAL ERROR: Syntax error parsing input tree, causing kaanapali-mtp.dtb to fail to build.

Failure details:

Lexical error: ../arch/arm64/boot/dts/qcom/kaanapali.dtsi:777.21-46 Unexpected 'CAM_CC_CAMNOC_NRT_AXI_CLK'
Lexical error: ../arch/arm64/boot/dts/qcom/kaanapali.dtsi:778.14-38 Unexpected 'CAM_CC_CAMNOC_RT_AXI_CLK'
... (30+ similar Lexical errors for CAM_CC_* clocks and GDSCs) ...
FATAL ERROR: Syntax error parsing input tree
make[4]: *** [.../kaanapali-mtp.dtb] Error 1

The same root cause also triggers a secondary failure in dt-binding-check during the dtbs build pass (though the per-schema dt_binding_check/dtbs_check for the new YAML files themselves pass):

Documentation/devicetree/bindings/media/qcom,kaanapali-camss.example.dts:25:18:
  fatal error: dt-bindings/clock/qcom,kaanapali-camcc.h: No such file or directory

And identically for qcom,sm8750-camcc.h in the SM8750 binding example.

Fix: Add the missing clock-binding header files to the PR:

  • include/dt-bindings/clock/qcom,kaanapali-camcc.h — defining all CAM_CC_* constants used in kaanapali.dtsi (clocks at lines 777–811, GDSCs at lines 896–899, 940, 970, 1000, and CCI clocks at lines 942, 972, 1002).
  • include/dt-bindings/clock/qcom,sm8750-camcc.h — same for SM8750 DTS.

These headers are typically generated from the clock controller driver (e.g., drivers/clk/qcom/camcc-kaanapali.c). If the camcc driver is not yet in the tree, the headers must be added standalone (as is common for FROMLIST DTS patches that depend on a not-yet-merged clock driver). Check whether a companion camcc PR exists and either merge it first or cherry-pick the header files.

Reproduce locally:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs 2>&1 | grep -E "kaanapali|sm8750.*camcc"

Verdict

2 blockers to fix before merge:

  1. checkpatch — Convert 3 CSID_RDI_* macros in camss-csid-gen4.c to static inline functions to eliminate the Macro argument reuse CHECKs.
  2. dtb-check — Add include/dt-bindings/clock/qcom,kaanapali-camcc.h and include/dt-bindings/clock/qcom,sm8750-camcc.h so the DTS files compile cleanly; the kaanapali-mtp.dtb build currently fails with 30+ unresolved CAM_CC_* symbols.

@sgaud-quic

Copy link
Copy Markdown
Contributor

dtb-check | ❌ | kaanapali-mtp.dtb fails to build — missing qcom,kaanapali-camcc.h header; exit code 1

@HangxiangMa please fix this.

@sgaud-quic sgaud-quic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Pakala is needed on qcom-6.18.y branch ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants