Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5427126pxj; Wed, 23 Jun 2021 00:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTydflA5dX9BnsVix+1vJZG62dS7/s/siPO//GYrugrUHUMHsRmh5KaJUqJCJv5UqGX1Wk X-Received: by 2002:aa7:d9cc:: with SMTP id v12mr3747323eds.232.1624433966908; Wed, 23 Jun 2021 00:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624433966; cv=none; d=google.com; s=arc-20160816; b=Y0c3nfbw2/XDQAthwmdnvVYMlXXCkmL8Jq+Tu8Ko8T9t3ydz9iLOXvV9zU/ghveVMg eUNFa7Inwq/1lJSeNV53mJp+f2IAz8zvYOs+ntpErkakhDZl0AwneWjC6TeV6WxlUjR6 e76EK5WBMsizfkpPmPEywzGO4iX9v7OKp7vFF0oPaGcHoqdOakvDggGpycwHbIP1Mg+T kotxhWNYRGU5EZ4iK75gMkzQDuWM+AzMuqB1Kb65ZG7oQOjzfBlJMpo4bJymB0fHrwmy 3ElQ4AL8grc7b3vhs7ZvS1HjoujikxBpJh7gbk+29rvDr5nItzNBCDNMMdRwezMmILgw g7nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr; bh=llJUImoK2e7IKr6/oOM6dXhzf+DetMTKBOvi3IAO9w4=; b=YXe/tyWqmmshaMfw1Wyt/eu7bR0V30XRd2UHWrwJk+qFzDA93JuTFeEe1TjNDyyEw4 TE5DNPc1OnZ5Ikn5NqPgNpCz860W6QUe9kytKeDLufVRBs76liRaF56N8+S64ScBe8O8 wwNTuEmaYvI1744lC3B9pTGrFmF5wYV9Geg4TtvSBoxquAfCxvuoRuVmmu9sc6K4j5n2 XDr1MhFsZaLKHhaGVnmC8nByIdWD5UDSuUs8aOJcgjTpzsxA8HC+gZgLSisbXBN6XUuI +PB7c6qR/sbJAaA5ni8ygA+NV89sm+8hzHESUFyLjX3PRbYaPCs+FNo0GRr+CnXzaPVR 971w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv25si16455912ejc.161.2021.06.23.00.39.04; Wed, 23 Jun 2021 00:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbhFWHjt (ORCPT + 99 others); Wed, 23 Jun 2021 03:39:49 -0400 Received: from labrats.qualcomm.com ([199.106.110.90]:4033 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbhFWHj1 (ORCPT ); Wed, 23 Jun 2021 03:39:27 -0400 IronPort-SDR: rSf3kEGxfPls28NJoptcnE8i3v2WSFhubXF7ba1eWunPn/QJmggQg8c7H7OeioItmiLo6rLqqg G6kIkew7XOhZTOl4BZHzaRX/Yl0kAV6Y3ZsicB8orULc7IZm0+GFJh+aRhsgipJTuO59NMxP5F ik0+drNDjN9qNUyA0x0XSh9hIHyNo8BNZvzoYhbea2KE9eF40nAA2yFGGO26FKGzQ32jivDr/N ETES5eOJD7K8gcDetVpxOZyf7Y39OGol7Tb01PAYLRSUQqgomrnmZg51m4SArTmbL0JKh5jLSp kzQ= X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="47902946" Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by labrats.qualcomm.com with ESMTP; 23 Jun 2021 00:37:07 -0700 X-QCInternal: smtphost Received: from stor-presley.qualcomm.com ([192.168.140.85]) by ironmsg02-sd.qualcomm.com with ESMTP; 23 Jun 2021 00:37:07 -0700 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 4790E21BC1; Wed, 23 Jun 2021 00:37:07 -0700 (PDT) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, cang@codeaurora.org Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Jaegeuk Kim , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 05/10] scsi: ufs: Remove a redundant tag check in ufshcd_queuecommand() Date: Wed, 23 Jun 2021 00:35:05 -0700 Message-Id: <1624433711-9339-7-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1624433711-9339-1-git-send-email-cang@codeaurora.org> References: <1624433711-9339-1-git-send-email-cang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit a45f937110fa6b0c2c06a5d3ef026963a5759050 ("scsi: ufs: Optimize host lock on transfer requests send/compl paths") has moved ufshcd state check to front, we can remove the following tag check added for preventing the scenario where a cmd is trying to take a lrbp, which is still in use. This scenario can only happen if a cmd goes through the fast abort path (whose tag is released but lrbp is not) in ufshcd_abort(), and since ufshcd state is also changed by the fast abort path, checking the ufshcd state in ufshcd_queuecommand() is equivalent, hence remove the tag check. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5f837c4..3695dd2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2768,15 +2768,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) WARN_ON(ufshcd_is_clkgating_allowed(hba) && (hba->clk_gating.state != CLKS_ON)); - if (unlikely(test_bit(tag, &hba->outstanding_reqs))) { - if (hba->wlu_pm_op_in_progress) - set_host_byte(cmd, DID_BAD_TARGET); - else - err = SCSI_MLQUEUE_HOST_BUSY; - ufshcd_release(hba); - goto out; - } - lrbp = &hba->lrb[tag]; WARN_ON(lrbp->cmd); lrbp->cmd = cmd; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.