Commit f0e473e0 authored by Murthy Bhat's avatar Murthy Bhat Committed by Martin K. Petersen

scsi: smartpqi: Add SCSI cmd info for resets

Report on SCSI command that has triggered the reset.  Also add check for
NULL SCSI commands resulting from issuing sg_reset when there is no
outstanding commands.

   Example:

   sg_reset -d /dev/sgXY
   smartpqi 0000:39:00.0: resetting scsi 4:0:1:0 due to cmd 0x12

Link: https://lore.kernel.org/r/20210714182847.50360-6-don.brace@microchip.comReviewed-by: default avatarKevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: default avatarMike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: default avatarScott Benesh <scott.benesh@microchip.com>
Reviewed-by: default avatarScott Teel <scott.teel@microchip.com>
Signed-off-by: default avatarMurthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8e505fce
...@@ -6033,8 +6033,10 @@ static int pqi_eh_device_reset_handler(struct scsi_cmnd *scmd) ...@@ -6033,8 +6033,10 @@ static int pqi_eh_device_reset_handler(struct scsi_cmnd *scmd)
mutex_lock(&ctrl_info->lun_reset_mutex); mutex_lock(&ctrl_info->lun_reset_mutex);
dev_err(&ctrl_info->pci_dev->dev, dev_err(&ctrl_info->pci_dev->dev,
"resetting scsi %d:%d:%d:%d\n", "resetting scsi %d:%d:%d:%d due to cmd 0x%02x\n",
shost->host_no, device->bus, device->target, device->lun); shost->host_no,
device->bus, device->target, device->lun,
scmd->cmd_len > 0 ? scmd->cmnd[0] : 0xff);
pqi_check_ctrl_health(ctrl_info); pqi_check_ctrl_health(ctrl_info);
if (pqi_ctrl_offline(ctrl_info)) if (pqi_ctrl_offline(ctrl_info))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment