From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: serial: start_tx & buffer handling
Date: Thu, 3 May 2018 11:34:08 -0700 [thread overview]
Message-ID: <20180503183408.GA12152@kroah.com> (raw)
In-Reply-To: <CAHhAz+iPbNjeHH72Omi7VCUVL_cOUnQjrqbyJKQstUSL6J1hCw@mail.gmail.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Muni Sekhar <munisekharrms@gmail.com>
Cc: linux-serial <linux-serial@vger.kernel.org>,
linux-kernel@vger.kernel.org,
kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: serial: start_tx & buffer handling
Date: Thu, 3 May 2018 11:34:08 -0700 [thread overview]
Message-ID: <20180503183408.GA12152@kroah.com> (raw)
In-Reply-To: <CAHhAz+iPbNjeHH72Omi7VCUVL_cOUnQjrqbyJKQstUSL6J1hCw@mail.gmail.com>
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
next prev parent reply other threads:[~2018-05-03 18:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 14:38 serial: start_tx & buffer handling Muni Sekhar
2018-05-03 14:38 ` Muni Sekhar
2018-05-03 18:34 ` Greg KH [this message]
2018-05-03 18:34 ` Greg KH
2018-05-04 4:31 ` Muni Sekhar
2018-05-04 4:31 ` Muni Sekhar
2018-05-04 12:13 ` loïc tourlonias
2018-05-04 12:13 ` loïc tourlonias
2018-05-04 12:13 ` loïc tourlonias
2018-05-04 12:14 ` loïc tourlonias
2018-05-04 12:14 ` loïc tourlonias
2018-05-04 14:10 ` Muni Sekhar
2018-05-04 14:10 ` Muni Sekhar
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=20180503183408.GA12152@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.