[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] hw/sd/sdhci: Fix DMA Transfer Block Size field
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 3/3] hw/sd/sdhci: Fix DMA Transfer Block Size field |
Date: |
Tue, 1 Sep 2020 16:03:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 9/1/20 4:01 PM, Philippe Mathieu-Daudé wrote:
> The 'Transfer Block Size' field is 12-bit wide.
>
> See section '2.2.2. Block Size Register (Offset 004h)' in datasheet.
>
> Cc: qemu-stable@nongnu.org
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1892960
> Fixes: d7dfca0807a ("hw/sdhci: introduce standard SD host controller")
> Reported-by: Alexander Bulekov <alxndr@bu.edu>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Cc: 1892960@bugs.launchpad.net
> ---
> hw/sd/sdhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 60f083b84c1..beb7b7ea092 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1104,7 +1104,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val,
> unsigned size)
> break;
> case SDHC_BLKSIZE:
> if (!TRANSFERRING_DATA(s->prnsts)) {
> - MASKED_WRITE(s->blksize, mask, value);
> + MASKED_WRITE(s->blksize, mask, extract32(s->blksize, 0, 12));
Beh change unstaged, sorry, will repost.
> MASKED_WRITE(s->blkcnt, mask >> 16, value >> 16);
> }
>
>