From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEE66C4363D for ; Wed, 21 Oct 2020 04:41:48 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B75020870; Wed, 21 Oct 2020 04:41:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="KVFuwJdX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="ZwmycWLp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="TBXG1Qlj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B75020870 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kV5wY-0006F9-LZ; Wed, 21 Oct 2020 04:41:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV5wW-0006Ey-Pp for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Oct 2020 04:41:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/T+FsAu4nzwIF5Q9pVOZNve9pRJvwd0JqcTXUIPTlLY=; b=KVFuwJdXC8xBistjdhtsYn2GX3 +s8WWRvj/X663BHl+i5AHTlW64imE2neGP+JKN8TXF2VyomacnemplCuVWv1PnINAoeSQb+G0lv5U nMT4ja+PrFFv9zZcTcjpCy6ean0TV3tBFLxLS71wVvtyIP5/2NRp/Y85Dz2CzzcUzQAI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/T+FsAu4nzwIF5Q9pVOZNve9pRJvwd0JqcTXUIPTlLY=; b=ZwmycWLpLZ+2LM0sYwtZJI/Qqw pWtIlv0salN2yyPlNp3+Cowr8cZ0cXk+PP/fUV66xEzfH8JOLEWh38E3JU+Pw8sMJkVjRBRmy2RYR TS65PoFBALSJQNZ9TPjzB3AtckHqkr6F1wjdzQ+PBmWAm05OK8LAAAnJ2fHsMFO646NA=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kV5wR-006YaC-9o for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Oct 2020 04:41:44 +0000 Received: from localhost (unknown [104.132.1.66]) (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 C58E420870; Wed, 21 Oct 2020 04:41:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603255288; bh=6uZ87hYjpqMWbluAtKdcHz+J86BJB1yfOvW6vRcBnTw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TBXG1QljTF457ZpXCoGUHETOtkFuOQeydOxijaUXSFCz4y2/eiv3wWmaA2PJC2UbZ k4jRcyF7pl6MMWiMXan8KdWqmIKqhVPCqlMr4WDb1Aqus7d7Utu2sY8Gq6M77i3wUf wUibrN875yx1UDLUgLhi3ybi9icUSrlBSAUv/M3A= Date: Tue, 20 Oct 2020 21:41:28 -0700 From: jaegeuk@kernel.org To: Can Guo Message-ID: <20201021044128.GA3004521@google.com> References: <20201020195258.2005605-1-jaegeuk@kernel.org> <20201020195258.2005605-2-jaegeuk@kernel.org> <6c7bc6794b215a0ae1ae0cd9d448efa3@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6c7bc6794b215a0ae1ae0cd9d448efa3@codeaurora.org> X-Headers-End: 1kV5wR-006YaC-9o Subject: Re: [f2fs-dev] [PATCH v2 1/5] scsi: ufs: atomic update for clkgating_enable X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Avri Altman , Alim Akhtar , kernel-team@android.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 10/21, Can Guo wrote: > On 2020-10-21 03:52, Jaegeuk Kim wrote: > > From: Jaegeuk Kim > > > > When giving a stress test which enables/disables clkgating, we hit > > device > > timeout sometimes. This patch avoids subtle racy condition to address > > it. > > > > Cc: Alim Akhtar > > Cc: Avri Altman > > Cc: Can Guo > > Signed-off-by: Jaegeuk Kim > > Reviewed-by: Can Guo > > Next time can you have a cover letter in case of multiple patches? Ah, it seems I had to cc you here as well. https://lore.kernel.org/linux-scsi/20201020195258.2005605-1-jaegeuk@kernel.org/T/#mb4e43f3bd03a6b7bc136bea21ac805041c1417a2 > > Thanks, > > Can Guo. > > > --- > > drivers/scsi/ufs/ufshcd.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > > index b8f573a02713..7344353a9167 100644 > > --- a/drivers/scsi/ufs/ufshcd.c > > +++ b/drivers/scsi/ufs/ufshcd.c > > @@ -1807,19 +1807,19 @@ static ssize_t > > ufshcd_clkgate_enable_store(struct device *dev, > > return -EINVAL; > > > > value = !!value; > > + > > + spin_lock_irqsave(hba->host->host_lock, flags); > > if (value == hba->clk_gating.is_enabled) > > goto out; > > > > - if (value) { > > - ufshcd_release(hba); > > - } else { > > - spin_lock_irqsave(hba->host->host_lock, flags); > > + if (value) > > + __ufshcd_release(hba); > > + else > > hba->clk_gating.active_reqs++; > > - spin_unlock_irqrestore(hba->host->host_lock, flags); > > - } > > > > hba->clk_gating.is_enabled = value; > > out: > > + spin_unlock_irqrestore(hba->host->host_lock, flags); > > return count; > > } _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel