Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: mcq: Fix error output and clean up ufshcd_mcq_abort()

An error unrelated to ufshcd_try_to_abort_task is being logged and can
cause confusion. Modify ufshcd_mcq_abort() to print the result of the abort
failure. For readability, return immediately instead of 'goto'.

Fixes: f1304d442077 ("scsi: ufs: mcq: Added ufshcd_mcq_abort()")
Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
Link: https://lore.kernel.org/r/20240524015904.1116005-1-cw9316.lee@samsung.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Chanwoo Lee and committed by
Martin K. Petersen
d53b681c 4fedb1f0

+8 -9
+8 -9
drivers/ufs/core/ufs-mcq.c
··· 634 634 struct ufshcd_lrb *lrbp = &hba->lrb[tag]; 635 635 struct ufs_hw_queue *hwq; 636 636 unsigned long flags; 637 - int err = FAILED; 637 + int err; 638 638 639 639 if (!ufshcd_cmd_inflight(lrbp->cmd)) { 640 640 dev_err(hba->dev, 641 641 "%s: skip abort. cmd at tag %d already completed.\n", 642 642 __func__, tag); 643 - goto out; 643 + return FAILED; 644 644 } 645 645 646 646 /* Skip task abort in case previous aborts failed and report failure */ 647 647 if (lrbp->req_abort_skip) { 648 648 dev_err(hba->dev, "%s: skip abort. tag %d failed earlier\n", 649 649 __func__, tag); 650 - goto out; 650 + return FAILED; 651 651 } 652 652 653 653 hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); ··· 659 659 */ 660 660 dev_err(hba->dev, "%s: cmd found in sq. hwq=%d, tag=%d\n", 661 661 __func__, hwq->id, tag); 662 - goto out; 662 + return FAILED; 663 663 } 664 664 665 665 /* ··· 667 667 * in the completion queue either. Query the device to see if 668 668 * the command is being processed in the device. 669 669 */ 670 - if (ufshcd_try_to_abort_task(hba, tag)) { 670 + err = ufshcd_try_to_abort_task(hba, tag); 671 + if (err) { 671 672 dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err); 672 673 lrbp->req_abort_skip = true; 673 - goto out; 674 + return FAILED; 674 675 } 675 676 676 - err = SUCCESS; 677 677 spin_lock_irqsave(&hwq->cq_lock, flags); 678 678 if (ufshcd_cmd_inflight(lrbp->cmd)) 679 679 ufshcd_release_scsi_cmd(hba, lrbp); 680 680 spin_unlock_irqrestore(&hwq->cq_lock, flags); 681 681 682 - out: 683 - return err; 682 + return SUCCESS; 684 683 }