Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp463576pxa; Tue, 11 Aug 2020 07:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOlJYgYUnpiuZsZNld2jHrSI5GNNhkvQrSfO6VlJjtz1NLXXHyPwjRsFlizgh9c9Eq6CMP X-Received: by 2002:a17:906:e87:: with SMTP id p7mr1500627ejf.547.1597155844406; Tue, 11 Aug 2020 07:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597155844; cv=none; d=google.com; s=arc-20160816; b=uBQ2LidPBDaLZyMI2nhaZKyFBYxm92VX43Rys5+ZQF6zU3R8AzXop8Ilrk4i3iqKy0 1lwbWJrOSjwTjQll9I9yy2NfrLiBGsUKvct1dwOGLB8xJX6Zxt+qQQRCMsj354kmCq8U NeLXbPEtSXYIQv9VzYfdKOuCQr+Dz837ts4zEyCF4jeY5Igtu/3sxO2fOtvW+kiIys8B CjDotvl67yE+N3JyJRs5fpNcYLSwYE00sxYKG9rH7gw6ue3PQldcHWXj1rln7V2yaP2X mLMGtbKNW4XZzz5Wl9Rh1gZxsUbQSqy37doIevk6xoUVAYITCShNF7YbmrUTV6jf9+1i d59Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YEsfFaQhbNo4Nh7eCvn4HhXSvpFeuv1zORb6ik42jgw=; b=xUCALRgZXCHvWuFzlvnmaCbEbPxQGOX3gO4xeuDgkXhR6X26GV50eC6bqfpr3KoQ60 7VBmb68kv4hVre8/xJEJsxb7BGXj3T7YFP61EyA1rqKIl4dUa6IgMoZEv4o1kWEK/mQF 6JnswJ/QtIdfMJjWorf6S7vhHBmbY3+nc9gCpJ/cNsTkrIcKZ1bSRoxyzNvKIZsZqtyR OxaUMolfMQdJ0xZrhVFS6UP/yVDZiFTTVVpB4K/JehzH9jgZw/WyoF9FEYDRf5OOkPp2 bnBRV7pLhvpjsZwi0+/WfSekgPNNUcXOZCtF/V9rMyeFN98imLafcbjiirlEGby27l8U C1HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UsZATr2c; 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 z9si4231375edr.282.2020.08.11.07.23.41; Tue, 11 Aug 2020 07:24:04 -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=UsZATr2c; 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 S1728794AbgHKOTr (ORCPT + 99 others); Tue, 11 Aug 2020 10:19:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728516AbgHKOTo (ORCPT ); Tue, 11 Aug 2020 10:19:44 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3273C06174A; Tue, 11 Aug 2020 07:19:43 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id bo3so13254605ejb.11; Tue, 11 Aug 2020 07:19:43 -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:in-reply-to:references; bh=YEsfFaQhbNo4Nh7eCvn4HhXSvpFeuv1zORb6ik42jgw=; b=UsZATr2cNAFxqiVxvPOK8ahADy4L1dDNduK7GACjlWsMDN5tCavCLbrwWccj5laels 4LF3Y0HrqBHLTow17Q3+C4k0XZPQIOvHsdgOjn0bG6GOXutiI91kMxU6m5wb5wCCvwnh mQASFylYiGrx78sXVASy1jobZxKWsX2jZoixnvnHwNExSwW7ezpU+6IEVUh0+Fg49LSR RKCDtYHTRgWUD0gD+o/mo1+s/LzfcKF7tVr5YZEVMwgI2Qwr1Bj1xgVDZgzfhJY7aXbj mTjbk4cSq+6wW44wOzKpu8ynei0pQlM4yVJlilDZi3N/Qmr5qIC2m35QNCnJo+loQNdK YAbA== 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:in-reply-to :references; bh=YEsfFaQhbNo4Nh7eCvn4HhXSvpFeuv1zORb6ik42jgw=; b=VrwOzhDJ4ZOyogbNll2UxXlSIcWtD56PSzHnn2ihjAyYOJZ9XEyxK0IH9AwIxZsn7D Wm7RWoQ6lIdNbZyiX+QHY7rk34SbqcX9N6HvYn6pAOj9mx0F0oWHkO5r0A4VNoBBY2ot 5Gz0jquGGWd6YX4q0s3QYOGs2wQBY4H3GEvYK4izh1EIp90IshHOW6mYzFeCwL/2wii/ Rg6CxnjgrpEFimewwkGsL69yhc7ToebuRg9lwA5ZWFd6r37/CtHc9W4+8L2sUBp2UN8O Q0jjJHyQNZOL34eYJ6O/p3RWuHSM5bcw0SOJAYFGIDDWay8YfGbzs5xwNNYyZdtjEwzk 3F2Q== X-Gm-Message-State: AOAM530qXFSaLeZGQg8+ujxwFMjOCvayZRPWU1SFYfz9iS2gmaxwnqVO fCBtukkAam7MJoA0l1+G45s= X-Received: by 2002:a17:906:73d9:: with SMTP id n25mr8793159ejl.412.1597155582400; Tue, 11 Aug 2020 07:19:42 -0700 (PDT) Received: from localhost.localdomain ([2a01:598:b888:52c9:44c:d55b:5f94:2fc4]) by smtp.gmail.com with ESMTPSA id q15sm1467050edc.74.2020.08.11.07.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 07:19:41 -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 v2 2/2] scsi: ufs: no need to send one Abort Task TM in case the task in DB was cleared Date: Tue, 11 Aug 2020 16:18:59 +0200 Message-Id: <20200811141859.27399-3-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811141859.27399-1-huobean@gmail.com> References: <20200811141859.27399-1-huobean@gmail.com> 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. Instead, let it directly goto cleanup. Meanwhile, to keep original debug print, move this goto below the debug print. Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 66fe814c8725..5f09cda7b21c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6434,14 +6434,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) goto out; } - if (!(reg & (1 << tag))) { - dev_err(hba->dev, - "%s: cmd was completed, but without a notifying intr, tag = %d", - __func__, tag); - } - /* Print Transfer Request of aborted task */ - dev_err(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag); + dev_info(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag); /* * Print detailed info about aborted request. @@ -6462,6 +6456,13 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) } hba->req_abort_count++; + if (!(reg & (1 << tag))) { + dev_err(hba->dev, + "%s: cmd was completed, but without a notifying intr, tag = %d", + __func__, tag); + goto cleanup; + } + /* Skip task abort in case previous aborts failed and report failure */ if (lrbp->req_abort_skip) { err = -EIO; -- 2.17.1