lkml.org 
[lkml]   [2018]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: serial: start_tx & buffer handling
    On Thu, May 03, 2018 at 08:08:48PM +0530, Muni Sekhar wrote:
    > Hi All,
    >
    > I’m trying to understand how user mode buffer is written to low level
    > serial hardware registers.
    >
    > For this I read the kernel code and I came to know that from user mode
    > write() API lands into kernel’s tty_write() ("drivers/tty/tty_io.c")
    > and then it calls a uart_write() ("drivers/tty/serial/serial_core.c").
    >
    > In uart_write(), the buffer is copied to circ_buf and then it calls
    > low level serial hardware driver’s start_tx() (struct uart_ops
    > .start_tx). But here I could not find how the buffer kept in circ_buf
    > is copied to serial port’s TX_FIFO registers?
    >
    > Can someone take a moment to explain me on this?

    It all depends on which specific UART driver you are looking at, they
    all do it a bit different depending on the hardware.

    Which one are you looking at? Look at what the start_tx callback does
    for that specific driver, that should give you a hint as to how data
    starts flowing. Usually an interrupt is enabled that is used to flush
    the buffer out to the hardware.

    thanks,

    greg k-h

    \
     
     \ /
      Last update: 2018-05-03 20:34    [W:2.961 / U:0.124 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site