Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in memory I2C mux state does not always reflect true state #1417

Merged
merged 9 commits into from
Jun 19, 2023

Conversation

bcantrill
Copy link
Collaborator

@bcantrill bcantrill commented Jun 16, 2023

Fixes #1413; draft comment:

Addresses #1413 by:

- Eliminating the possibility of having in-memory state not reflect
  hardware state by intoducing an explicit state (MuxState::Unknown)
  denoting unknown mux state for a bus (and therefore necessitating
  mux initialization on any subsequent transaction)

- Making sure that any failed attempt to set mux state (e.g., in
  initial configuration) indicates that the bus is in
  MuxState::Unknown

- Fixing a source of initial configuration failures due to reset
  during an I2C transaction by correcting the SCL wiggling code to
  correctly clock through the zombie transaction and assert a STOP
  condition

- Greatly expanding the ring buffer holding I2C errors (which pushes
  us over a memory threshold -- but this is clearly a price worth
  paying)

- Making the ring buffer much more explicit as to observed errors

- Having reset of the controller reset all muxes on a bus rather
  than merely the mux that was involved in the transaction that
  induced the need for a reset -- and have all such resets set the
  state to be MuxState::Unknown

Additionally, this eliminates the selected_mux_segment entry point,
which has outlived its usefulness.

@bcantrill bcantrill changed the title Mux fix frfr in memory I2C mux state does not always reflect true state Jun 17, 2023
@bcantrill bcantrill marked this pull request as ready for review June 17, 2023 05:31
drv/i2c-api/src/lib.rs Outdated Show resolved Hide resolved
@bcantrill bcantrill merged commit dcb6408 into master Jun 19, 2023
51 checks passed
@cbiffle cbiffle deleted the mux-fix-frfr branch July 10, 2023 19:04
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.

Rev-C gimlet came up with a self-assigned IP address / corrupt VPD
2 participants