Re: [PATCH 4/4] [SCSI] ufshcd: SCSI error handling

From: Namjae Jeon
Date: Sun Feb 05 2012 - 02:37:49 EST


> +
> +/**
> + * ufshcd_abort - abort a specific command
> + * @cmd: SCSI command pointer
> + *
> + * Returns 0 on success, non-zero value on failure
> + */
> +static int ufshcd_abort(struct scsi_cmnd *cmd)
> +{
> + Â Â Â struct Scsi_Host *host;
> + Â Â Â struct ufs_hba *hba;
> + Â Â Â unsigned long flags;
> + Â Â Â unsigned int tag;
> + Â Â Â unsigned int pos;
> + Â Â Â int err;
> +
> + Â Â Â host = cmd->device->host;
> + Â Â Â hba = (struct ufs_hba *) host->hostdata;
> + Â Â Â tag = cmd->request->tag;
> +
> + Â Â Â spin_lock_irqsave(host->host_lock, flags);
> + Â Â Â pos = (1 << tag);
> +
> + Â Â Â /* check if command is still pending */
> + Â Â Â if (!(hba->outstanding_reqs & pos)) {
> + Â Â Â Â Â Â Â err = -1;
> + Â Â Â Â Â Â Â spin_unlock_irqrestore(host->host_lock, flags);
> + Â Â Â Â Â Â Â goto out;
> + Â Â Â }
> +
> + Â Â Â err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_ABORT_TASK);
Hi.
You called spin_lock_irqsave in ufshcd_issue_tm_cmd() without
spin_unlock_irqrestore.

> + Â Â Â if (!err) {
> + Â Â Â Â Â Â Â spin_lock_irqsave(host->host_lock, flags);
This case is same also.
Thanks.
> + Â Â Â Â Â Â Â scsi_dma_unmap(cmd);
> +
> + Â Â Â Â Â Â Â /* clear the respective UTRLCLR bit */
> + Â Â Â Â Â Â Â writel(~pos,
> + Â Â Â Â Â Â Â Â Â Â Â (UFSHCD_MMIO_BASE +
> + Â Â Â Â Â Â Â Â Â Â Â ÂREG_UTP_TRANSFER_REQ_LIST_CLEAR));
> + Â Â Â Â Â Â Â hba->outstanding_reqs &= ~pos;
> + Â Â Â Â Â Â Â hba->lrb[tag].cmd = NULL;
> + Â Â Â Â Â Â Â spin_unlock_irqrestore(host->host_lock, flags);
> + Â Â Â }
> +out:
> + Â Â Â return err;
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/