Skip to content

media: gs201-csis: Leave ERR_WRONG_CONFIG out of the link's error interrupt - #120

Merged
derekross merged 1 commit into
derekross:omamobilefrom
W4HO-ham:tegu-csis-wrongcfg
Nov 28, 2026
Merged

derekross merged 1 commit into
derekross:omamobilefrom
W4HO-ham:tegu-csis-wrongcfg

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

Draft, stacked on #103 (and #63 under it); only the last commit is new. It waits for one camera run on the palmtop: the nine-switch capture test, plus the link interrupt count per main-camera frame, which should drop from about 530 to about 2.

Every camera stream on the 9a shows link errors, and all of them are INT0 bit 3, ERR_WRONG_CONFIG (the name in Google's isp_fe.h): a packet on VC 0 with a data type no channel takes. The front and ultrawide cameras send one a frame, an embedded-data line. The main camera sends about 527 a frame, its PDAF data; the link's per-VC counters show frames only on VC 0. At 30 fps that's some 16,000 interrupts a second, each a read and two writes of the link's interrupt registers, for an error that never touches the image.

The default INT0 mask now leaves ERR_WRONG_CONFIG out, and the other link errors still interrupt. int0_mask can still take them all for bring-up.

Checks: checkpatch --strict clean. The module with this change (together with #103's fix) is built for the palmtop's kernel.

@derekross

Copy link
Copy Markdown
Owner

Thank you. The numbers explain the change well (about 527 interrupts a frame on the main camera, for packets the image never uses). One thing for when it leaves draft: int0_mask's default applies to every SoC, so this also changes the Pixel 7 Pro, where the old comment records the same ERR_WRONG_CONFIG flood from the main camera's second stream. I think the reason holds there too, so I'm happy to treat it as a deliberate change on both phones, but then it needs a capture on my Pixel 7 Pro before it merges. I can do that alongside #63 and #103. Alternatively, keep gs201's default in its SoC data. Tell me which you prefer.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Run on the palmtop (7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, this commit with #103's in the module; int0_mask reads 16773239, bit 3 clear). Nine captures, switching between all three cameras in every order (3 2 1 2 3 1 1 3 2), all wrote frames (WDMA done 5-9 each). Link interrupts per stream now track the frame count: the main camera took 10 for 5 frames, where it took 2,611 and 3,078 for the same five frames before. The front and ultrawide take one a frame as before, which is the frame interrupt. The error counter still sees bit 3 on the frame interrupts it reads; it just no longer interrupts for it.

@W4HO-ham
W4HO-ham marked this pull request as ready for review October 28, 2026 14:42
@derekross

Copy link
Copy Markdown
Owner

Thank you for the run. Nine captures across all three cameras in every order, with the main camera down from 2,611 and 3,078 link interrupts to 10 for five frames, is a clear result. The int0_mask you read (16773239, 0xfff077) is exactly the default this commit builds: I compared the object with #103's, and the only difference is that one word in .data, bit 3 cleared. No function changes.

You've taken it out of draft with the default still shared, so I'll treat it as a deliberate change on both phones. The reason holds on the Pixel 7 Pro too: my camera notes record ERR_WRONG_CONFIG as the only link error there, about 180-200 interrupts a frame from the main camera's VC 1 lines and once a frame on the others. Two things before it merges:

  1. Please add a sentence to the commit message saying that the default applies to gs201 (the Pixel 7 Pro) too, and why it's right there (the same error, from the main camera's VC 1 lines). As it reads now, the message describes only the 9a, and the old comment's Pixel 7 Pro figure is gone from the new one. "Both phones' sensors" in the comment would cover it.
  2. I'll run a capture on my Pixel 7 Pro with media, phy: the Pixel 9a (zumapro) camera receiver on gs201-csis and the DC-PHY driver #63, media: gs201-csis, s5kgn1, MAINTAINERS: follow-ups to #63 #103 and this commit, and post the result here before I merge. Merge order is media, phy: the Pixel 9a (zumapro) camera receiver on gs201-csis and the DC-PHY driver #63, then media: gs201-csis, s5kgn1, MAINTAINERS: follow-ups to #63 #103, then this.

The checks pass on today's omamobile (clean merge, sign-offs, checkpatch with #63's two known notes, W=1 on the four files).

@kdegeek

kdegeek commented Nov 18, 2026

Copy link
Copy Markdown

A second zumapro data point, from the Pixel 9 Pro Fold (comet, 7.3.0-rc6 int-k9 builds, 11-01).

  • The main IMX787 (link 1, C-PHY x3, 4000x3000) raised ERR_WRONG_CONFIG (INT0 bit 3) about 2,248 times a frame. With this PR's last commit applied as int0_mask=16773239 (0x00fff077), that dropped to 3-6 link errors a capture, and frames were written with WDMA done 3 errors 0.

  • The other three sensors with the mask:

    • outer S5K3K1 (link 4, D-PHY x4): 0 link errors;
    • inner S5K3K1 (link 0, D-PHY x4): 0 link errors;
    • tele S5K3J1 (link 6, D-PHY x4): 9 link errors, all bit 3.

    Test-pattern frames were correct on all three.

  • The S5K3LU ultrawide (link 2, C-PHY x3) needs google,lrte-packet-delimiters, as tegu's GN8 does. Without it, it gives FS 8 FE 0, INT1 bits 3 and 6 about 60,600 times each, and every pixel 0. With the delimiters (lrte_config=0xffff7fff) it gives FS 4 FE 4, WDMA done 4 errors 0 and correct colour bars. The IMX787 doesn't need it.

So the default mask holds on comet's five sensors too. Comet's board DTS will set the LRTE property on the ultrawide's link when it goes up.

@derekross

Copy link
Copy Markdown
Owner

@kdegeek, thank you for the comet numbers. The main IMX787 going from about 2,248 of these a frame to a handful per capture, with the other sensors quiet and no WDMA errors, is the same picture as on the 9a, now on five more sensors. I'll note the ultrawide's google,lrte-packet-delimiters for when comet's board file comes up; it's separate from this commit. When that board PR arrives, please bring the tree and kernel release these runs were made on with it, so the notes can cite them.

@W4HO-ham, where this stands. The head hasn't changed since 28 October, and I re-ran our gate on today's omamobile with it: a clean merge, the 19 sign-offs, checkpatch with #63's two known notes, and the W=1 builds of the four files. Nothing under the CSIS driver or the DC-PHY has moved on omamobile since your base, so the object comparison from then still holds: one word of data differs from #103, bit 3 of the default mask.

Two things are still open from my comment of the 28th:

  1. The message and the comment still describe only the Pixel 9a. The default is shared, so this changes the Pixel 7 Pro too, where the same error comes from the main camera's VC 1 lines (about 180 to 200 a frame). Please add a sentence saying so to the commit message, and name both phones' sensors in the comment above int0_mask; the old comment's Pixel 7 Pro figure disappeared with the rewrite. That's a message amend and one comment line.
  2. My Pixel 7 Pro capture with media, phy: the Pixel 9a (zumapro) camera receiver on gs201-csis and the DC-PHY driver #63, media: gs201-csis, s5kgn1, MAINTAINERS: follow-ups to #63 #103 and this commit. That one is on me, and I'm sorry it is still open; I'll post the per-frame interrupt counts here before I merge.

The order stays #63, then #103, then this.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Both wording points are in (d57eade), and the branch is rebased onto #103's current head (1e59669, rebased on 2026-11-24). The commit message now says the default is shared and changes the Pixel 7 Pro too, where the error comes from the main camera's VC 1 lines, about 180 to 200 a frame. The comment above int0_mask names both phones' sensors: the 9a's IMX712s and S5KGN8, and the 7 Pro's GN1 with its figure back. The code is unchanged, and checkpatch --strict is clean.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you, @W4HO-ham. Both wording points are in: the message now says the default is shared and what it changes on the Pixel 7 Pro, and the comment names both phones' sensors with the 7 Pro's figure. The code is unchanged since 10-28, so the object comparison from then still holds: one word of data, bit 3 of the default mask.

#63 and #103 landed today, so this needs one rebase: git rebase --onto omamobile 1e596698ac97 leaves your one commit on the new tip. I tried it here: it applies cleanly, the result's tree is 01352fea7a56, the same as the test merge onto today's omamobile, and the checks pass on it (sign-off, checkpatch clean, the W=1 build).

The other open point, the capture on my Pixel 7 Pro, is mine, and I'm sorry it has taken this long. Now that the phone runs #63 and #103, I can run your default there through the int0_mask parameter without a new kernel. I'll post the per-frame interrupt counts here, and merge once they're in and the branch is rebased.

@derekross

Copy link
Copy Markdown
Owner

I ran the 7 Pro test I owed you. This PR only changes the default of gs201_csis's int0_mask, which is read at every stream start, and the 7 Pro's kernel already has the code it relies on. So I tested it by writing the parameter rather than pushing a kernel. Kernel 7.3.0-rc6-omamobile-push1-g91b1e57b325e (today's omamobile with #63 and #103), libcamera 0.7.2. Each of the four cameras ran 10 frames through libcamerasrc, first on today's default (16773247) and then on this PR's (16773239). Afterwards I wrote the default back.

Receiver Link interrupts/frame, today With this PR WDMA errors Dropped
1a440000 (main) 1248 3.4 0 → 0 3 → 3
1a450000 1160 2.9 0 → 0 2 → 1
1a460000 2.9 2.8 0 → 0 1 → 2
1a480000 2373 2.7 0 → 0 2 → 1

The stopped: lines for the main camera's link:

today: stopped: FS 19 FE 18 link errors 12481 (last 0x00000008), WDMA done 16 errors 0 (last 0x00000000), dropped 3, missed frame ends 0
#120:  stopped: FS 19 FE 18 link errors 34 (last 0x00000008), WDMA done 16 errors 0 (last 0x00000000), dropped 3, missed frame ends 0

On three of the four links, the bit-3 storm drops to about three interrupts per frame. The fourth link was already quiet and stays the same. The frame counts are unchanged, and WDMA errors stay at 0. Bit 3 is still the only error bit counted, as it was on the 9a. There were no oopses or new error bits. No register reads were made: I didn't touch regs or scan.

From the 7 Pro's side, this is ready to merge.

…errupt

ERR_WRONG_CONFIG flags a packet that no channel is configured to take.
The Pixel 9a's sensors send such packets by design on VC 0: one
embedded-data line a frame on the front and ultrawide cameras, and about
527 PDAF packets a frame on the main camera. At 30 fps that is some
16,000 link interrupts a second on the main camera, each a read and two
writes of the link's interrupt registers, for an error that never
affects the image. The default is shared, so this changes the Pixel 7
Pro too, where the same error comes from the main camera's VC 1 lines,
about 180 to 200 a frame.

Leave it out of the default INT0 mask; the other link errors still
interrupt, and the int0_mask parameter can still take them all for
bring-up.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Rebased as you said (git rebase --onto omamobile 1e596698ac97): the one commit is now on 9f13dedda, head 1ccc6b798. git range-diff shows it unchanged, the sign-off is intact, and tools/kernel-pr-check passes on the new head.

@derekross derekross left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you, @W4HO-ham, for the quick rebase. It's the same commit as before on today's omamobile, and the checks pass there: sign-off, checkpatch clean, the W=1 build of gs201-csis.c, and CI is green on the new head. With the Pixel 7 Pro run in as well, this is ready, and I'll merge it now.

@derekross
derekross merged commit c143303 into derekross:omamobile Nov 28, 2026
1 check passed
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.

3 participants