From: Tony Lindgren <tony@atomide.com>
To: Govindraj <govindraj.ti@gmail.com>
Cc: "Govindraj.R" <govindraj.raja@ti.com>,
linux-omap@vger.kernel.org,
Kevin Hilman <khilman@deeprootsystems.com>
Subject: Re: [PATCH v5] OMAP UART: Add omap-serial driver support.
Date: Wed, 10 Feb 2010 09:25:44 -0800 [thread overview]
Message-ID: <20100210172544.GU21755@atomide.com> (raw)
In-Reply-To: <d6a0f7aa1002100639n721d86fdn63520aecb056dd59@mail.gmail.com>
* Govindraj <govindraj.ti@gmail.com> [100210 06:36]:
> Tony,
>
> >
> >> +static void serial_omap_start_tx(struct uart_port *port)
> >> +{
> >> + struct uart_omap_port *up = (struct uart_omap_port *)port;
> >> +
> >> + if (up->use_dma && !(up->port.x_char)) {
> >> +
> >> + struct circ_buf *xmit = &up->port.state->xmit;
> >> + unsigned int start = up->uart_dma.tx_buf_dma_phys +
> >> + (xmit->tail & (UART_XMIT_SIZE - 1));
> >> + if (uart_circ_empty(xmit) || up->uart_dma.tx_dma_state)
> >> + return;
> >> + spin_lock(&(up->uart_dma.tx_lock));
> >> + up->uart_dma.tx_dma_state = 1;
> >> + spin_unlock(&(up->uart_dma.tx_lock));
> >> +
> >> + up->uart_dma.tx_buf_size = uart_circ_chars_pending(xmit);
> >> + /*
> >> + * It is a circular buffer. See if the buffer has wounded back.
> >> + * If yes it will have to be transferred in two separate dma
> >> + * transfers
> >> + */
> >> + if (start + up->uart_dma.tx_buf_size >=
> >> + up->uart_dma.tx_buf_dma_phys + UART_XMIT_SIZE)
> >> + up->uart_dma.tx_buf_size =
> >> + (up->uart_dma.tx_buf_dma_phys +
> >> + UART_XMIT_SIZE) - start;
> >> +
> >> + if (up->uart_dma.tx_dma_channel == 0xFF)
> >> + omap_request_dma(up->uart_dma.uart_dma_tx,
> >> + "UART Tx DMA",
> >> + (void *)uart_tx_dma_callback, up,
> >> + &(up->uart_dma.tx_dma_channel));
> >
> > You need to check the result from omap_request_dma. On a busy system
> > it's quite possible that all DMA channels are taken and you need to
> > dynamically fall back to PIO transfer instead.
> >
> > Looks like this function is easy to fix for that. Maybe you also
> > need to reprogram something in the UART for switching between DMA
> > and PIO?
>
> I explored the possibility of falling back to to Interrupt mode when we get an
> -EBUSY signal from request dma.
>
> It is quite complex, as we set DMA mode in FCR [Fifo control register]
> and FCR can be configured only when "the baud clock is not running
> (DLL_REG and DLH_REG set to 0)."
>
> So we need to reconfigure complete register set since setting DLL and
> DLH to zero means
> we need to reconfigure for baudrate again this would affect the mcr
> configuration and other
> flow control configuration which is set. Thus increasing the
> complexity of switching
> to interrupt mode.
Sure, that's what I figured too.. How about make the reconfigure function
non __init for that?
Sounds like it will also be needed if we want to power off the uart
for off-idle too.
This is quite a critical driver to get right, it's the only debug
console we have in most cases.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-02-10 17:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 9:56 [PATCH v5] OMAP UART: Add omap-serial driver support Govindraj.R
2010-01-27 17:25 ` Tony Lindgren
2010-01-27 17:49 ` Kevin Hilman
2010-01-27 17:57 ` Tony Lindgren
2010-01-27 18:07 ` Kevin Hilman
2010-01-27 18:18 ` Tony Lindgren
2010-01-27 19:10 ` Kevin Hilman
2010-01-27 19:33 ` Tony Lindgren
2010-02-10 14:39 ` Govindraj
2010-02-10 17:25 ` Tony Lindgren [this message]
2010-01-27 18:20 ` Kevin Hilman
2010-01-27 19:37 ` Kevin Hilman
2010-01-28 3:22 ` Olof Johansson
2010-02-04 15:09 ` Govindraj.R
2010-02-04 15:28 ` Olof Johansson
2010-02-04 15:45 ` Govindraj.R
2010-02-04 17:46 ` Kevin Hilman
2010-02-04 20:37 ` Olof Johansson
2010-02-04 20:33 ` Olof Johansson
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=20100210172544.GU21755@atomide.com \
--to=tony@atomide.com \
--cc=govindraj.raja@ti.com \
--cc=govindraj.ti@gmail.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@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