@@ -2965,10 +2965,7 @@ static long srp_build_response(struct scsi_info *vscsi,
rsp->opcode = SRP_RSP;
- if (vscsi->credit > 0 && vscsi->state == SRP_PROCESSING)
- rsp->req_lim_delta = cpu_to_be32(vscsi->credit);
- else
- rsp->req_lim_delta = cpu_to_be32(1 + vscsi->credit);
+ rsp->req_lim_delta = cpu_to_be32(1 + vscsi->credit);
rsp->tag = cmd->rsp.tag;
rsp->flags = 0;
@@ -3739,6 +3736,22 @@ static void ibmvscsis_queue_tm_rsp(struct se_cmd *se_cmd)
static void ibmvscsis_aborted_task(struct se_cmd *se_cmd)
{
+ struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd,
+ se_cmd);
+ struct scsi_info *vscsi = cmd->adapter;
+
+ /*
+ * With a successfully aborted op through LIO we want to increment the
+ * the vscsi credit so that when we dont send a rsp to the original
+ * scsi abort op but the tm rsp to the abort is sent, the credit is
+ * correctly sent with the abort tm rsp. We would need 1 for the abort
+ * tm rsp and 1 credit for the aborted scsi op. Thus we need to
+ * increment here.
+ */
+ spin_lock_bh(&vscsi->intr_lock);
+ vscsi->credit += 1;
+ spin_unlock_bh(&vscsi->intr_lock);
+
pr_debug("ibmvscsis_aborted_task %p task_tag: %llu\n",
se_cmd, se_cmd->tag);
}