scsi: mpi3mr: Rework mrioc->bsg_device model to fix warnings
During driver unload, mrioc->bsg_device reference count becomes
negative. Also, as reported in [1], the driver's bsg_device model had few
more bugs. Fix all these up.
scsi: mpi3mr: Add target device related sysfs attributes
Add sysfs attributes for exposing target device details such as SAS
address, firmware device handle, and persistent ID for the
controller-attached devices and RAID volumes.
Add shost related sysfs attributes to display the controller's firmware
version, queue depth, number of requests, and number of reply queues. Also
add an attribute to set & get the logging_level.
Link: https://lore.kernel.org/r/YnOmMGHqCOtUCYQ1@kili
Fixes: 43ca11005098 ("scsi: mpi3mr: Add support for PEL commands")
Signed-off-by: Dan Carpenter <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit bc7896d31a922ee9caabb10dc07509f65d41dc0e)
Signed-off-by: Michael Reed <email address hidden>
0903a95...
by
Dan Carpenter <email address hidden>
scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init()
The bsg_setup_queue() function does not return NULL. It returns error
pointers. Fix the check accordingly.
scsi: mpi3mr: Return I/Os to an unrecoverable HBA with DID_ERROR
Complete all new I/O requests issued to an unrecoverable controller with
DID_ERROR status instead of returning the I/O requests with
SCSI_MLQUEUE_HOST_BUSY. This will prevent the infinite retries of the new
I/Os when a controller is in an unrecoverable state.
Link: https://<email address hidden>
Signed-off-by: Sreekanth Reddy <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(backported from commit 256bd4f23d9cecaba2e6795f0058fa9c2362698c)
Signed-off-by: Michael Reed <email address hidden>
[Michael Reed - Context adjustments. A line was modified for a clean build]
Modify patch "Return I/Os to an unrecoverable HBA with DID_ERROR"
The patch "256bd4f23d9c scsi: mpi3mr: Return I/Os to an unrecoverable HBA with DID_ERROR"
introduces the issue with scsi_done(scmd) where it should be scmd->scsi_done(scmd);
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.