lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080114093525.GA22818@flint.arm.linux.org.uk>
Date:	Mon, 14 Jan 2008 09:35:25 +0000
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	Pavel Machek <pavel@....cz>
Cc:	Linux Kernel List <linux-kernel@...r.kernel.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH: 2/2] [SERIAL] avoid stalling suspend if serial port won't drain

On Mon, Jan 14, 2008 at 10:04:59AM +0100, Pavel Machek wrote:
> On Mon 2008-01-14 00:29:12, Russell King wrote:
> > 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.

The only way you could do that on 8250 is to clear the RX FIFO, enable
loopback, wait for the port to transmit all its characters into the RX
FIFO and read them out that way.

That brings up other questions though:

- what if its a port with 256 characters in the FIFO, and its programmed
  for 110 baud?
- what if loopback isn't supported?
- what if, while doing this operation, the remote end is sending characters
  because you can't deassert RTS?

Finally, on many non-8250 ports, you don't have a loopback mode to
enable, so you have no way to read back the contents of the FIFO.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ