From: Stanley Chu <stanley.chu@mediatek.com>
To: Avri Altman <Avri.Altman@wdc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"cang@codeaurora.org" <cang@codeaurora.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kuohong.wang@mediatek.com" <kuohong.wang@mediatek.com>,
"peter.wang@mediatek.com" <peter.wang@mediatek.com>,
"chun-hung.wu@mediatek.com" <chun-hung.wu@mediatek.com>,
"andy.teng@mediatek.com" <andy.teng@mediatek.com>
Subject: RE: [PATCH v2 3/5] scsi: ufs: add LU Dedicated buffer mode support for WriteBooster
Date: Thu, 30 Apr 2020 16:37:33 +0800 [thread overview]
Message-ID: <1588235853.3197.6.camel@mtkswgap22> (raw)
In-Reply-To: <BYAPR04MB462991CBE166B51BFAF2E6B3FCAA0@BYAPR04MB4629.namprd04.prod.outlook.com>
Hi Avri,
On Thu, 2020-04-30 at 08:30 +0000, Avri Altman wrote:
> >
> > static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf)
> > {
> > + int ret;
> > + u8 lun;
> > + u32 d_lu_wb_buf_alloc = 0;
> > +
> > if (hba->desc_size.dev_desc <=
> > DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP)
> > goto wb_disabled;
> >
> > @@ -6821,15 +6842,35 @@ static void ufshcd_wb_probe(struct ufs_hba
> > *hba, u8 *desc_buf)
> > hba->dev_info.b_wb_buffer_type =
> > desc_buf[DEVICE_DESC_PARAM_WB_TYPE];
> >
> > - hba->dev_info.d_wb_alloc_units =
> > - get_unaligned_be32(desc_buf +
> > - DEVICE_DESC_PARAM_WB_SHARED_ALLOC_UNITS);
> > hba->dev_info.b_presrv_uspc_en =
> > desc_buf[DEVICE_DESC_PARAM_WB_PRESRV_USRSPC_EN];
> >
> > - if (!(hba->dev_info.b_wb_buffer_type &&
> > - hba->dev_info.d_wb_alloc_units))
> > - goto wb_disabled;
> > + if (hba->dev_info.b_wb_buffer_type == WB_BUF_MODE_SHARED) {
> > + hba->dev_info.d_wb_alloc_units =
> > + get_unaligned_be32(desc_buf +
> > + DEVICE_DESC_PARAM_WB_SHARED_ALLOC_UNITS);
> > + if (!hba->dev_info.d_wb_alloc_units)
> > + goto wb_disabled;
> > + } else {
> > + for (lun = 0; lun < hba->dev_info.max_lu_supported; lun++) {
> > + ret = ufshcd_read_unit_desc_param(hba,
> > + lun,
> > + UNIT_DESC_PARAM_WB_BUF_ALLOC_UNITS,
> > + (u8 *)&d_lu_wb_buf_alloc,
> > + sizeof(d_lu_wb_buf_alloc));
> > + if (ret)
> > + goto wb_disabled;
> > + if (d_lu_wb_buf_alloc) {
> > + hba->dev_info.wb_dedicated_lu = lun;
> > + break;
> Why are you allowing only a single WB lun?
> You should allow those buffers for lun0..lun7
In UFS 3.1 specification, the valid value of bDeviceMaxWriteBoosterLUs
is 1. Therefore only one LU can have WriteBooster buffer.
Thanks,
Stanley
next prev parent reply other threads:[~2020-04-30 8:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 13:56 [PATCH v2 0/5] scsi: ufs: support LU Dedicated buffer type for WriteBooster Stanley Chu
2020-04-29 13:56 ` [PATCH v2 1/5] scsi: ufs: allow legacy UFS devices to enable WriteBooster Stanley Chu
2020-04-30 7:44 ` Avri Altman
2020-04-30 8:34 ` Stanley Chu
2020-04-29 13:56 ` [PATCH v2 2/5] scsi: ufs: add "index" in parameter list of ufshcd_query_flag() Stanley Chu
2020-04-30 7:56 ` Avri Altman
2020-04-30 8:35 ` Stanley Chu
2020-04-29 13:56 ` [PATCH v2 3/5] scsi: ufs: add LU Dedicated buffer mode support for WriteBooster Stanley Chu
2020-04-30 8:30 ` Avri Altman
2020-04-30 8:37 ` Stanley Chu [this message]
2020-04-29 13:56 ` [PATCH v2 4/5] scsi: ufs-mediatek: enable WriteBooster capability Stanley Chu
2020-04-29 13:56 ` [PATCH v2 5/5] scsi: ufs: cleanup WriteBooster feature Stanley Chu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1588235853.3197.6.camel@mtkswgap22 \
--to=stanley.chu@mediatek.com \
--cc=Avri.Altman@wdc.com \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=asutoshd@codeaurora.org \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=chun-hung.wu@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=peter.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).