feat(diagnostics): expose sanitized driver health and USB counters - #3
feat(diagnostics): expose sanitized driver health and USB counters#3pvurda wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6141d5579d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| usb_urb->status == -ECONNRESET || | ||
| usb_urb->status == -ESHUTDOWN)) | ||
| goto in_fail; | ||
| if (unlikely(usb_urb->status != 0)) { |
There was a problem hiding this comment.
Keep recoverable URB errors from permanently panicking PCM
When a PCM completion reports a recoverable transport error such as -EPROTO or -EILSEQ, this broadened predicate now enters the panic path instead of resubmitting the URB. Because rt->panic then makes every remaining input and output callback return without resubmission, a single transient USB error permanently stops all audio until a device reset or replug; checked both PCM completion handlers, which should distinguish teardown/fatal statuses from errors that can be recorded and retried.
Useful? React with 👍 / 👎.
| snd_iprintf(buffer, "packet_bytes=%u:%u\n", chip->info->out_packet_size, | ||
| chip->info->in_packet_size); |
There was a problem hiding this comment.
Report the resolved playback packet size
On a Ploytec device whose playback endpoint resolves to interrupt transport, this reports the static bulk default of 4096 bytes even though ploytec_get_out_packet_size() allocates 3856-byte output URBs. Consequently packet_bytes is deterministically wrong for that supported topology and can mislead comparisons with the new completion logs; derive the value through the device callback or the initialized URB instead.
Useful? React with 👍 / 👎.
| atomic_set(&chip->diag.last_stage, stage); | ||
| atomic_set(&chip->diag.last_usb_status, usb_status); | ||
| atomic_set(&chip->diag.last_errno, error); |
There was a problem hiding this comment.
Publish the last-failure fields as one snapshot
When input, output, or MIDI URBs fail concurrently, these three independent stores can interleave with another ozzy_diag_failure() call, while the proc reader also reads them independently. The resulting last_failure may combine one event's stage with another event's USB status or errno, defeating the intended exact failure diagnostic; serialize the tuple or protect it with a sequence counter so readers obtain one coherent event.
Useful? React with 👍 / 👎.
Summary
/proc/asound/cardN/ozzy_statustools/ozzy-report.shcollector that never opens PCM or rawmidi devicesDiagnostics contract
The proc entry contains no USB serial number, PCM samples, MIDI payloads, memory addresses, or hex dumps. Counters are connection-scoped and read-only. Missing ALSA proc support does not prevent the module from loading.
ozzy-report.sh --card N --output FILEwrites mode0600, reports unavailable sources explicitly, and sanitizes serials, usernames, home paths, memory addresses, and unrelated kernel logs.Validation
make -C linux ci KERNELDIR=/lib/modules/6.14.0-37-generic/buildmake -C linux ci KERNELDIR=/lib/modules/6.8.0-100-generic/buildmake -C tests/ploytec testmake -C tests/ploytec sanitizeshellcheck tools/ozzy-report.sh tests/report/test-report.shtests/report/test-report.shcheckpatch.pl: no errors or warnings22f0:000f,%p, buffer dumps, or per-successful-URB loggingLocal Clang was unavailable; the existing Ubuntu 24.04 GCC/Clang CI matrix remains the authoritative Clang gate.
Scope
No codec, audio format, packet geometry, USB ID, or Xone:43C runtime support changes.
Stacked on #2.