Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2379637rdb; Tue, 14 Nov 2023 21:28:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjzb3YnFmzGLWn6NCeIMdm+rQ4jQxGypLUoQnQVMkbFVHStYNFiGNZYSg1eVuA81lFDD49 X-Received: by 2002:a05:6808:188a:b0:3b2:ddc0:ac9c with SMTP id bi10-20020a056808188a00b003b2ddc0ac9cmr15275480oib.39.1700026094808; Tue, 14 Nov 2023 21:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700026094; cv=none; d=google.com; s=arc-20160816; b=nV573TrAlkezG6v7R29VgMNZFcWqlFJDrj2f9QF1nUBH7B4qO3zSssf4tTjwCuzq+3 8vF6w2Hyajp3lfoMFC/hk6fWdZVcr3KeVqd4UYJ/lgHBiaCzKHwkTcKMge1SYWKgying WO0hbv78CUBCpKVYipFnt/IUY/edu54EKxH1FJNphenNsUVT5NqN/wqXB8rLsLaLoEFU 9aDeviJrOJuxUAsp1r2YjCGFye7pZCv3zt6+kQwqhtwRD7oe0wYF1Hu0gjMlFwdMoA4X 6RXaG56ZgXISqRXIXc6/ykN0SqlLwSsmwd+gJHp/3bX1v7GM2oXOsugmFbzwrDeMDLS2 ZtUw== 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=D0EqNZ4QvmTiqp+zm9gUip9+1CE4m/Mr3OtYi4fnK84=; fh=Mf8pTaoRAFm3ujrMY3mVroaP5ALjnLzS8ohhhY7kqB4=; b=lGfOSkHR4fqqVX2DBCx00xbWFZKJgvZ5rPhIWZXZja22p/dvxrotFCXoxPvC+So40x UzqIZrwlzmS+GPDZ3ji4ubMxUztFiP4YVyG1Jc9wfuqIZU9+TAMTyvm+T+gXPdLKfn9d ggTXCRQKdRww3tJfRDQQqTVvIKXERM8H38irZsMQqCLjl5NzSTiL9mi3CoIGwPK7KPc2 PJp3SAMnjfRxhTIZazDnSjW0B9EisQ7+kXLNkLmwjFnJ7QwTltivYytmcvnzkqyX4zxc nS79AabUluXx+Yfy0M4mR4lLlEDQ7CNvb70CJMigZNbbmo7T2+onuOGTeSACE1Da51Uc MIpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ald55Mma; 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 cl22-20020a056a02099600b005b7d9aace9dsi10228156pgb.46.2023.11.14.21.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 21:28:14 -0800 (PST) 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=Ald55Mma; 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 6F0948069F05; Tue, 14 Nov 2023 21:27:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234507AbjKOF1N (ORCPT + 99 others); Wed, 15 Nov 2023 00:27:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbjKOF1L (ORCPT ); Wed, 15 Nov 2023 00:27:11 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB547C3 for ; Tue, 14 Nov 2023 21:27:06 -0800 (PST) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20231115052703epoutp013ed35639ae69fc01ad0af984be81d0bb~XtKlYjAuy0913309133epoutp01k for ; Wed, 15 Nov 2023 05:27:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20231115052703epoutp013ed35639ae69fc01ad0af984be81d0bb~XtKlYjAuy0913309133epoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1700026023; bh=D0EqNZ4QvmTiqp+zm9gUip9+1CE4m/Mr3OtYi4fnK84=; h=From:To:In-Reply-To:Subject:Date:References:From; b=Ald55MmamXookYk9bNvZJYivhK6D9WzjrqF/Z4MKvUqNi6AE/65g4USPq+VbR7Nnc 5Y6aXNAV1Vv0ZMrip9tc2vzuFJ/P61d+xpLiocOVcWiOU+Wp2dRhi0ovFlj8CJxMp9 gFDUpyQwU7fIlzvkpdE9BnL+lS3ggXexOngAppnw= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20231115052702epcas2p4bf1ed0b3b92810f0966e742e4553af6f~XtKkn6zhR0725207252epcas2p43; Wed, 15 Nov 2023 05:27:02 +0000 (GMT) Received: from epsmgec2p1.samsung.com (unknown [182.195.36.92]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4SVWr61JVLz4x9Q9; Wed, 15 Nov 2023 05:27:02 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmgec2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 90.81.08648.5A654556; Wed, 15 Nov 2023 14:27:02 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20231115052701epcas2p4d1106372cfc6e274fbf51ce14d5c4924~XtKjItrl-1897718977epcas2p4Q; Wed, 15 Nov 2023 05:27:01 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231115052701epsmtrp1474112faf7522eb10d691ca34ae2e501~XtKjH3mQz0354103541epsmtrp1i; Wed, 15 Nov 2023 05:27:01 +0000 (GMT) X-AuditID: b6c32a43-4b3ff700000021c8-05-655456a5efc7 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 3F.7E.08817.5A654556; Wed, 15 Nov 2023 14:27:01 +0900 (KST) Received: from KORCO118546 (unknown [10.229.38.108]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231115052701epsmtip18ad6a5c866000d16411b218042404755~XtKi6RgAz1106911069epsmtip1D; Wed, 15 Nov 2023 05:27:01 +0000 (GMT) From: "hoyoung seo" To: "'Bart Van Assche'" , , , , , , , , , , , , , , , In-Reply-To: Subject: RE: [PATCH v2] scsi: ufs: core: fix racing issue during ufshcd_mcq_abort Date: Wed, 15 Nov 2023 14:27:00 +0900 Message-ID: <000001da1784$5c2520f0$146f62d0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLYbO3h/Z18bVSq8KBPFnY/ewa5qgDl2w4PAbQq5PquaVzhQA== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLJsWRmVeSWpSXmKPExsWy7bCmqe6ysJBUg8mvmC0ezNvGZvHy51U2 i4MPO1kspn34yWzx8pCmxa+/69ktFt3YxmSx628zk8XW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kmZ22j0RNHty8JWlsvXPR 9s6tsW8juVwvngxM2r1x5hPr4+cThC7wbH4smrdedULZ9llpK9OVls5pCDxYYCLvWvXnjJzE D9OLF1Z8+BjMJdf/WN/jhhJLcUaioRZzUXEiAPxfK/xDAwAA X-CMS-MailID: 20231115052701epcas2p4d1106372cfc6e274fbf51ce14d5c4924 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: 20231114043431epcas2p4a8d452e18fff192c03fb6066e81514ea References: <20231114043704.52525-1-hy50.seo@samsung.com> X-Spam-Status: No, score=-2.1 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_SCC_BODY_TEXT_LINE autolearn=ham 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]); Tue, 14 Nov 2023 21:27:36 -0800 (PST) > -----Original Message----- > From: Bart Van Assche > Sent: Wednesday, November 15, 2023 2:55 AM > To: SEO HOYOUNG ; 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; > kwangwon.min@samsung.com; kwmad.kim@samsung.com; sh425.lee@samsung.com; > sc.suh@samsung.com; quic_nguyenb@quicinc.com; cpgs@samsung.com; > grant.jung@samsung.com; junwoo80.lee@samsung.com > Subject: Re: [PATCH v2] scsi: ufs: core: fix racing issue during > ufshcd_mcq_abort > > On 11/13/23 20:37, SEO HOYOUNG wrote: > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > > index 9a730a794b66..55f4c0eeda7b 100644 > > --- a/drivers/ufs/core/ufshcd.c > > +++ b/drivers/ufs/core/ufshcd.c > > @@ -7574,6 +7574,10 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, > int tag) > > goto out; > > } > > > > + if (!ufshcd_cmd_inflight(lrbp->cmd) || > > + test_bit(SCMD_STATE_COMPLETE, &lrbp->cmd->state)) > > + goto out; > > + > > err = ufshcd_clear_cmd(hba, tag); > > if (err) > > dev_err(hba->dev, "%s: Failed clearing cmd at tag %d, > err %d\n", > > The UFS driver must not set SCMD_STATE_COMPLETE itself. Only the SCSI core > is allowed to set that bit. > > Thanks, > > Bart. Hi, The test_bit() function just check SCMD_STATE_COMPLETE bit state. Do not set SCMD_STATE_COMPLETE field. This function is also used in ufshcd_mcq_compl_pending_transfer() to check the status of cmd. Thanks. BRs SEO.