Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5633107pxu; Wed, 23 Dec 2020 01:12:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVMoDxblrT8MottRKPWpVQIZLvRJ71A8tgoUD311ahs1FFxMuzvrXSXex2AcF6QZKNUf42 X-Received: by 2002:a17:906:4c4c:: with SMTP id d12mr23426700ejw.307.1608714774968; Wed, 23 Dec 2020 01:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608714774; cv=none; d=google.com; s=arc-20160816; b=JCjN3QSEYqr4y8kLwpEnPVHF22vdDRa6QyD4TDknGvAMP5YKqremGBIPYuUkElJ/67 yJIFYFd7QzIQwDelTw2OXTneY9APqeyaTHmIxYSnulDm0vwcYMGr9bDxQHgQhnOCVPmZ 8cOcd5fxEcctRprNkf82zfJVtne/UtllaFDdaZNkXiDdwX7LJ6XfRZoy2sgLbk0Ymhpw KoKA2LcuWJVHCoSlc9oIHywHxZF7qmEPTybC9kcrZbqF1rPnTbIu/XowwEQxhefjWTcQ DkJ+EKIsTsBowFKn+JQwbqKWlVKkwo8mZHrf3RKmbf4z6DadrUHQlnJDah9/jP5aPpxH 9ptQ== 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=AHWpVX6q+qCh8ODzxkS4UNsn41pmzdeXyK0+HQYdwAQ=; b=RPKVqvN4toVw4mLsnbsMLMg3+vmjpavG2yidor+RUGJvzwsRaknA3UWPz7wUsyTL5G ltt1PahE7ZHflkOogycBNF8t+cL2wWDqvBD1gq9kDEOLLp3xEM0bFti/Cjy/bY2k1jDC NhTfFUQAkZP1gKFZFBcZ4g1TntDS+gAC/cdBQ+sXNwkdGxsNozmC261mlNN55S2Un81X lnxVmSSnd20cl+OXlf21co+Wzzw+uMtZwhfoyPbw8Cem2bbzevYQ0UVOpEn5WHEOsW96 UefMYqlJVsD/o++0bPr0k9psKqknpM6GpXxAub20A5hcJRXYnCHstpRuq7aagxweCVKU yvbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hQ5zJFDG; 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 q8si11812770ejj.24.2020.12.23.01.12.32; Wed, 23 Dec 2020 01:12:54 -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=hQ5zJFDG; 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 S1728242AbgLWJLu (ORCPT + 99 others); Wed, 23 Dec 2020 04:11:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbgLWJLt (ORCPT ); Wed, 23 Dec 2020 04:11:49 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA4E2C0613D3; Wed, 23 Dec 2020 01:11:08 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id b9so21946017ejy.0; Wed, 23 Dec 2020 01:11:08 -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=AHWpVX6q+qCh8ODzxkS4UNsn41pmzdeXyK0+HQYdwAQ=; b=hQ5zJFDGwR5gnkH8b7qXuqD3qpqmP0KYGHz0TZwd1qPuoT5rYQXyHIqU+0J1imLWQ5 GtlCdfkCMgBR12tMUuNJU88PJXODRLRc6aLuERuRi9WEluEYrFHPjk6MRt07JQB7sH7Y aeThOZ0W8KCwzJqc7rc/L45W9rRwGGQoB4QnxcxYfasqzbYO8/THtIY67kz7BUpoYF3D o4VDBcCxiJb1JbONNlPbegdaXAD1izNLmypEAzJi3Mb6s+n6xI+g37UM4o+vMraxqWZm iRnsgfkfMBOjoD3PAWj4pTyP8gxOzWb1xeve7sMa/4t/txyuYSXw1Hee91xfuIiW3S3z uzrg== 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=AHWpVX6q+qCh8ODzxkS4UNsn41pmzdeXyK0+HQYdwAQ=; b=UfUxu+U4x4YR2RzpcnRz6IflAT5YJoPdwZ40w1asOpprE5kEtN7xYyD1hl14utHe8l JbHTV4C04wAMZyjr4brU1c+hHWaFawo9B0RFxbbhFse+BZuZR7YmCmJSRraN1QLc/BSd +Eawb2BKWI8wOL0scOtH5Avg4YsLs5adsEoYOid4Mebo5gi0KVz/qtbS79Hyk8d58ZTM 6qeUOm3BPX6qwQ20+ie8MGaFnitLAPotZuBdKCIP++vHOnj8q2vLWmLkJAYf6AqW3UWw 9M+OmxMuGoNLpsEDtcHh5xZTAfD59AckwQANVplYTg40q2eJIHXL3DOx+MFgR1b/PiQg ysJA== X-Gm-Message-State: AOAM533G9oDcWec+P/eJz6T4vohjgt7Z1wMq9PA1BK0yQnpVP51FYbID 6IV0qbjm6Tk4juUKcEWkV1o= X-Received: by 2002:a17:906:16da:: with SMTP id t26mr23142020ejd.478.1608714667319; Wed, 23 Dec 2020 01:11:07 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id k16sm11319781ejd.78.2020.12.23.01.11.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Dec 2020 01:11:06 -0800 (PST) Message-ID: <8a680bed6a421fe2cfeec6867af966354e38a9c0.camel@gmail.com> Subject: Re: [PATCH v5 1/7] scsi: ufs: Add "wb_on" sysfs node to control WB on/off From: Bean Huo To: Can Guo Cc: Stanley Chu , 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: Wed, 23 Dec 2020 10:11:05 +0100 In-Reply-To: <862483add1462510b809aee6d3678435@codeaurora.org> References: <20201215230519.15158-1-huobean@gmail.com> <20201215230519.15158-2-huobean@gmail.com> <1608617307.14045.3.camel@mtkswgap22> <28211d08700d1e4876a9aea342e8fcb79534cd2c.camel@gmail.com> <862483add1462510b809aee6d3678435@codeaurora.org> 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 Wed, 2020-12-23 at 09:31 +0800, Can Guo wrote: > And assume you come up with a better check, > you want to add the check everywhere? You must have noticed the fix > to > the func ufshcd_clk_gate_enable_store() from Jaegeuk Kim. Do you mean lock spin_lock_irqsave(hba->host->host_lock, flags)? It can completely fix race issue, but it is different with here. ufshcd_clkgate_enable_store() doesn't call ufshcd_hold(). If you want using this lock, we should change ufshcd_hold() and ufshcd_query_*(). Bean