Skip to content

Conversation

@makubacki
Copy link
Collaborator

Description

The implementation currently doesn't skip a driver when a specific child handle is given. It might potentially call the driver's stop function and return success instead of returning not found.

This change:

  1. Adds a flag to track whether the specified child handle was found in the driver's child list.

  2. Adds a validation check to skip processing a driver if a specific child was requested but not found in that driver's child list.

  3. Updates the disconnect logic to use total_children == child_handles.len() to determine if all children should be disconnected.

A couple of unit tests are added to test expected behavior based on child state when core_disconnect_controller() is called.

The new test added, test_disconnect_specific_child_among_multiple_children() would have passed previously but tests that a specific child is requested, the child handle is present in the driver's child list, and that the child is not the only child. Under these conditions, it verifies that the driver's stop function is not called (since other child are present) and the driver remains connected to the controller.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • Run all unit tests
  • Check that test_disconnect_specific_child_not_managed_by_driver() fails without thee change and passes with it
  • QEMU boot to EFI shell

Integration Instructions

  • N/A

@makubacki makubacki self-assigned this Nov 11, 2025
@github-actions github-actions bot added the impact:testing Affects testing label Nov 11, 2025
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki makubacki marked this pull request as ready for review November 11, 2025 18:30
The implementation currently doesn't skip a driver when a specific
child handle is given. It might potentially call the driver's stop
function and return success instead of returning not found.

This change:

1. Adds a flag to track whether the specified child handle was found
   in the driver's child list.

2. Adds a validation check to skip processing a driver if a specific
   child was requested but not found in that driver's child list.

3. Updates the disconnect logic to use
   `total_children == child_handles.len()` to determine if all
   children should be disconnected.

A couple of unit tests are added to test expected behavior based
on child state when core_disconnect_controller() is called.

The `test_disconnect_specific_child_among_multiple_children()` would
have passed previously but tests that a specific child is requested,
the child handle is present in the driver's child list, and that the
child is not the only child. Under these conditions, it verifies that
the driver's stop function is not called (since other child are
present) and the driver remains connected to the controller.

Signed-off-by: Michael Kubacki <[email protected]>
@makubacki makubacki force-pushed the disconnect_cont_child_validation branch from 92efccb to 1a66d75 Compare December 19, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:testing Affects testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants