Re: [PATCH 1/1] tty, serial, 8250: to avoid recv fifo overrun, read rx fifo during xmit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg/Peter


On Wed, Apr 29, 2015 at 2:07 PM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Apr 29, 2015 at 04:48:01PM -0400, Peter Hurley wrote:
>> On 04/29/2015 08:30 AM, Greg KH wrote:
>> > On Wed, Apr 29, 2015 at 08:22:39AM -0400, Peter Hurley wrote:
>> >> On 04/28/2015 02:17 PM, Greg KH wrote:
>> >>> On Tue, Apr 28, 2015 at 10:44:31AM -0700, Prasad Koya wrote:
>> >>> Please let's make this automatic, and work properly, no configuration
>> >>> option should be needed, _IF_ this doesn't cause a problem for people
>> >>> with normal systems.
>> >>
>> >> I feel the effort and trade-offs required to make this automatic and
>> >> bullet-proof is simply not worth it.
>> >>
>> >> For example, new data that's received while in the middle of a
>> >> printk() may trigger a GPF_ATOMIC memory allocation.
>> >>
>> >> That could cause real problems under the wrong circumstances.
>> >
>> > Then why have this "fix" in here at all?  It sounds wrong.
>>
>> Greg,
>>
>> I'd like to make clear that while I've been trying to provide
>> guidance for the patch, I'm not convinced this belongs in mainline
>> (and I explained that upfront several months ago).
>>

Peter has been immensely helpful with this patch and suggested that
this may not no into mainline as there could be ways to work around
this. However, George Spelvin also came up with another use case where
this patch could help. Hence the effort behind this.

>> Basically, the boundary conditions for stable behavior can easily
>> be exceeded in several circumstances; this is one of them.
>>
>> So is trying to printk() a 1Kb log line over 9600 baud. That's nearly
>> a second with interrupts off; good luck with that.
>>

Here is a printk outputting a little over 100 chars and an echo of 52
chars (I tried manually to reproduce on vanilla kernel) and I see
buffer overrun. This is at 9600 baud.

[Thu Apr 23 18:58:46 2015]Aboot# echo
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzwatchdog_timer_fn:
watchdog_timer_fn watchdog_timer_fn watchdog_timer_fn
watchdog_timer_fn watchdog_timer_fn
[Thu Apr 23 18:58:48 2015]ttyS0: 1 input overrun(s)

So we dont need a really large printk for this to happen. For example,
a 60 byte (very reasonable size) printk would turn off interrupts for
about 60ms at 9600 baud. During this 60ms, console input of, say, 20
bytes could cause a 16 byte FIFO overrun during that time.

thanks
Prasad
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux