From: Stanley Jhu <stanleyjhu@google.com>
To: Hyeoncheol Jeong <hyenc.jeong@samsung.com>
Cc: James.Bottomley@HansenPartnership.com, mkp@kernel.org,
avri.altman@sandisk.com, bvanassche@acm.org,
peter.wang@mediatek.com, linux-scsi@vger.kernel.org,
alim.akhtar@samsung.com, Stanley Jhu <stanleyjhu@google.com>
Subject: Re: [PATCH v2 2/2] scsi: ufs: Serve the device init reads from one aggregated read
Date: Thu, 1 Oct 2026 13:53:07 +0800 [thread overview]
Message-ID: <20261001055307.4097978-1-stanleyjhu@google.com> (raw)
In-Reply-To: <1653986196.21790747102619.JavaMail.epsvc@epcpadp1new>
On Wed, 30 Sep 2026 14:18:25 +0900, Hyeoncheol Jeong wrote:
> + for (i = 0; i < idn; i++)
> + off += ufs_agg_attr_width[i];
This assumes the Attributes group (Group Type 02h) is serialized by
ascending IDN at fixed offsets. JESD220H Section 10.7.9.14 and
Table 10.56 define only the group header and Next Group Offset chain;
the intra-group layout and ordering are not specified.
How does this handle:
- Array attributes: wContextConf (10h) requires INDEX=LUN and
SELECTOR=ContextID, where valid SELECTOR values are 01h..0Fh so 00h
is invalid (Table 14.28), yet AGGREGATED READ leaves bytes 14-17
Reserved (Table 10.42). Assuming 2 bytes in ufs_agg_attr_width[]
breaks if a device omits it or returns all elements.
- Optional attributes: if a device omits unimplemented optional
attributes such as PSA (15h, 16h) instead of zero-padding them,
subsequent attributes shift (e.g. bWriteBoosterBufferLifeTimeEst at
1Eh shifts by 5 bytes) with no per-entry framing to detect it.
- Write-only attributes: ufs_agg_attr_width[] reserves 4 bytes for
dSecondsPassed (0Fh), which Table 14.28 marks Write only. Whether a
device serializes write-only attributes in a read response is
unspecified.
> + if (index == 0 && !ufshcd_agg_attr(hba, idn, out))
> + return 0;
The commit message states that bWriteBoosterBufferLifeTimeEst is
served from the packet only in shared-buffer mode. In LU-dedicated
mode (bWriteBoosterBufferType != 01h, Table 14.28 NOTE 15) with
wb_dedicated_lu == 0, ufshcd_wb_get_query_index() also returns 0, so
this check serves LU 0's lifetime from a packet with no LUN qualifier.
> + if (!group_buf || idn >= group_len)
> + return -ENOENT;
> +
> + *out = group_buf[idn];
The Flags group (Group Type 01h) has the same issue: Table 14.26
NOTE 1 distinguishes device-level flags from array flags addressed by
INDEX and SELECTOR, and the specification defines no 1-byte-per-IDN
packed layout.
next prev parent reply other threads:[~2026-10-01 5:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260930050201epcms2p13ab67182445b0555acc8d27b927cda86@epcms2p7>
[not found] ` <20260930050201epcms2p13ab67182445b0555acc8d27b927cda86@epcms2p1>
2026-09-30 5:15 ` [PATCH v2 1/2] scsi: ufs: Add the aggregated read query opcode and its reply format Hyeoncheol Jeong
2026-09-30 7:54 ` Peter Wang
2026-09-30 5:18 ` [PATCH v2 2/2] scsi: ufs: Serve the device init reads from one aggregated read Hyeoncheol Jeong
2026-09-30 7:28 ` sashiko-bot
2026-09-30 7:55 ` Peter Wang
2026-10-01 5:53 ` Stanley Jhu [this message]
2026-10-02 5:11 ` Hyeoncheol Jeong
2026-10-02 15:50 ` Bean Huo
2026-10-06 8:01 ` Hyeoncheol Jeong
[not found] <CGME20260930050201epcms2p13ab67182445b0555acc8d27b927cda86@epcms2p1>
2026-09-30 5:02 ` [PATCH v2 0/2] scsi: ufs: batch device-init reads with UFS 5.0 " Hyeoncheol Jeong
2026-10-02 9:24 ` Bean Huo
2026-10-06 7:17 ` Hyeoncheol Jeong
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=20261001055307.4097978-1-stanleyjhu@google.com \
--to=stanleyjhu@google.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@sandisk.com \
--cc=bvanassche@acm.org \
--cc=hyenc.jeong@samsung.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=peter.wang@mediatek.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