Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp762886rdb; Wed, 1 Nov 2023 01:43:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbX3JwxDi7jWfw/rHigx0X6UR+uLgskJX5Kjk9wFXq9RMDkBixjGD2htFJhPWxG3n1Sx2N X-Received: by 2002:a05:6a20:3941:b0:15e:b253:269f with SMTP id r1-20020a056a20394100b0015eb253269fmr6526453pzg.28.1698828212187; Wed, 01 Nov 2023 01:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698828212; cv=none; d=google.com; s=arc-20160816; b=HxQeoZCLGSRBbWX0gT6reaIWkWh9+NWrD4HCfnBuNMB/Q1W/eWASrn/L7vmt4q28UE ekTV16Cl15bkQcAO8/MhNgF7WC31Izjs0uF6y4m4CWwvoEwbYTn/E3pZxT4HZUZ33HTF b7yaN2pR6o8PFp9CfdXCYt2UrQlx7rY2gBaGWkoR/N9PuxH+t+vRu51FyN0Hiz+YB4Xy mFH7WMZyEUCipt5JQzf9hyMfCwskT0ehKiBRoYNqxFBly8ghSJKL+F93AFBJQpSZjW/t gDHQpWFlOYzdnP2NPoji28yPckLcMAaQ742dErxSixma5GDHfZWalbsKz5tMqNvLtV/C Xp/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=Ueeq4gnoEMe7xuekvlOF7idWvlky879rxssZHhVOM/8=; fh=eMU3+aA+LZzo2xVdcJJ5AFSSFYjGpKKYAvPNYI1cTH8=; b=Eo6kay6N4xRvBf7ye/PiOUaROVpBxfNc1wVmAOc9sLZeQP8OHcdqiMZFtj2wM7Om+h SV2I4qvZJGtBbt3OO7JufHZW3ne0FkN4UAtPPlMLc1S49NUceID2uuQMVEC1yP7bNe7V +T3xv6uDG8PaT5pmN3t6C3QjKNqZEkXG3UZLVyeDhdmTn9FDlhn78Wt11X6vBUZlZg/Y pFFCcoQMcXRWFnk693QX8PV+vtNHoub/Zurbk48RZn21Q0hJl9pw82UePV3n5g2h6MFq rdAPAA8LcXpa6DYh2YvmBHwUEg7psCKkfTXTLl2FS4OGfgHUvMgYM3vCsCIGtwLr3ymX SBsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HY07nAUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cn3-20020a056a020a8300b0056959099f46si2427249pgb.856.2023.11.01.01.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 01:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HY07nAUQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 085F1805C3C6; Wed, 1 Nov 2023 01:43:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbjKAInB (ORCPT + 99 others); Wed, 1 Nov 2023 04:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234120AbjKAIm6 (ORCPT ); Wed, 1 Nov 2023 04:42:58 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7629107 for ; Wed, 1 Nov 2023 01:42:51 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231101084248epoutp040a4c8432fd5f875a69562b71154d16d3~Tczf3_cwr2849528495epoutp04B for ; Wed, 1 Nov 2023 08:42:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231101084248epoutp040a4c8432fd5f875a69562b71154d16d3~Tczf3_cwr2849528495epoutp04B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698828168; bh=Ueeq4gnoEMe7xuekvlOF7idWvlky879rxssZHhVOM/8=; h=From:To:Cc:Subject:Date:References:From; b=HY07nAUQDZHGWWAKeFA/vUcQCWMAhpWG/EOlNUkKlMrBxh9KS73ijuJ7CSq6OtaMx 8xCrO3zqORG+hPGpbiiTz1jRnXl/AvT2e1err8Qx2oZjP4zfWhWB64QexgrUQVGKMm JpIcP7pYLNRaBbQeH71NkBfatD5stIoI+aQuPidg= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20231101084247epcas2p2129462642c0fa24c56898cea2d244538~Tcze5H8Pb1183311833epcas2p2B; Wed, 1 Nov 2023 08:42:47 +0000 (GMT) Received: from epsmgec2p1-new.samsung.com (unknown [182.195.36.100]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SL0rQ5Sxfz4x9Pw; Wed, 1 Nov 2023 08:42:46 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmgec2p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 21.91.18994.68F02456; Wed, 1 Nov 2023 17:42:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20231101084246epcas2p32ae15219878d1c31e7d8a14c22489519~TczdoeD_I3146031460epcas2p3o; Wed, 1 Nov 2023 08:42:46 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231101084246epsmtrp158e8cd269db0d28b000847452d7fb6df~TczdnmD-42468024680epsmtrp1n; Wed, 1 Nov 2023 08:42:46 +0000 (GMT) X-AuditID: b6c32a4d-9f7ff70000004a32-57-65420f8613a6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 46.3C.07368.68F02456; Wed, 1 Nov 2023 17:42:46 +0900 (KST) Received: from rack03.dsn.sec.samsung.com (unknown [10.229.95.126]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231101084245epsmtip21d55f2f4788dcdc8c75e98354b95ff9c~TczdW-MP92863528635epsmtip2i; Wed, 1 Nov 2023 08:42:45 +0000 (GMT) From: SEO HOYOUNG To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, bvanassche@acm.org, kwangwon.min@samsung.com, kwmad.kim@samsung.com, sh425.lee@samsung.com, sc.suh@samsung.com, quic_nguyenb@quicinc.com, cpgs@samsung.com Cc: SEO HOYOUNG Subject: [PATCH v1] scsi: ufs: core: Process abort completed command in MCQ mode Date: Wed, 1 Nov 2023 17:45:04 +0900 Message-Id: <20231101084504.79087-1-hy50.seo@samsung.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMJsWRmVeSWpSXmKPExsWy7bCmqW4bv1OqwenpWh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BMFXyyxTZ2zR mWP4ortllkfoYZsHyZLJyjfYrhW++bDilsYz072H66ZbnVvzhNfqRug0MXZ9P42D73xserqN sz8muDdq9vrv6kx3vvck3LVMiaU4I9FQi7moOBEAg+SBdvUCAAA= X-CMS-MailID: 20231101084246epcas2p32ae15219878d1c31e7d8a14c22489519 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231101084246epcas2p32ae15219878d1c31e7d8a14c22489519 References: X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 01:43:27 -0700 (PDT) In MCQ mode, the case where OCS is updated to aborted is as follows 1. when abort processing is completed 2. When a duplicate command occurs In case of 1 situation, cmd should be re-request. So in the case of cmd whose abort processing is completed in MCQ mode, the ufs driver needs to update to scsi with DID_REQUEUE. Signed-off-by: SEO HOYOUNG --- drivers/ufs/core/ufshcd.c | 9 ++++++++- include/ufs/ufshci.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 68d7da02944f..234b7d7ec037 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5307,6 +5307,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, enum utp_ocs ocs; u8 upiu_flags; u32 resid; + u8 eec; upiu_flags = lrbp->ucd_rsp_ptr->header.flags; resid = be32_to_cpu(lrbp->ucd_rsp_ptr->sr.residual_transfer_count); @@ -5371,7 +5372,13 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, } break; case OCS_ABORTED: - result |= DID_ABORT << 16; + if (cqe) + eec = le32_to_cpu(cqe->status) & MASK_EEC; + + if (is_mcq_enabled(hba) && !eec) + result |= DID_REQUEUE << 16; + else + result |= DID_ABORT << 16; break; case OCS_INVALID_COMMAND_STATUS: result |= DID_REQUEUE << 16; diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h index d5accacae6bc..9aefc7e6d0fc 100644 --- a/include/ufs/ufshci.h +++ b/include/ufs/ufshci.h @@ -465,6 +465,7 @@ enum utp_ocs { enum { MASK_OCS = 0x0F, + MASK_EEC = 0xF0, }; /* The maximum length of the data byte count field in the PRDT is 256KB */ -- 2.26.0