Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3846707ybc; Mon, 25 Nov 2019 22:58:35 -0800 (PST) X-Google-Smtp-Source: APXvYqw73CPb4Nxl1sMaD/uZCzWM2N4RMFRDLl3oJbhN28TMcUbr+hUEG9pu+VGsZ81KNZg5Qfxn X-Received: by 2002:a17:906:5c0d:: with SMTP id e13mr40067380ejq.82.1574751515633; Mon, 25 Nov 2019 22:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574751515; cv=none; d=google.com; s=arc-20160816; b=KUbugCsKc2hTXoTMyMKDPjHIe5VFxvp3UFCr95PvbJi9sHzAhvubZxWMvLxsZJMCJi kN1n+pC3wWJyyT7jr/vCxfbAO5cpEoD6LiglGgOSece0x5YWI2fPNNmWN8uGM7U/lxch 18GY904+V6lng8yOCMztFx94c3VOKZcm6bzasKY9torV4ydZkEVbvjVDWpF+6cn1u/QF NKjd2p6yfqBvLKvJyYWOZ8Gs+bchaKE0WyiXXllOs65QBzzT41u5v+0i3IQGODqBVYBt 9JBga0yoC+Kj1IUvO8rk4txVDzgnYorE4ENLf5YS2ul91lOAMxGe859RuzLX/7hOxvsF najg== 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=1Mtb1OX06S8PcZSL2ju0V2f1znDeFP5M8Q4j5hHBbqM=; b=uWlQXLwOFCYoExGyd6Lv/esniO2f/9exrhR3PZzXqkM4zg6aSLdkxeKGagvJtgh36x bJJ8ykgDWWi0uAZyA6wW88p4LQ+JK5OO3c93Ca8YPmVAUm1cjfNrp4JHl/uc7sOOTNvE XRJbI1f9MX4GEaPjvVF4GxHn+OkzzW34y9SU5Oc7Coklfn6+oqdn4VAHHNysQd0ISdNX vSOKg6W8fs29j3WLUm/Px1Cqv9XxsIqiTlEpFFyQ4jG4nC0m0jQ+xubnGRcTffnBMQT/ 0vxwp0m0BLe2POxmRdl+IAf5/FtsBARDLornlDQToG3QNQT/aqPIuzRdwFphyd3l/3B5 7Nvg== 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 ce3si8023782edb.441.2019.11.25.22.58.11; Mon, 25 Nov 2019 22:58:35 -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 S1727186AbfKZGxy (ORCPT + 99 others); Tue, 26 Nov 2019 01:53:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:43188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbfKZGxx (ORCPT ); Tue, 26 Nov 2019 01:53:53 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 320A3C447B6; Tue, 26 Nov 2019 06:53:53 +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 0013FC43383; Tue, 26 Nov 2019 06:53:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0013FC43383 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 v3 1/4] scsi: ufs: Recheck bkops level if bkops is disabled Date: Mon, 25 Nov 2019 22:53:30 -0800 Message-Id: <1574751214-8321-2-git-send-email-cang@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1574751214-8321-1-git-send-email-cang@qti.qualcomm.com> References: <1574751214-8321-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 Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar 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