Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3699171ybv; Mon, 10 Feb 2020 04:57:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwVwob9Ffld8JouAcsWj2eFoEYSniTSbDNfAYmHPydV41VGll3TV9sWtvcywKE7CkQfsmz0 X-Received: by 2002:a9d:65cb:: with SMTP id z11mr889647oth.348.1581339426713; Mon, 10 Feb 2020 04:57:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339426; cv=none; d=google.com; s=arc-20160816; b=hEVmCVtNyzv4sz5EhwKWDsr73kDIgFvwenEeX5MDlb8Ped71Ceu2RcrY494XgBf+qG jMmjN3+rCGxPvzSL6m+wcnWzV143VjqMyKUDqTjatG3nNlSLmeciYS0eYbAjObIBTOUy bOBxCqN2aou/BZP7U5J1QHQvV4tTHPjp7KT8pxMIWD0pVbgwr726lDRx0iHYkpc/Hmyw 3uDRvVbUEgHIuFHkQYEzKQo8Wl2QXHNSSPEYJGKVcMgDwrE6kyqapHal4NiM4gB96FFI X5xzbYUMBe215WspTwlUX56LifL/LBVkBEzaVCv3ZWYVLtseTmYcIId7Eaxt1R1+s1i/ 58JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qutJubXlyt7UATgdeA0s6iMsvazk2pWQzB2QZPeg6M8=; b=V2UFu0YWwz5o5BedIMZqiMuM7pinCONeZyd6RLnNRSzFpuu3+NKHTP3wLVaFvowLWd 6obl3Jzud5281qN9cniPg2IWpuJoxp40/dxYG7jtKCM+EamPxBqBlmXynUNDjbFowGcP xRrsYzrHoo0cWtmiwFZfeD9lIjwBMzosa/cWYER8h1BPc1jdBmbzhrmG94kc+J8ULkQs bmVK3p7wFZu63lVCThC/axWR0jw5V6SDlM0Cctew25MFG+jY794OZYR01o4vN4fyG7ep zgF2OmV90WaoCzrgv6Z8Ys1CM+XlQ062ex+HwFnGY9WI7QrlRn/qxGHZiBDocfcVidKR qd2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZIyE7/bl"; 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 b2si197197ots.284.2020.02.10.04.56.55; Mon, 10 Feb 2020 04:57:06 -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=@kernel.org header.s=default header.b="ZIyE7/bl"; 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 S1730186AbgBJM4v (ORCPT + 99 others); Mon, 10 Feb 2020 07:56:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:44168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730024AbgBJMlf (ORCPT ); Mon, 10 Feb 2020 07:41:35 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0546C20733; Mon, 10 Feb 2020 12:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338495; bh=y9Bm0VEPRRwBIkpZOZX5/h6YwU4gJxJiEpIUJiLd6/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZIyE7/blt+jtLtwk46v/jQeUr4fm7LMnO2FLawNMUNn5umm7hN3DbJZa4qhF/RVe6 kFAiKX2za+6q5BfKny072S7ts+/GFv7dJTM3M9hdFu0smNLxNLbP1ZVwPpXO0b8PtS VMdQ3d07PVaJIDFMrntY4r5/gh02q6vDnomftIjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bean Huo , Alim Akhtar , Asutosh Das , Can Guo , "Martin K. Petersen" Subject: [PATCH 5.5 283/367] scsi: ufs: Recheck bkops level if bkops is disabled Date: Mon, 10 Feb 2020 04:33:16 -0800 Message-Id: <20200210122450.108920904@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Asutosh Das commit 24366c2afbb0539fb14eff330d4e3a5db5c0a3ef upstream. bkops level should be rechecked upon receiving an exception. Currently the level is being cached and never updated. Update bkops 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) Link: https://lore.kernel.org/r/1574751214-8321-2-git-send-email-cang@qti.qualcomm.com Reviewed-by: Bean Huo Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar Signed-off-by: Asutosh Das Signed-off-by: Can Guo Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5053,6 +5053,7 @@ static int ufshcd_disable_auto_bkops(str 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; } @@ -5077,6 +5078,7 @@ static void ufshcd_force_reset_auto_bkop 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) @@ -5123,6 +5125,7 @@ static int ufshcd_bkops_ctrl(struct ufs_ err = ufshcd_enable_auto_bkops(hba); else err = ufshcd_disable_auto_bkops(hba); + hba->urgent_bkops_lvl = curr_status; out: return err; }