[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data reg
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled |
Date: |
Fri, 4 Jan 2019 19:31:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 1/4/19 7:20 PM, Philippe Mathieu-Daudé wrote:
> When the device is disable, the internal circuitry keep the data
"keep" -> "keeps"
> register loaded and doesn't update it.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/char/stm32f2xx_usart.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c
> index f3363a2952..10392c70e2 100644
> --- a/hw/char/stm32f2xx_usart.c
> +++ b/hw/char/stm32f2xx_usart.c
> @@ -53,14 +53,13 @@ static void stm32f2xx_usart_receive(void *opaque, const
> uint8_t *buf, int size)
> {
> STM32F2XXUsartState *s = opaque;
>
> - s->usart_dr = *buf;
> -
> if (!(s->usart_cr1 & USART_CR1_UE && s->usart_cr1 & USART_CR1_RE)) {
> /* USART not enabled - drop the chars */
> DB_PRINT("Dropping the chars\n");
> return;
> }
>
> + s->usart_dr = *buf;
> s->usart_sr |= USART_SR_RXNE;
>
> if (s->usart_cr1 & USART_CR1_RXNEIE) {
>