Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2311064pxu; Mon, 7 Dec 2020 03:21:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw67LUtY1kBFo8R+omBilmPqqNmFankPVwJsknfSMnPUusNWNyZZzJhVySNjArl9hOibVk2 X-Received: by 2002:a17:906:3b55:: with SMTP id h21mr18388664ejf.184.1607340067981; Mon, 07 Dec 2020 03:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607340067; cv=none; d=google.com; s=arc-20160816; b=hayU6AZBJg0Unegj2ZEzfOKMroF9aifxyDivuooU5i2/kSqP9B1V/C87hm2u2s7+fV 5bnMvuAoYEyxA/3Kig1NbXwsGIJcBIYNeLnIUCQHSMC3PTkGe6TCCwYXFb889yG+jljz qVpJp+tklgQSNGNBTovZBzmP0kwZHAU6z1x7kJrGJrqDKgCWA6eWDl0hNk2l2t/pi73g jHUaN3qZn3OeopRjaR7FwuQqB/DyeUcCTXogC/TnnBL/am9ftKHQRNFvnbD7O6u18vuz XyQQT18AAHV85R173ReS0LWH0kaXthGEaEt0ahhZTMeVCnVuDulYofvGSQl1juTU7TW3 fLtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=LzuHMjHqXt98AxqLTSyAQqGYo+32ZS7gzfcD3uCXQW4=; b=G6Rt3loylAtiTFc4aNqTSGIAlvkLTZvwktYITcElqoPXWtyqY6ycg76RVArD+Qp9ik X5FQ5wV6AirTGtHR8X15WFwHwqFX2OXac2UzBTDotRX37jVZF/ubM+DKVspQR4vE/lak GrXl5l/40uDfLkv4YiYuQcyfBObGZFsrdCTKqwyJUmPCN6u8JSj14NA6vHvlMCg9VvL/ VJSF+Y7QKIK6/YCB/P9IWxraKYCyUzwl6oBXSihaAr6fHk9g+YXC0W3xSnaM634pYBeh rP2dWRJlJCykYaiHarYObxQ5lqA0nFdnBYBb2/0sigADsDdnj3MEdEp6/RaCs46mHCVF qBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nH0ybEha; 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 n1si5223178edq.466.2020.12.07.03.20.45; Mon, 07 Dec 2020 03:21:07 -0800 (PST) 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=nH0ybEha; 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 S1726492AbgLGLSx (ORCPT + 99 others); Mon, 7 Dec 2020 06:18:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbgLGLSx (ORCPT ); Mon, 7 Dec 2020 06:18:53 -0500 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE826C0613D0; Mon, 7 Dec 2020 03:18:12 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id cw27so13290559edb.5; Mon, 07 Dec 2020 03:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=LzuHMjHqXt98AxqLTSyAQqGYo+32ZS7gzfcD3uCXQW4=; b=nH0ybEha6h0mKYzN4F5umyS6sby7ByHgwez3MrADauhPUEDAi/eVEnr58E6kfkfLCD ZX6EpvQ0OovXbSMoSybu+F5FY2PMD+nkOKqlQzI5p1Dn9L8Mh7vTILMME5LTuJCk5JuL CeiGnTZJJjcReRevzasOGNHEjhsSP0LzS8LsKDSrJF0hpZ6J7sLhQFeOu6A1Z6hf96mc DePi0De/vBGUH5jYQIDA12biyYzv/H1T96mGOhDlti6t1Bjdi+IFOdvy8HviYrRrdmXW 4/HHfi0odQKbXaIoPdv/zNcNkW+xZ9uAg9vWpedGcfPhfxMF+yRwy7KMVFTnnKN74I4t 5bOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=LzuHMjHqXt98AxqLTSyAQqGYo+32ZS7gzfcD3uCXQW4=; b=o6JXFs36l5PdxU+BWQDIO35W/qXE8+TIoki0k6BUGg6z7OFULSnz3nC93v4eVNDDhG dM9xxhUYf2D2zajiqVYuYmWyJkFphlVrq/uN8E5t8qf225OQ9kxMoQLIkQKKayw1aaMt JygEKyyZFa5mDI/Zuq/PGLqTm/u+XhBqK2FIje9aPtVW9zrhs6Q3U3sKiBAGkkWTcu1Q T5aaQLKHSz3uOmJPhtkeMz7muFszx8LHTsXSCb47JLkC02vSamKSKt+SZt4+eyZYouCP eWwNwajvfy0Gq64E1xL0HVGMzynilEmVFg7Tw6sk6C2zXUGHRXVFneq9O/2NzYiD3YM7 3naA== X-Gm-Message-State: AOAM532kUyJeX6jfZ0OCMGuJhYMWbhpZQ2Y6G1K1GUN0RUG4GsQExfqW j+GhYeQWgpueps6TYnxhhp4= X-Received: by 2002:a05:6402:1a54:: with SMTP id bf20mr3385270edb.65.1607339891647; Mon, 07 Dec 2020 03:18:11 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id z9sm12090123eju.123.2020.12.07.03.18.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Dec 2020 03:18:11 -0800 (PST) Message-ID: <2ef12e328ecdc411e7d145a331d7c8ce668bf2be.camel@gmail.com> Subject: Re: [PATCH v2 2/3] scsi: ufs: Keep device active mode only fWriteBoosterBufferFlushDuringHibernate == 1 From: Bean Huo To: Avri Altman , "alim.akhtar@samsung.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" Date: Mon, 07 Dec 2020 12:18:10 +0100 In-Reply-To: References: <20201206101335.3418-1-huobean@gmail.com> <20201206101335.3418-3-huobean@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-12-07 at 08:02 +0000, Avri Altman wrote: > > According to the JEDEC UFS 3.1 Spec, If > > fWriteBoosterBufferFlushDuringHibernate > > is set to one, the device flushes the WriteBooster Buffer data > > automatically > > whenever the link enters the hibernate (HIBERN8) state. While the > > flushing > > operation is in progress, the device should be kept in Active power > > mode. > > Currently, we set this flag during the UFSHCD probe stage, but we > > didn't deal > > with its programming failure. Even this failure is less likely to > > occur, but > > still it is possible. > > This patch is to add checkup of > > fWriteBoosterBufferFlushDuringHibernate > > setting, > > keep the device as "active power mode" only when this flag be > > successfully > > set > > to 1. > > > > Fixes: 51dd905bd2f6 ("scsi: ufs: Fix WriteBooster flush during > > runtime > > suspend") > > Signed-off-by: Bean Huo > > You've added the fixes tag, yes,it is a bug. > but my previous comment is still unanswered: > you are adding protection to a single device management command. > Why this command in particular? > What makes it so special that it needs this extra care? > see the Spec: " If fWriteBoosterBufferFlushDuringHibernate is set to one, the device flushes the WriteBooster Buffer data automatically whenever the link enters the hibernate (HIBERN8) state. The device shall stop the flushing operation if fWriteBoosterBufferFlushDuringHibernate are set to zero. .... " If fWriteBoosterBufferFlushDuringHibernate ==0, device will not flush WB, even if you keep device as "active mode" and LINK in hibernate state. Bean Thanks,