From: Bart Van Assche <bvanassche@acm.org>
To: Daniel Lee <chullee@google.com>,
James.Bottomley@hansenpartnership.com,
martin.petersen@oracle.com
Cc: alim.akhtar@samsung.com, avri.altman@sandisk.com,
tanghuan@vivo.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] ufs: sysfs: Add WB partial flush mode support
Date: Tue, 24 Nov 2026 10:30:03 -0800 [thread overview]
Message-ID: <187cbe4e-2efb-47dd-8b0c-0c433b05b3d6@acm.org> (raw)
In-Reply-To: <20261117004729.635562-1-chullee@google.com>
On 11/16/26 4:47 PM, Daniel Lee wrote:
> Introduce UFS_ATTRIBUTE_RW and UFS_FLAG_RW to support writable attributes
> and flags.
Thank you for having addressed my v3 comments. Please split this patch
into a series: (1) convert the UFS_FLAG() / UFS_ATTRIBUTE() bodies into
helper functions without changing behavior, (2) introduce
UFS_ATTRIBUTE_RW() and UFS_FLAG_RW() and (3) add the partial flush mode
attributes and flag.
That will make both reviewing and bisecting easier.
> + ufshcd_rpm_put_sync(hba);
> + if (ret > 0)
> + ret = -EINVAL;
> + if (ret)
> + goto out;
This changes the error code reported to user space for all existing
flag and attribute sysfs entries: negative error codes are now passed
through instead of being converted into -EINVAL. I'm fine with this
change but please move it into a separate patch and explain it in the
patch description.
> +static bool ufshcd_is_wb_pinned_pfm_supported(struct ufs_hba *hba)
> +{
> + return ufshcd_is_wb_allowed(hba) &&
> + hba->dev_info.b_presrv_uspc_en &&
> + (hba->dev_info.ext_wb_sup & UFS_DEV_WB_PINNED_PFM);
> +}
Why does pinned mode require bWriteBoosterBufferPreserveUserSpaceEn
while FIFO mode doesn't? Please add a comment that refers to the
relevant section of JESD220G.
> +/* Possible values for bWriteBoosterBufferPartialFlushMode */
> +enum wb_partial_flush_mode {
> + WB_PARTIAL_FLUSH_NONE = 0,
> + WB_PARTIAL_FLUSH_FIFO = 1,
> + WB_PARTIAL_FLUSH_PINNED = 2,
> + NUM_WB_PARTIAL_FLUSH_MODES = 3,
> };
Please leave NUM_WB_PARTIAL_FLUSH_MODES out of this enum since the
enum documents values defined by the UFS standard. Using
ARRAY_SIZE(wb_partial_flush_modes) in ufs-sysfs.c instead should be
sufficient.
> + mode = sysfs_match_string(wb_partial_flush_modes, buf);
> + if (mode < 0)
> + return -EINVAL;
> +
> + switch (mode) {
[ ... ]
> + default:
> + return -EINVAL;
> + }
The default case is unreachable because sysfs_match_string() only
returns valid indexes into wb_partial_flush_modes[].
> + Buffer.
> + The attribute is read only.
Please use "read-only" consistently in the new ABI entries.
Thanks,
Bart.
prev parent reply other threads:[~2026-11-24 18:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 0:47 Daniel Lee
2026-11-19 9:58 ` Peter Wang
2026-11-23 23:32 ` Daniel Lee
2026-11-24 6:14 ` Peter Wang
2026-11-24 18:30 ` Bart Van Assche [this message]
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=187cbe4e-2efb-47dd-8b0c-0c433b05b3d6@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@sandisk.com \
--cc=chullee@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tanghuan@vivo.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®