[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/6] hw/sd: sdhci: Limit block size only when SDHC_BLKSIZE
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 5/6] hw/sd: sdhci: Limit block size only when SDHC_BLKSIZE register is writable |
Date: |
Thu, 18 Feb 2021 19:03:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/18/21 6:09 PM, Philippe Mathieu-Daudé wrote:
> On 2/16/21 4:46 AM, Bin Meng wrote:
>> The codes to limit the maximum block size is only necessary when
>> SDHC_BLKSIZE register is writable.
Per "SD Command Generation":
The Host Driver should not read the SDMA System Address, Block Size
and Block Count registers during a data transaction unless the
transfer is stopped because the value is changing and not stable.
To prevent destruction of registers using data transfer when issuing
command, the 32-bit Block Count, Block Size, 16-bit Block Count and
Transfer Mode registers shall be write protected by the Host
Controller while Command Inhibit (DAT) is set to 1 in the Present
State register.
Shouldn't we check for !(s->prnsts & SDHC_DATA_INHIBIT) instead?
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> ---
>>
>> Changes in v2:
>> - new patch: sdhci: Limit block size only when SDHC_BLKSIZE register is
>> writable
>>
>> hw/sd/sdhci.c | 14 +++++++-------
>> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>