I don’t know the driver details.
Try to write a character directly to the UART using the hardware level function
outp when your write is unlocked by the alarm call.
If only one interrupt was lost, but UART is OK and can continue sending
interrupts after each character is transmitted to the serial port, after
transmitting this character the UART will produce a new interrupt that will
“unblock” the driver (I hope).
If UART has stopped sending interrupts the driver will remain “blocked”.
With this test you can have an idea if the origin of the problem is related to
the UART itself or if it’s related to the interrupt managing system.
Note that the extra character sent to the UART will interfere with your serial
message. This is oly a test, and even in the case this unblocks the driver this
is not a valid solution to be used in the working environment.
“Lawrence R. Sweet” wrote:
“Joan Baucells” <“Joan Baucells”@NoSpam.es> wrote in message
news:> 42D4B6DE.A137134E@NoSpam.es> …
The write call sends a message to the serial port driver.
The driver receives this message and writes the first character to the
UART.
After sending that chracter the UART activates an interrupt.
This interrup is the signal to the driver to send next character.
This process repeats until no more characters are available to write to
the UART.
At this point the driver reply the message and the initial write call
returns.
Note that if one interrupt is lost the process is blocked and the write
call
never returns (it remains reply blocked).
The alarm unblocks your process, but the driver continues “waiting” for
the
interrupt indicating UART is free to receive next character. This explain
that
the Alarm call unblocks your process, but you can’t write again until
serial
driver is restarted.
The problem is that sometimes one single interrup is lost.
The origin may be hardware, or an interrupt conflict with other devices.
This may
be difficult to find.
I was wondering what effect it would have to enable the FIFO? I guess it
would just reduce the chance of this happening because we are decreasing the
number of transmit interrupts generated.
What is it that Dev.ser does during initialization of the UART that resets
the chip so that it works again? Perhaps I could do the same thing in my
application in the case where alarm(1) pulls me out of the write?
This would be preferable to having to slay and restart the driver.
Is the source code for the latest Dev.ser available in usr/free?
Rennie Allen wrote:
Lawrence R. Sweet wrote:
Has anyone seen this type of behaviour before?
I have; with incorrectly configured and/or malfunctioning hardware.
Could you provide more details ? Have you tried this with different MBs
?
What IRQ ? How does the MB handle the on-board UARTs IRQ assigments
(some
MBs require that the IRQ for the UART be designated as legacy, and some
automatically handle this when the UART is enabled) ? Is the UART at one
of the conventional (i.e. 0x3f8,0x2f8) addresses ? What state is the
driver
in (e.g. REPLY blocked ?).
The next time I experience
the lockup I was going to read some of the UART registers to see if I
could
see something amiss. Is there any reason that the serial driver would
stop
accepting/transmitting characters?
I suppose there are quite a few reasons this could happen. The most
obvious
(given that h/w flow control is disabled) being that the UART stopped
generating interrupts for some reason.