2008-09-24 13:26:20 BF537 kernel panic: serial driver
Sullivan FERRARI (FRANCE)
Message: 62640
Hello,
I'm running on the 2007R1 branch and I have got a problem with the serial driver in DMA mode.
My UART1 is connected to a GSM/GPRS modem.
Firstly, I used the driver designed to work with workqueue for the CTS signal, but I have got some hardware traces (see first attached file named "CTS_workqueue.txt"and my kernel crashed due to the events/0 process which requires 99% BF537 usage.
So, I got the last bfin_5xx.c and associated files back for testing the use of timer to poll the CTS pin. Unfortunately, my kernel crashed as well (see the 2nd file named "CTS_timer_polling.txt"
Could you help me about this problem ? I have got the HZ constant defined to 250 value. Is it necessary to increase this value ?
Thanks a lot in advance
CTS_workqueue.txt
CTS_timer_polling.txt
QuoteReplyEditDelete
2008-09-24 15:49:24 Re: BF537 kernel panic: serial driver
Robin Getz (UNITED STATES)
Message: 62649
Sullivan:
Is it possible to update to 2008R1.5? There have been lots of fixes in UART code.
-Robin
QuoteReplyEditDelete
2008-09-24 17:56:15 Re: BF537 kernel panic: serial driver
Sullivan FERRARI (FRANCE)
Message: 62659
Robin,
Yes, I can. Actually, I also noticed the UART changes that you are talking about and I already started to "migrate" to this new release version of the complete distribution. But there are many changes that impact some of my applications (new GPIO interface, a lot of changes in configuration files, etc) that's why I prefer to keep running on 2007R1 branch.
My last compilation error was concerning the chat application in order to establish the GPRS connection with pppd for example.
As a first step, it will be great if I could kick this crash out quickly. Do you mean it is not possible ?
Cheers,
Sullivan
QuoteReplyEditDelete
2008-09-24 23:29:42 Re: BF537 kernel panic: serial driver
Sonic Zhang (CHINA)
Message: 62676
You can try to check out the kernel source code from SVN 2007R1 branch. Some UART bug fixings were checked into that branch after the 2007R1.1 release.
QuoteReplyEditDelete
2008-09-25 10:10:28 Re: BF537 kernel panic: serial driver
Sullivan FERRARI (FRANCE)
Message: 62709
Sonic,
I am already working on the last SVN 2007R1 branch. I tested the following files concerning the serial driver :
1)
* bfin_5xx.c revision 4420 (CTS workqueue) => see CTS_workqueue.txt in previous thread
* serial_core.c revision 3024
* bfin_serial_5xx.h revision 4416
2)
* bfin_5xx.c revision 4869 => see CTS_timer_polling.txt in previous thread
'+' character error at line #899 (is there a patch somewhere ?)
* serial_core.c revision 3024
* bfin_serial_5xx.h revision 4851
3)
* bfin_5xx.c revision 5336
'+' character error at line #905 (is there a patch somewhere ?)
spin_lock_irqsave error at line #383
int flags unused at line #114
* serial_core.c revision 3024
* bfin_serial_5xx.h revision 4851
In that case, I tried to modify the source code, but I still have the kernel crash when I transmit a file through the GPRS modem.
Could you help all the same ?
Cheers
QuoteReplyEditDelete
2008-10-10 10:48:56 Re: BF537 kernel panic: serial driver
Robin Getz (UNITED STATES)
Message: 63424
Sullivan:
Did you get things resolved?
QuoteReplyEditDelete
2008-10-13 04:11:27 Re: BF537 kernel panic: serial driver
Sullivan FERRARI (FRANCE)
Message: 63520
Hello Robin,
No, things are not resolved with the last driver. So I modified the
function below:
static void bfin_serial_set_mctrl(struct uart_port *port, unsigned int
mctrl)
{
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
unsigned long flags;
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
spin_lock_irqsave(&uart->port.lock, flags);
if (uart->rts_pin < 0)
return;
if (mctrl & TIOCM_RTS)
gpio_set_value(uart->rts_pin, 0);
else
gpio_set_value(uart->rts_pin, 1);
spin_unlock_irqrestore(&uart->port.lock, flags);
#endif
}
I still have kernel panic (No valid PID...) but it seems to happen less
frequently. I am testing this modification at this moment, before using the
serial driver 2008 version from branch. (like I said before, I need to
migrate my apps to use the new GPIO interface, modify configuration
files...)
If you have any ideas, let me know, I am still interested. I had a look at
the serial driver 2008 version, and there are a lot of changes.
I will give you the conclusion of my tests as soon as possible.
Cheers,
Sullivan
QuoteReplyEditDelete
2008-10-13 12:44:45 Re: BF537 kernel panic: serial driver
Robin Getz (UNITED STATES)
Message: 63567
Sullivan:
There was a recent fix in the serial driver last night (on 2008R1, 2007R1 branches and trunk) - but I don't think it would have anything to do with the flow control. (which is where your problem seems to be occuring).
Can you describe your test case/setup in a little more detail? I understand I don't have a modem, but anything that asserts CTS/RTS alot is OK?
Also - something to check is if things work ok in PIO mode (flow control is problematic with DMA, due to the nature of DMA - the flow control we have on the 537 is emulated with GPIO - so we check CTS when DMA starts, but if CTS de-asserts during the DMA transaction - we miss it). However - this should only cause data loss - not kernel crashes.
Is it exactly the same trace everytime?
-Robin
QuoteReplyEditDelete
2008-10-13 23:37:30 Re: BF537 kernel panic: serial driver
Sonic Zhang (CHINA)
Message: 63591
Could you try again in PIO mode with CTS/RTS enabled? Any difference with DMA mode?
QuoteReplyEditDelete
2009-01-13 11:39:08 Re: BF537 kernel panic: serial driver
Sullivan FERRARI (FRANCE)
Message: 67893
Hello guys !
Best wishes for this new year.
I am back on the project and I noticed I did not answer you from the last time.
So I finally used the 5405 revision number for bfin_5xx.c with the PIO mode and I confirm you Sonic I did not have any problems with the hardware flow control.
To answer you Robin, here is a little description:
my UART#1 is connected to a GSM/GPRS modem. I can act manually on the RTS/CTS signals thanks to a special wire. When I did it, there is no problem with hardware flowcontrol.
But when I use the modem for establishing a GSM/GPRS connection and sending data, I had the problem. In fact, I observed with a logical analyzer (mixed signal oscilloscope) that uClinux took too much time to react when the CTS signal is activated.
For example, if I send data from uClinux to the modem, about 2000 characters/sec are still sent even though the CTS signal is activated (with a baudrate sets to 115200).
In PIO mode, there is no problem. uClinux stops quite instantly (about 1 or 2 characters/sec are still sent)
=> no data loss and no kernel crash
I hope I am clear.
Anyways, I thank you for your help
Cheers,
Sullivan
QuoteReplyEditDelete
2009-01-13 11:56:21 Re: BF537 kernel panic: serial driver
Mike Frysinger (UNITED STATES)
Message: 67894
emulated CTS/RTS is not supported in DMA mode