Skip to content

serial: Fix reset when disconnected - #4178

Merged
Steven Malis (smalis-msft) merged 1 commit into
microsoft:mainfrom
smalis-msft:serial-dc-rst
Aug 7, 2026
Merged

serial: Fix reset when disconnected#4178
Steven Malis (smalis-msft) merged 1 commit into
microsoft:mainfrom
smalis-msft:serial-dc-rst

Conversation

@smalis-msft

Copy link
Copy Markdown
Contributor

Refactors how serial device state is initialized and reset to ensure that the device's modem connection state actually matches the backend connection status after a reset. This prevents devices from incorrectly reporting a carrier when no backend is attached. Also add new tests to verify this behavior.

@smalis-msft
Steven Malis (smalis-msft) requested a review from a team as a code owner August 6, 2026 20:05
Copilot AI lite review requested due to automatic review settings August 6, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Refactors serial device initialization/reset so modem/carrier state reflects whether a backend is actually connected after reset, preventing false carrier reporting on disconnected ports, and adds regression tests.

Changes:

  • Initialize State with backend connectivity (io.is_connected()) instead of always “connecting” after reset.
  • Remove unconditional connect() calls in constructors and reset paths for PL011 and 16550.
  • Add async tests ensuring reset does not assert carrier/modem lines when the backend is disconnected.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
vm/devices/serial/serial_pl011/src/lib.rs Makes state init/reset conditional on backend connectivity; adds PL011 regression test for disconnected reset.
vm/devices/serial/serial_16550/src/lib.rs Makes state init/reset conditional on backend connectivity; adds 16550 regression test for disconnected reset.

Comment thread vm/devices/serial/serial_pl011/src/lib.rs
Comment thread vm/devices/serial/serial_16550/src/lib.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

@smalis-msft
Steven Malis (smalis-msft) merged commit 7c5eb13 into microsoft:main Aug 7, 2026
97 of 101 checks passed
@smalis-msft
Steven Malis (smalis-msft) deleted the serial-dc-rst branch August 7, 2026 19:57
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.

3 participants