Skip to content

Commit a3d2165

Browse files
Sreekanth Reddykamalmostafa
authored andcommitted
[SCSI] mpt3sas: Infinite loops can occur if MPI2_IOCSTATUS_CONFIG_INVALID_PAGE is not returned
commit 14be49a upstream. Infinite loop can occur if IOCStatus is not equal to MPI2_IOCSTATUS_CONFIG_INVALID_PAGE value in the while loops in functions _scsih_search_responding_sas_devices, _scsih_search_responding_raid_devices and _scsih_search_responding_expanders So, Instead of checking for MPI2_IOCSTATUS_CONFIG_INVALID_PAGE value, in this patch code is modified to check for IOCStatus not equals to MPI2_IOCSTATUS_SUCCESS to break the while loop. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
1 parent da732f6 commit a3d2165

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6409,7 +6409,7 @@ _scsih_search_responding_sas_devices(struct MPT3SAS_ADAPTER *ioc)
64096409
handle))) {
64106410
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
64116411
MPI2_IOCSTATUS_MASK;
6412-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6412+
if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
64136413
break;
64146414
handle = le16_to_cpu(sas_device_pg0.DevHandle);
64156415
device_info = le32_to_cpu(sas_device_pg0.DeviceInfo);
@@ -6511,7 +6511,7 @@ _scsih_search_responding_raid_devices(struct MPT3SAS_ADAPTER *ioc)
65116511
&volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
65126512
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
65136513
MPI2_IOCSTATUS_MASK;
6514-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6514+
if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
65156515
break;
65166516
handle = le16_to_cpu(volume_pg1.DevHandle);
65176517

@@ -6535,7 +6535,7 @@ _scsih_search_responding_raid_devices(struct MPT3SAS_ADAPTER *ioc)
65356535
phys_disk_num))) {
65366536
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
65376537
MPI2_IOCSTATUS_MASK;
6538-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6538+
if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
65396539
break;
65406540
phys_disk_num = pd_pg0.PhysDiskNum;
65416541
handle = le16_to_cpu(pd_pg0.DevHandle);
@@ -6614,7 +6614,7 @@ _scsih_search_responding_expanders(struct MPT3SAS_ADAPTER *ioc)
66146614

66156615
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
66166616
MPI2_IOCSTATUS_MASK;
6617-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6617+
if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
66186618
break;
66196619

66206620
handle = le16_to_cpu(expander_pg0.DevHandle);
@@ -6759,8 +6759,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
67596759
MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) {
67606760
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
67616761
MPI2_IOCSTATUS_MASK;
6762-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6763-
break;
67646762
if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
67656763
pr_info(MPT3SAS_FMT "\tbreak from expander scan: " \
67666764
"ioc_status(0x%04x), loginfo(0x%08x)\n",
@@ -6804,8 +6802,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
68046802
phys_disk_num))) {
68056803
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
68066804
MPI2_IOCSTATUS_MASK;
6807-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6808-
break;
68096805
if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
68106806
pr_info(MPT3SAS_FMT "\tbreak from phys disk scan: "\
68116807
"ioc_status(0x%04x), loginfo(0x%08x)\n",
@@ -6871,8 +6867,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
68716867
&volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) {
68726868
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
68736869
MPI2_IOCSTATUS_MASK;
6874-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6875-
break;
68766870
if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
68776871
pr_info(MPT3SAS_FMT "\tbreak from volume scan: " \
68786872
"ioc_status(0x%04x), loginfo(0x%08x)\n",
@@ -6931,8 +6925,6 @@ _scsih_scan_for_devices_after_reset(struct MPT3SAS_ADAPTER *ioc)
69316925
handle))) {
69326926
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
69336927
MPI2_IOCSTATUS_MASK;
6934-
if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE)
6935-
break;
69366928
if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
69376929
pr_info(MPT3SAS_FMT "\tbreak from end device scan:"\
69386930
" ioc_status(0x%04x), loginfo(0x%08x)\n",

0 commit comments

Comments
 (0)