Re: RFC: RPMB write failed with SDHCI Auto CMD23 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jisheng

在 2021/5/31 16:18, Jisheng Zhang 写道:
On Mon, 31 May 2021 15:51:38 +0800 Shawn Lin <shawn.lin@xxxxxxxxxxxxxx> 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")


Oh, they are using exactly sdhci-of-dwmshc but I didn't notice your patch isn't applied on their tree.


      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?

I guess maybe some of them were broken for this but we don't get proper
test reports, but at least for sdhci-of-arasan I can check, too.


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











[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux