From: Tony Lindgren <tony@atomide.com>
To: Tero.Kristo@nokia.com
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH] OMAP3: Serial: Improved sleep logic
Date: Thu, 4 Feb 2010 08:10:34 -0800 [thread overview]
Message-ID: <20100204161033.GP22747@atomide.com> (raw)
In-Reply-To: <1F18D6510CF0474A8C9500565A7E41A223727D496C@NOK-EUMSG-02.mgdnok.nokia.com>
* Tero.Kristo@nokia.com <Tero.Kristo@nokia.com> [100203 23:59]:
>
>
> >-----Original Message-----
> >From: ext Tony Lindgren [mailto:tony@atomide.com]
> >Sent: 03 February, 2010 19:50
> >To: Kristo Tero (Nokia-D/Tampere)
> >Cc: linux-omap@vger.kernel.org
> >Subject: Re: [PATCH] OMAP3: Serial: Improved sleep logic
> >
> >* Tero Kristo <tero.kristo@nokia.com> [100202 01:38]:
> >> From: Tero Kristo <tero.kristo@nokia.com>
> >>
> >> Only RX interrupt will now kick the sleep prevent timer. In
> >addition, TX
> >> fifo status is checked before disabling clocks, this will
> >prevent occasional
> >> garbage being printed on serial line. Smartidle is also
> >disabled while
> >> entering idle if we have data in the transmit buffer,
> >because having this
> >> enabled will prevent wakeups from the TX interrupt, and this causes
> >> pauses while sending large blocks of data.
> >
> >Sounds this is for 2.6.34 merge window and does not contain anything
> >that needs to be fixed for 2.6.33.
>
> Yeah, this only fixes a couple of annoying issues, but nothing fatal. Also improves power efficiency in some cases which is a nice to have feature, and basically eases the development of PM code as the UART does not block the system from sleeping always.
Yeah cool. Separate issue, but I wonder if we should also clear
the the first rx character from the fifo to avoid corrupting
the console. Only when the uart clocks are off and and
we get a key press. Would be easy to do just do with one
serial_read_reg(uart->p, UART_RX)..
Tony
>
> -Tero
>
> >
> >Regards,
> >
> >Tony
> >
> >
> >> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> >> ---
> >> arch/arm/mach-omap2/serial.c | 19 +++++++++++++++----
> >> 1 files changed, 15 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-omap2/serial.c
> >b/arch/arm/mach-omap2/serial.c
> >> index 777e802..e11dfe9 100644
> >> --- a/arch/arm/mach-omap2/serial.c
> >> +++ b/arch/arm/mach-omap2/serial.c
> >> @@ -317,7 +317,8 @@ static void omap_uart_allow_sleep(struct
> >omap_uart_state *uart)
> >> if (!uart->clocked)
> >> return;
> >>
> >> - omap_uart_smart_idle_enable(uart, 1);
> >> + if (serial_read_reg(uart->p, UART_LSR) & UART_LSR_TEMT)
> >> + omap_uart_smart_idle_enable(uart, 1);
> >> uart->can_sleep = 1;
> >> del_timer(&uart->timer);
> >> }
> >> @@ -335,7 +336,11 @@ void omap_uart_prepare_idle(int num)
> >>
> >> list_for_each_entry(uart, &uart_list, node) {
> >> if (num == uart->num && uart->can_sleep) {
> >> - omap_uart_disable_clocks(uart);
> >> + if (serial_read_reg(uart->p, UART_LSR) &
> >> + UART_LSR_TEMT)
> >> + omap_uart_disable_clocks(uart);
> >> + else
> >> + omap_uart_smart_idle_enable(uart, 0);
> >> return;
> >> }
> >> }
> >> @@ -407,8 +412,14 @@ int omap_uart_can_sleep(void)
> >> static irqreturn_t omap_uart_interrupt(int irq, void *dev_id)
> >> {
> >> struct omap_uart_state *uart = dev_id;
> >> + u8 lsr;
> >>
> >> - omap_uart_block_sleep(uart);
> >> + lsr = serial_read_reg(uart->p, UART_LSR);
> >> + /* Check for receive interrupt */
> >> + if (lsr & UART_LSR_DR)
> >> + omap_uart_block_sleep(uart);
> >> + if (lsr & UART_LSR_TEMT && uart->can_sleep)
> >> + omap_uart_smart_idle_enable(uart, 1);
> >>
> >> return IRQ_NONE;
> >> }
> >> --
> >> 1.5.4.3
> >>
> >> --
> >> 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-04 16:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 11:30 [PATCH] OMAP3: Serial: Improved sleep logic Tero Kristo
2010-02-03 17:50 ` Tony Lindgren
2010-02-04 8:00 ` Tero.Kristo
2010-02-04 16:10 ` Tony Lindgren [this message]
2010-02-09 15:32 ` Tero.Kristo
2010-02-04 21:19 ` Kevin Hilman
2010-02-09 15:40 ` Tero.Kristo
-- strict thread matches above, loose matches on Subject: below --
2010-02-10 16:28 Tero Kristo
2010-02-11 11:50 ` Tero.Kristo
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=20100204161033.GP22747@atomide.com \
--to=tony@atomide.com \
--cc=Tero.Kristo@nokia.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 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.