From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
qemu-devel@nongnu.org
Cc: "Bin Meng" <bmeng.cn@gmail.com>,
"C é dric Le Goater" <clg@kaod.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
qemu-block@nongnu.org,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Luc Michel" <luc.michel@amd.com>
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 [thread overview]
Message-ID: <32a4bff3-2148-4a3e-b60b-20eb76d86b63@linaro.org> (raw)
In-Reply-To: <g1ry6.dru2gk6m73t@linaro.org>
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(-)
prev parent reply other threads:[~2024-07-03 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 8:59 [PATCH v45 0/3] hw/sd/sdcard: Cleanups before adding eMMC support Philippe Mathieu-Daudé
2024-07-03 8:59 ` [PATCH v45 1/3] hw/sd/sdcard: Remove leftover comment about removed 'spi' Property Philippe Mathieu-Daudé
2024-07-03 12:03 ` Manos Pitsidianakis
2024-07-03 8:59 ` [PATCH v45 2/3] hw/sd/sdcard: Use spec v3.01 by default Philippe Mathieu-Daudé
2024-07-03 8:59 ` [PATCH v45 3/3] hw/sd/sdcard: Do not store vendor data on block drive (CMD56) Philippe Mathieu-Daudé
2024-07-03 12:24 ` Manos Pitsidianakis
2024-07-03 13:17 ` Philippe Mathieu-Daudé [this message]
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=32a4bff3-2148-4a3e-b60b-20eb76d86b63@linaro.org \
--to=philmd@linaro.org \
--cc=berrange@redhat.com \
--cc=bmeng.cn@gmail.com \
--cc=clg@kaod.org \
--cc=eduardo@habkost.net \
--cc=luc.michel@amd.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).