qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/char/pl011: fix baud rate calculation


From: Peter Maydell
Subject: Re: [PATCH] hw/char/pl011: fix baud rate calculation
Date: Fri, 14 Oct 2022 19:01:50 +0100

On Thu, 6 Oct 2022 at 11:20, Baruch Siach <baruch@tkos.co.il> wrote:
>
> The PL011 TRM says that "UARTIBRD = 0 is invalid and UARTFBRD is ignored
> when this is the case". But the code looks at FBRD for the invalid case.
> Fix this.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  hw/char/pl011.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/char/pl011.c b/hw/char/pl011.c
> index 6e2d7f75095c..c076813423fc 100644
> --- a/hw/char/pl011.c
> +++ b/hw/char/pl011.c
> @@ -176,7 +176,7 @@ static unsigned int pl011_get_baudrate(const PL011State 
> *s)
>  {
>      uint64_t clk;
>
> -    if (s->fbrd == 0) {
> +    if (s->ibrd == 0) {
>          return 0;
>      }

Applied to target-arm.next, thanks. (The only thing we do with the
calculated baud rate is trace it, so the bug wouldn't have had any
bad effects on the guest.)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]