Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp271714lqb; Thu, 23 May 2024 18:59:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5UzDNSnLUDP5T6kibhF0bhtEXSfq5DWEcU4VOCaZ5uyEYmKF/JGLgNm1BCtxIHdmUmzeMoMbAjcLrmZQgxZdsYugumV44VEnC3R2KOQ== X-Google-Smtp-Source: AGHT+IHZ4nKb/tavz98u4fW8A1TGMwX1GVXaTJGQxcxnocXPwthuzK7G2VrG9Fy0YQgpGy9moZFL X-Received: by 2002:a17:906:f993:b0:a62:6d4a:3e70 with SMTP id a640c23a62f3a-a626d4a4ae9mr33304666b.29.1716515962316; Thu, 23 May 2024 18:59:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716515962; cv=pass; d=google.com; s=arc-20160816; b=oth34xbbpmNe64QGH19NgE4Pd+CyLrSlehG53+96ChOs1B0mjmixExa2EFKMHtdgC8 /qIbzLhB6s1ZOD3B4EBPRy3LklHnJvdZ8KnDW+sTdsS4krHONepvBYRJ2AOGmb5fCOoL KoD4g0WZ0QEHxU3dlbpgIn73CmvQqjK8b4tr/5IySqpSOWJkyzsfD3s1sd0dh1IjvK9g NioILmdAdIf/hGKrFT0M6afm5xrZXBEtsYWClgmcnY920COJ9Nf49kncbmyZToFVHpNx XkNBIat1D50RwslZ7xt6KqRuqnzRhvxWJDYQrfXxrtxXNf3x0Tvuoh78f5HOwyMee6M9 GUuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=Lc51D5b48Af/XQTwq2XFWVLT/g5JdkG0gRQi0KSFZYs=; fh=vVo+4+5lPs5rSH2d3ELRilKgiehErHj/Giotft8Ahn8=; b=kunzJGbH34YVK7zyggWqXjtiBqs9/3VT0gAKttaNMIRvh8C9tKZF+rUY5k2KjmaIqX RZIJO94Gf9Y5y+VPpYPndscggJTmG+jmE2CM0c3wUOqnNFbXGnGMIRuX/bMdNvQrQgdQ 9jxq8criZiWcJGK17aDmjUU/7zE6Vs6m5G1Q3zZ7TU/qTHyl9HIjgLh2ZsFAI0UBA1zE 6CwtrExt9BlF10fiv/aDjGv0Y4gwQ+0sO0RAwZWemP/JLaqp7fRucHMlKi16TyBlrSLA sHNv5f5R067bvb9pc7FyLlfvKD3CgdT5LrMSavAWSYJYQ39cg6bVbL1SS3OJnfQugSgc +YTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="eUGIU/x4"; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-188222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc378b0si26295766b.286.2024.05.23.18.59.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 18:59:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="eUGIU/x4"; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-188222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D208C1F230D0 for ; Fri, 24 May 2024 01:59:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1B7822616; Fri, 24 May 2024 01:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="eUGIU/x4" Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9DC44A3C for ; Fri, 24 May 2024 01:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716515953; cv=none; b=q0Mh3ogGpmrsZa5oBTPlnRASa+Iln4JhICd/7KgCiiHq/ljE0W/6jXtE8p8yGRXIMHo/VMXaHZFfpq1N8JyjoCKIZ46ajqWIzQ9m4cNjfmXDayIuboTRwoedcXN16T4NYkn3r4AWMcd6yjcwfxl+4GgexQHzZwGNrUvr7DemJu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716515953; c=relaxed/simple; bh=8HvXOKkqios4yzwlfe0hQTKvICnw8ZVW3mMRcplGCRQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=A4gTl4lvApbRITX1Vi45JA49NCl+0j+VK/FxC6aymsPi/i8nT3qwtAMGbZGtkObEQposj007QpYmzdwn7PR6fxn5LtNCVJyyZKLo+fKMBCDMWg6YWUrHwgetZ4eDABdLo1lMVaTVr5/uSeoopBB0/XyetCKqt+8bx3vBDxk4EhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=eUGIU/x4; arc=none smtp.client-ip=203.254.224.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240524015908epoutp021cdf4345fee1d98cf712f937ff088ae9~SSikg2QAK2789727897epoutp02S for ; Fri, 24 May 2024 01:59:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240524015908epoutp021cdf4345fee1d98cf712f937ff088ae9~SSikg2QAK2789727897epoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716515948; bh=Lc51D5b48Af/XQTwq2XFWVLT/g5JdkG0gRQi0KSFZYs=; h=From:To:Cc:Subject:Date:References:From; b=eUGIU/x4rpJ18TdxQtu955Ex+a4Ej/90jHUUIc6CjNxr3fQfAKDhRE7pi2DDIoCx+ 1Q9jyOXFkkvEMek2pJewtZNRZnv8SQ4LC+bvRBjXnJq75idkmaLdcb6uK5TCIZq5B8 DJYDO6J+eWVeAc19KyQ8aOZTGdQWuY2uRLjSPWwM= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20240524015908epcas1p466445ee52a12daa12ceffe0f86919b88~SSikMFJbf2205322053epcas1p4M; Fri, 24 May 2024 01:59:08 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.38.249]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4VlpB35Vz3z4x9QK; Fri, 24 May 2024 01:59:07 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id D2.9A.10158.B64FF466; Fri, 24 May 2024 10:59:07 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240524015907epcas1p2598a2ba8a81529b6639cff007fe9106b~SSijih1Oj0170501705epcas1p2T; Fri, 24 May 2024 01:59:07 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240524015907epsmtrp26cd1de8f56036ec4a4f8df6a7014b87d~SSijh1hrc0720707207epsmtrp2K; Fri, 24 May 2024 01:59:07 +0000 (GMT) X-AuditID: b6c32a38-8e1ff700000027ae-47-664ff46bb858 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D7.D6.08924.B64FF466; Fri, 24 May 2024 10:59:07 +0900 (KST) Received: from lee.. (unknown [10.253.100.232]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240524015907epsmtip1067e709a65e6b21fb946d5f0a5616f2d~SSijWM8Sg2280522805epsmtip1c; Fri, 24 May 2024 01:59:07 +0000 (GMT) From: Chanwoo Lee To: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com, quic_nguyenb@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chanwoo Lee Subject: [PATCH v2] ufs:mcq:Fixing Error Output and cleanup for ufshcd_mcq_abort Date: Fri, 24 May 2024 10:59:04 +0900 Message-Id: <20240524015904.1116005-1-cw9316.lee@samsung.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpik+LIzCtJLcpLzFFi42LZdljTQDf7i3+awftDGhYP5m1js3j58yqb xbQPP5ktZpxqY7XY2M9hcXnXHDaL7us72CyWH//HZDH1xXF2B06Py1e8PaZNOsXm8fHpLRaP iXvqPPq2rGL0+LxJzqP9QDdTAHtUtk1GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5 kkJeYm6qrZKLT4CuW2YO0F1KCmWJOaVAoYDE4mIlfTubovzSklSFjPziElul1IKUnAKzAr3i xNzi0rx0vbzUEitDAwMjU6DChOyM6Q+WMRe8E664uc+ugfEPfxcjB4eEgInE933GXYycHEIC OxglWl/7djFyAdmfGCWuP5/ADOF8Y5R4dreTEaQKpGHLus3sEIm9jBJX+k+xQ7Q/YZToWO4J MpVNQEvi9jFvkLCIwENGif63gSA2s4CGxJ+2i2wgtrBAkET7hIVgrSwCqhLfTu8Cs3kFbCV+ HDvJDLFLXmL/wbPMEHFBiZMzn7BAzJGXaN46G+w4CYG37BLb726FanCROH31KguELSzx6vgW dghbSuLzu71sEA3NjBIL3xyH6p7AKPHl4202iCp7iebWZjaQD5gFNCXW79KH2MYn8e5rDysk uHglOtqEIKpVJOZ0nWODmf/xxmNWCNtD4tqdVlZImMRKtHR/Z5/AKDcLyQ+zkPwwC2HZAkbm VYxiqQXFuempxYYFJvBoTM7P3cQIToxaFjsY5779oHeIkYmD8RCjBAezkghv9ErfNCHelMTK qtSi/Pii0pzU4kOMpsBQncgsJZqcD0zNeSXxhiaWBiZmRiYWxpbGZkrivGeulKUKCaQnlqRm p6YWpBbB9DFxcEo1MCny/Tox4WOq61lmd/sPJ9I0lq5Mufl2ne0Mloa7Sg9Od/XNkuAozt3w MiEqPjDD6vOvW0vNr9/5wHt6T+XkH8uSWc2y5jG4n0iW/PClYs/9N/p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SKjs9j3/ 4ren2+r3+5otXzL/cJ6yUu52tvjwbRcEi46yHezw3fpgdvDruEVqBqz6+pu/XmNZOuFHUWdh 9P7HnG/Onq4I7YxxSZ7ufH6x0fo/xzJ1mtZmtnasuzq15My0Be+FlViKMxINtZiLihMB94Vy GtACAAA= X-CMS-MailID: 20240524015907epcas1p2598a2ba8a81529b6639cff007fe9106b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240524015907epcas1p2598a2ba8a81529b6639cff007fe9106b References: An error unrelated to ufshcd_try_to_abort_task is being output and can cause confusion. So, I modified it to output the result of abort fail. * dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err); And for readability,I modified it to return immediately instead of 'goto'. Fixes: f1304d442077 ("scsi: ufs: mcq: Added ufshcd_mcq_abort()") Signed-off-by: Chanwoo Lee --- v1->v2: - Change title and description - Change all 'goto out' statements into 'return FAILED'. - Add 'return SUCCESS' at the end. v1 : https://patchwork.kernel.org/project/linux-scsi/patch/20240523002257.1068373-1-cw9316.lee@samsung.com/ --- drivers/ufs/core/ufs-mcq.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 005d63ab1f44..8944548c30fa 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -634,20 +634,20 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd) struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct ufs_hw_queue *hwq; unsigned long flags; - int err = FAILED; + int err; if (!ufshcd_cmd_inflight(lrbp->cmd)) { dev_err(hba->dev, "%s: skip abort. cmd at tag %d already completed.\n", __func__, tag); - goto out; + return FAILED; } /* Skip task abort in case previous aborts failed and report failure */ if (lrbp->req_abort_skip) { dev_err(hba->dev, "%s: skip abort. tag %d failed earlier\n", __func__, tag); - goto out; + return FAILED; } hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); @@ -659,7 +659,7 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd) */ dev_err(hba->dev, "%s: cmd found in sq. hwq=%d, tag=%d\n", __func__, hwq->id, tag); - goto out; + return FAILED; } /* @@ -667,18 +667,17 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd) * in the completion queue either. Query the device to see if * the command is being processed in the device. */ - if (ufshcd_try_to_abort_task(hba, tag)) { + err = ufshcd_try_to_abort_task(hba, tag); + if (err) { dev_err(hba->dev, "%s: device abort failed %d\n", __func__, err); lrbp->req_abort_skip = true; - goto out; + return FAILED; } - err = SUCCESS; spin_lock_irqsave(&hwq->cq_lock, flags); if (ufshcd_cmd_inflight(lrbp->cmd)) ufshcd_release_scsi_cmd(hba, lrbp); spin_unlock_irqrestore(&hwq->cq_lock, flags); -out: - return err; + return SUCCESS; } -- 2.34.1