2010-08-25 09:57:28 external uart reset (16C554)
Filip Vanalme (BELGIUM)
Message: 92765
BF561
I was wondering if the Kernel serial driver can detect if a quad uart 16C554 gets an external reset ?
If the uart gets an external rest, registers return to a reset state. E.g. the interrupts are disabled. If the driver is unaware of this, it will stop (because no interrupts anymore) and it will never restart again. Correct ? In that case, device and driver are out of sync. I think the interrupts are enabled only once when starting up the kernel and initialising the driver. How could one detect this situation ? And what to do to make communication restart ?
TranslateQuoteReplyEditDelete
2010-08-25 22:37:46 Re: external uart reset (16C554)
Aaron Wu (CHINA)
Message: 92771
Hi Vanalme ,
Could you give us a detailed decription about you usecase? What's the detailed engineering problem you encountered in your development work? Also if you have special requirment in your system design please let us know so we can better understand your situation.
QuoteReplyEditDelete
2010-08-25 22:55:17 Re: external uart reset (16C554)
Mike Frysinger (UNITED STATES)
Message: 92775
my understanding, and Sonic probably knows a lot more, is that the interrupts and such are only allocated/configured once -- when the device is initially opened. after that, the kernel assumes that the peripheral state isnt randomly reset on it.
do you have any signal to provide feedback on when that occurs ? if you had a GPIO or something that'd trigger an IRQ, you could signal userspace and have it load/unload the 8520 serial driver. otherwise you're probably hosed.
asking on lkml and/or the linux-serial@vger.kernel.org list might get you a better/different response. we dont really track any serial drivers other than the Blackfin-specific ones (like the on-chip UART or the SPORT/UART).
QuoteReplyEditDelete
2010-08-25 23:59:59 Re: external uart reset (16C554)
Sonic Zhang (CHINA)
Message: 92777
Actually the receive interrupt is enabled only once after the port is opened.
You can start a timer to detect the external reset case. If there is a interrupt binding to this reset event, uart driver can get notified as well.
QuoteReplyEditDelete
2010-08-26 03:31:39 Re: external uart reset (16C554)
Filip Vanalme (BELGIUM)
Message: 92796
Thanks for the responses !
It should be possible for the application to detect that a reset has occured.
I'm just wandering : is it sufficient to close/open the serial ports ? Or do I have to load/unload the driver (meaning I have to make the 8250 driver as loadable module) ?
TranslateQuoteReplyEditDelete
2010-08-26 03:38:16 Re: external uart reset (16C554)
Mike Frysinger (UNITED STATES)
Message: 92797
you have to unload the driver, or extend it to support your use case. opening/closing the port will not reload the irqs and such. you can see this in the "startup" function -- this is only called on the very first open.