Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp281903pxa; Tue, 4 Aug 2020 05:38:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEfifNjvgOtBBnsa97D/0pkonV4Ki1ErKRxRpwoAXZHt8VOykiqPIxwNvjV+sBnq9odsiZ X-Received: by 2002:a17:906:a182:: with SMTP id s2mr14664609ejy.526.1596544718839; Tue, 04 Aug 2020 05:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596544718; cv=none; d=google.com; s=arc-20160816; b=LYkCoboDgA/ygsXgcbbc2ONvm0o6sOWqYjOTyuKzd/Uk4Y4lZUOQ9jvuquoNHFdwNw PGFu95eX3IFt/MvkVtTgYp49pr66aRRKIskkVvxepP1UqL0K6q7Jh7WwgmpJv9cwkqwc huukUtRyD0ASnU5xQODmknL901YZVlwGr5Kr/SAUss1FezQVvfVgVvO4jI94s5ktsa0+ 7boKIH4hK58OHblo0Bpj7eQg3bnyNkhYZfahu1fTauv/kvoHujQBAwXY8YXYo/Uci4bB JYnlpV2Evl83hCFPCMqziZ+slp50yq92kI4JU0UokV7A+jbfZwKESK+GjlIVkHylwymq nXAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6RTVhFDX46AnPd26vPe+RB8qNqmkRWknJbiE97l1Y+Y=; b=Wad9FJTTNca/Q7xoPKkpuxYlspUvBzdarYOxLu3kSNF/9/bOmhDm6GGF6Muzde1c0V 5hVxXnSoMhY53dhDSEMesD/HS5FGjOqoRWfUJshFbcY0T40dF0uWlo5B3BnNLmGS52Zf 15W3NIq5qhv/ykMv6BQfoWYaDHVdPrKNx/dECeZMnleTXzE1K0o3kltH/101u4DxWhgp SbKIAySeXP6lrO5nlR94akyUGSkyHjgQWqofs6KvH1+u1HoBpsdg9t5ZhWvp3tYZ9Oht Vo1iqBJJB6ILTLW+UFLi7jQn2DDSP4HG5P37pL3o3alYpibAdkVdLJCpAepH0imQoWbP Hv8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OxhKHu6d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si12210346edr.459.2020.08.04.05.38.15; Tue, 04 Aug 2020 05:38:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OxhKHu6d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727022AbgHDMgB (ORCPT + 99 others); Tue, 4 Aug 2020 08:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgHDMgA (ORCPT ); Tue, 4 Aug 2020 08:36:00 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9882BC06174A; Tue, 4 Aug 2020 05:35:59 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id c16so21838379ejx.12; Tue, 04 Aug 2020 05:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6RTVhFDX46AnPd26vPe+RB8qNqmkRWknJbiE97l1Y+Y=; b=OxhKHu6db2XpSqxcE6NiFINrJxgBl1DWnXgFtyU+pkKBKOfzyy0+LMbh7NB7HNVfRU lMJGCoDE/FZs+I0WNEJMG5XsdddfDRzcUMWNJu6p52Gu7mJNM+sCuS/VaZb+qIJjMATc R1cfNcJHias4PZkk5yIkei6BALKCW9cfEB9U9E+BymV6YcI4tDWzyhTo0qzWC3ccQQyI sxBWhbkcntUTnU29PDsd1GGfMRoIqRSE0oM2eQqLEsR+ZqV0IScRascUv5BF4oWegVdu lczV+GvaY8Zlsj3LkvcSID3NqGz+TeqAadC7Cnrr+93GAVGDQafxcXR7klC/2PG27GV8 oz4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6RTVhFDX46AnPd26vPe+RB8qNqmkRWknJbiE97l1Y+Y=; b=jUekQbGrFT7ZgGFEIE4H3sXm3s5gvvSVsueo1hRElcdR6g+rty4403BS43yKIw6PTR GTqZh8OQ9NDvw52QEpN80U83ZotLPbjAlLrRtVNAWkDtnwgwGLRpLfbIa1Ds9b9kL6vb eJL2Uh9Ns44cQIlzrDkmJ4a4sWtWgByNoq2nLER77VsJDsfk3ahTQp+VKQC64z+he/C2 fVILTCHfP1rr+VYIN4Wgt6q9ZM18TH/kN6bZ8p6/ZFc2npgSVavz/gOgnfcKpsPCo6NT /cOTpAmBF1ts5lJf1L+LT3tmeFapPkCzlh0BEZZc9qC8Z7+tg5/bh0e/GI+ecuEW2nyr X4qQ== X-Gm-Message-State: AOAM532339lKu8c2ep0RD+nMVOeT6uwF1geMfiFXFDQb03tykpfw+FTS mThQabI2JIA6jW9C8RZpcIx+VZSX X-Received: by 2002:a17:906:a209:: with SMTP id r9mr22108168ejy.413.1596544558402; Tue, 04 Aug 2020 05:35:58 -0700 (PDT) Received: from localhost.localdomain ([2a01:598:b88a:676c:15b9:533b:62ba:b5b3]) by smtp.gmail.com with ESMTPSA id r19sm18514261edi.85.2020.08.04.05.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2020 05:35:57 -0700 (PDT) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] scsi: ufs: no need to send one Abort Task TM in case the task in DB was cleared Date: Tue, 4 Aug 2020 14:35:34 +0200 Message-Id: <20200804123534.29104-1-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo If the bit corresponds to a task in the Doorbell register has been cleared, no need to poll the status of the task on the device side and to send an Abort Task TM. This patch also deletes dispensable dev_err() in case of the task already completed. Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 307622284239..581b4ab52bf4 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6425,19 +6425,16 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) return ufshcd_eh_host_reset_handler(cmd); ufshcd_hold(hba, false); - reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); /* If command is already aborted/completed, return SUCCESS */ - if (!(test_bit(tag, &hba->outstanding_reqs))) { - dev_err(hba->dev, - "%s: cmd at tag %d already completed, outstanding=0x%lx, doorbell=0x%x\n", - __func__, tag, hba->outstanding_reqs, reg); + if (!(test_bit(tag, &hba->outstanding_reqs))) goto out; - } + reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); if (!(reg & (1 << tag))) { dev_err(hba->dev, "%s: cmd was completed, but without a notifying intr, tag = %d", __func__, tag); + goto out; } /* Print Transfer Request of aborted task */ -- 2.17.1