mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Huan Tang <tanghuan@vivo.com>,
	alim.akhtar@samsung.com, avri.altman@wdc.com,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, beanhuo@micron.com,
	luhongfei@vivo.com, quic_cang@quicinc.com,
	keosung.park@samsung.com, viro@zeniv.linux.org.uk,
	quic_mnaresh@quicinc.com, peter.wang@mediatek.com,
	manivannan.sadhasivam@linaro.org, quic_nguyenb@quicinc.com,
	linux@weissschuh.net, ebiggers@google.com, minwoo.im@samsung.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH v10] ufs: core: Add WB buffer resize support
Date: Wed, 9 Apr 2025 14:17:25 -0700	[thread overview]
Message-ID: <4ef0fe17-c30a-4d15-87e0-35f0c0163e1b@acm.org> (raw)
In-Reply-To: <20250407090920.431-1-tanghuan@vivo.com>

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@vivo.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@vivo.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.

  reply	other threads:[~2025-04-09 21:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  9:09 Huan Tang
2025-04-09 21:17 ` Bart Van Assche [this message]
2025-04-11  9:37   ` Huan Tang

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=4ef0fe17-c30a-4d15-87e0-35f0c0163e1b@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=ebiggers@google.com \
    --cc=keosung.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=luhongfei@vivo.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=minwoo.im@samsung.com \
    --cc=opensource.kernel@vivo.com \
    --cc=peter.wang@mediatek.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_mnaresh@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=tanghuan@vivo.com \
    --cc=viro@zeniv.linux.org.uk \
    /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®