devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
To: Frans Klaver
	<frans.klaver-MHHw4NDrbWwAvxtiuMwx3w@public.gmane.org>,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Alexey Pelykh
	<alexey.pelykh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org>,
	linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/4] tty: omap-serial: use threaded interrupt handler
Date: Mon, 15 Sep 2014 13:31:56 -0400	[thread overview]
Message-ID: <5417228C.5070503@hurleysoftware.com> (raw)
In-Reply-To: <54170823.7040801-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>

On 09/15/2014 11:39 AM, Peter Hurley wrote:
> On 09/15/2014 10:00 AM, Frans Klaver wrote:
>> At 3.6Mbaud, with slightly over 2Mbit/s data coming in, we see 1600 uart
>> rx buffer overflows within 30 seconds. Threading the interrupt handling reduces
>> this to about 170 overflows in 10 minutes.
> 
> Why is the threadirqs kernel boot option not sufficient?
> Or conversely, shouldn't this be selectable?

Also, do you see the same performance differential when you implement this
in the 8250 driver (that is, on top of Sebastian's omap->8250 conversion)?


> Regards,
> Peter Hurley
> 
> PS - To overflow the 64 byte RX FIFO at those data rates means interrupt
> latency in excess of 250us?
> 
>> In practice this therefore reduces the need for hardware flow control,
>> meaning the sending side doesn't have to buffer as much either.
>>
>> Signed-off-by: Frans Klaver <frans.klaver-MHHw4NDrbWwAvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/tty/serial/omap-serial.c | 30 +++++++++++++++++++++++-------
>>  1 file changed, 23 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
>> index 7d3f557..398139a 100644
>> --- a/drivers/tty/serial/omap-serial.c
>> +++ b/drivers/tty/serial/omap-serial.c
>> @@ -575,6 +575,20 @@ static void serial_omap_rdi(struct uart_omap_port *up, unsigned int lsr)
>>  }
>>  
>>  /**
>> + * serial_omap_fast_irq() - schedule interrupt handling
>> + */
>> +static irqreturn_t serial_omap_fast_irq(int irq, void *dev_id)
>> +{
>> +	struct uart_omap_port *up = dev_id;
>> +	unsigned int iir = serial_in(up, UART_IIR);
>> +
>> +	if (iir & UART_IIR_NO_INT)
>> +		return IRQ_NONE;
>> +
>> +	return IRQ_WAKE_THREAD;
>> +}
>> +
>> +/**
>>   * serial_omap_irq() - This handles the interrupt from one port
>>   * @irq: uart port irq number
>>   * @dev_id: uart port info
>> @@ -584,7 +598,6 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id)
>>  	struct uart_omap_port *up = dev_id;
>>  	unsigned int iir, lsr;
>>  	unsigned int type;
>> -	irqreturn_t ret = IRQ_NONE;
>>  	int max_count = 256;
>>  
>>  	spin_lock(&up->port.lock);
>> @@ -595,7 +608,6 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id)
>>  		if (iir & UART_IIR_NO_INT)
>>  			break;
>>  
>> -		ret = IRQ_HANDLED;
>>  		lsr = serial_in(up, UART_LSR);
>>  
>>  		/* extract IRQ type from IIR register */
>> @@ -634,7 +646,7 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id)
>>  	pm_runtime_put_autosuspend(up->dev);
>>  	up->port_activity = jiffies;
>>  
>> -	return ret;
>> +	return IRQ_HANDLED;
>>  }
>>  
>>  static unsigned int serial_omap_tx_empty(struct uart_port *port)
>> @@ -731,15 +743,19 @@ static int serial_omap_startup(struct uart_port *port)
>>  	/*
>>  	 * Allocate the IRQ
>>  	 */
>> -	retval = request_irq(up->port.irq, serial_omap_irq, up->port.irqflags,
>> -				up->name, up);
>> +	retval = request_threaded_irq(up->port.irq, serial_omap_fast_irq,
>> +						serial_omap_irq,
>> +						IRQF_ONESHOT | up->port.irqflags,
>> +						up->name, up);
>>  	if (retval)
>>  		return retval;
>>  
>>  	/* Optional wake-up IRQ */
>>  	if (up->wakeirq) {
>> -		retval = request_irq(up->wakeirq, serial_omap_irq,
>> -				     up->port.irqflags, up->name, up);
>> +		retval = request_threaded_irq(up->wakeirq, serial_omap_fast_irq,
>> +						serial_omap_irq,
>> +						IRQF_ONESHOT | up->port.irqflags,
>> +						up->name, up);
>>  		if (retval) {
>>  			free_irq(up->port.irq, up);
>>  			return retval;
>>


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-09-15 17:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 14:00 [PATCH v3 0/4] omap-serial high-speed fixes/improvements Frans Klaver
2014-09-15 14:00 ` [PATCH 1/4] tty: omap-serial: pull out calculation from baud_is_mode16 Frans Klaver
2014-09-15 14:00 ` [PATCH 2/4] tty: omap-serial: prevent division by zero Frans Klaver
2014-09-15 14:00 ` [PATCH 3/4] tty: omap-serial: use threaded interrupt handler Frans Klaver
2014-09-15 15:39   ` Peter Hurley
     [not found]     ` <54170823.7040801-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2014-09-15 17:31       ` Peter Hurley [this message]
2014-09-16  8:50         ` Frans Klaver
2014-09-17 12:01           ` Peter Hurley
2014-09-17 12:13             ` Frans Klaver
2014-09-23  8:24               ` Frans Klaver
     [not found]                 ` <20140923082445.GA16218-fflvphBLEC9V3v/g3MTWbjg1oUeLRpcR@public.gmane.org>
2014-09-23 17:17                   ` Peter Hurley
     [not found]                     ` <5421AB20.8040606-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
2014-09-23 18:11                       ` Frans Klaver
2014-09-23 18:38                         ` Tony Lindgren
2014-09-23 20:02                           ` Frans Klaver
2014-09-15 14:00 ` [PATCH 4/4] tty: omap-serial: support setting of hardware flow control in dts Frans Klaver

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=5417228C.5070503@hurleysoftware.com \
    --to=peter-wagbzjegnqdsbiue7sb01tbpr1lh4cv8@public.gmane.org \
    --cc=alexey.pelykh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frans.klaver-MHHw4NDrbWwAvxtiuMwx3w@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=jslaby-AlSwsSmVLrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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;
as well as URLs for NNTP newsgroup(s).