Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5289658pxu; Tue, 22 Dec 2020 13:00:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrYQQJuSTY2nebizGDztFr/mkEeAckTSydlUBnEr5QMmnZbFJjkXJNlTlx0wqgxDYh2dpp X-Received: by 2002:a17:906:6c8b:: with SMTP id s11mr21348312ejr.187.1608670812735; Tue, 22 Dec 2020 13:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608670812; cv=none; d=google.com; s=arc-20160816; b=geW2jQ6hSYypEnK3As3Vg0R/1ZAXMEe407Zwq3S8mle4PEM8w89rnUKutG6rqzRXf/ DvD676piOh6IHqmDz/+3rnKItXq3y61F5mJ0IECP4GZSYQNPMWlCHlBy2aMvrmiCem5E DLT2nsF9/onEFo/qkTatgFshUdH6+Y5r1wzZf51pPv02x+qhCsp/d3/EMe2alA9UmKzH svoyGgcoO8CSPj/A9V37GisLI0MpBhXtleFzw2T0RiLw6GiAPLmWHkzu6Tloy84n4sBz zUS4qR4p8Wd2QImsY9auebhyuy9HvQnhFPypxCNa4cXvrDAHdL04nra2GAAS8f3N3rNV 3rCA== 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=zUWKl7dvt8OlTSLdq8E8E3SrHTkmLLGK9+sNIq8RkLU=; b=Lg1j7rvqEQQbI6cknTgjLy56A4PQY6i+Yhyx7v/Qy6U+xYFKZIcCuOs+xtfiApO6pg sBI3+tMovBB2pNDCKPfHt6I9HOZPVrjpvMyWpwB9xD1w+g85eYHb5cAImGNLflqpCPDO PgmeULcSdrHBjB435DNHizGvGMcnwYzPPvuJatkZWMhShIE/Dv9sIqtvZfqvUsA7lcKW FLAI8xZHDa8oVv76fbcUB7GCWPORF6NoTfEped1E0rZUOoaxeOs0OGw6SEP1AXelpuLd +9zGM6HwZaMvExJarhctXS8SFnu6nNo+Lo0aLFRpQG5cl90OYvOCZETXiPsHy9iZilmm uaRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="G/FjNgjV"; 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 k9si11419780ejp.237.2020.12.22.12.59.49; Tue, 22 Dec 2020 13:00:12 -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="G/FjNgjV"; 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 S1727678AbgLVU54 (ORCPT + 99 others); Tue, 22 Dec 2020 15:57:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbgLVU5z (ORCPT ); Tue, 22 Dec 2020 15:57:55 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33B75C0613D3; Tue, 22 Dec 2020 12:57:15 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id qw4so19981127ejb.12; Tue, 22 Dec 2020 12:57:15 -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=zUWKl7dvt8OlTSLdq8E8E3SrHTkmLLGK9+sNIq8RkLU=; b=G/FjNgjV8WDYYnE5GWldP59qbvJszG4VYfMK20v/u9megbPD7nOLcjQyWiPaligPzN DtOaaWNWN1nRYPMo9JGu2Fu+REwrF/DlQsmodGPFdfg3FglxIbMUHEj2rRQX5zSYnCiw KYBPUFsVO8DGeKKKmWiIwUMKp2EcOskGT0nk69/YloGvFJ349SrKi+qiUozwipdUxkZb IHo5DpAlcw5aNuOs+fP2NG13ZjkPY9YzrEWNAUg8i5NMA9toRI2/rsQJd+me9Butbjih R7Ho1B2x2w0l2mJUGDgbm4j+XqqYxNzPs3AZOBTFY0qO6uP1fZm2UEUUj3KPLsu33GFy fr4w== 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=zUWKl7dvt8OlTSLdq8E8E3SrHTkmLLGK9+sNIq8RkLU=; b=lWet8imSZk5I+Og7BUnvmk8nOpb0WcJ0pqJT06Okl9HxGC0q3LvJBv+3AIC6M20yrW W9dt8M97GsQ2Hqi8B8MzzMKDs201o4rQqneoP1Xk7N67OgYKpBz1KgtqwWJDu+3sUtZ+ reYggEz0871aoIOEMKruc3tQ1ea0rsKlGhuTFWs9vEsg5I5iRHesEg4o9XX/oHZO99lk lHFfJXUh3l0h0ZZCQGMj3RXj7mdZOro/0pP8ukfo5uc8Fp3r7K8+LlmRd6JPRWHFPPw8 EJGaTXFTi6H/jdlxBmI44Y+uk4pavkZHvN/lhHCrpAmhH3IFVFxstQu9JOBLAHb3Rfay 7h4g== X-Gm-Message-State: AOAM531AIYk/lfpAdP9SUMbfL7X7s5Q7tdPfqb/PTVAqggOGQnNZJP2a cUnMUxdI1ni14YD1ITpuhESITD1KteZgtw== X-Received: by 2002:a17:907:a8a:: with SMTP id by10mr21163548ejc.423.1608670633938; Tue, 22 Dec 2020 12:57:13 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id v18sm10669550ejw.18.2020.12.22.12.57.12 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Dec 2020 12:57:13 -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: Can Guo , 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, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 22 Dec 2020 21:57:12 +0100 In-Reply-To: References: <20201215230519.15158-1-huobean@gmail.com> <20201215230519.15158-2-huobean@gmail.com> <1608617307.14045.3.camel@mtkswgap22> 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 14:12 +0800, Can Guo wrote: > > > + return -EOPNOTSUPP; > > > + > > > + if (kstrtouint(buf, 0, &wb_enable)) > > > + return -EINVAL; > > > + > > > + if (wb_enable != 0 && wb_enable != 1) > > > + return -EINVAL; > > > + > > > + pm_runtime_get_sync(hba->dev); > > > + res = ufshcd_wb_ctrl(hba, wb_enable); > > > > 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. > > I have the same doubt - can user still access sysfs nodes after > system > starts to run shutdown routines? If yes, then we need to remove all > UFS > sysfs nodes in ufshcd_shutdown(). > No, we shouldn't do in this way, user space complains this. I think the nodes in the sysfs can be shileded write, but the nodes shouldn't be flash of its presence frequently. Thanks, Bean > Thanks, > > Can Guo.