Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: mpi3mr: Hidden drives not removed during soft reset

If any drive is missing during reset, the driver checks whether the device
is exposed to the OS. If it is, then it removes the device from the OS and
its own internal list. For hidden devices, even if they are found as
missing during reset, the driver is not removing them from its internal
list.

Modify driver to remove hidden devices from the driver's target device list
if they are missing during soft reset.

Link: https://lore.kernel.org/r/20220505184808.24049-2-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Sreekanth Reddy and committed by
Martin K. Petersen
2dd8389f 1aa529d4

+5 -3
+5 -3
drivers/scsi/mpi3mr/mpi3mr_os.c
··· 911 911 912 912 list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list, 913 913 list) { 914 - if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) && 915 - tgtdev->host_exposed) { 916 - mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); 914 + if (tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) { 915 + dprint_reset(mrioc, "removing target device with perst_id(%d)\n", 916 + tgtdev->perst_id); 917 + if (tgtdev->host_exposed) 918 + mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); 917 919 mpi3mr_tgtdev_del_from_list(mrioc, tgtdev); 918 920 mpi3mr_tgtdev_put(tgtdev); 919 921 }