[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR04MB462991CBE166B51BFAF2E6B3FCAA0@BYAPR04MB4629.namprd04.prod.outlook.com>
Date: Thu, 30 Apr 2020 08:30:08 +0000
From: Avri Altman <Avri.Altman@....com>
To: Stanley Chu <stanley.chu@...iatek.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"asutoshd@...eaurora.org" <asutoshd@...eaurora.org>
CC: "beanhuo@...ron.com" <beanhuo@...ron.com>,
"cang@...eaurora.org" <cang@...eaurora.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"bvanassche@....org" <bvanassche@....org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kuohong.wang@...iatek.com" <kuohong.wang@...iatek.com>,
"peter.wang@...iatek.com" <peter.wang@...iatek.com>,
"chun-hung.wu@...iatek.com" <chun-hung.wu@...iatek.com>,
"andy.teng@...iatek.com" <andy.teng@...iatek.com>
Subject: RE: [PATCH v2 3/5] scsi: ufs: add LU Dedicated buffer mode support
for WriteBooster
>
> 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
Powered by blists - more mailing lists