smartpqi updates
Subsystems (2)
Don Brace
maintainerv2 cover smartpqi updates
cat smartpqi_6.6_cover_letter
These patches are based on Martin Petersen's 6.6/scsi-queue tree
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
6.6/scsi-queue
The biggest functional change to smartpqi is the addition of an abort handler. Some customers were complaining about I/O stalls to all devices when only one device is reset. Adding an abort handler helps to prevent I/O stalls to all devices.
All of the reset of the patches are small changes to logging messages, MACRO and variable name changes, and one minor change for LUN assignments.
This set of changes consists of:
* smartpqi-add-abort-handler
When a device reset occurs, the SML pauses I/O to all devices presented by a controller instance causing some performance issues.
To only affect device with a problematic request, we added an abort handler. The abort handler is implemented by using a device reset, but I/O to the other devices is no longer affected.
* smartpqi-refactor-rename-MACRO-to-clarify-purpose
The MACRO SOP_RC_INCORRECT_LOGICAL_UNIT was used to check for a condition where a TMF was sent an incorrect LUN. We renamed this MACRO to SOP_TMF_INCORRECT_LOGICAL_UNIT for clarity.
* smartpqi-refactor-rename-pciinfo-to-pci_info
Change the pciinfo variable to pci_info to make more readable code. No functional changes.
* smartpqi-simplify-lun_number-assignment
We simplified the conditional expression used to populate LUN numbers for requests.
* smartpqi-enhance-shutdown-notification
Clarify controller cache flush errors. We added in more precise information to the cache flush informational message.
No functional changes.
* smartpqi-enhance-controller-offline-notification
The driver can offline a controller for multiple reasons. We added a description of why these rare offline actions are taken. And a function to provide the specific details of the shutdown.
* smartpqi-enhance-error-messages
We added host:bus:target:lun to messages emitted in our reset/abort handlers. No functional changes.
* smartpqi-change-driver-version-to-2.1.24-046
Changes since v1:
Removed patch smartpqi-reformat-to-align-with-oob-driver based on a review by:
"Martin K. Petersen" <[email protected]>
David Strahan (3):
smartpqi: simplify lun_number assignment
smartpqi: enhance shutdown notification
smartpqi: enhance controller offline notification
Don Brace (1):
smartpqi: change driver version to 2.1.24-046
Kevin Barnett (3):
smartpqi: add abort handler
smartpqi: refactor rename MACRO to clarify purpose
smartpqi: refactor rename pciinfo to pci_info
Mahesh Rajashekhara (1):
smartpqi: enhance error messages
drivers/scsi/smartpqi/smartpqi.h | 16 +- drivers/scsi/smartpqi/smartpqi_init.c | 254 ++++++++++++++++++++------ 2 files changed, 215 insertions(+), 55 deletions(-)
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 1/8 smartpqi: add abort handler
From: Kevin Barnett <[email protected]>
Implement aborts as resets.
Avoid I/O stalls across all devices attached to a controller when device I/O requests time out.
--- drivers/scsi/smartpqi/smartpqi.h | 14 ++- drivers/scsi/smartpqi/smartpqi_init.c | 171 ++++++++++++++++++++------ 2 files changed, 149 insertions(+), 36 deletions(-)
drivers/scsi/smartpqi/smartpqi.h +13 -1
@@ -1085,7 +1085,16 @@ struct pqi_stream_data {u32 last_accessed; }; -#define PQI_MAX_LUNS_PER_DEVICE 256 +#define PQI_MAX_LUNS_PER_DEVICE 256 + +struct pqi_tmf_work { +struct work_struct work_struct; +struct scsi_cmnd *scmd; +struct pqi_ctrl_info *ctrl_info; +struct pqi_scsi_dev *device; +u8 lun; +u8 scsi_opcode; +};struct pqi_scsi_dev {int devtype;/* as reported by INQUIRY command */
@@ -1111,6 +1120,7 @@ struct pqi_scsi_dev { u8 erase_in_progress : 1;bool aio_enabled;/* only valid for physical disks */ bool in_remove; +bool in_reset[PQI_MAX_LUNS_PER_DEVICE ];bool device_offline;u8 vendor[8 ];/* bytes 8-15 of inquiry data */ u8 model[16 ];/* bytes 16-31 of inquiry data */
@@ -1149,6 +1159,8 @@ struct pqi_scsi_dev {struct pqi_stream_data stream_data[NUM_STREAMS_PER_LUN ];atomic_t scsi_cmds_outstanding[PQI_MAX_LUNS_PER_DEVICE ];unsigned int raid_bypass_cnt; + +struct pqi_tmf_work tmf_work[PQI_MAX_LUNS_PER_DEVICE ]; };/* VPD inquiry pages */
drivers/scsi/smartpqi/smartpqi_init.c +136 -35
338 lines not on this page · raw message
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 2/8 smartpqi: refactor rename MACRO to clarify purpose
In reply to Don BraceFrom: Kevin Barnett <[email protected]>
Rename SOP_RC_INCORRECT_LOGICAL_UNIT to SOP_TMF_INCORRECT_LOGICAL_UNIT to clarify the intended purpose.
--- drivers/scsi/smartpqi/smartpqi.h | 2 +- drivers/scsi/smartpqi/smartpqi_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/smartpqi/smartpqi.h +1 -1
@@ -710,7 +710,7 @@ typedef u32 pqi_index_t;#define SOP_TMF_COMPLETE 0x0#define SOP_TMF_REJECTED 0x4#define SOP_TMF_FUNCTION_SUCCEEDED 0x8 -#define SOP_RC_INCORRECT_LOGICAL_UNIT 0x9 +#define SOP_TMF_INCORRECT_LOGICAL_UNIT 0x9/* additional CDB bytes usage field codes */ #define SOP_ADDITIONAL_CDB_BYTES_0 0/* 16-byte CDB */
drivers/scsi/smartpqi/smartpqi_init.c +1 -1
@@ -3358,7 +3358,7 @@ static int pqi_interpret_task_management_response(struct pqi_ctrl_info *ctrl_infcase SOP_TMF_REJECTED : rc = -EAGAIN ;break ; -case SOP_RC_INCORRECT_LOGICAL_UNIT : +case SOP_TMF_INCORRECT_LOGICAL_UNIT : rc = -ENODEV ;break ;default :
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 3/8 smartpqi: refactor rename pciinfo to pci_info
In reply to Don BraceFrom: Kevin Barnett <[email protected]>
Make pci device structure names consistent and readable.
--- drivers/scsi/smartpqi/smartpqi_init.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +6 -6
@@ -6570,21 +6570,21 @@ static int pqi_getpciinfo_ioctl(struct pqi_ctrl_info *ctrl_info, void __user *arstruct pci_dev *pci_dev;u32 subsystem_vendor;u32 subsystem_device; -cciss_pci_info_struct pciinfo; +cciss_pci_info_struct pci_info;if (!arg)return -EINVAL ; pci_dev = ctrl_info->pci_dev; - pciinfo.domain =pci_domain_nr (pci_dev->bus); - pciinfo.bus = pci_dev->bus->number; - pciinfo.dev_fn = pci_dev->devfn; + pci_info.domain =pci_domain_nr (pci_dev->bus); + pci_info.bus = pci_dev->bus->number; + pci_info.dev_fn = pci_dev->devfn; subsystem_vendor = pci_dev->subsystem_vendor; subsystem_device = pci_dev->subsystem_device; - pciinfo.board_id = ((subsystem_device <<16 ) &0xffff0000 ) | subsystem_vendor; + pci_info.board_id = ((subsystem_device <<16 ) &0xffff0000 ) | subsystem_vendor; -if (copy_to_user (arg, &pciinfo,sizeof (pciinfo))) +if (copy_to_user (arg, &pci_info,sizeof (pci_info)))return -EFAULT ;return 0 ;
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 4/8 smartpqi: simplify lun_number assignment
In reply to Don BraceFrom: David Strahan <[email protected]>
Simplify lun_number assignment. lun_number assignment is only required for non-AIO requests.
--- drivers/scsi/smartpqi/smartpqi_init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +2 -4
@@ -5656,7 +5656,6 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info *ctrl_info,int rc;struct pqi_io_request *io_request;struct pqi_aio_path_request *request; -struct pqi_scsi_dev *device; io_request =pqi_alloc_io_request (ctrl_info, scmd);if (!io_request)
@@ -5676,9 +5675,8 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info *ctrl_info, request->command_priority = io_high_prio;put_unaligned_le16 (io_request->index, &request->request_id); request->error_index = request->request_id; - device = scmd->device->hostdata; -if (!pqi_is_logical_device (device) && ctrl_info->multi_lun_device_supported) -put_unaligned_le64 (((scmd->device->lun) <<8 ), &request->lun_number); +if (!raid_bypass && ctrl_info->multi_lun_device_supported) +put_unaligned_le64 (scmd->device->lun <<8 , &request->lun_number);if (cdb_length >sizeof (request->cdb)) cdb_length =sizeof (request->cdb); request->cdb_length = cdb_length;
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 5/8 smartpqi: enhance shutdown notification
In reply to Don BraceFrom: David Strahan <[email protected]>
Provide more detailed information about cache flush errors during shutdown.
--- drivers/scsi/smartpqi/smartpqi_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/smartpqi/smartpqi_init.c +1 -1
@@ -9161,7 +9161,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev) rc =pqi_flush_cache (ctrl_info, shutdown_event);if (rc)dev_err (&pci_dev->dev, -"unable to flush controller cache\n" ); +"unable to flush controller cache during shutdown\n" );pqi_crash_if_pending_command (ctrl_info);pqi_reset (ctrl_info);
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 6/8 smartpqi: enhance controller offline notification
In reply to Don BraceFrom: David Strahan <[email protected]>
Add a description for the reason the controller has been taken off-line.
--- drivers/scsi/smartpqi/smartpqi_init.c | 50 ++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-)
drivers/scsi/smartpqi/smartpqi_init.c +49 -1
@@ -9003,6 +9003,52 @@ static void pqi_ctrl_offline_worker(struct work_struct *work)pqi_take_ctrl_offline_deferred (ctrl_info); } +static char *pqi_ctrl_shutdown_reason_to_string (enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason) +{ +char *string; + +switch (ctrl_shutdown_reason) { +case PQI_IQ_NOT_DRAINED_TIMEOUT : + string ="inbound queue not drained timeout" ; +break ; +case PQI_LUN_RESET_TIMEOUT : + string ="LUN reset timeout" ; +break ; +case PQI_IO_PENDING_POST_LUN_RESET_TIMEOUT : + string ="I/O pending timeout after LUN reset" ; +break ; +case PQI_NO_HEARTBEAT : + string ="no controller heartbeat detected" ; +break ; +case PQI_FIRMWARE_KERNEL_NOT_UP : + string ="firmware kernel not ready" ; +break ; +case PQI_OFA_RESPONSE_TIMEOUT : + string ="OFA response timeout" ; +break ; +case PQI_INVALID_REQ_ID : + string ="invalid request ID" ; +break ; +case PQI_UNMATCHED_REQ_ID : + string ="unmatched request ID" ; +break ; +case PQI_IO_PI_OUT_OF_RANGE : + string ="I/O queue producer index out of range" ; +break ; +case PQI_EVENT_PI_OUT_OF_RANGE : + string ="event queue producer index out of range" ; +break ; +case PQI_UNEXPECTED_IU_TYPE : + string ="unexpected IU type" ; +break ; +default : + string ="unknown reason" ; +break ; + } + +return string; +} +static void pqi_take_ctrl_offline (struct pqi_ctrl_info *ctrl_info,enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason) {
@@ -9015,7 +9061,9 @@ static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info,if (!pqi_disable_ctrl_shutdown)sis_shutdown_ctrl (ctrl_info, ctrl_shutdown_reason);pci_disable_device (ctrl_info->pci_dev); -dev_err (&ctrl_info->pci_dev->dev,"controller offline\n" ); +dev_err (&ctrl_info->pci_dev->dev, +"controller offline: reason code 0x%x (%s)\n" , + ctrl_shutdown_reason,pqi_ctrl_shutdown_reason_to_string (ctrl_shutdown_reason));schedule_work (&ctrl_info->ctrl_offline_work); }
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 7/8 smartpqi: enhance error messages
In reply to Don BraceFrom: Mahesh Rajashekhara <[email protected]>
Add more detail to some TMF messages.
--- drivers/scsi/smartpqi/smartpqi_init.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +9 -8
@@ -6358,10 +6358,8 @@ static int pqi_device_reset_handler(struct pqi_ctrl_info *ctrl_info, struct pqi_mutex_lock (&ctrl_info->lun_reset_mutex);dev_err (&ctrl_info->pci_dev->dev, -"resetting scsi %d:%d:%d:%d due to cmd 0x%02x\n" , - ctrl_info->scsi_host->host_no, - device->bus, device->target, lun, - scmd->cmd_len >0 ? scmd->cmnd[0 ] :0xff ); +"resetting scsi %d:%d:%d:%u SCSI cmd at %p due to cmd opcode 0x%02x\n" , + ctrl_info->scsi_host->host_no, device->bus, device->target, lun, scmd, scsi_opcode);pqi_check_ctrl_health (ctrl_info);if (pqi_ctrl_offline (ctrl_info))
@@ -6415,18 +6413,20 @@ static int pqi_eh_abort_handler(struct scsi_cmnd *scmd) shost = scmd->device->host; ctrl_info =shost_to_hba (shost); + device = scmd->device->hostdata;dev_err (&ctrl_info->pci_dev->dev, -"attempting TASK ABORT on SCSI cmd at %p\n" , scmd); +"attempting TASK ABORT on scsi %d:%d:%d:%d for SCSI cmd at %p\n" , + shost->host_no, device->bus, device->target, (int )scmd->device->lun, scmd);if (cmpxchg (&scmd->host_scribble,PQI_NO_COMPLETION , (void *)&wait) ==NULL ) {dev_err (&ctrl_info->pci_dev->dev, -"SCSI cmd at %p already completed\n" , scmd); +"scsi %d:%d:%d:%d for SCSI cmd at %p already completed\n" , + shost->host_no, device->bus, device->target, (int )scmd->device->lun, scmd); scmd->result =DID_RESET <<16 ; goto out; } - device = scmd->device->hostdata; tmf_work = &device->tmf_work[scmd->device->lun];if (cmpxchg (&tmf_work->scmd,NULL , scmd) ==NULL ) {
@@ -6440,7 +6440,8 @@ static int pqi_eh_abort_handler(struct scsi_cmnd *scmd)wait_for_completion (&wait);dev_err (&ctrl_info->pci_dev->dev, -"TASK ABORT on SCSI cmd at %p: SUCCESS\n" , scmd); +"TASK ABORT on scsi %d:%d:%d:%d for SCSI cmd at %p: SUCCESS\n" , + shost->host_no, device->bus, device->target, (int )scmd->device->lun, scmd); out:
Signature · 1 line
2.42.0
Don Brace
maintainerPATCH v2 8/8 smartpqi: change driver version to 2.1.24-046
In reply to Don Brace--- drivers/scsi/smartpqi/smartpqi_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +3 -3
@@ -33,11 +33,11 @@#define BUILD_TIMESTAMP #endif -#define DRIVER_VERSION "2.1.22-040" +#define DRIVER_VERSION "2.1.24-046"#define DRIVER_MAJOR 2#define DRIVER_MINOR 1 -#define DRIVER_RELEASE 22 -#define DRIVER_REVISION 40 +#define DRIVER_RELEASE 24 +#define DRIVER_REVISION 46#define DRIVER_NAME "Microchip SmartPQI Driver (v" \ DRIVER_VERSION BUILD_TIMESTAMP ")"
Signature · 1 line
2.42.0
Martin K. Petersen
AppliedDon,
Quoted 4 lines
The biggest functional change to smartpqi is the addition of an abort handler. Some customers were complaining about I/O stalls to all devices when only one device is reset. Adding an abort handler helps to prevent I/O stalls to all devices.
Applied to 6.6/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 11 lines · Don Brace
cat smartpqi_6.6_cover_letter
These patches are based on Martin Petersen's 6.6/scsi-queue tree
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
6.6/scsi-queueThe biggest functional change to smartpqi is the addition of an abort handler. Some customers were complaining about I/O stalls to all devices when only one device is reset. Adding an abort handler helps to prevent I/O stalls to all devices.
[...]
Applied to 6.6/scsi-queue, thanks!
[1/8] smartpqi: add abort handler
https://git.kernel.org/mkp/scsi/c/153c45dd63ef [2/8] smartpqi: refactor rename MACRO to clarify purpose https://git.kernel.org/mkp/scsi/c/43cf3a6eab58 [3/8] smartpqi: refactor rename pciinfo to pci_info https://git.kernel.org/mkp/scsi/c/e9c39117b448 [4/8] smartpqi: simplify lun_number assignment https://git.kernel.org/mkp/scsi/c/dad662c9fe50 [5/8] smartpqi: enhance shutdown notification https://git.kernel.org/mkp/scsi/c/276395d024cc [6/8] smartpqi: enhance controller offline notification https://git.kernel.org/mkp/scsi/c/72b737fa73bf [7/8] smartpqi: enhance error messages https://git.kernel.org/mkp/scsi/c/e1b919494aa9 [8/8] smartpqi: change driver version to 2.1.24-046 https://git.kernel.org/mkp/scsi/c/08b7ad50c8bc
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering