The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=24f83c9b197eaadc711d40eac2665d6aee17cc24
commit 24f83c9b197eaadc711d40eac2665d6aee17cc24 Author: Chandrakanth Patil <[email protected]> AuthorDate: 2026-09-27 15:52:24 +0000 Commit: Sumit Saxena <[email protected]> CommitDate: 2026-12-02 08:21:01 +0000 mpi3mr: Fix non-RAID JBOD drive re-exposure after device removal When removing a target device, the driver previously required the firmware removal handshake to be fully completed before allowing the device to be unlinked from the driver's internal target list. If a non-RAID JBOD drive had already been unregistered from the OS layer before the removal handshake completed, its entry remained stuck in the driver's internal list. Because the stale entry was retained, subsequent re-discovery of the drive (such as when re-inserting the drive or hot-plugging a replacement) failed to expose the drive to the OS. Allow the target entry to be unlinked from the internal list if the device has already been removed from the OS layer. This ensures stale entries are cleaned up promptly and allows hot-plugged JBOD drives to be re-discovered and exposed immediately. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D60310 --- sys/dev/mpi3mr/mpi3mr_cam.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index e46f9a1c12a9..f7b57d564333 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -1933,9 +1933,11 @@ out: void mpi3mr_remove_device_from_list(struct mpi3mr_softc *sc, struct mpi3mr_target *target, bool must_delete) { - if ((must_delete == false) && - (target->state != MPI3MR_DEV_REMOVE_HS_COMPLETED)) - return; + if (must_delete == false) { + if ((target->state != MPI3MR_DEV_REMOVE_HS_COMPLETED) && + (!target->dev_removed)) + return; + } mtx_lock_spin(&sc->target_lock); TAILQ_REMOVE(&sc->cam_sc->tgt_list, target, tgt_next);
