[bug report] scsi: ufs: Abort tasks before clearing them from doorbell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Can Guo's email is bouncing.  Ah well.  - dan ]

Hello Can Guo,

The patch 307348f6ab14: "scsi: ufs: Abort tasks before clearing them
from doorbell" from Aug 24, 2020, leads to the following Smatch
static checker warning:

	drivers/ufs/core/ufshcd.c:7064 ufshcd_try_to_abort_task()
	warn: missing error code here? '_dev_err()' failed. 'err' = '0'

drivers/ufs/core/ufshcd.c
    7032 static int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
    7033 {
    7034         struct ufshcd_lrb *lrbp = &hba->lrb[tag];
    7035         int err = 0;
    7036         int poll_cnt;
    7037         u8 resp = 0xF;
    7038         u32 reg;
    7039 
    7040         for (poll_cnt = 100; poll_cnt; poll_cnt--) {
    7041                 err = ufshcd_issue_tm_cmd(hba, lrbp->lun, lrbp->task_tag,
    7042                                 UFS_QUERY_TASK, &resp);
    7043                 if (!err && resp == UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED) {
    7044                         /* cmd pending in the device */
    7045                         dev_err(hba->dev, "%s: cmd pending in the device. tag = %d\n",
    7046                                 __func__, tag);
    7047                         break;
    7048                 } else if (!err && resp == UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
    7049                         /*
    7050                          * cmd not pending in the device, check if it is
    7051                          * in transition.
    7052                          */
    7053                         dev_err(hba->dev, "%s: cmd at tag %d not pending in the device.\n",
    7054                                 __func__, tag);
    7055                         reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
    7056                         if (reg & (1 << tag)) {
    7057                                 /* sleep for max. 200us to stabilize */
    7058                                 usleep_range(100, 200);
    7059                                 continue;
    7060                         }
    7061                         /* command completed already */
    7062                         dev_err(hba->dev, "%s: cmd at tag %d successfully cleared from DB.\n",
    7063                                 __func__, tag);

Error message printed on success path.

--> 7064                         goto out;
    7065                 } else {
    7066                         dev_err(hba->dev,
    7067                                 "%s: no response from device. tag = %d, err %d\n",
    7068                                 __func__, tag, err);
    7069                         if (!err)
    7070                                 err = resp; /* service response error */
    7071                         goto out;
    7072                 }
    7073         }
    7074 

regards,
dan carpenter



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux