}
 
 /**
- * ipr_sata_eh_done - done function for aborted SATA commands
+ * __ipr_sata_eh_done - done function for aborted SATA commands
  * @ipr_cmd:   ipr command struct
  *
  * This function is invoked for ops generated to SATA
  * Return value:
  *     none
  **/
-static void ipr_sata_eh_done(struct ipr_cmnd *ipr_cmd)
+static void __ipr_sata_eh_done(struct ipr_cmnd *ipr_cmd)
 {
        struct ata_queued_cmd *qc = ipr_cmd->qc;
        struct ipr_sata_port *sata_port = qc->ap->private_data;
 }
 
 /**
- * ipr_scsi_eh_done - mid-layer done function for aborted ops
+ * ipr_sata_eh_done - done function for aborted SATA commands
+ * @ipr_cmd:   ipr command struct
+ *
+ * This function is invoked for ops generated to SATA
+ * devices which are being aborted.
+ *
+ * Return value:
+ *     none
+ **/
+static void ipr_sata_eh_done(struct ipr_cmnd *ipr_cmd)
+{
+       struct ipr_hrr_queue *hrrq = ipr_cmd->hrrq;
+       unsigned long hrrq_flags;
+
+       spin_lock_irqsave(&hrrq->_lock, hrrq_flags);
+       __ipr_sata_eh_done(ipr_cmd);
+       spin_unlock_irqrestore(&hrrq->_lock, hrrq_flags);
+}
+
+/**
+ * __ipr_scsi_eh_done - mid-layer done function for aborted ops
  * @ipr_cmd:   ipr command struct
  *
  * This function is invoked by the interrupt handler for
  * Return value:
  *     none
  **/
-static void ipr_scsi_eh_done(struct ipr_cmnd *ipr_cmd)
+static void __ipr_scsi_eh_done(struct ipr_cmnd *ipr_cmd)
 {
        struct scsi_cmnd *scsi_cmd = ipr_cmd->scsi_cmd;
 
        list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
 }
 
+/**
+ * ipr_scsi_eh_done - mid-layer done function for aborted ops
+ * @ipr_cmd:   ipr command struct
+ *
+ * This function is invoked by the interrupt handler for
+ * ops generated by the SCSI mid-layer which are being aborted.
+ *
+ * Return value:
+ *     none
+ **/
+static void ipr_scsi_eh_done(struct ipr_cmnd *ipr_cmd)
+{
+       unsigned long hrrq_flags;
+       struct ipr_hrr_queue *hrrq = ipr_cmd->hrrq;
+
+       spin_lock_irqsave(&hrrq->_lock, hrrq_flags);
+       __ipr_scsi_eh_done(ipr_cmd);
+       spin_unlock_irqrestore(&hrrq->_lock, hrrq_flags);
+}
+
 /**
  * ipr_fail_all_ops - Fails all outstanding ops.
  * @ioa_cfg:   ioa config struct
                                cpu_to_be32(IPR_DRIVER_ILID);
 
                        if (ipr_cmd->scsi_cmd)
-                               ipr_cmd->done = ipr_scsi_eh_done;
+                               ipr_cmd->done = __ipr_scsi_eh_done;
                        else if (ipr_cmd->qc)
-                               ipr_cmd->done = ipr_sata_eh_done;
+                               ipr_cmd->done = __ipr_sata_eh_done;
 
                        ipr_trc_hook(ipr_cmd, IPR_TRACE_FINISH,
                                     IPR_IOASC_IOA_WAS_RESET);
 }
 
 /**
- * ipr_erp_done - Process completion of ERP for a device
+ * __ipr_erp_done - Process completion of ERP for a device
  * @ipr_cmd:           ipr command struct
  *
  * This function copies the sense buffer into the scsi_cmd
  * Return value:
  *     nothing
  **/
-static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
+static void __ipr_erp_done(struct ipr_cmnd *ipr_cmd)
 {
        struct scsi_cmnd *scsi_cmd = ipr_cmd->scsi_cmd;
        struct ipr_resource_entry *res = scsi_cmd->device->hostdata;
        list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
 }
 
+/**
+ * ipr_erp_done - Process completion of ERP for a device
+ * @ipr_cmd:           ipr command struct
+ *
+ * This function copies the sense buffer into the scsi_cmd
+ * struct and pushes the scsi_done function.
+ *
+ * Return value:
+ *     nothing
+ **/
+static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
+{
+       struct ipr_hrr_queue *hrrq = ipr_cmd->hrrq;
+       unsigned long hrrq_flags;
+
+       spin_lock_irqsave(&hrrq->_lock, hrrq_flags);
+       __ipr_erp_done(ipr_cmd);
+       spin_unlock_irqrestore(&hrrq->_lock, hrrq_flags);
+}
+
 /**
  * ipr_reinit_ipr_cmnd_for_erp - Re-initialize a cmnd block to be used for ERP
  * @ipr_cmd:   ipr command struct
 }
 
 /**
- * ipr_erp_request_sense - Send request sense to a device
+ * __ipr_erp_request_sense - Send request sense to a device
  * @ipr_cmd:   ipr command struct
  *
  * This function sends a request sense to a device as a result
  * Return value:
  *     nothing
  **/
-static void ipr_erp_request_sense(struct ipr_cmnd *ipr_cmd)
+static void __ipr_erp_request_sense(struct ipr_cmnd *ipr_cmd)
 {
        struct ipr_cmd_pkt *cmd_pkt = &ipr_cmd->ioarcb.cmd_pkt;
        u32 ioasc = be32_to_cpu(ipr_cmd->s.ioasa.hdr.ioasc);
 
        if (IPR_IOASC_SENSE_KEY(ioasc) > 0) {
-               ipr_erp_done(ipr_cmd);
+               __ipr_erp_done(ipr_cmd);
                return;
        }
 
                   IPR_REQUEST_SENSE_TIMEOUT * 2);
 }
 
+/**
+ * ipr_erp_request_sense - Send request sense to a device
+ * @ipr_cmd:   ipr command struct
+ *
+ * This function sends a request sense to a device as a result
+ * of a check condition.
+ *
+ * Return value:
+ *     nothing
+ **/
+static void ipr_erp_request_sense(struct ipr_cmnd *ipr_cmd)
+{
+       struct ipr_hrr_queue *hrrq = ipr_cmd->hrrq;
+       unsigned long hrrq_flags;
+
+       spin_lock_irqsave(&hrrq->_lock, hrrq_flags);
+       __ipr_erp_request_sense(ipr_cmd);
+       spin_unlock_irqrestore(&hrrq->_lock, hrrq_flags);
+}
+
 /**
  * ipr_erp_cancel_all - Send cancel all to a device
  * @ipr_cmd:   ipr command struct
        ipr_reinit_ipr_cmnd_for_erp(ipr_cmd);
 
        if (!scsi_cmd->device->simple_tags) {
-               ipr_erp_request_sense(ipr_cmd);
+               __ipr_erp_request_sense(ipr_cmd);
                return;
        }
 
        u32 masked_ioasc = ioasc & IPR_IOASC_IOASC_MASK;
 
        if (!res) {
-               ipr_scsi_eh_done(ipr_cmd);
+               __ipr_scsi_eh_done(ipr_cmd);
                return;
        }