Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "avri.altman@wdc.com" <avri.altman@wdc.com>,
	"liu.song13@zte.com.cn" <liu.song13@zte.com.cn>,
	"tanghuan@vivo.com" <tanghuan@vivo.com>,
	"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>,
	"zhongqiu.han@oss.qualcomm.com" <zhongqiu.han@oss.qualcomm.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"keosung.park@samsung.com" <keosung.park@samsung.com>,
	"chullee@google.com" <chullee@google.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs: core: Handle sentinel value for dHIDAvailableSize
Date: Tue, 13 Jan 2026 07:24:17 +0000	[thread overview]
Message-ID: <aee15d0084e1801378ec8f8296bc04c58416d916.camel@mediatek.com> (raw)
In-Reply-To: <20251226042825epcms2p6f02ba12fa97ff4a69c00f6fb9ff55603@epcms2p6>

On Fri, 2025-12-26 at 13:28 +0900, Keoseong Park wrote:
> JEDEC UFS spec defines 0xFFFFFFFF for dHIDAvailableSize as indicating
> no
> valid fragmented size information. Returning the raw value can
> mislead
> userspace. Return -ENODATA instead when the value is unavailable.
> 
> Signed-off-by: Keoseong Park <keosung.park@samsung.com>
> ---
>  drivers/ufs/core/ufs-sysfs.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/ufs/core/ufs-sysfs.c b/drivers/ufs/core/ufs-
> sysfs.c
> index b33f8656edb5..1017dd3ae5d3 100644
> --- a/drivers/ufs/core/ufs-sysfs.c
> +++ b/drivers/ufs/core/ufs-sysfs.c
> @@ -1847,6 +1847,7 @@ static ssize_t defrag_trigger_store(struct
> device *dev,
> 
>  static DEVICE_ATTR_WO(defrag_trigger);
> 
> +#define UFS_HID_AVAILABLE_SIZE_INVALID 0xFFFFFFFFU
>  static ssize_t fragmented_size_show(struct device *dev,
>                 struct device_attribute *attr, char *buf)
>  {
> @@ -1859,6 +1860,9 @@ static ssize_t fragmented_size_show(struct
> device *dev,
>         if (ret)
>                 return ret;
> 
> +       if (value == UFS_HID_AVAILABLE_SIZE_INVALID)
> +               return -ENODATA;
> +
>         return sysfs_emit(buf, "%u\n", value);
>  }

Reviewed-by: Peter Wang <peter.wang@mediatek.com>


  reply	other threads:[~2026-01-13  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251226042825epcms2p6f02ba12fa97ff4a69c00f6fb9ff55603@epcms2p6>
2025-12-26  4:28 ` [PATCH] scsi: ufs: core: Handle sentinel value for dHIDAvailableSize Keoseong Park
2026-01-13  7:24   ` Peter Wang (王信友) [this message]
2026-01-13 16:42   ` Bart Van Assche
2026-01-17  4:11   ` Martin K. Petersen
2026-01-24  3:50   ` Martin K. Petersen

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=aee15d0084e1801378ec8f8296bc04c58416d916.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=chullee@google.com \
    --cc=keosung.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liu.song13@zte.com.cn \
    --cc=martin.petersen@oracle.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=tanghuan@vivo.com \
    --cc=zhongqiu.han@oss.qualcomm.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