From: Avri Altman <Avri.Altman@wdc.com>
To: Asutosh Das <asutoshd@codeaurora.org>,
"subhashj@codeaurora.org" <subhashj@codeaurora.org>,
"cang@codeaurora.org" <cang@codeaurora.org>,
"rnayak@codeaurora.org" <rnayak@codeaurora.org>,
"vinholikatti@gmail.com" <vinholikatti@gmail.com>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Bean Huo <beanhuo@micron.com>,
Tomas Winkler <tomas.winkler@intel.com>,
Colin Ian King <colin.king@canonical.com>,
Bart Van Assche <bvanassche@acm.org>,
Venkat Gopalakrishnan <venkatg@codeaurora.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
open list <linux-kernel@vger.kernel.org>
Subject: RE: [<RFC PATCH v1> 1/2] scsi: ufs: add write booster feature support
Date: Tue, 25 Feb 2020 10:58:40 +0000 [thread overview]
Message-ID: <MN2PR04MB69918182A787BA86A275A59CFCED0@MN2PR04MB6991.namprd04.prod.outlook.com> (raw)
In-Reply-To: <0eb182e6731bc4ce0c1d6a97f102155d7186520f.1582330473.git.asutoshd@codeaurora.org>
> + /* Enable WB only for UFS-3.1 OR if desc len >= 0x59 */
You don't really check that the descriptor size is large enough
> + if (dev_info->wspecversion >= 0x310) {
> + hba->dev_info.d_ext_ufs_feature_sup =
> + desc_buf[DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP]
> + << 24 |
> + desc_buf[DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 1]
> + << 16 |
> + desc_buf[DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 2]
> + << 8 |
> + desc_buf[DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 3];
> +
> + hba->dev_info.b_wb_buffer_type =
> + desc_buf[DEVICE_DESC_PARAM_WB_TYPE];
> +
> + if (hba->dev_info.b_wb_buffer_type)
> + goto skip_unit_desc;
> +
> + hba->dev_info.wb_config_lun = false;
> + for (lun = 0; lun < UFS_UPIU_MAX_GENERAL_LUN; lun++) {
You forgot to set
u8 wb_buf[4] = {};
> + memset(wb_buf, 0, sizeof(wb_buf));
Not needed
> + err = ufshcd_get_wb_alloc_units(hba, lun, wb_buf);
> + if (err)
> + break;
> +
> + res = wb_buf[0] << 24 | wb_buf[1] << 16 |
> + wb_buf[2] << 8 | wb_buf[3];
> + if (res) {
> + hba->dev_info.wb_config_lun = true;
> + break;
> + }
> + }
> + }
> +
Thanks,
Avri
next prev parent reply other threads:[~2020-02-25 10:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1582330473.git.asutoshd@codeaurora.org>
2020-02-22 0:47 ` Asutosh Das
2020-02-23 9:03 ` Avri Altman
2020-03-16 23:45 ` Asutosh Das (asd)
2020-02-25 10:58 ` Avri Altman [this message]
2020-02-25 11:21 ` Avri Altman
2020-02-25 12:50 ` Avri Altman
2020-02-26 17:57 ` Asutosh Das (asd)
2020-03-16 23:52 ` Asutosh Das (asd)
2020-02-22 0:47 ` [<RFC PATCH v1> 2/2] ufs-qcom: scsi: configure write booster type Asutosh Das
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=MN2PR04MB69918182A787BA86A275A59CFCED0@MN2PR04MB6991.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=beanhuo@micron.com \
--cc=bjorn.andersson@linaro.org \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=colin.king@canonical.com \
--cc=jejb@linux.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=rnayak@codeaurora.org \
--cc=stanley.chu@mediatek.com \
--cc=subhashj@codeaurora.org \
--cc=tomas.winkler@intel.com \
--cc=venkatg@codeaurora.org \
--cc=vinholikatti@gmail.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
all inboxes | Powered by JetHome®