From: Jorge Ramirez via U-Boot <u-boot@lists.u-boot-project.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>,
trini@konsulko.com, jens.wiklander@linaro.org,
ilias.apalodimas@linaro.org, bhupesh.linux@gmail.com,
n-francis@ti.com, marek.vasut+renesas@mailbox.org,
igor.belwon@mentallysanemainliners.org, shawn.lin@rock-chips.com,
yoshihiro.shimoda.uh@renesas.com, alchark@gmail.com,
tuyen.dang.xa@renesas.com, macpaul.lin@mediatek.com,
padmarao.begari@amd.com, jstephan@baylibre.com, bb@ti.com,
j-mcarthur@ti.com, venkyada@qti.qualcomm.com,
hayashi.kunihiko@socionext.com, u-boot@lists.denx.de,
sumit.garg@kernel.org
Subject: Re: [PATCH v1 1/7] ufs: decode string descriptors as UTF-16 big-endian
Date: Tue, 21 Jul 2026 16:56:00 +0200 [thread overview]
Message-ID: <al-IgLQ97rQpHDGA@trex> (raw)
In-Reply-To: <72878f7a-81f1-4216-8eb3-6b41160068fe@linaro.org>
On 21/07/26 09:32:43, neil.armstrong@linaro.org wrote:
> Hi,
>
> On 7/20/26 10:51, Jorge Ramirez-Ortiz wrote:
> > UFS string descriptors are UTF-16 big-endian (JESD220), but
> > ufshcd_read_string_desc() fed the raw bytes to utf16_to_utf8(), which reads
> > host-endian code units, leaving dev_desc->model blank. Byte-swap to host
> > order before decoding, matching the kernel.
> >
> > Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> > ---
> > drivers/ufs/ufs-uclass.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/ufs/ufs-uclass.c b/drivers/ufs/ufs-uclass.c
> > index 6a51f337e47..4d10e0b11fe 100644
> > --- a/drivers/ufs/ufs-uclass.c
> > +++ b/drivers/ufs/ufs-uclass.c
> > @@ -1765,6 +1765,14 @@ static int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index,
> > goto out;
> > }
> > + {
> > + u16 *ustr = (u16 *)&buf[QUERY_DESC_HDR_SIZE];
> > + int num_chars = (desc_len - QUERY_DESC_HDR_SIZE) / 2;
> > +
> > + for (i = 0; i < num_chars; i++)
> > + ustr[i] = be16_to_cpu(ustr[i]);
> > + }
>
>
> This block looks weird in the middle of ufshcd_read_string_desc(), move it to a new inline
> helper instead.
sure, sorry about it.
next prev parent reply other threads:[~2026-07-21 14:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 8:51 [PATCH v1 0/7] ufs: rpmb: route OP-TEE RPMB secure storage over UFS Jorge Ramirez-Ortiz
2026-07-20 8:51 ` [PATCH v1 1/7] ufs: decode string descriptors as UTF-16 big-endian Jorge Ramirez-Ortiz
2026-07-21 7:32 ` Neil Armstrong (Linaro) via U-Boot
2026-07-21 14:56 ` Jorge Ramirez via U-Boot [this message]
2026-07-20 8:51 ` [PATCH v1 2/7] ufs: add RPMB transport over SCSI SECURITY PROTOCOL Jorge Ramirez-Ortiz
2026-07-21 7:46 ` Neil Armstrong (Linaro) via U-Boot
2026-07-22 6:10 ` Jorge Ramirez via U-Boot
2026-07-20 8:51 ` [PATCH v1 3/7] ufs: rpmb: derive the per-region RPMB CID and size for OP-TEE Jorge Ramirez-Ortiz
2026-07-21 7:51 ` Neil Armstrong (Linaro) via U-Boot
2026-07-20 8:51 ` [PATCH v1 4/7] ufs: rpmb: retry SECURITY PROTOCOL on power-on UNIT ATTENTION Jorge Ramirez-Ortiz
2026-07-21 7:52 ` Neil Armstrong (Linaro) via U-Boot
2026-07-22 6:10 ` Jorge Ramirez via U-Boot
2026-07-20 8:51 ` [PATCH v1 5/7] ufs: rpmb: bounce unaligned frames through a DMA-aligned buffer Jorge Ramirez-Ortiz
2026-07-21 7:53 ` Neil Armstrong (Linaro) via U-Boot
2026-07-22 6:11 ` Jorge Ramirez via U-Boot
2026-07-20 8:51 ` [PATCH v1 6/7] optee: rename rpmb.c to rpmb_legacy.c Jorge Ramirez-Ortiz
2026-07-20 8:51 ` [PATCH v1 7/7] optee: implement the RPMB subsystem interface for UFS Jorge Ramirez-Ortiz
2026-07-21 7:34 ` Neil Armstrong (Linaro) via U-Boot
2026-07-21 14:55 ` Jorge Ramirez via U-Boot
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=al-IgLQ97rQpHDGA@trex \
--to=u-boot@lists.u-boot-project.org \
--cc=alchark@gmail.com \
--cc=bb@ti.com \
--cc=bhupesh.linux@gmail.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=igor.belwon@mentallysanemainliners.org \
--cc=ilias.apalodimas@linaro.org \
--cc=j-mcarthur@ti.com \
--cc=jens.wiklander@linaro.org \
--cc=jorge.ramirez@oss.qualcomm.com \
--cc=jstephan@baylibre.com \
--cc=macpaul.lin@mediatek.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=n-francis@ti.com \
--cc=neil.armstrong@linaro.org \
--cc=padmarao.begari@amd.com \
--cc=shawn.lin@rock-chips.com \
--cc=sumit.garg@kernel.org \
--cc=trini@konsulko.com \
--cc=tuyen.dang.xa@renesas.com \
--cc=u-boot@lists.denx.de \
--cc=venkyada@qti.qualcomm.com \
--cc=yoshihiro.shimoda.uh@renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.