From patchwork Thu Aug 22 11:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 822120 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 A50F2185934 for ; Thu, 22 Aug 2024 11:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724325181; cv=none; b=JQN5ZRwTqt1zX8x46zUVd2djoqfBFmazoDWWaZ2Jct2F3Fe5ZpI3a79OCKsRtqX0Z1nQC1BcFTvZbAhegleyQnMLzpW2fUqV3GY7UJvxzlvXKTuRJR1k/yEvgoYJLn5ceLKu91i5mPQfKQhEXFfDROamxSPFtk5ftRTbNkdhXBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724325181; c=relaxed/simple; bh=2o6SFFiK50nEtSzqm0jnsTg70qgeGslBl21arPBajnk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:In-Reply-To: Content-Type:References; b=nIBjk6i9ksmGWAudgveHfTPRWghKaRqV5i5dTpAmYH0RP2a90VckBRgPon+2hxjxeL/NoRPOmI6hZSux0vy16zjRI38D5P22+c/kXXlWFiw6KaUaXDoMuJOTO8QrcBOIqsvHA8GA9wNTH5svEJuUmSdZQ9C9xf+Ea3VamPT28/Q= 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=PZUtai4N; arc=none smtp.client-ip=203.254.224.33 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="PZUtai4N" Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240822111250epoutp03e8c2ab2ef5f60086e3d018e8b46e765f~uCJtnCJRk2887028870epoutp03c for ; Thu, 22 Aug 2024 11:12:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240822111250epoutp03e8c2ab2ef5f60086e3d018e8b46e765f~uCJtnCJRk2887028870epoutp03c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1724325170; bh=WhDyByxQC4KKueN7C/L/+10V4NNuprqT3IU+mda/IRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=PZUtai4NlyOpk9nfDUKKLOg8GzAMRMUA6OHfHG3/65luqYCFoqWHJwM23pLV3o0XD cONOfcBcjyx/8NTij++RyErpKPMxN5CfHG+oTkpT6pnoEGaVkcru4MEnHl3tJExwIu /A6qy8u+BZgrSA/nTovaHfy1wy1f6RYnSOQIXLos= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240822111250epcas2p441dfb7d4e7bcacaeac857abf1fa55603~uCJtEeNtf1350613506epcas2p4q; Thu, 22 Aug 2024 11:12:50 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.92]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4WqLCP3GSMz4x9Pp; Thu, 22 Aug 2024 11:12:49 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id BC.90.10066.13D17C66; Thu, 22 Aug 2024 20:12:49 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20240822111248epcas2p2739b7db15fd92f9a3f0da9cbffc3d5f9~uCJr3Duvq0251702517epcas2p2L; Thu, 22 Aug 2024 11:12:48 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240822111248epsmtrp10729d00c9dfdd32e39b28ad00a8ea7af~uCJr2X2if1127011270epsmtrp1w; Thu, 22 Aug 2024 11:12:48 +0000 (GMT) X-AuditID: b6c32a46-4b7fa70000002752-92-66c71d31230d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 8B.57.19367.03D17C66; Thu, 22 Aug 2024 20:12:48 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240822111248epsmtip141970c9e30c7e57b67ec8f4d0e79d878~uCJrmrfmn0588005880epsmtip1_; Thu, 22 Aug 2024 11:12:48 +0000 (GMT) From: Kiwoong Kim To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, adrian.hunter@intel.com, h10.kim@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, kwangwon.min@samsung.com, junwoo80.lee@samsung.com, wkon.kim@samsung.com Cc: Kiwoong Kim Subject: [PATCH v2 1/2] scsi: ufs: core: introduce override_cqe_ocs Date: Thu, 22 Aug 2024 20:15:34 +0900 Message-Id: <6aaeaa5fd70f76a1ac751ae3c5a3f0e37bc697b1.1724325280.git.kwmad.kim@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJsWRmVeSWpSXmKPExsWy7bCmua6h7P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d2qJ3v+nGerOjlp0ZwIbWmmZYcEUwVjWRkcD9x8 umGnnuTqe4+6JfldRNwKrMV/KLEUZyQaajEXFScCACUwFUv5AgAA X-CMS-MailID: 20240822111248epcas2p2739b7db15fd92f9a3f0da9cbffc3d5f9 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240822111248epcas2p2739b7db15fd92f9a3f0da9cbffc3d5f9 References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: This patch is to declare override_cqe_ocs callback to override OCS value. Signed-off-by: Kiwoong Kim --- drivers/ufs/core/ufshcd-priv.h | 9 +++++++++ drivers/ufs/core/ufshcd.c | 11 +++++++---- include/ufs/ufshcd.h | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h index ce36154..6ebc830 100644 --- a/drivers/ufs/core/ufshcd-priv.h +++ b/drivers/ufs/core/ufshcd-priv.h @@ -275,6 +275,15 @@ static inline int ufshcd_mcq_vops_config_esi(struct ufs_hba *hba) return -EOPNOTSUPP; } +static inline enum utp_ocs ufshcd_vops_override_cqe_ocs(struct ufs_hba *hba, + enum utp_ocs ocs) +{ + if (hba->vops && hba->vops->override_cqe_ocs) + return hba->vops->override_cqe_ocs(ocs); + + return ocs; +} + extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[]; /** diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0dd2605..0615e37 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -821,11 +821,14 @@ static inline bool ufshcd_is_device_present(struct ufs_hba *hba) * * Return: the OCS field in the UTRD. */ -static enum utp_ocs ufshcd_get_tr_ocs(struct ufshcd_lrb *lrbp, +static enum utp_ocs ufshcd_get_tr_ocs(struct ufs_hba *hba, + struct ufshcd_lrb *lrbp, struct cq_entry *cqe) { if (cqe) - return le32_to_cpu(cqe->status) & MASK_OCS; + return ufshcd_vops_override_cqe_ocs(hba, + le32_to_cpu(cqe->status) & + MASK_OCS); return lrbp->utr_descriptor_ptr->header.ocs & MASK_OCS; } @@ -3180,7 +3183,7 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba, * not trigger any race conditions. */ hba->dev_cmd.complete = NULL; - err = ufshcd_get_tr_ocs(lrbp, NULL); + err = ufshcd_get_tr_ocs(hba, lrbp, NULL); if (!err) err = ufshcd_dev_cmd_completion(hba, lrbp); } else { @@ -5351,7 +5354,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, scsi_set_resid(lrbp->cmd, resid); /* overall command status of utrd */ - ocs = ufshcd_get_tr_ocs(lrbp, cqe); + ocs = ufshcd_get_tr_ocs(hba, lrbp, cqe); if (hba->quirks & UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR) { if (lrbp->ucd_rsp_ptr->header.response || diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index a43b142..3dbd3e4 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -382,6 +382,7 @@ struct ufs_hba_variant_ops { int (*get_outstanding_cqs)(struct ufs_hba *hba, unsigned long *ocqs); int (*config_esi)(struct ufs_hba *hba); + enum utp_ocs (*override_cqe_ocs)(enum utp_ocs); }; /* clock gating state */ From patchwork Thu Aug 22 11:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 822121 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 DEF85181BA8 for ; Thu, 22 Aug 2024 11:12:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724325176; cv=none; b=jsupYaequ58qB/bcXUdQD2SEWonbyPATjQ/MVuKZockclduQn3ZX8o87YfwqU8HGVPSx8iPxQN5RBkJYYfM5t162UBmNE7ciaT2+0MLVTsKpAeSBzehQEH5SiPzc6bzCshaHVez119QyVPzdM0CP1euo21CI+57CbbM4X3Sp/EM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724325176; c=relaxed/simple; bh=AGnKr1NzUWLrk4XMShjBVsJMRG/N+ThYgYQttEhm4Bs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:In-Reply-To: Content-Type:References; b=hmSC3/dp488mbLgJLm9sBjsf0MhldmJ8ZGcBM0fk+zGsYxao6bV7XIdRlc9LDpCZW+OFohoWcsmA9xJfgZ++fhhzct8VSo+bxCezFurDhftnaWbA5cHVShBWMghX4M8gLpmbWckp7K5CZS3O5H2eeY/5k8ZQ/m6J4wPJJwmNyK8= 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=kjzfj2GP; arc=none smtp.client-ip=203.254.224.34 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="kjzfj2GP" Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240822111251epoutp041fbf8c471f3dbe8462002a2f3f6d5558~uCJueH6S70688506885epoutp04O for ; Thu, 22 Aug 2024 11:12:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240822111251epoutp041fbf8c471f3dbe8462002a2f3f6d5558~uCJueH6S70688506885epoutp04O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1724325171; bh=pUkKEpqsWn1vgiB80YuD9+I/Uj7IWzHftlh2WMqtSFw=; h=From:To:Cc:Subject:Date:In-Reply-To:In-Reply-To:References:From; b=kjzfj2GPztH32PICh+mARc2G5zXLFz8t9tIUXyLwuXKnxaGCoMl/a1kDvqsqnpTj2 cXlPgG+vQTfCggfDD+L+ii2yYXMgTRtZzhPzk5B4pRUNFmou2QoFw7EO6tCRTSM0n3 2Zd8hqvHFCdZhm2fyjeQe1qjMo37KOFS58kv3G0c= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240822111251epcas2p4cd1e01de78cf14f0eb3f60dad7251215~uCJt4FUVC1130211302epcas2p46; Thu, 22 Aug 2024 11:12:51 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.91]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4WqLCQ2tK4z4x9Pw; Thu, 22 Aug 2024 11:12:50 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 74.57.10012.23D17C66; Thu, 22 Aug 2024 20:12:50 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20240822111249epcas2p1201417c48df67afbc734ff38ea841cda~uCJss-6Cw0076400764epcas2p1J; Thu, 22 Aug 2024 11:12:49 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240822111249epsmtrp107cd3bab302666b3d2702e57d8f8dddb~uCJssR2l_1127011270epsmtrp1y; Thu, 22 Aug 2024 11:12:49 +0000 (GMT) X-AuditID: b6c32a47-ea1fa7000000271c-f1-66c71d32813f Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 9C.57.19367.13D17C66; Thu, 22 Aug 2024 20:12:49 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240822111249epsmtip1e151548a962775c253deaaa15228b496~uCJsdOwDH0982509825epsmtip1V; Thu, 22 Aug 2024 11:12:49 +0000 (GMT) From: Kiwoong Kim To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, adrian.hunter@intel.com, h10.kim@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, kwangwon.min@samsung.com, junwoo80.lee@samsung.com, wkon.kim@samsung.com Cc: Kiwoong Kim Subject: [PATCH v2 2/2] scsi: ufs: ufs-exynos: implement override_cqe_ocs Date: Thu, 22 Aug 2024 20:15:35 +0900 Message-Id: <763ab716ba0207ecdad6f55ce38edf2d1bc7d04b.1724325280.git.kwmad.kim@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJsWRmVeSWpSXmKPExsWy7bCmma6R7PE0gx1/BC1OPlnDZvFg3jY2 i5c/r7JZHHzYyWIx7cNPZou/ty+yWqxe/IDFYtGNbUwWu/42M1lsvbGTxeLmlqMsFpd3zWGz 6L6+g81i+fF/TBZL/71lsdh86RuLg4DH5SveHov3vGTymLDoAKPH9/UdbB4fn95i8ejbsorR 4/MmOY/2A91MARxR2TYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkou PgG6bpk5QB8oKZQl5pQChQISi4uV9O1sivJLS1IVMvKL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c/r7JZHHzYyWIx7cNPZou/ty+yWqxe/IDFYtGNbUwWu/42M1lsvbGTxeLmlqMsFpd3zWGz 6L6+g81i+fF/TBZL/71lsdh86RuLg4DH5SveHov3vGTymLDoAKPH9/UdbB4fn95i8ejbsorR 4/MmOY/2A91MARxRXDYpqTmZZalF+nYJXBm79i5hLTjCVbH78Fb2BsYnHF2MnBwSAiYSnTfv M3cxcnEICWxnlHg4o40dIiEpcWLnc0YIW1jifssRVoiib4wSlzZNAkuwCWhKPL05lQnEFhFo Zpboa7IHsZkF1CV2TTgBFOfgEBbwlDg4PRMkzCKgKrHi90IWEJtXIFpi68V+Foj5chI3z3Uy g9icApYS5w7OABspJGAhMXXNTTZc4hMYBRYwMqxiFE0tKM5Nz00uMNQrTswtLs1L10vOz93E CI4JraAdjMvW/9U7xMjEwXiIUYKDWUmEN+ne0TQh3pTEyqrUovz4otKc1OJDjNIcLErivMo5 nSlCAumJJanZqakFqUUwWSYOTqkGprWV0pGLk85lV55rti1g//6+9WFFturC/rtLGTVdg51v z3glFKy2tkONT3Njz+lM1YpPux54HHQ15lnkILNw7WSRmd883CRXvjG4aSXj8E4jdyHD8gTV 34159tybp21yXbnj3srWJVVRW96sK9z2uCis7Pyeo4+vHX3h7b/zQ7WI35vefUkVaWFb/qV0 vF1V177P5L5kkYzQRVnrgqiieRaLxZrtcoJ5YiVCCvRumXsseKl/q+3R99kyuY9KbnMvqb5S rcJd/Up12vdV5/gkH/ek+5nOaW3K2f5di5N5pwBTzad9SZ/P/+z1qvm7tuL6RIaLZ9+XhgrG tR5S2HrMOmBB1OFspak1d3/uv9XXr8RSnJFoqMVcVJwIAJA5Ojn4AgAA X-CMS-MailID: 20240822111249epcas2p1201417c48df67afbc734ff38ea841cda X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240822111249epcas2p1201417c48df67afbc734ff38ea841cda References: Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Exynos host reports OCS_ABORT when a command is nullifed or cleaned up with MCQ enabled. I think the command in those situations should be issued again, rather than fail, because when some conditions that caused the nullification or cleaning up disppears after recovery, the command could be processed. Signed-off-by: Kiwoong Kim --- drivers/ufs/host/ufs-exynos.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 16ad352..7ff0e84 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1376,6 +1376,13 @@ static void exynos_ufs_fmp_resume(struct ufs_hba *hba) #endif /* !CONFIG_SCSI_UFS_CRYPTO */ +static enum utp_ocs exynos_ufs_override_cqe_ocs(enum utp_ocs ocs) +{ + if (ocs == OCS_ABORTED) + ocs = OCS_INVALID_COMMAND_STATUS; + return ocs; +} + static int exynos_ufs_init(struct ufs_hba *hba) { struct device *dev = hba->dev; @@ -1926,6 +1933,7 @@ static const struct ufs_hba_variant_ops ufs_hba_exynos_ops = { .suspend = exynos_ufs_suspend, .resume = exynos_ufs_resume, .fill_crypto_prdt = exynos_ufs_fmp_fill_prdt, + .override_cqe_ocs = exynos_ufs_override_cqe_ocs, }; static struct ufs_hba_variant_ops ufs_hba_exynosauto_vh_ops = {