This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: at91 serial driver bug?
- From: "Eric de Jong" <list_ericdejong_10 at gmx dot net>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 18 Aug 2003 10:34:37 +0200
- Subject: Re: [ECOS] at91 serial driver bug?
- References: <HHENIOKDDKPGCGOGJPAOOEHKDBAA.perhedblom@dof.se>
>> I think there is a small but serious bug in the function at91_serial_DSR
No bug. The read of the AT91_US_IMR register in the DSR function checks if the
interrupt is enabled (TX interrupt is only enabled when there are characters to
be send). In the function at91_serial_putc the CSR register is checked to see if
the TX buffer is empty.
The following code might improve performance under heavy loads:
HAL_READ_UINT32(base+AT91_US_IMR, stat);
HAL_READ_UINT32(base+AT91_US_CSR, c);
stat = stat & c;
Now the putc function will not be called when a character is received, and the
transmitter is not yet empty.
----- Original Message -----
From: "Per Hedblom"
Sent: Friday, August 15, 2003 2:32 PM
Subject: [ECOS] at91 serial driver bug?
I think there is a small but serious bug in the function at91_serial_DSR
(ecos file packages/devs/serial/arm/at91/current/src/at91_serial.c)
The status of the serial device should be read from the Channel Status
Register (US_CSR) register.
The current implementation reads the Interrupt Mask Register (US_IMR) in the
beginning of the function.
HAL_READ_UINT32(base+AT91_US_IMR,stat);
should be
HAL_READ_UINT32(base+AT91_US_CSR,stat);
I have not tested this since we don't use this code any more but I believe
this bug affects the performance of the driver.
Per Hedblom
Mindcore Software AB
Sweden
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss