From: Federico Fuga <fuga@studiofuga.com>
To: linux-sh@vger.kernel.org
Subject: Re: sci spurious irq on sh7203
Date: Sat, 14 May 2011 10:50:02 +0000 [thread overview]
Message-ID: <2704C387-0B77-4CD3-B796-AA7121CDB4E9@studiofuga.com> (raw)
In-Reply-To: <CAECAEC7-EB01-45D9-951D-849F5B974AB3@studiofuga.com>
Hi,
I isolated the problem and solved the issue in a very handicraft way...
The problem is that when on sh7203 an overrun occurs, the overrun isn't detected by the driver (why?) and consequently the flag isn't cleared.
So I applied this check at the end of the sci_mpxed_interrupt function, just before returning:
/* Check for buffer overrun */
lsr = sci_in(port, SCLSR);
if (lsr & 0x0001) {
struct tty_struct *tty = port->state->port.tty;
sci_out(port, SCLSR, 0x0000);
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
tty_flip_buffer_push(tty);
dev_notice(port->dev, "overrun error\n");
}
this way the lockup is solved, and the problem still resides on the very poor performance of the serial port ...
Regards
Federico Fuga
Il giorno 03/mag/2011, alle ore 19.08, Federico Fuga ha scritto:
> Hi Magnus,
>
> thank you very much for your response!
> As you suggested, I made both test - disabling the earlyprintk on the 2.6.37 [nothing changes] and trying the same test with the latest, git version. In the this case, after applying all changes to support my board (this means only some change to the arch/sh/boards/mach-rsk/devices-rsk7203.c, arch/sh/boards/mach-rsk/setup.c) the system doesn't output anything on the serial console, neither with nor without the earlyprintk option.
> I'am stuck :-)
> I double checked all my modifications, but there's nothing related to serial port sci0. And in my old (2.6.37) sh_sci.c there is no changes other than some debug message...
> Any idea?
>
> Thank you!
>
> Regards,
>
>
> Federico Fuga
>
>
>
>
>
>
> Il giorno 02/mag/2011, alle ore 22.48, Magnus Damm ha scritto:
>
>> Hi Federico,
>>
>> On Tue, May 3, 2011 at 3:11 AM, Federico Fuga <fuga@studiofuga.com> wrote:
>>> Hi All,
>>>
>>> I am working on a sh7203 based board, running the linux-sh kernel 2.6.37 [3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5]
>>> I am experiencing a bug when using the sci0 as a console.
>>> The serial port is working as expected, except when more than a certain number of characters are sent to the console; in this case, the kernels traps many spurious interrupts that triggers the __report_bad_irq() function and disables the IRQ vector 192.
>>> I append a snapshot of the console output.
>>> As you can see, I modified some kernel sources to output the status of some register - also not related to SCI.
>>> I modified the sh_sci.c source to trigger an output of the irq registers when no irq routine is serviced - basically a flag that change state when sci_tx_interrupt or similar function are called from inside sci_mpxed_interrupt.
>>> So I noted that the error is triggered when
>>>
>>> ssr_status\0000060
>>> scr_status\0000078
>>> err_enabled\0000040
>>>
>>> The strange thing is that the irq is triggered for TEND flag and TX FIFO Empty even if TIE is disabled.
>>> I was investigating both tx and rx interrupt routines, but I see nothing strange happening. But it seems something related to Receiving too many characters (a stream of 15 bytes do not triggers the problem; 16+ bytes almost always triggers the problem), since Sending seems to work fine.
>>> I also tried to update sh-sci.c/h and some other header file (in arch/... and include/linux/...) to the latest version, and compile, but the problem persists.
>>> Actually I cannot test any other serial port for this problem, but I hope I can make this test soon.
>>> Thank you in advance.
>>
>> As usual with these things, please try to test on latest upstream if
>> possible. Your issue may be solved already and if so is a matter of
>> backporting.
>>
>> I don't recall any recent sh7203 serial fixes though. You may want to
>> try to test without earlyprintk. From your description it sounds like
>> your issue may be related to TX errors (overrun), perhaps the TX error
>> interrupt is enabled even though TIE is disabled?
>>
>> Thanks,
>>
>> / magnus
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2011-05-14 10:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 18:11 sci spurious irq on sh7203 Federico Fuga
2011-05-02 20:48 ` Magnus Damm
2011-05-03 17:08 ` Federico Fuga
2011-05-14 10:50 ` Federico Fuga [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2704C387-0B77-4CD3-B796-AA7121CDB4E9@studiofuga.com \
--to=fuga@studiofuga.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox