Repository navigation
usb: typec: tipd: cd321x: don't race the resume read in the IRQ test - #348
Closed
RyanTheTide wants to merge 1 commit into
Closed
RyanTheTide wants to merge 1 commit into
RyanTheTide wants to merge 1 commit into
Conversation
cd321x_ack_retry_across_sleep_test() asserted that the resume read was pending right after tipd_complete(). The driver queues that read with no delay, so on an SMP test machine a worker can already be running it, with the pending bit clear, and the test fails although the driver behaved correctly. With two CPUs it failed in 1 of 20 runs. Wait for the resume read with flush_work() instead. Unlike flush_delayed_work(), it does not run early the retry that the read schedules, so the loop that follows still sees exactly one retry pending after each read. Check that the resume read tried to read the events. The other pending and timer checks in the test look either at work that nothing can queue at that point, or at a retry scheduled at least 500 ms ahead. Not queueing the resume read, or giving up the retry after the cable-state budget, still makes the test fail, and now so does queueing the resume read late. Fixes: 7e97f2f ("usb: typec: tipd: cd321x: Never leave interrupt events unacknowledged") Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Superseded by #349: the same tree, with the commit trailers corrected to the house Assisted-by/Signed-off-by block. The branch is kept. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cd321x_ack_retry_across_sleep_test(from #338) flaked under-smp 2, failing atcd321x-irq-test.c:329. It's the same class as the race #338 already fixed incd321x_test_recover():cd321x_complete()queues the resume read withmod_delayed_work(…, 0), and the test asserted that the read was still pending;Fix (test only, +9/−1)
After
tipd_complete(), the test now waits for the resume read withflush_work(&resume_work.work), then checks that it made exactly one event read. The existing retry loop runs unchanged.It uses
flush_work(), notflush_delayed_work(): if the read has already finished and armed its next retry on a ≥1 s timer,flush_delayed_work()would run that retry at once, giving 2 reads instead of 1.flush_work()covers all three states (queued, running, finished).Audit: every other
delayed_work_pending()/timer assertion incd321x-irq-test.cis deterministic, or follows a timer at least 500 ms away.cd321x-pm-test.chas none.Testing
-smp 2, 20 runs-smp 2, 20 runs-smp 4, 10 runs-smp 2, 20 runs (control)run.py55/55, and checkpatch with 0 errors.🤖 Generated with Claude Code