• Remy Bohmer's avatar
    atmel_serial: split the interrupt handler · 1ecc26bd
    Remy Bohmer authored
    Split up the interrupt handler of the serial port into a interrupt top-half
    and a tasklet.
    
    The goal is to get the interrupt top-half as short as possible to minimize
    latencies on interrupts.  But the old code also does some calls in the
    interrupt handler that are not allowed on preempt-RT in IRQF_NODELAY context.
    This handler is executed in this context because of the interrupt sharing with
    the timer interrupt.  The timer interrupt on Preempt-RT runs in IRQF_NODELAY
    context.
    
    The tasklet takes care of handling control status changes, pushing incoming
    characters to the tty layer, handling break and other errors.  It also handles
    pushing TX data into the data register.
    
    Reading the complete receive queue is still done in the top-half because we
    never want to miss any incoming character.
    
    [hskinnemoen@atmel.com: misc cleanups and simplifications]
    Signed-off-by: default avatarRemy Bohmer <linux@bohmer.net>
    Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
    Cc: Andrew Victor <linux@maxim.org.za>
    Tested-by: default avatarMarc Pignat <marc.pignat@hevs.ch>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1ecc26bd
atmel_serial.c 29.2 KB