[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ef0fe17-c30a-4d15-87e0-35f0c0163e1b@acm.org>
Date: Wed, 9 Apr 2025 14:17:25 -0700
From: Bart Van Assche <bvanassche@....org>
To: Huan Tang <tanghuan@...o.com>, alim.akhtar@...sung.com,
avri.altman@....com, James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com, beanhuo@...ron.com, luhongfei@...o.com,
quic_cang@...cinc.com, keosung.park@...sung.com, viro@...iv.linux.org.uk,
quic_mnaresh@...cinc.com, peter.wang@...iatek.com,
manivannan.sadhasivam@...aro.org, quic_nguyenb@...cinc.com,
linux@...ssschuh.net, ebiggers@...gle.com, minwoo.im@...sung.com,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: Re: [PATCH v10] ufs: core: Add WB buffer resize support
On 4/7/25 2:09 AM, Huan Tang wrote:
> +What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/ext_wb_sup
> +What: /sys/bus/platform/devices/*.ufs/device_descriptor/ext_wb_sup
> +Date: April 2025
> +Contact: Huan Tang <tanghuan@...o.com>
> +Description:
> + This file shows extended WriteBooster features supported by
> + the device.
> +
> + The file is read only.
Please remove this attribute again. I don't think that it is useful to
make the value of wExtendedWriteBoosterSupport available in sysfs.
Additionally, wExtendedWriteBoosterSupport is a bitfield and hence
exporting it directly violates the sysfs one-value-per-attribute rule.
> +What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_resize_status
> +What: /sys/bus/platform/devices/*.ufs/attributes/wb_resize_status
> +Date: April 2025
> +Contact: Huan Tang <tanghuan@...o.com>
> +Description:
> + The host can check the resize operation status of the WriteBooster
> + buffer by reading this attribute.
> +
> + ================ ========================================
> + idle Resize operation is not issued
> + in_progress Resize operation in progress
> + complete_success Resize operation completed successfully
> + general_fail Resize operation general failure
> + ================ ========================================
Why "general_fail" instead of "general_failure"?
> +static const char * const wb_resize_en_mode[] = {
> + [WB_RESIZE_EN_IDLE] = "idle",
> + [WB_RESIZE_EN_DECREASE] = "decrease",
> + [WB_RESIZE_EN_INCREASE] = "increase",
> +};
A minor comment: please remove one tab in front of "=" for the value
assignments in the above array definition.
> +static ssize_t wb_resize_hint_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct ufs_hba *hba = dev_get_drvdata(dev);
> + int ret;
> + u32 value;
> +
> + ret = wb_read_resize_attrs(hba,
> + QUERY_ATTR_IDN_WB_BUF_RESIZE_HINT, &value);
> + if (ret)
> + goto out;
> +
> + ret = sysfs_emit(buf, "%s\n", ufs_wb_resize_hint_to_string(value));
> +
> +out:
> + return ret;
> +}
The formatting of the above code is not compliant with the Linux kernel
coding style guide. Please reformat this patch, e.g. with "git
clang-format HEAD^".
Otherwise this patch looks good to me.
Thanks,
Bart.
Powered by blists - more mailing lists