LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Linux Kernel List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH: 2/2] [SERIAL] avoid stalling suspend if serial port won't drain
Date: Mon, 14 Jan 2008 10:04:59 +0100	[thread overview]
Message-ID: <20080114090459.GB4024@elf.ucw.cz> (raw)
In-Reply-To: <20080114002912.GA19195@flint.arm.linux.org.uk>

On Mon 2008-01-14 00:29:12, Russell King wrote:
> On Fri, Jan 11, 2008 at 10:17:21AM +0000, Pavel Machek wrote:
> > On Tue 2008-01-08 11:57:03, Russell King wrote:
> > > +		if (!tries)
> > > +			printk(KERN_ERR "%s%s%s%d: Unable to drain transmitter\n",
> > > +			       port->dev ? port->dev->bus_id : "",
> > > +			       port->dev ? ": " : "",
> > > +			       drv->dev_name, port->line);
> > >  
> > >  		ops->shutdown(port);
> > >  	}
> > > 
> > 
> > Is printk() enough for 'we've just lost your data' condition? Maybe we
> > should abort suspend if we can't drain fifo?
> 
> That would mean that a port set for hardware flow control, with hardware
> implemented flow control, has CTS deasserted, you'll never suspend.

Yep. 

> If you're suspending because your battery is almost dead what would you
> prefer - the system being prevented from suspending and losing complete
> power unexpectedly, resulting in complete data loss, or losing the
> characters in the serial port and suspending?
> 
> Which is the lesser of two evils?

Not sure, but there's third option -- correct but more work. What
about saving/restoring fifo state? That will not stall suspend, nor
will loose data.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2008-01-14  9:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08 11:51 [PATCH: 1/2] [SERIAL] avoid waking up closed serial ports on resume Russell King
2008-01-08 11:57 ` [PATCH: 2/2] [SERIAL] avoid stalling suspend if serial port won't drain Russell King
2008-01-09  0:06   ` Andrew Morton
2008-01-09  1:29     ` Alan Cox
2008-01-09  8:34     ` Russell King
2008-01-11 10:17   ` Pavel Machek
2008-01-13 22:51     ` nigel
2008-01-14  0:49       ` Alan Cox
2008-01-14  2:40         ` nigel
2008-01-14 10:04           ` Russell King
2008-01-14  9:46         ` Russell King
2008-01-13 22:56     ` Benjamin Herrenschmidt
2008-01-14  0:29     ` Russell King
2008-01-14  9:04       ` Pavel Machek [this message]
2008-01-14  9:35         ` Russell King
2008-01-14 10:21           ` 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=20080114090459.GB4024@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --subject='Re: [PATCH: 2/2] [SERIAL] avoid stalling suspend if serial port won'\''t drain' \
    /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

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).