Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: RFC: RPMB write failed with SDHCI Auto CMD23 support
Date: Mon, 31 May 2021 16:18:23 +0800	[thread overview]
Message-ID: <20210531161823.3f91725e@xhacker.debian> (raw)
In-Reply-To: <a0381554-a17f-1b85-b931-f27f755a4ab3@rock-chips.com>

On Mon, 31 May 2021 15:51:38 +0800 Shawn Lin <shawn.lin@rock-chips.com> wrote:


> 
> Hi,
> 
>      I got some reports about offical mmc-utils rpmb write failure[1] and
> offical OP-TEE rpmb write failure[2]. Debug it shows the problem is due
> to the AUTO CMD23 support for sdhci. RPMB issues CMD23 perior to multi
> block operations with MMC_CMD23_ARG_REL_WR tagged. This tag is ignored
> by SDHCI AUTO CMD23 routine, so General Failure is always set in RPMB
> operation result.

Which host do you see this issue? I'm not sure whether all sdhci host
has the problem or not. But sdhci-of-dwcmshc does suffer from the problem
I fixed it with commit ca1219c0a7432 ("mmc: sdhci-of-dwcmshc: fix rpmb access")

> 
>      Just ask for some suggestions about how to address it.  Does it
> sound fine to let sdhci_auto_cmd23() or sdhci_manual_cmd23() checks all
> the 29-31 bits of  mrq->sbc->arg and bailout auto cmd23 sound fine?

Is this problem common for all sdhci hosts?

Thanks
> 
> 
> [1]:
> rk3566_firefly_aiojd4:/ # /data/mmc-utils rpmb read-block
> /dev/mmcblk2rpmb 0 1 -  /data/rpmbkey | busybox hexdump -C
> 00000000  79 03 c1 05 a0 6d 45 57  1d d4 7b a4 7c 1f c0 14
> |y....mEW..{.|...|
> 00000010  54 34 44 44 62 e5 1a c1  5c 8b 6b 0c 5d 8e 90 4d
> |T4DDb...\.k.]..M|
> 00000020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
> |................|
> *
> 00000100
> rk3566_firefly_aiojd4:/ # awk 'BEGIN {while (c++<128) printf "ab"}' |
> /data/mmc-utils rpmb write-block /dev/mmcblk2rpmb 0 -  /data/rpmbkey
> RPMB operation failed, retcode 0x0001
> 
> [2]:
> E/TC:? 0 TA panicked with code 0xffff0000
> E/LD:  Status of TA 8dddf200-2450-11e4-abe2-0002a5d5c53d
> E/LD:   arch: arm
> E/LD:  region  0: va 0xc0004000 pa 0x00400000 size 0x002000 flags rw-s
> (ldelf)
> E/LD:  region  1: va 0xc0006000 pa 0x00402000 size 0x006000 flags r-xs
> (ldelf)
> E/LD:  region  2: va 0xc000c000 pa 0x00408000 size 0x001000 flags rw-s
> (ldelf)
> E/LD:  region  3: va 0xc000d000 pa 0x00409000 size 0x002000 flags rw-s
> (ldelf)
> E/LD:  region  4: va 0xc000f000 pa 0x00416000 size 0x001000 flags r--s
> E/LD:  region  5: va 0xc0010000 pa 0x00001000 size 0x009000 flags r-xs [0]
> E/LD:  region  6: va 0xc0019000 pa 0x0000a000 size 0x00c000 flags rw-s [0]
> E/LD:  region  7: va 0xc0025000 pa 0x0040b000 size 0x001000 flags rw-s
> (stack)
> E/LD:   [0] 8dddf200-2450-11e4-abe2-0002a5d5c53d @ 0xc0010000
> E/LD:  Call stack:
> E/LD:   0xc00118fc
> E/LD:   0xc001155f
> E/LD:   0xc00100fd
> E/LD:   0xc0012029
> E/LD:   0xc001646f
> TEEC_InvokeCommand failed with code 0xffff3024 origin 0x3
> 
> 


  reply	other threads:[~2021-05-31  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  7:51 RFC: RPMB write failed with SDHCI Auto CMD23 support Shawn Lin
2021-05-31  8:18 ` Jisheng Zhang [this message]
2021-05-31  8:55   ` Shawn Lin

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=20210531161823.3f91725e@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    /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