Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2360207ybc; Sun, 17 Nov 2019 19:57:02 -0800 (PST) X-Google-Smtp-Source: APXvYqynbNXEVzHBmKeB5tu6gHJd/+ZQ7ayrV9WMpqUH4avwZW8CT2rGJxSw+gXsjVFniS4JZb9y X-Received: by 2002:a17:906:c353:: with SMTP id ci19mr22337103ejb.249.1574049422609; Sun, 17 Nov 2019 19:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574049422; cv=none; d=google.com; s=arc-20160816; b=hFUI3bfwc9IuXdm3bJ6XquH3xwwX0BGUCXMs/CrIwqKPuE/aajwwxRRyh7gv1QqYY4 8bqclXRBlQS3NfpxH6Sfcawr/wTY0GBFT1cT+VWU0bfyaAsrnlrU0OXu7nsUTWY41VN5 a5yihfDA5tocGrWwIhkFukIxFD9MrQO6zNdw7Yhp7t4wv/hYx1KuXA+FpKDHab67qQxk Z5uyz73UyWA5ioVMUFLB06XTV8PCeNTn0dxmPxuU4Wq/r01fKhq7llT3ceFTVaF+4OWV 9VT+WAPNArvPO0C0ZoVTyElQYxDf1qu7wkXIYHfDSCI+cV6GJy080d6kjSu99EAYBV1N CNtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:references:in-reply-to :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature; bh=YNB71u1jDYmLDLBo1xXLhcQU60ZMdrWgQpS/fLsKfP8=; b=QmgXc1y8Qd70Z5o4lNNdxB0ymy1tCNIAxu+5aBBV6FH4p61+Qq+PzC8HM/PDLE/l+B focfuiIMTvWbKzA0KXYpWh4MoyYliDMbpFPRCHZXkOZ4wVxFXaJQlSwwJB7bNvmx2NuV GQMMAVIYtxnQ6GLYqEpC7p6j5ORWklrnyKPfUdYvFYWhNd93GCwqAWZjTe0mx4F+mAjB kCgQv2vqR4b9M8M4STJPOq6rdDMuqLCQyofC8CiI5WJAaQMa4KQDBarY2h38gj2aN399 MuJz/yR0N0d7qTzSP9SdXfHqVtgAXinV0IQi1mqRB1BZUF1r+zyGQcwxfzkiT16sjGQ4 IW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=oeSqlZom; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=H65Eo8gy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si10582417ejx.271.2019.11.17.19.56.38; Sun, 17 Nov 2019 19:57:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=oeSqlZom; dkim=pass header.i=@amazonses.com header.s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx header.b=H65Eo8gy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbfKRDzB (ORCPT + 99 others); Sun, 17 Nov 2019 22:55:01 -0500 Received: from a27-10.smtp-out.us-west-2.amazonses.com ([54.240.27.10]:49240 "EHLO a27-10.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbfKRDzB (ORCPT ); Sun, 17 Nov 2019 22:55:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zsmsymrwgfyinv5wlfyidntwsjeeldzt; d=codeaurora.org; t=1574049299; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; bh=Khjp9idUetqKkgihK8iOQyiq9dNb53Oa0Bjyc3Bj4LY=; b=oeSqlZom4jtk/k+FuqnVydiv5KWmHWSz5CmheYRqo3UlgtjP8n8Hvoh8w9ApKRWg ClhEesK7O67ZMQZCU4NvNcxiQYL6E38WW7PyKKsUx7ytoo8ymtxzEwf9r1FH7yAVN5i r4WRlbcUOEksye6puaepqF9QkhqKwLSJgN9MKt6Q= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gdwg2y3kokkkj5a55z2ilkup5wp5hhxx; d=amazonses.com; t=1574049299; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Feedback-ID; bh=Khjp9idUetqKkgihK8iOQyiq9dNb53Oa0Bjyc3Bj4LY=; b=H65Eo8gyugftpAkX1Wk3AOdxMMRJr5gxKlfyp649WBR/r81WEQ0+84acmU83sWFf +9rLqHLMYPIj8T0Nzh6BB5OXdBjs1Bc7ijhYJkgUltMocJtrEXrUknruWgTGfcOYGDF oSzq6Ei+kLzWlZjIoF4mbn+jISjK6b0zh2R/HW/0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3DDEAC43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=cang@codeaurora.org From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, cang@codeaurora.org Cc: Alim Akhtar , Avri Altman , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Tomas Winkler , Venkat Gopalakrishnan , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 3/4] scsi: ufs: Avoid messing up the compl_time_stamp of lrbs Date: Mon, 18 Nov 2019 03:54:59 +0000 Message-ID: <0101016e7ca63d9d-c9360196-acbf-4e53-9041-ccf8935f0d2b-000000@us-west-2.amazonses.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1574049277-13477-1-git-send-email-cang@codeaurora.org> References: <1574049277-13477-1-git-send-email-cang@codeaurora.org> X-SES-Outgoing: 2019.11.18-54.240.27.10 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To be on the safe side, do not touch one lrb after clear its slot in the lrb_in_use bitmap to avoid messing up the next task which would possibly occupy this lrb. Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8e7c362..5950a7c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4902,12 +4902,14 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, cmd->result = result; /* Mark completed command as NULL in LRB */ lrbp->cmd = NULL; + lrbp->compl_time_stamp = ktime_get(); clear_bit_unlock(index, &hba->lrb_in_use); /* Do not touch lrbp after scsi done */ cmd->scsi_done(cmd); __ufshcd_release(hba); } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE || lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) { + lrbp->compl_time_stamp = ktime_get(); if (hba->dev_cmd.complete) { ufshcd_add_command_trace(hba, index, "dev_complete"); @@ -4916,8 +4918,6 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba, } if (ufshcd_is_clkscaling_supported(hba)) hba->clk_scaling.active_reqs--; - - lrbp->compl_time_stamp = ktime_get(); } /* clear corresponding bits of completed commands */ -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project