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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_2 autolearn=unavailable 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 66A72C28CBC for ; Sat, 9 May 2020 09:16:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 31F2A214D8 for ; Sat, 9 May 2020 09:16:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gKpnyIoE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="N887FmWe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31F2A214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T/io8+bw9dVlxDIKj0BTbFBw+firkKgrUSeIaJmfW1E=; b=gKpnyIoEL5sogc vJCYel/l3+fykf0WJ716i9KK9wA4OWkcBJDcFKLq9gmlYC5lo7MHYDhWzNXIcwYWrO5hslztV474z gIqdwzxs5CqqA31M2tnOnktDqtcAahha8NFPIEh5Q4WqrzPyI8CbgwoSTpZN3/eNbBjDoxiNQyyKR S5rTUi7JGye8IfptQwwSwmDHxsPKo+ai4YX2zCJ7Quh0oJXAfXtQbDbsy512JpVCkxsbRjgi3Lox1 QjkdNpPU1Wzw7RHNYqd5v5ByT9zE8dEv6sHUHtMslCNgjay1icLc8vesTLkMjggXRbEHvf+lmOoSH mLNV9b9YgbQHPbHAR4Cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jXLaD-0001Ko-Rr; Sat, 09 May 2020 09:15:45 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jXLa5-0001DB-KE; Sat, 09 May 2020 09:15:39 +0000 X-UUID: 162dda43d1b645b78fb7c6be10ca41e4-20200509 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=9Lb29hO5PeItPueSz5Wf3YcpdQaQo/KG2QCEVEztjPI=; b=N887FmWev6aw6uiDMBrnf2BfTSmJS+8F8YYfHzW5VGrFjlTgbRxO+YdetjVYHn+v7rySJUUYfbbOqbPe0NyyKRwEVwGgq8Z0qqXanECLJDdHs5ZijuNAs0klU9M3qMWs/wORSa/TFr4jHUJLAPSBtFN3DkWEeezYTzIpKlsG13o=; X-UUID: 162dda43d1b645b78fb7c6be10ca41e4-20200509 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 59785960; Sat, 09 May 2020 01:15:15 -0800 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 9 May 2020 02:15:19 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 9 May 2020 17:15:06 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 9 May 2020 17:15:07 +0800 Message-ID: <1589015708.3197.46.camel@mtkswgap22> Subject: Re: [PATCH v1 3/5] scsi: ufs: customize flush threshold for WriteBooster From: Stanley Chu To: "Asutosh Das (asd)" Date: Sat, 9 May 2020 17:15:08 +0800 In-Reply-To: <4196ff98-093e-3708-d166-a7a7c6046c57@codeaurora.org> References: <20200508171513.14665-1-stanley.chu@mediatek.com> <20200508171513.14665-4-stanley.chu@mediatek.com> <4196ff98-093e-3708-d166-a7a7c6046c57@codeaurora.org> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200509_021537_670291_9219F6AD X-CRM114-Status: GOOD ( 17.48 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-scsi@vger.kernel.org, martin.petersen@oracle.com, andy.teng@mediatek.com, jejb@linux.ibm.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, avri.altman@wdc.com, cang@codeaurora.org, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, alim.akhtar@samsung.com, matthias.bgg@gmail.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, beanhuo@micron.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hi Asutosh, Thanks for your review. On Fri, 2020-05-08 at 11:12 -0700, Asutosh Das (asd) wrote: > On 5/8/2020 10:15 AM, Stanley Chu wrote: > > Allow flush threshold for WriteBooster to be customizable by > > vendors. To achieve this, make the value as a variable in struct > > ufs_hba first. > > > > Signed-off-by: Stanley Chu > > --- > > drivers/scsi/ufs/ufshcd.c | 6 ++++-- > > drivers/scsi/ufs/ufshcd.h | 1 + > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > > index cdacbe6378a1..9a0ce6550c2f 100644 > > --- a/drivers/scsi/ufs/ufshcd.c > > +++ b/drivers/scsi/ufs/ufshcd.c > > @@ -5301,8 +5301,8 @@ static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba, > > cur_buf); > > return false; > > } > > - /* Let it continue to flush when >60% full */ > > - if (avail_buf < UFS_WB_40_PERCENT_BUF_REMAIN) > > + /* Let it continue to flush when available buffer exceeds threshold */ > > + if (avail_buf < hba->vps->wb_flush_threshold) > > return true; > > > > return false; > > @@ -6839,6 +6839,7 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf) > > if (!d_lu_wb_buf_alloc) > > goto wb_disabled; > > } > > + > Is this newline needed? Oops, I will remove this in next version. > > > return; > > > > wb_disabled: > > @@ -7462,6 +7463,7 @@ static const struct attribute_group *ufshcd_driver_groups[] = { > > > > static struct ufs_hba_variant_params ufs_hba_vps = { > > .hba_enable_delay_us = 1000, > > + .wb_flush_threshold = UFS_WB_40_PERCENT_BUF_REMAIN, > > .devfreq_profile.polling_ms = 100, > > .devfreq_profile.target = ufshcd_devfreq_target, > > .devfreq_profile.get_dev_status = ufshcd_devfreq_get_dev_status, > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > > index f7bdf52ba8b0..e3dfb48e669e 100644 > > --- a/drivers/scsi/ufs/ufshcd.h > > +++ b/drivers/scsi/ufs/ufshcd.h > > @@ -570,6 +570,7 @@ struct ufs_hba_variant_params { > > struct devfreq_dev_profile devfreq_profile; > > struct devfreq_simple_ondemand_data ondemand_data; > > u16 hba_enable_delay_us; > > + u32 wb_flush_threshold; > > }; > > > > /** > > > > Patch[3] & [4] may be combined into a single patch perhaps? > Patch[4] just redoes what [3] did in a different way, so might as well > just do what patch[4] does right away. OK! I will try to merge both to a single patch in next version. Let me know if you have any other comments for the whole series. Thanks, Stanley Chu > > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek