aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c55
1 files changed, 38 insertions, 17 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5441531c0d8e..17b106b79f72 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1053,7 +1053,7 @@ static void ipr_log_array_error(struct ipr_ioa_cfg *ioa_cfg,
1053 array_entry->dev_res_addr.lun); 1053 array_entry->dev_res_addr.lun);
1054 } 1054 }
1055 1055
1056 if (array_entry->dev_res_addr.bus >= IPR_MAX_NUM_BUSES) { 1056 if (array_entry->expected_dev_res_addr.bus >= IPR_MAX_NUM_BUSES) {
1057 ipr_err("Expected Location: unknown\n"); 1057 ipr_err("Expected Location: unknown\n");
1058 } else { 1058 } else {
1059 ipr_err("Expected Location: %d:%d:%d:%d\n", 1059 ipr_err("Expected Location: %d:%d:%d:%d\n",
@@ -2885,7 +2885,7 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
2885 * Return value: 2885 * Return value:
2886 * SUCCESS / FAILED 2886 * SUCCESS / FAILED
2887 **/ 2887 **/
2888static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd) 2888static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2889{ 2889{
2890 struct ipr_ioa_cfg *ioa_cfg; 2890 struct ipr_ioa_cfg *ioa_cfg;
2891 int rc; 2891 int rc;
@@ -2905,6 +2905,17 @@ static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2905 return rc; 2905 return rc;
2906} 2906}
2907 2907
2908static int ipr_eh_host_reset(struct scsi_cmnd * cmd)
2909{
2910 int rc;
2911
2912 spin_lock_irq(cmd->device->host->host_lock);
2913 rc = __ipr_eh_host_reset(cmd);
2914 spin_unlock_irq(cmd->device->host->host_lock);
2915
2916 return rc;
2917}
2918
2908/** 2919/**
2909 * ipr_eh_dev_reset - Reset the device 2920 * ipr_eh_dev_reset - Reset the device
2910 * @scsi_cmd: scsi command struct 2921 * @scsi_cmd: scsi command struct
@@ -2916,7 +2927,7 @@ static int ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
2916 * Return value: 2927 * Return value:
2917 * SUCCESS / FAILED 2928 * SUCCESS / FAILED
2918 **/ 2929 **/
2919static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) 2930static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2920{ 2931{
2921 struct ipr_cmnd *ipr_cmd; 2932 struct ipr_cmnd *ipr_cmd;
2922 struct ipr_ioa_cfg *ioa_cfg; 2933 struct ipr_ioa_cfg *ioa_cfg;
@@ -2970,6 +2981,17 @@ static int ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
2970 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS); 2981 return (IPR_IOASC_SENSE_KEY(ioasc) ? FAILED : SUCCESS);
2971} 2982}
2972 2983
2984static int ipr_eh_dev_reset(struct scsi_cmnd * cmd)
2985{
2986 int rc;
2987
2988 spin_lock_irq(cmd->device->host->host_lock);
2989 rc = __ipr_eh_dev_reset(cmd);
2990 spin_unlock_irq(cmd->device->host->host_lock);
2991
2992 return rc;
2993}
2994
2973/** 2995/**
2974 * ipr_bus_reset_done - Op done function for bus reset. 2996 * ipr_bus_reset_done - Op done function for bus reset.
2975 * @ipr_cmd: ipr command struct 2997 * @ipr_cmd: ipr command struct
@@ -3068,6 +3090,12 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3068 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata; 3090 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata;
3069 res = scsi_cmd->device->hostdata; 3091 res = scsi_cmd->device->hostdata;
3070 3092
3093 /* If we are currently going through reset/reload, return failed.
3094 * This will force the mid-layer to call ipr_eh_host_reset,
3095 * which will then go to sleep and wait for the reset to complete
3096 */
3097 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
3098 return FAILED;
3071 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res))) 3099 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res)))
3072 return FAILED; 3100 return FAILED;
3073 3101
@@ -3118,23 +3146,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3118 **/ 3146 **/
3119static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd) 3147static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd)
3120{ 3148{
3121 struct ipr_ioa_cfg *ioa_cfg; 3149 unsigned long flags;
3150 int rc;
3122 3151
3123 ENTER; 3152 ENTER;
3124 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
3125 3153
3126 /* If we are currently going through reset/reload, return failed. This will force the 3154 spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
3127 mid-layer to call ipr_eh_host_reset, which will then go to sleep and wait for the 3155 rc = ipr_cancel_op(scsi_cmd);
3128 reset to complete */ 3156 spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
3129 if (ioa_cfg->in_reset_reload)
3130 return FAILED;
3131 if (ioa_cfg->ioa_is_dead)
3132 return FAILED;
3133 if (!scsi_cmd->device->hostdata)
3134 return FAILED;
3135 3157
3136 LEAVE; 3158 LEAVE;
3137 return ipr_cancel_op(scsi_cmd); 3159 return rc;
3138} 3160}
3139 3161
3140/** 3162/**
@@ -5886,6 +5908,7 @@ static void __ipr_remove(struct pci_dev *pdev)
5886 5908
5887 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); 5909 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
5888 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); 5910 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
5911 flush_scheduled_work();
5889 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); 5912 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
5890 5913
5891 spin_lock(&ipr_driver_lock); 5914 spin_lock(&ipr_driver_lock);
@@ -5916,8 +5939,6 @@ static void ipr_remove(struct pci_dev *pdev)
5916 5939
5917 ENTER; 5940 ENTER;
5918 5941
5919 ioa_cfg->allow_cmds = 0;
5920 flush_scheduled_work();
5921 ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj, 5942 ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj,
5922 &ipr_trace_attr); 5943 &ipr_trace_attr);
5923 ipr_remove_dump_file(&ioa_cfg->host->shost_classdev.kobj, 5944 ipr_remove_dump_file(&ioa_cfg->host->shost_classdev.kobj,