2014-09-10 20:54 GMT+09:00 Dolev Raviv <dra...@codeaurora.org>:
> +static void ufshcd_set_queue_depth(struct scsi_device *sdev)
> +{
> +       int ret = 0;
> +       u8 lun_qdepth;
> +       struct ufs_hba *hba;
> +
> +       hba = shost_priv(sdev->host);
> +
> +       lun_qdepth = hba->nutrs;
> +       ret = ufshcd_read_unit_desc_param(hba,
> +                                         ufshcd_scsi_to_upiu_lun(sdev->lun),
> +                                         UNIT_DESC_PARAM_LU_Q_DEPTH,
> +                                         &lun_qdepth,
> +                                         sizeof(lun_qdepth));
> +
> +       /* Some WLUN doesn't support unit descriptor */
> +       if (ret == -EOPNOTSUPP)
> +               lun_qdepth = 1;
> +       else if (!lun_qdepth)
> +               /* eventually, we can figure out the real queue depth */
> +               lun_qdepth = hba->nutrs;
> +       else
> +               lun_qdepth = min_t(int, lun_qdepth, hba->nutrs);

If ufshcd_read_unit_desc_param() failed and its error code was not
-EOPNOTSUPP, lun_qdepth is undefined.  In such cases lun_qdepth
should be 1?
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to