type-c-service/ucsi: Fix excessive OPM notification#851
Open
RobertZ2011 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Type-C service’s UCSI integration to avoid notifying the OS Policy Manager (OPM) about PSU connect/disconnect events when the relevant UCSI notification isn’t enabled, reducing unnecessary OPM wakeups/processing.
Changes:
- Gate PSU connect/disconnect-driven UCSI pending notifications on the “battery charge change” notification enable bit.
- Broaden visibility of internal UCSI
Statefields to allow cross-module access from the power-policy event handler.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| type-c-service/src/service/ucsi.rs | Makes UCSI State fields publicly accessible within the parent module to support notification gating logic elsewhere. |
| type-c-service/src/service/power.rs | Avoids pended UCSI notifications on PSU connect/disconnect unless the corresponding UCSI notification is enabled. |
The existing implementation will always notify the OPM on PSU connect/disconnect even if the OPM hasn't enabled the corresponding notification.
b10570c to
6ff117d
Compare
jerrysxie
approved these changes
May 19, 2026
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.
The existing implementation will always notify the OPM on PSU connect/disconnect even if the OPM hasn't enabled the corresponding notification.