* [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled
@ 2019-01-04 18:20 Philippe Mathieu-Daudé
2019-01-04 18:31 ` Philippe Mathieu-Daudé
2019-01-08 11:53 ` Peter Maydell
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-04 18:20 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Marc-André Lureau, Alistair Francis,
Peter Maydell, Philippe Mathieu-Daudé
When the device is disable, the internal circuitry keep the data
register loaded and doesn't update it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
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) {
--
2.17.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled
2019-01-04 18:20 [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled Philippe Mathieu-Daudé
@ 2019-01-04 18:31 ` Philippe Mathieu-Daudé
2019-01-04 19:47 ` Alistair Francis
2019-01-08 11:53 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-04 18:31 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Marc-André Lureau, Alistair Francis,
Peter Maydell
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é <philmd@redhat.com>
> ---
> 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) {
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled
2019-01-04 18:31 ` Philippe Mathieu-Daudé
@ 2019-01-04 19:47 ` Alistair Francis
0 siblings, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2019-01-04 19:47 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel@nongnu.org Developers, Peter Maydell, Paolo Bonzini,
Alistair Francis, Marc-André Lureau
On Fri, Jan 4, 2019 at 10:31 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> 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é <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> > ---
> > 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) {
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled
2019-01-04 18:20 [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled Philippe Mathieu-Daudé
2019-01-04 18:31 ` Philippe Mathieu-Daudé
@ 2019-01-08 11:53 ` Peter Maydell
1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2019-01-08 11:53 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: QEMU Developers, Paolo Bonzini, Marc-André Lureau,
Alistair Francis
On Fri, 4 Jan 2019 at 18:21, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> When the device is disable, the internal circuitry keep the data
> register loaded and doesn't update it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> 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) {
> --
> 2.17.2
Applied to target-arm.next, thanks (with the commit message typos fixed).
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-08 11:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-04 18:20 [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: Do not update data register when device is disabled Philippe Mathieu-Daudé
2019-01-04 18:31 ` Philippe Mathieu-Daudé
2019-01-04 19:47 ` Alistair Francis
2019-01-08 11:53 ` Peter Maydell
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).