qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v45 3/3] hw/sd/sdcard: Do not store vendor data on block driv


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v45 3/3] hw/sd/sdcard: Do not store vendor data on block drive (CMD56)
Date: Wed, 3 Jul 2024 15:17:48 +0200
User-agent: Mozilla Thunderbird

On 3/7/24 14:24, Manos Pitsidianakis wrote:
On Wed, 03 Jul 2024 11:59, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
"General command" (GEN_CMD, CMD56) is described as:

 GEN_CMD is the same as the single block read or write
 commands (CMD24 or CMD17). The difference is that [...]
 the data block is not a memory payload data but has a
 vendor specific format and meaning.

Thus this block must not be stored overwriting data block
on underlying storage drive. Keep it in a dedicated
'vendor_data[]' array.



I am reading the 4.3 spec, and it says:

 The bus transaction of the GEN_CMD is the same as the single block  read or write commands (CMD24 or CMD17). The difference is that the  argument denotes the direction of the data transfer (rather than the  address) and the data block is not a memory payload data but has a  vendor specific format and meaning.

The vendor here (qemu) does not support any functionality with CMD56. I think the correct approach would be to read zeros and discard writes, without storing anything and without changing data_offset (which is for `data` buffer)

What do you think?

As Luc suggested in v42. Indeed simpler thus clever.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
v43: Do not re-use VMSTATE_UNUSED_V (danpb)
v44: Use subsection (Luc)
v45: Remove APP_READ_BLOCK/APP_WRITE_BLOCK macros
---
hw/sd/sd.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]