GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — kraken3: match HID responses to the requests that asked for them by creativeheadz · Pull Request #916 · liquidctl/liquidctl ConversationThe problem
def _write_then_read(self, data): self._write(data) return self._read() Two things routinely leave other reports in the queue: several call sites send with a bare The two meet inside self._write([0x36, 0x02]) # end transfer — reply left queued if not self._switch_bucket(...): # reads that leftover instead so That byte happened to be
The user-visible symptom is an LCD push that reports success and does not display, intermittently, with no error on any path — which makes it look like a panel quirk rather than a driver bug. The fixClear the queue before sending, then check the prefix of what comes back. The clear is what actually fixes it. The prefix check is a backstop and cannot by itself disambiguate replies that share a prefix, as the bucket queries do — worth stating explicitly, since prefix matching alone looks sufficient and is not. Reads that find no matching report fall back to the first report read, preserving the previous behaviour rather than raising. TestsAdded a regression test that queues a stale This required making the mock faithful: it previously answered bucket-setup and bucket-switch with a zeroed Full suite: 518 passed, 2 skipped (both pre-existing). ScopeIndependent of #915 and branched from
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions_write_then_read() returns whatever report arrives next, without checking
that it answers the command just sent. Two things routinely leave other
reports in the queue: several call sites send with a bare _write() and never
consume the reply, and the device also emits unsolicited status reports.
The two meet inside _send_data(), which ends a transfer with
self._write([0x36, 0x02]) # reply left queued
if not self._switch_bucket(...): # reads that leftover instead
so _switch_bucket() takes byte 14 of the stale 0x37 0x02 as the switch
result. Observed on a Kraken 2023 Elite (1e71:300c), firmware 1.1.0, while
tracing every exchange of one push:
MISMATCH cmd=0x38 0x01 expected=0x39 0x01 got=0x37 0x02 byte14=0x01
That byte happened to be 0x01, so the switch reported success without having
been verified at all. _query_buckets() reads the same blind way, and since
all sixteen queries answer 0x31 0x04, one misread shifts the whole table and
_get_bucket_memory_offset() then sizes a transfer from another bucket's
address. The symptom is an LCD push that reports success and does not
display, intermittently and with no error on any path.
Clear the queue before sending, and check the prefix of what comes back.
The clear is what fixes it; the prefix check is a backstop, and cannot by
itself disambiguate replies that share a prefix, as the bucket queries do.
Reads that find no matching report fall back to the first report read, which
preserves the previous behaviour rather than raising.
The mock grew reply prefixes for the bucket-setup, bucket-switch,
bucket-query and data-transfer commands, which it previously answered with a
zeroed header that no real device sends.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. This branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |