]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: mpt3sas: Fix system going into read-only mode
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Wed, 17 Nov 2021 10:50:58 +0000 (16:20 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 19 Nov 2021 03:38:59 +0000 (22:38 -0500)
commit9ac2c77f98411434f3b361a90b3e3b1e7ac6f4eb
treeae646dea27aaff44922dfb0be1f9e585040dffe5
parentc013a441d0517700b7bf4f2c1f1b6d5af0a783d1
scsi: mpt3sas: Fix system going into read-only mode

While determining the SAS address of a drive, the driver checks whether the
handle number is less than the HBA phy count or not. If the handle number
is less than the HBA phy count then driver assumes that this handle belongs
to HBA and hence it assigns the HBA SAS address.

During IOC firmware downgrade operation, if the number of HBA phys is
reduced and the OS drive's device handle drops below the phy count while
determining the drive's SAS address, the driver ends up using the HBA's SAS
address. This leads to a mismatch of drive's SAS address and hence the
driver unregisters the OS drive and the system goes into read-only mode.

Update the IOC's num_phys to the HBA phy count provided by actual loaded
firmware.

Link: https://lore.kernel.org/r/20211117105058.3505-1-sreekanth.reddy@broadcom.com
Fixes: 3337a1eaacd4 ("scsi: mpt3sas: Update hba_port objects after host reset")
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.h
drivers/scsi/mpt3sas/mpt3sas_scsih.c