linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] tty: omap-serial: Keep the wakeup mechanism enabled by default
Date: Wed, 18 Apr 2012 16:02:09 +0100	[thread overview]
Message-ID: <20120418150209.GO25053@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <87mx69nms2.fsf@ti.com>

On Wed, Apr 18, 2012 at 07:21:33AM -0700, Kevin Hilman wrote:
> "Raja, Govindraj" <govindraj.raja@ti.com> writes:
> 
> > On Wed, Apr 18, 2012 at 4:55 AM, Kevin Hilman <khilman@ti.com> wrote:
> >> "Govindraj.R" <govindraj.raja@ti.com> writes:
> >>
> >>> From: "Govindraj.R" <govindraj.raja@ti.com>
> >>>
> >>> The wakeups can be left enabled by default and should be disabled
> >>> only when disabled from sysfs and while entering suspend.
> >>
> >> Left enabled? ?That assumes something else has initizlied them, but we
> >> can't make that assumption.
> >>
> >> First, wakeups should be disabled when ->probe has finished. ?Then,
> >> they should be enabled whenever driver is in use, and disabled when
> >> the driver is not in use.
> >>
> >> I'm not familiar enough with uart_ops, but it looks like they should
> >> probably be enabled in uart_ops->startup and disabled in
> >> uart_ops->shutdown.
> >
> > uart_ops->shutdown gets called in suspend path also
> > serial_omap_suspend => uart_suspend_port = > ops->shutdown(uport);
> >
> > This will leave uart wakeup disabled in suspend path.
> 
> As I said, I'm not familiar enough with uart_ops to know which are the
> right ones.
> 
> Maybe ->request_port and ->release_port are the right ones?

No, the clue's there in the name - these are supposed to be for resource
management.  They only get called when the port is first acquired by the
driver, and released when the port is no longer required (iow, they
cover the span in time where the driver is capable of using the device.)
They don't tell you about the lifetime that the user has the port open.

> The point is that wakeups should be enabled whenever driver is in use,
> and disabled when the driver is not in use.

Well, we don't actually tell low level drivers that kind of detail (we
assume they're rather dumb - which maybe we shouldn't.)

It looks to me like there is the possibility of checking the TTY port
flags to see whether ASYNC_INITIALIZED is set - this will be clear in
->shutdown() method if the user is closing the port, otherwise it will
be set.  Same goes for the ->startup() method.

I'm not sure whether Alan would allow that kind of knowledge in low
level serial drivers though...

  reply	other threads:[~2012-04-18 15:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 12:30 [PATCH] tty: omap-serial: Keep the wakeup mechanism enabled by default Govindraj.R
2012-04-17 23:25 ` Kevin Hilman
2012-04-18 13:16   ` Raja, Govindraj
2012-04-18 14:21     ` Kevin Hilman
2012-04-18 15:02       ` Russell King - ARM Linux [this message]
2012-04-18 19:08       ` Alan Cox
2012-04-19 14:30         ` Raja, Govindraj
2012-04-20  9:13           ` Alan Cox

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=20120418150209.GO25053@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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).