Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5297049pxu; Tue, 22 Dec 2020 13:10:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNKmps28g8A1keUuA/fy4NUjydGJhj/btc79+e7FbRNNK1ry3yxMUJZeNTOA0iUtuhRRzV X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr22109382ejr.54.1608671453019; Tue, 22 Dec 2020 13:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608671453; cv=none; d=google.com; s=arc-20160816; b=YlTHhGiYeBcp6qPnd3qbErFKjhaLeWnt1vvE1D0PzXT+kERZJjX9r9wh9FPvnixcrW 0VmY1VsCFSJ6LGuBw1RIlTNluHnhk4pnOXb5WkURVu4FLPJ2SHSZddaPAm5+cGpY+oSp 1K8LNDlm0bqQWM77+h+VFUMDW7gxUwBa0OAqPvm518FoNJLF/BhbTXZ36Wizfkq/fbVX YSQYlEIdiKDpLFFQgv1fT7pZqppbjk85WqojkLZymlkITi6mT9rU/XOtdKFXI57w53z+ nNRQDA6zE/yHyV06psNDRe/Htmp424h7v4kTzYvdbMuFU2JD50XTWVOwVej7Agp8TiHr PJCw== 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=GHDD6k758sHyLbm3erfWNgoWWYdDW9BcqtWScl75Bq0=; b=ZZQVSkYMrn34hq7k8lFwEblXNAeKLT8ZeGRhuw6F+xhCA1ygMqQ070hZiCLhepKA9h 71J7/AKEMd+lIgSbr6qQYVOJW5ymXZWaJZddd+iKtMlO0chzHIYSlQGAIht/WII+i4/h M97UADzwTgF/spzdWFa/VKqQ9VJ+zGZ+ZC+gwVB/I4VV75Vfe5WPu7bf4shGkJkkLxDn aZ0Kiiw0biBr1QMExNDF5DQ/aK3WNOg/dSfwqkDjEnZ2B4Il1QBSrj61b3rdMvTV2+Zn xd3K2Ki01Tcm89lIubF3Ql403PZ2WCrhnxdg/sFRbkCnVgHNjXIAA+UMQGs0YMlm3lU3 spog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fPo2VSkR; 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 g1si11912644ejf.377.2020.12.22.13.10.30; Tue, 22 Dec 2020 13:10:53 -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=fPo2VSkR; 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 S1727889AbgLVVJl (ORCPT + 99 others); Tue, 22 Dec 2020 16:09:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbgLVVJk (ORCPT ); Tue, 22 Dec 2020 16:09:40 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF34FC0613D3; Tue, 22 Dec 2020 13:08:59 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id cw27so14249347edb.5; Tue, 22 Dec 2020 13:08:59 -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=GHDD6k758sHyLbm3erfWNgoWWYdDW9BcqtWScl75Bq0=; b=fPo2VSkRWpZWaQFqj/NVNxUkZWVOHy8Zu2Hdn69c52GsvU1tnqIPoJ2OsDdAXlw6NE sER4Q3LIUEgirrRjdjpa8+hmSHjozQp2uMTD8h1xBHxlFGPuUffEY+FMFUf2Jjgav0u9 6MKn5Xym/BWVJK8i06HBeVaOA0ttKyu6nQWTMILobWngpNkE+htqgjaeWc9XEv2hS0dM 02ksBTdKodTczFsShy83tzZGCrv+JenaQoH+93zEXfdYgCEze/32KSL7E86C/Pekz7UL VeAjqqZGairLWFsRyFRcV+FKOTA8r1vOmZAw/jd4DIKcI6obUrXiBDSLRRtnI3jzxGOf k1jg== 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=GHDD6k758sHyLbm3erfWNgoWWYdDW9BcqtWScl75Bq0=; b=slaTUz2KtuMCkXsphClPSOcmqV4y+bPqJpuL/742KJHRQ9C5QQ2fCwtuAmuSmXeotg oCDxdQm8fprqh126nodlxu8ZI5ZL8uyyFpwrpEeJt+dC+smPjrWjZR/rQWBlRFyVx451 0MneTaZmEtJNGktEFDcZ7iqmq19yBDVEAg5EtEFqEH9nOv1dwDHyvalG1qC/GGDDCOYf E1okxRBzsaD4qJ+Swm9WkIe3K+48abGJt1ZNTR8irE2XrHG/+C7b0SL52FYJOQ6rspVT DuV5ffO+J9tQh8nmNRjT9yqwBeNtY7sNorX5LkVs9bVVZiqs229ER2CPiR+4skNOfYyB Ht/w== X-Gm-Message-State: AOAM531gf6hTfDwZlKTwfxTo4opJNOM1nb2NfAwhMg2tiO0VSLihYMz9 cd5S5PpP5Yg08rxI0QYsv4w= X-Received: by 2002:aa7:df91:: with SMTP id b17mr22467222edy.272.1608671338728; Tue, 22 Dec 2020 13:08:58 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id n20sm10663028ejo.83.2020.12.22.13.08.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Dec 2020 13:08:58 -0800 (PST) Message-ID: Subject: Re: [PATCH v5 1/7] scsi: ufs: Add "wb_on" sysfs node to control WB on/off From: Bean Huo To: Stanley Chu Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 22 Dec 2020 22:08:56 +0100 In-Reply-To: <4c15956660bd7305b0c095603bfa0e30c7f1610e.camel@gmail.com> References: <20201215230519.15158-1-huobean@gmail.com> <20201215230519.15158-2-huobean@gmail.com> <1608617307.14045.3.camel@mtkswgap22> <4c15956660bd7305b0c095603bfa0e30c7f1610e.camel@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 Tue, 2020-12-22 at 21:50 +0100, Bean Huo wrote: > > > > May this operation race with UFS shutdown flow? > > > > To be more clear, ufshcd_wb_ctrl() here may be executed after host > > clock > > is disabled by shutdown flow? > > > > If yes, we need to avoid it. > > > > Thanks, > > Stanley Chu > > Yes, it is quite possible, but who will mess up this on purpose? > > ok, to counterbalance our concerns, I can add checkup: > > > /* UFS device & link must be active before we change WB status */ > if (!ufshcd_is_ufs_dev_active(hba) || !ufshcd_is_link_active(hba)) > return -EINVAL; > > > how do you think about? > > Bean seems there are only auto_hibern8 and wb will issue command to UFS device. if you think auto_hibern8 also needs this protection. I will add in the next version patch, otherwise, just add this checkup in the WB. Look forward to your feedback! Thanks, Bean