qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against


From: Alistair Francis
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate
Date: Wed, 19 Oct 2016 11:49:34 +0200

On Tue, Oct 18, 2016 at 8:46 PM, P J P <address@hidden> wrote:
> +-- On Tue, 18 Oct 2016, Peter Maydell wrote --+
> | > +    if (!s->r[R_BRGR] || !(s->r[R_BDIV] + 1)
> | > +        || baud_rate < (s->r[R_BRGR] * (s->r[R_BDIV] + 1))) {
> | > +        return;
> | > +    }
> | >      ssp.speed = baud_rate / (s->r[R_BRGR] * (s->r[R_BDIV] + 1));
> | >      packet_size = 1;
> |
> | It seems really unlikely that early return here is the correct thing, since
> | it will result in our not correctly setting a bunch of the other
> | stuff done later in this function that's unrelated to baud rate.
> | What does the datasheet for this UART specify for this situation?
>
> @Alistair.. wdyt?

I'm traveling this week, so I won't have a chance to check the data
sheet until next week.

Generally these types of IP just say 'undefined' in invalid situations
like this. If that is the case we shouldn't return but just set some
default value and allow the other functions in the setup to continue
on.

Thanks,

Alistair

> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
>



reply via email to

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