lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RESEND PATCH 4/4] scsi:ufs:add fbo functionality
Date
Here also - missing spaces in the title.

...............

> +static int ufsfbo_get_fbo_prog_state(struct ufs_hba *hba, int
> +*prog_state) {
> + int ret = 0, attr = -1;
> +
> + down(&hba->host_sem);
> + if (!ufshcd_is_user_access_allowed(hba)) {
> + ret = -EBUSY;
> + goto out;
> + }
> + ufshcd_rpm_get_sync(hba);
> + ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR,
> + QUERY_ATTR_IDN_FBO_PROG_STATE, 0, 0, &attr);
> + ufshcd_rpm_put_sync(hba);
> + if (ret) {
> + pr_err("Query attr fbo prog state failed.");
> + goto out;
> + }
> +
> + switch (attr) {
> + case 0x0:
> + case 0x1:
> + case 0x2:
> + case 0x3:
> + case 0xff:
Maybe use enum UFSFBO_PROG_STATE values?

..................

> +static ssize_t fbo_operation_ctrl_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count) {
> + int ret = 0;
> + u32 val;
> + struct scsi_device *sdev = to_scsi_device(dev);
> + struct ufs_hba *hba = shost_priv(sdev->host);
> +
> + if (kstrtouint(buf, 0, &val))
> + return -EINVAL;
Maybe also test for valid bFBOControl value?
And add the appropriate enum as well.


Thanks,
Avri

\
 
 \ /
  Last update: 2022-11-02 09:54    [W:0.682 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site