[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
>
- [Qemu-devel] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/18
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, Peter Maydell, 2016/10/18
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/18
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate,
Alistair Francis <=
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/19
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, Alistair Francis, 2016/10/19
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/20
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, Edgar E. Iglesias, 2016/10/20
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/21
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, Alistair Francis, 2016/10/24
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, P J P, 2016/10/24
- Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate, Alistair Francis, 2016/10/24