diff options
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 52b348c36d56..0c5b02d4c7f8 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -241,11 +241,10 @@ static inline void scsi_eh_prt_fail_stats(struct Scsi_Host *shost, | |||
241 | 241 | ||
242 | if (cmd_cancel || cmd_failed) { | 242 | if (cmd_cancel || cmd_failed) { |
243 | SCSI_LOG_ERROR_RECOVERY(3, | 243 | SCSI_LOG_ERROR_RECOVERY(3, |
244 | printk("%s: %d:%d:%d:%d cmds failed: %d," | 244 | sdev_printk(KERN_INFO, sdev, |
245 | " cancel: %d\n", | 245 | "%s: cmds failed: %d, cancel: %d\n", |
246 | __FUNCTION__, shost->host_no, | 246 | __FUNCTION__, cmd_failed, |
247 | sdev->channel, sdev->id, sdev->lun, | 247 | cmd_cancel)); |
248 | cmd_failed, cmd_cancel)); | ||
249 | cmd_cancel = 0; | 248 | cmd_cancel = 0; |
250 | cmd_failed = 0; | 249 | cmd_failed = 0; |
251 | ++devices_failed; | 250 | ++devices_failed; |
@@ -674,10 +673,9 @@ static int scsi_eh_get_sense(struct list_head *work_q, | |||
674 | SCSI_SENSE_VALID(scmd)) | 673 | SCSI_SENSE_VALID(scmd)) |
675 | continue; | 674 | continue; |
676 | 675 | ||
677 | SCSI_LOG_ERROR_RECOVERY(2, printk("%s: requesting sense" | 676 | SCSI_LOG_ERROR_RECOVERY(2, scmd_printk(KERN_INFO, scmd, |
678 | " for id: %d\n", | 677 | "%s: requesting sense\n", |
679 | current->comm, | 678 | current->comm)); |
680 | scmd->device->id)); | ||
681 | rtn = scsi_request_sense(scmd); | 679 | rtn = scsi_request_sense(scmd); |
682 | if (rtn != SUCCESS) | 680 | if (rtn != SUCCESS) |
683 | continue; | 681 | continue; |
@@ -1035,7 +1033,8 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd) | |||
1035 | if (!scmd->device->host->hostt->skip_settle_delay) | 1033 | if (!scmd->device->host->hostt->skip_settle_delay) |
1036 | ssleep(BUS_RESET_SETTLE_TIME); | 1034 | ssleep(BUS_RESET_SETTLE_TIME); |
1037 | spin_lock_irqsave(scmd->device->host->host_lock, flags); | 1035 | spin_lock_irqsave(scmd->device->host->host_lock, flags); |
1038 | scsi_report_bus_reset(scmd->device->host, scmd->device->channel); | 1036 | scsi_report_bus_reset(scmd->device->host, |
1037 | scmd_channel(scmd)); | ||
1039 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); | 1038 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); |
1040 | } | 1039 | } |
1041 | 1040 | ||
@@ -1063,7 +1062,8 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd) | |||
1063 | if (!scmd->device->host->hostt->skip_settle_delay) | 1062 | if (!scmd->device->host->hostt->skip_settle_delay) |
1064 | ssleep(HOST_RESET_SETTLE_TIME); | 1063 | ssleep(HOST_RESET_SETTLE_TIME); |
1065 | spin_lock_irqsave(scmd->device->host->host_lock, flags); | 1064 | spin_lock_irqsave(scmd->device->host->host_lock, flags); |
1066 | scsi_report_bus_reset(scmd->device->host, scmd->device->channel); | 1065 | scsi_report_bus_reset(scmd->device->host, |
1066 | scmd_channel(scmd)); | ||
1067 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); | 1067 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); |
1068 | } | 1068 | } |
1069 | 1069 | ||
@@ -1093,7 +1093,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost, | |||
1093 | for (channel = 0; channel <= shost->max_channel; channel++) { | 1093 | for (channel = 0; channel <= shost->max_channel; channel++) { |
1094 | chan_scmd = NULL; | 1094 | chan_scmd = NULL; |
1095 | list_for_each_entry(scmd, work_q, eh_entry) { | 1095 | list_for_each_entry(scmd, work_q, eh_entry) { |
1096 | if (channel == scmd->device->channel) { | 1096 | if (channel == scmd_channel(scmd)) { |
1097 | chan_scmd = scmd; | 1097 | chan_scmd = scmd; |
1098 | break; | 1098 | break; |
1099 | /* | 1099 | /* |
@@ -1111,7 +1111,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost, | |||
1111 | rtn = scsi_try_bus_reset(chan_scmd); | 1111 | rtn = scsi_try_bus_reset(chan_scmd); |
1112 | if (rtn == SUCCESS) { | 1112 | if (rtn == SUCCESS) { |
1113 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { | 1113 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { |
1114 | if (channel == scmd->device->channel) | 1114 | if (channel == scmd_channel(scmd)) |
1115 | if (!scsi_device_online(scmd->device) || | 1115 | if (!scsi_device_online(scmd->device) || |
1116 | !scsi_eh_tur(scmd)) | 1116 | !scsi_eh_tur(scmd)) |
1117 | scsi_eh_finish_cmd(scmd, | 1117 | scsi_eh_finish_cmd(scmd, |
@@ -1174,13 +1174,9 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q, | |||
1174 | struct scsi_cmnd *scmd, *next; | 1174 | struct scsi_cmnd *scmd, *next; |
1175 | 1175 | ||
1176 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { | 1176 | list_for_each_entry_safe(scmd, next, work_q, eh_entry) { |
1177 | printk(KERN_INFO "scsi: Device offlined - not" | 1177 | sdev_printk(KERN_INFO, scmd->device, |
1178 | " ready after error recovery: host" | 1178 | "scsi: Device offlined - not" |
1179 | " %d channel %d id %d lun %d\n", | 1179 | " ready after error recovery\n"); |
1180 | scmd->device->host->host_no, | ||
1181 | scmd->device->channel, | ||
1182 | scmd->device->id, | ||
1183 | scmd->device->lun); | ||
1184 | scsi_device_set_state(scmd->device, SDEV_OFFLINE); | 1180 | scsi_device_set_state(scmd->device, SDEV_OFFLINE); |
1185 | if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) { | 1181 | if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) { |
1186 | /* | 1182 | /* |
@@ -1342,10 +1338,8 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) | |||
1342 | return SUCCESS; | 1338 | return SUCCESS; |
1343 | 1339 | ||
1344 | case RESERVATION_CONFLICT: | 1340 | case RESERVATION_CONFLICT: |
1345 | printk(KERN_INFO "scsi: reservation conflict: host" | 1341 | sdev_printk(KERN_INFO, scmd->device, |
1346 | " %d channel %d id %d lun %d\n", | 1342 | "reservation conflict\n"); |
1347 | scmd->device->host->host_no, scmd->device->channel, | ||
1348 | scmd->device->id, scmd->device->lun); | ||
1349 | return SUCCESS; /* causes immediate i/o error */ | 1343 | return SUCCESS; /* causes immediate i/o error */ |
1350 | default: | 1344 | default: |
1351 | return FAILED; | 1345 | return FAILED; |
@@ -1683,7 +1677,7 @@ void scsi_report_bus_reset(struct Scsi_Host *shost, int channel) | |||
1683 | struct scsi_device *sdev; | 1677 | struct scsi_device *sdev; |
1684 | 1678 | ||
1685 | __shost_for_each_device(sdev, shost) { | 1679 | __shost_for_each_device(sdev, shost) { |
1686 | if (channel == sdev->channel) { | 1680 | if (channel == sdev_channel(sdev)) { |
1687 | sdev->was_reset = 1; | 1681 | sdev->was_reset = 1; |
1688 | sdev->expecting_cc_ua = 1; | 1682 | sdev->expecting_cc_ua = 1; |
1689 | } | 1683 | } |
@@ -1718,8 +1712,8 @@ void scsi_report_device_reset(struct Scsi_Host *shost, int channel, int target) | |||
1718 | struct scsi_device *sdev; | 1712 | struct scsi_device *sdev; |
1719 | 1713 | ||
1720 | __shost_for_each_device(sdev, shost) { | 1714 | __shost_for_each_device(sdev, shost) { |
1721 | if (channel == sdev->channel && | 1715 | if (channel == sdev_channel(sdev) && |
1722 | target == sdev->id) { | 1716 | target == sdev_id(sdev)) { |
1723 | sdev->was_reset = 1; | 1717 | sdev->was_reset = 1; |
1724 | sdev->expecting_cc_ua = 1; | 1718 | sdev->expecting_cc_ua = 1; |
1725 | } | 1719 | } |