Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp138361rdb; Wed, 1 Nov 2023 21:08:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1Nv2HieXsk27r4a3MemUzNQQ+Giv6vZCrAs2MlUZTA5HJTcSi1XIQjeOhpdftw/kx2Hgq X-Received: by 2002:a05:6359:7297:b0:168:eb96:f495 with SMTP id uw23-20020a056359729700b00168eb96f495mr15450517rwb.16.1698898081026; Wed, 01 Nov 2023 21:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698898080; cv=none; d=google.com; s=arc-20160816; b=cXWHdf2foascyuWGIeI9WjWS1b34dUVRvB17htHF997x7pQWj2xoi8H1lPt5uKV0H6 K+lW/7jy8u7fbIEtLMHaSLGjl5rtM/kbgXX5fGUMjfLXIF6ijN95Hd3SvOmnM5Sf1hTl fXsX+UL8or8frMHeYcaTcLjk3s4LVDTpgx1KJmKPJ9NCuRA1I+pENOeNytBWftz2bBD3 wOqXlEWTSUue98N0fYY/7ivj4lfVhipokN6P4IRz8eILtRikNqXByR1gT3MWGpSTJQvA Dl4/eUOLaaaKDuliwAMjioR2sTRoRj0SfTWKQQye1N1UqnM2ttknM/cG5iDzq2/00YXD co+g== 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-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:to:from:dkim-signature:dkim-filter; bh=b0X8nfNxem9JetzRHwX5y/FRL/0G/2uEZ8HwSBZ8HDo=; fh=af0dnlnBUeBOSH8nx95Ub0nxlUEI75wmxeVUM3LRwxc=; b=ANQ9qCkFZWovVLoxwy7Bmdzn9sMdglfqqpeidsDg/XDGQZ2odmqsl9udlmXBJQiCAp MADYcfxrtJ0wUR7lFZr1+XuDwC0j8TJ3Vmf6JVWdRIUDAby0Kq7aZHrAwTMadtzL+3YX p2J0AncUCETO9DjLpRHxdwmEzO6MTr8pNmLyYyKIH/fQApeL5Ms4MGwswEoOVvewvtPW G/VyVjd+5nFYtmpfgAeai/n/cexRrh8OYGSKyeXpDl7aW0tLgSZHp9Mmuk3vZcLERAy/ Q+tVisrKemW88WPPnwhGWYn/dxKFXDmZCXhCks8MDGK7jYMwHjnO24KAEt8n2osD2P1h UhHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VfJXaeWB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bq5-20020a056a02044500b005acb3613ba9si1289457pgb.432.2023.11.01.21.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 21:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VfJXaeWB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 09AE281B75E6; Wed, 1 Nov 2023 21:08:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348390AbjKBEHu (ORCPT + 99 others); Thu, 2 Nov 2023 00:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348387AbjKBEHq (ORCPT ); Thu, 2 Nov 2023 00:07:46 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E5E8127 for ; Wed, 1 Nov 2023 21:07:39 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20231102040733epoutp01b632c2358c48f6c62c06a060665f5869~Tssdlsg4T0548905489epoutp016 for ; Thu, 2 Nov 2023 04:07:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20231102040733epoutp01b632c2358c48f6c62c06a060665f5869~Tssdlsg4T0548905489epoutp016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1698898053; bh=b0X8nfNxem9JetzRHwX5y/FRL/0G/2uEZ8HwSBZ8HDo=; h=From:To:In-Reply-To:Subject:Date:References:From; b=VfJXaeWB2Pr+HBBtBt8/U9O4FvERaOnDtPweAqJaasl/jMGEK0KAhODCzH3Z+K8uo lI4qaEKpQfxuq4Ay3q9GSsA3drz390qnaybIihJTVYgkNvjfqNOVHYEfDtYV4INqVA YFif0xG0GJ39M9OAR0Ki7hcGwguP2rlbd9/8MDwg= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20231102040733epcas2p1d7a3e7e448683a9406d00fcc74af85b2~TssdGdeAg0295302953epcas2p1s; Thu, 2 Nov 2023 04:07:33 +0000 (GMT) Received: from epsmgec2p1.samsung.com (unknown [182.195.36.89]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4SLVhN4WjZz4x9Pr; Thu, 2 Nov 2023 04:07:32 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmgec2p1.samsung.com (Symantec Messaging Gateway) with SMTP id A6.26.08648.48023456; Thu, 2 Nov 2023 13:07:32 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20231102040732epcas2p4b725fde7d65e0569f7ff5b9809140c43~Tssb81lGL2090720907epcas2p4U; Thu, 2 Nov 2023 04:07:32 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231102040732epsmtrp2d797d4a1fd97c31b8e9bb020b652dad3~Tssb7V_kU1194411944epsmtrp2W; Thu, 2 Nov 2023 04:07:32 +0000 (GMT) X-AuditID: b6c32a43-4b3ff700000021c8-4f-6543208483d9 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id D9.93.07368.38023456; Thu, 2 Nov 2023 13:07:32 +0900 (KST) Received: from KORCO118546 (unknown [10.229.38.108]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231102040731epsmtip11ed5b0085c6a9a98da6de5f58451571e~TssbtBr0r0643906439epsmtip1e; Thu, 2 Nov 2023 04:07:31 +0000 (GMT) From: "hoyoung seo" To: "'Bart Van Assche'" , , , , , , , , , , , , , In-Reply-To: Subject: RE: [PATCH v1] scsi: ufs: core: Process abort completed command in MCQ mode Date: Thu, 2 Nov 2023 13:07:31 +0900 Message-ID: <000001da0d42$1a1c8410$4e558c30$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQI/NadRec19V/jm3RVDFrtg0RqXhwIoHnBGAuFKLQmvc6/hoA== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMJsWRmVeSWpSXmKPExsWy7bCmuW6LgnOqweEeBYsH87axWbz8eZXN 4uDDThaLaR9+Mlu8PKRpsejGNiaLrTd2sljc3HKUxeLyrjlsFt3Xd7BZ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bFv3p8U+eEzHds3jHn5TNpyYv ju5oXZzV87l4xtTPSQ1/T2kJ3+K4+0zaffJ1Ad+l21KW3//SW9q7ID/o7LuY/iePHpwts+48 98UxMVKJpTgj0VCLuag4EQDEzal3OgMAAA== X-CMS-MailID: 20231102040732epcas2p4b725fde7d65e0569f7ff5b9809140c43 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: <20231101084504.79087-1-hy50.seo@samsung.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS,T_PDS_OTHER_BAD_TLD,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 21:08:00 -0700 (PDT) > -----Original Message----- > From: Bart Van Assche > Sent: Thursday, November 2, 2023 1:39 AM > To: SEO HOYOUNG ; linux-scsi=40vger.kernel.org; l= inux- > kernel=40vger.kernel.org; alim.akhtar=40samsung.com; avri.altman=40wdc.co= m; > jejb=40linux.ibm.com; martin.petersen=40oracle.com; beanhuo=40micron.com; > kwangwon.min=40samsung.com; kwmad.kim=40samsung.com; sh425.lee=40samsung.= com; > sc.suh=40samsung.com; quic_nguyenb=40quicinc.com; cpgs=40samsung.com > Subject: Re: =5BPATCH v1=5D scsi: ufs: core: Process abort completed comm= and > in MCQ mode >=20 > On 11/1/23 01:45, SEO HOYOUNG wrote: > > 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 >=20 > What is a =22duplicate command=22? The UFSHCI driver guarantees that each= SCSI > command has a unique tag. >=20 > > In case of 1 situation, cmd should be re-request. >=20 > It should be resubmitted by the SCSI error handler. The UFSHCI driver doe= s > not have to request this explicitly. See also the code at the end of > scmd_eh_abort_handler(). >=20 > > case OCS_ABORTED: > > - result =7C=3D DID_ABORT << 16; > > + if (cqe) > > + eec =3D le32_to_cpu(cqe->status) & MASK_EEC; > > + > > + if (is_mcq_enabled(hba) && =21eec) > > + result =7C=3D DID_REQUEUE << 16; > > + else > > + result =7C=3D DID_ABORT << 16; > > break; >=20 > I don't think this change is necessary. Additionally, introducing > different behavior for MCQ compared to legacy mode in this code path is > suspicious. Why should how commands are queued affect how aborts are > processed? >=20 > Thanks, >=20 > Bart. when the ufs host receives any error, the ufs driver executes the error-han= der. If the error-hendler attempts re-init, it must abort and organize unprocess= ed requests. The above operation is the same for both MCQ/legacy mode. However, in the MCQ mode, if b or c is included in the following specs,=20 the OCS is updated to aborted, which is different from the legacy mode. B. If the command is in the Submission Queue and not issued to the device y= et,=20 the host controller will mark the command to be skipped in the Submission Q= ueue. The host controller will post to the Completion Queue to update the OCS fie= ld=20 with =E2=80=98ABORTED=E2=80=99.=0D=0AC.=20If=20the=20command=20is=20issued= =20to=20the=20device=20already=20but=20there=20is=20no=20response=20yet=20= =0D=0Afrom=20the=20device,=20the=20host=20software=20driver=20issue=20the= =20Abort=20task=20management=20function=0D=0A=20to=20the=20device=20for=20t= hat=20command.=0D=0AThen=20the=20host=20driver=20set=20SQRTCy.ICU=20as=20= =E2=80=981=E2=80=99=20to=20initiate=20the=20clean=20up=20the=20hardware=20= =0D=0Aresources.=20The=20host=20controller=20will=20post=20to=20the=20Compl= etion=20Queue=20to=20update=20the=20OCS=0D=0A=20field=20with=20=E2=80=98ABO= RTED=E2=80=99.=0D=0A=0D=0AUnlike=20legacy=20mode,=20this=20phenomenon=20cau= ses=20unintended=20behavior.=20(As=20shown=20in=20the=20log=20below)=0D=0A= =0D=0A=5B1:=20=20kworker/u20:2:23157=5D=20ufshcd_try_to_abort_task:=20cmd= =20pending=20in=20the=20device.=20tag=20=3D=209=0D=0A=5B3:=20=20kworker/u20= :2:23157=5D=20Aborting=20tag=209=20/=20CDB=200x2a=20succeeded=0D=0A=5B4:=20= =20=20=20=20=20swapper/4:=20=20=20=200=5D=20sd=200:0:0:0:=20=5Bsda=5D=20tag= =239=20UNKNOWN(0x2003)=20Result:=20hostbyte=3D0x05=20driverbyte=3DDRIVER_OK= =20cmd_age=3D0s=20//=20DID_ABORT=0D=0A=5B4:=20=20=20=20=20=20swapper/4:=20= =20=20=200=5D=20sd=200:0:0:0:=20=5Bsda=5D=20tag=239=20CDB:=20opcode=3D0x2a= =202a=2000=2000=20d3=2002=2000=2000=2001=2000=2000=0D=0A=5B4:=20=20=20=20= =20=20swapper/4:=20=20=20=200=5D=20I/O=20error,=20dev=20sda,=20sector=20110= 628864=20op=200x1:(WRITE)=20flags=200x800=20phys_seg=20256=20prio=20class= =202=0D=0A=0D=0A=0D=0AFor=20commands=20that=20have=20completed=20the=20abor= t=20operation=20in=20MCQ=20mode,=0D=0Asince=20OCS=20has=20been=20updated=20= to=20aborted,=20it=20seems=20that=20it=20will=20be=20retransmitted=20only= =0D=0A=20when=20it=20is=20made=20to=20REQUEUE.=0D=0A=0D=0AThanks.=0D=0A=0D= =0ASEO.=0D=0A=0D=0A