git: 85be8c09ab4b - stable/14 - mpi3mr: Block devices persist despite being offlined during reset

From: Warner Losh <imp_at_FreeBSD.org>
Date: Wed, 30 Apr 2025 17:21:34 UTC
The branch stable/14 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=85be8c09ab4b2c2389bc8b0c7d6bfecebd3c413c

commit 85be8c09ab4b2c2389bc8b0c7d6bfecebd3c413c
Author:     Chandrakanth patil <chandrakanth.patil@broadcom.com>
AuthorDate: 2024-03-13 18:03:19 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-04-30 17:05:50 +0000

    mpi3mr: Block devices persist despite being offlined during reset
    
    The driver removes the drive from the OS if firmware sends 'device added'
    event with hidden bit or inaccessible status.
    
    Reviewed by:            imp
    Approved by:            imp
    Differential revision:  https://reviews.freebsd.org/D44421
    
    (cherry picked from commit 0d7056458db5b5dd7fdc5ccd8abab73e3ee76a20)
---
 sys/dev/mpi3mr/mpi3mr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c
index 01ecceb430d6..fa7623b56285 100644
--- a/sys/dev/mpi3mr/mpi3mr.c
+++ b/sys/dev/mpi3mr/mpi3mr.c
@@ -5669,6 +5669,8 @@ static void mpi3mr_rfresh_tgtdevs(struct mpi3mr_softc *sc)
 			if (target->exposed_to_os)
 				mpi3mr_remove_device_from_os(sc, target->dev_handle);
 			mpi3mr_remove_device_from_list(sc, target, true);
+		} else if (target->is_hidden && target->exposed_to_os) {
+				mpi3mr_remove_device_from_os(sc, target->dev_handle);
 		}
 	}