Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2357775ybc; Sun, 17 Nov 2019 19:52:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyY5HLXVGw3D9H2IZr4ZhFfcob+VTHnOTR/gPXjR1XIax1hDQ5Z4lHjKzlbMFHC2VHXA6w5 X-Received: by 2002:a17:906:4098:: with SMTP id u24mr23146419ejj.220.1574049165826; Sun, 17 Nov 2019 19:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574049165; cv=none; d=google.com; s=arc-20160816; b=r6X0UJtnibIwG5CyWK3nv48p75sonRewEH49bAIkwFtOZz1IrygCdWeG6nanKZhTY8 KWWE3+NOKPXWsh7RuBys4k+QtlResynZ1ZvjrILmL7cFtpSDH9KMUbZwE2dNgLkaHA8G m2OYYpgN5Q9r1itrFLDDBU4+fNVnhamZ5/JGzK7cInxX6TQRo+mBrTGPj6MhMdlUr0ey e2gQAoazhfenNiFVHHBs9e2+l3+XR4w6C7m1NvQy5+mWJHFe0udXU6hKR0v9WJYenuxK PHWOb5VIgZOuudEVqSIImiHDAAd/xvcE6184Iyz6GbHfZNijIKDYhuzC0A+U0YJFT9X1 lUnw== 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:dmarc-filter; bh=JQd0zIgbb2IrHHBf7NOf1INQGyV26xbJRyG8FVzMgVs=; b=a/IfNwo9UkfwGZWd3EiIgxrGo7yJ46yzv0/B6mdZPBvCN+jODSsQcaXfORalQk5otK tMdzERkGcfW/YJ81PmEpPyFjMXUOgCGDugp2UyXjDlQoXdaFZp9R4HBCBtiF5i5vWKm6 2NPR+cVbNXrLRHUecmlQeokSl06GyUa84/N+E7tflNG/AtJeus1qKewk1HVnLNVx7azf WchXnEAS7pbs+8FjjEnys+jlGeE5r09V5c0K3//yX7+Ry2EhpnmqlZb4H+WadYubyvq/ iHTjCVDYmfo7zVZWliJJDS4ejwUktZiWZ3MA0gDUfAKmQojEzClQTYKeUIB7/JgJqg7r GBQw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si12279529edj.96.2019.11.17.19.52.18; Sun, 17 Nov 2019 19:52:45 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=qti.qualcomm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726475AbfKRDvP (ORCPT + 99 others); Sun, 17 Nov 2019 22:51:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:52954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbfKRDvP (ORCPT ); Sun, 17 Nov 2019 22:51:15 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 25C72C447A5; Mon, 18 Nov 2019 03:51:14 +0000 (UTC) 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_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9BA95C43383; Mon, 18 Nov 2019 03:51:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9BA95C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=pass (p=none dis=none) header.from=qti.qualcomm.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=pass smtp.mailfrom=cang@qti.qualcomm.com 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 1/4] scsi: ufs: Recheck bkops level if bkops is disabled Date: Sun, 17 Nov 2019 19:50:57 -0800 Message-Id: <1574049061-11417-2-git-send-email-cang@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1574049061-11417-1-git-send-email-cang@qti.qualcomm.com> References: <1574049061-11417-1-git-send-email-cang@qti.qualcomm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Asutosh Das Bkops level should be rechecked upon receiving an exception. Currently the bkops level is being cached and never updated. Update the same each time the level is checked. Also do not use the cached bkops level value if it is disabled and then enabled. Fixes: afdfff59a0e0 (scsi: ufs: handle non spec compliant bkops behaviour by device) Signed-off-by: Asutosh Das Signed-off-by: Can Guo Reviewed-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3910c58..8e7c362 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5099,6 +5099,7 @@ static int ufshcd_disable_auto_bkops(struct ufs_hba *hba) hba->auto_bkops_enabled = false; trace_ufshcd_auto_bkops_state(dev_name(hba->dev), "Disabled"); + hba->is_urgent_bkops_lvl_checked = false; out: return err; } @@ -5123,6 +5124,7 @@ static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) hba->ee_ctrl_mask &= ~MASK_EE_URGENT_BKOPS; ufshcd_disable_auto_bkops(hba); } + hba->is_urgent_bkops_lvl_checked = false; } static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status) @@ -5169,6 +5171,7 @@ static int ufshcd_bkops_ctrl(struct ufs_hba *hba, err = ufshcd_enable_auto_bkops(hba); else err = ufshcd_disable_auto_bkops(hba); + hba->urgent_bkops_lvl = curr_status; out: return err; } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project