All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlo Caione <ccaione@baylibre.com>
To: Jorge Ramirez <jorge.ramirez@oss.qualcomm.com>
Cc: u-boot@lists.u-boot-project.org,
	 GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Macpaul Lin <macpaul.lin@mediatek.com>,
	 Bhupesh Sharma <bhupesh.linux@gmail.com>,
	Neha Malcom Francis <n-francis@ti.com>,
	 Tom Rini <trini@konsulko.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Jens Wiklander <jenswi@kernel.org>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	 James Hilliard <james.hilliard1@gmail.com>,
	Simon Glass <sjg@chromium.org>, Johan Jonker <jbx6244@gmail.com>,
	 Julien Stephan <jstephan@baylibre.com>,
	David Lechner <dlechner@baylibre.com>,
	 Quentin Schulz <quentin.schulz@cherry.de>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>
Subject: Re: [PATCH 2/7] ufs: rpmb: stop the model string at its NUL terminator
Date: Thu, 12 Nov 2026 08:07:36 +0100	[thread overview]
Message-ID: <avVk7_noolHp0olO@macbook> (raw)
In-Reply-To: <avVgZyWj1qwekTVJ@trex>

On Thu, Nov 12, 2026 at 07:44:55 +0100, Jorge Ramirez wrote:

Hi Jorge,

> > diff --git a/drivers/ufs/ufs-rpmb.c b/drivers/ufs/ufs-rpmb.c
> > index 508eb74d976..8b61760f071 100644
> > --- a/drivers/ufs/ufs-rpmb.c
> > +++ b/drivers/ufs/ufs-rpmb.c
> > @@ -270,6 +270,8 @@ static void ufs_rpmb_string_to_ascii(const u8 *raw, char *out, size_t outsz)
> >  	for (i = 0; i < nchars && n < (int)outsz - 1; i++) {
> >  		u16 c = get_unaligned_be16(raw + QUERY_DESC_HDR_SIZE + i * 2);
> >  
> > +		if (!c)
> > +			break;
> >  		out[n++] = (c >= 0x20 && c <= 0x7e) ? (char)c : ' ';
> >  	}
> >  	out[n] = '\0';
> 
> 
> have you tested this with Linux - RMPB access from u-boot and linux to confirm?
> AFAIR (plus the tests that I run) the code should match.

Yes, I did on a Genio 720 with a SK hynix HN8T05DJHVX105 UFS device.

The problem was that the device model descriptor contains two trailing
UTF-16 NULs. Linux's utf16s_to_utf8s() stops at the first NUL, while the
original U-Boot helper converts both to spaces:

  Original U-Boot: HN8T05DJHVX105<space><space>
  Linux/patched:  HN8T05DJHVX105

--
Carlo Caione

  reply	other threads:[~2026-11-12  7:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 10:21 [PATCH 0/7] Enable UFS RPMB-backed OP-TEE secure storage on Genio 720 Carlo Caione
2026-11-11 10:21 ` [PATCH 1/7] ufs: rpmb: validate requests before issuing commands Carlo Caione
2026-11-11 10:21 ` [PATCH 2/7] ufs: rpmb: stop the model string at its NUL terminator Carlo Caione
2026-11-12  6:44   ` Jorge Ramirez
2026-11-12  7:07     ` Carlo Caione [this message]
2026-11-12  7:43       ` Jorge Ramirez
2026-11-11 10:21 ` [PATCH 3/7] tee: optee: keep UFS RPMB discovery state consistent Carlo Caione
2026-11-11 11:44   ` Ilias Apalodimas
2026-11-11 13:05     ` Carlo Caione
2026-11-11 10:21 ` [PATCH 4/7] tee: optee: enumerate UFS RPMB services when consumers exist Carlo Caione
2026-11-11 10:21 ` [PATCH 5/7] cmd: allow the OP-TEE RPMB command with UFS storage Carlo Caione
2026-11-11 10:21 ` [PATCH 6/7] configs: add a Genio 720 UFS configuration with OP-TEE RPMB Carlo Caione
2026-11-11 15:32   ` David Lechner
2026-11-11 10:21 ` [PATCH 7/7] doc: uefi: mention UFS RPMB for OP-TEE variable storage Carlo Caione
2026-11-11 11:41   ` Ilias Apalodimas
2026-11-11 12:04     ` Carlo Caione

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=avVk7_noolHp0olO@macbook \
    --to=ccaione@baylibre.com \
    --cc=GSS_MTK_Uboot_upstream@mediatek.com \
    --cc=bhupesh.linux@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=james.hilliard1@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jbx6244@gmail.com \
    --cc=jenswi@kernel.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=quentin.schulz@cherry.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=xypron.glpk@gmx.de \
    /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.