Skip to content

Conversation

@tullom
Copy link
Contributor

@tullom tullom commented Jan 7, 2026

  • Removed static_cell dependency from Cargo.lock and Cargo.toml in examples and type-c-service.
  • Updated Type-C service methods to accept a reference to intrusive_list::IntrusiveList for better context management.
  • Modified various service methods to pass the controllers list where necessary, ensuring proper context usage.
  • Commented out unused code related to power policy channels and service initialization.
  • Adjusted the task closure to work with the updated service structure.
  • Enhanced error handling and logging throughout the service methods.

@tullom tullom self-assigned this Jan 7, 2026
@tullom tullom added the type-c Related to the type-c service or drivers. label Jan 7, 2026
@tullom tullom moved this to In progress in Embedded Controller Jan 7, 2026
@tullom tullom force-pushed the type-c/remove-global-statics branch 4 times, most recently from 8c975f6 to 16aadd1 Compare January 10, 2026 00:17
@tullom tullom marked this pull request as ready for review January 10, 2026 00:27
@tullom tullom requested review from a team as code owners January 10, 2026 00:27
@tullom tullom moved this from In progress to In review in Embedded Controller Jan 10, 2026
RobertZ2011
RobertZ2011 previously approved these changes Jan 12, 2026
kurtjd
kurtjd previously approved these changes Jan 12, 2026
asasine
asasine previously approved these changes Jan 14, 2026
Copy link

@asasine asasine left a comment

Choose a reason for hiding this comment

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

Looks functional so approved. All of my comments are therefore non-blocking.

  1. &'static -> &'a is a step for testability.
  2. Adding methods to Context and getting rid of the external public static functions is a usability improvement.
  3. Using self.controllers() instead of passing a field as an arg to your own methods is hygeine and usability.

@tullom tullom dismissed stale reviews from asasine, kurtjd, and RobertZ2011 via 4064a52 January 15, 2026 15:18
@tullom tullom force-pushed the type-c/remove-global-statics branch from 4064a52 to 113f3af Compare January 21, 2026 20:18
…context handling

- Removed `static_cell` dependency from Cargo.lock and Cargo.toml in examples and type-c-service.
- Updated Type-C service methods to accept a reference to `intrusive_list::IntrusiveList` for better context management.
- Modified various service methods to pass the controllers list where necessary, ensuring proper context usage.
- Commented out unused code related to power policy channels and service initialization.
- Adjusted the task closure to work with the updated service structure.
- Enhanced error handling and logging throughout the service methods.
- Initializing the service will now register all PD controllers before
  running the type-c task

WIP
@tullom tullom force-pushed the type-c/remove-global-statics branch from 113f3af to fb4a619 Compare January 21, 2026 20:19
@tullom tullom requested review from asasine and kurtjd January 21, 2026 20:19
@tullom tullom requested a review from RobertZ2011 January 21, 2026 20:20
Copy link
Contributor

@jerrysxie jerrysxie left a comment

Choose a reason for hiding this comment

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

Exposing intrusive_list::IntrusiveList as a part of the public API worries me a little bit as it is a bit not user friendly as an API. But if all the code owners for type C agrees that this is the most optimal way to do it, then it is fine.

@tullom Can you post this PR with a high-level description of why we are doing this refactoring on Zulip or maybe as a RFC on https://github.com/OpenDevicePartnership/governance/tree/main/rfc? Thanks.

@RobertZ2011
Copy link
Contributor

Exposing intrusive_list::IntrusiveList as a part of the public API worries me a little bit as it is a bit not user friendly as an API. But if all the code owners for type C agrees that this is the most optimal way to do it, then it is fine.

Long-term I think there's a good chance we'll end up switching to slices or something similar. But I think this is a good incremental change towards that goal.

@tullom
Copy link
Contributor Author

tullom commented Jan 22, 2026

@tullom Can you post this PR with a high-level description of why we are doing this refactoring on Zulip

Done, see Zulip thread here:
#embedded-controller > v0.2.0 Service Refactors

@tullom tullom merged commit 0ada106 into OpenDevicePartnership:v0.2.0 Jan 22, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Embedded Controller Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-c Related to the type-c service or drivers.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants