Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp225232lqg; Thu, 11 Apr 2024 00:12:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2LDnlQNRoGg1aEEJxbzcUQJFhsvfIbS6NPNzKMXZEnZgldvLBSVdBTs7/1Cvrxo16x66pM0GEnLWBkDKG/jfruSbiPuCdjp3B+k1JHQ== X-Google-Smtp-Source: AGHT+IGaFvz8JFidX78URbE20S/Hs6RodkvEVWyk/wtRta0svbD2oXIoSgfvgEZqgPULS6mfF3UK X-Received: by 2002:a05:620a:4002:b0:78d:36cb:5887 with SMTP id h2-20020a05620a400200b0078d36cb5887mr5641181qko.9.1712819559669; Thu, 11 Apr 2024 00:12:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712819559; cv=pass; d=google.com; s=arc-20160816; b=pXk2Obpt5UjT3kHS2Lnw9CLfunJ0XVUsT52GFP8DTA/rRK+69rdEPA9g97NDZiAd18 uXUdTFXa5yA4bV8LuDLHI/zATbEurB4zZlhkvDtjdq1NOtrcH5UO6W198xBML8/HwEKM 1ba8rM/qFWb5EOnSbd30L4E8uQ45ipZGp+ZR/ZJ1mcE3iIcz/ZVLuDGbAjpfACR9OnuZ FdPO3NQdoJRRaoRcEmE5i4I2Xz5UaVMUG+EoUK7IQ2+IRuZNYlH09FbWBmhz/hXc+iNF fXDfsvgZlqPo+pEX3Lcossu+XcSqhkkxynDm2PuS4+2B/nTVV7i0UrQJa/9FBG3/zFFk bEIg== 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=zVTnUQHv886FrPUVq7+WRcst/8IszsvzOiHELYTRM4Q=; fh=gdcxzXoydKSxydJSite61CNNHcQcsfC8XfZ+5h/vCiI=; b=XrXIbD7Fzi42Qwuy0zeg2xw1NeP+Mci0gGSA5S+dJ+PRQ1dUJ85M+dscK+yd1rGE50 FWeKPyknI9AmAvxeMptYDCVaCK1vlwbW7VKPTIttLYjw/LLAhxlbixqKxhKh81MFFzi3 R+ucFsO3VzukLEHL8JDOUVSMLbBXwJRV0TO1um8048QpKOOLeBTneAg2ALEFzgORPRwI iiKmSdYyXgY4TDcpOMVuuu3iRqf/pcNBiNsNa/MiUFoL62PIvp+a631K6NBfhkciDu4u JWC25C92+WeHXlbhr8C0QMr2dPJYtN25hVdQ9qCNVfrIyZCsY2Zl1HXT+Wi1LCfs31l1 MivA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HLXTbNFO; 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-139940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wg22-20020a05620a569600b0078d6398da27si940519qkn.84.2024.04.11.00.12.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HLXTbNFO; 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-139940-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139940-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8F7EA1C21398 for ; Thu, 11 Apr 2024 07:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 542B113E8A3; Thu, 11 Apr 2024 07:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HLXTbNFO" 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 67A3A13E020 for ; Thu, 11 Apr 2024 07:10:46 +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=1712819450; cv=none; b=ZYFTgd3vEnOYTGuBYIBBROctpjabLADA71MxtDnKibECTGp3IGTNuMIv9e3loNkXD0tznAehkjicPpSZIusiKm44EWn3FSCn2VekuOAOEc089LRVOC/jysiPKxRkPhFP2tgVTS/SK+aQdGLma6rMRVdWtaU1yVEqWjNpPtxYgbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819450; c=relaxed/simple; bh=EVrrGbITq6iY1+riebn7BmWva7odfM/dc+M8apZJsbk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: References; b=VMf4bZans+dgU1oEDWxpj3R+Ygvtm+489Jo7k6JG2KCe2RuULdCWPKPz3zuD7cfB2ykaiu3yBdf7dqeIp8TPG5DD1JrtM0SLCaUmKQZl/5cjK8bvssMd4qSOrEo+HXn57Z3YzLE4HnGhvl9GPwq/iNTggq7iq8UIk+otXdcke3w= 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=HLXTbNFO; 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 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240411071044epoutp03ca9d15593539dac641c9e71d804894ba~FKDWpQE4z2317223172epoutp03B for ; Thu, 11 Apr 2024 07:10:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240411071044epoutp03ca9d15593539dac641c9e71d804894ba~FKDWpQE4z2317223172epoutp03B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1712819444; bh=zVTnUQHv886FrPUVq7+WRcst/8IszsvzOiHELYTRM4Q=; h=From:To:Cc:Subject:Date:References:From; b=HLXTbNFO1TrH7dJM4cA5ghQdyg+scQATWASlRi0RrqKUGCSVcCX8EiTxE1ollqjBj yi9MOeiek/6Xx2n6OSkF+cfH1lFLUWkdHFuE2cPOiXkuVbA2S9OEe9lFD4v1bqfy7p q1zh8Hic8qq6b3SS06mZh9jGWoV9QlILBG66jHtE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240411071043epcas2p4f4f3f01b427d0aa827a057608b6ea64b~FKDWBERXA0511405114epcas2p4m; Thu, 11 Apr 2024 07:10:43 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.99]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4VFW7Q60s7z4x9Q1; Thu, 11 Apr 2024 07:10:42 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 2A.99.09640.2FC87166; Thu, 11 Apr 2024 16:10:42 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20240411071042epcas2p4b2e6937a952e6dfa879db166983b1c54~FKDU5YhP40511405114epcas2p4j; Thu, 11 Apr 2024 07:10:42 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240411071042epsmtrp151f16100e8b264a1de75943ef94c66ce~FKDU4ULWa2252922529epsmtrp18; Thu, 11 Apr 2024 07:10:42 +0000 (GMT) X-AuditID: b6c32a48-01f5ca80000025a8-88-66178cf24864 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 21.54.07541.2FC87166; Thu, 11 Apr 2024 16:10:42 +0900 (KST) Received: from rack03.dsn.sec.samsung.com (unknown [10.229.95.126]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240411071042epsmtip1a0e5464db6a74fe1adfd6a7cc2e38d72~FKDUngiKF0441504415epsmtip1R; Thu, 11 Apr 2024 07:10:42 +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, quic_nguyenb@quicinc.com, cpgs@samsung.com, h10.kim@samsung.com Cc: SEO HOYOUNG Subject: [PATCH v3] scsi: ufs: core: changing the status to check inflight Date: Thu, 11 Apr 2024 16:14:44 +0900 Message-Id: <20240411071444.51873-1-hy50.seo@samsung.com> X-Mailer: git-send-email 2.26.0 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+NgFtrHJsWRmVeSWpSXmKPExsWy7bCmue6nHvE0g/3LDCwezNvGZvHy51U2 i4MPO1kspn34yWzx8pCmxd/bF1ktVi9+wGKx6MY2JoutN3ayWNzccpTF4vKuOWwW3dd3sFks P/6PyWLqi+PsFkv/vWVx4Pe4fMXbY8KiA4we39d3sHl8fHqLxWPinjqPvi2rGD0+b5LzaD/Q zRTAEZVtk5GamJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0 upJCWWJOKVAoILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgxt7g0L10vL7XEytDAwMgU qDAhO+PGuRtMBSu4Kj4u3sbewHiBo4uRk0NCwESiZ+VVli5GLg4hgR2MEld23YVyPjFK3P43 lRHC+cYo8W3PdEaYlt9H+6Gq9jJKvDx3gRnC+cEo0X24FayKTUBDYs2xQ0wgtojAZSaJP8vM QGxmATWJz3eXsYDYwgJeEkcbj7OC2CwCqhJL9u8Ai/MKWEr0bV7FDLFNXmJRw28miLigxMmZ T1gg5shLNG+dDbZYQmAmh8S369ehGlwkpsxvYoOwhSVeHd/CDmFLSbzsbwOyOYDsYolZC6sh ehsYJQ7NngVVYywx61k7I0gNs4CmxPpd+hDlyhJHbkGt5ZPoOPwXqppXomHjb6iJvBIdbUIQ YSWJM3NvQ4UlJA7OzoEIe0h0LHoDDhwhgViJ53e3sE5gVJiF5K9ZSP6ahXDCAkbmVYxiqQXF uempxUYFJvD4Tc7P3cQITshaHjsYZ7/9oHeIkYmD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QfX1Sak1p8iFGag0VJnNdwxuwU IYH0xJLU7NTUgtQimCwTB6dUA9PKBatYHuQt2LRUXbYxK8fKXcS2Wl/RuaVdXEtxceAD991M alPCFXl5cx6+cpsutjZzZ7hm6I+UGVw3KoP05c2jT5ya7RF95YLoPtZti7j8Cnet7DgixRdw mefeyfIEa7ZvNZsXhFlzTn+xRLTmf8w2juyU1XPcVk1gfH4qZNcD6xvPlXbt6V/e2cN2Y9ax uzPOtH+zsdh5fbaWUETS3EtNekHvWD+v9t/at+oht8K9TN79e8UERAJjb9m/K+E9tiUl8sbl SNZFLd5TFzBYLQlgzHCe+ST9X/V8jxhjvr2utg9/zrS7dl/gm0pBKh+LQHv7Kb7i//d/l81Q 4NCzC3/F3Sc9zVPozUzbgAsl85RYijMSDbWYi4oTAUrSb9r3AgAA X-CMS-MailID: 20240411071042epcas2p4b2e6937a952e6dfa879db166983b1c54 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: 20240411071042epcas2p4b2e6937a952e6dfa879db166983b1c54 References: ufshcd_cmd_inflight() is used to check whether or not a command is in progress. Make it skip commands that have already completed by changing the !blk_mq_request_started(rq) check into blk_mq_rq_state(rq) != MQ_RQ_IN_FLIGHT. We cannot rely on lrbp->cmd since lrbp->cmd is not cleared when a command completes. v1 -> v2: convert the two return statements into a single return statement And modified comment of commit v2 -> v3: remove superfluous parentheses in the above return statement Link: https://lore.kernel.org/linux-scsi/20230517223157.1068210-3-bvanassche@acm.org/ Signed-off-by: SEO HOYOUNG --- drivers/ufs/core/ufshcd.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 21429eec1b82..a99f7ab85f12 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -3082,16 +3082,7 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba, */ bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd) { - struct request *rq; - - if (!cmd) - return false; - - rq = scsi_cmd_to_rq(cmd); - if (!blk_mq_request_started(rq)) - return false; - - return true; + return cmd && blk_mq_rq_state(scsi_cmd_to_rq(cmd)) == MQ_RQ_IN_FLIGHT; } /* -- 2.26.0