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: <545A7045.2040509@hurleysoftware.com>
Date:	Wed, 05 Nov 2014 13:45:25 -0500
From:	Peter Hurley <peter@...leysoftware.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
CC:	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
	Jiri Slaby <jslaby@...e.cz>
Subject: Re: [PATCH 4/4] serial: 8250_pnp: Override pnp suspend for no_console_suspend

On 11/05/2014 01:40 PM, Peter Hurley wrote:
> Prevent PNP bus from powering down the serial console device
> when suspending if the no_console_suspend command line option is set.

Whoops! I set the debug version <blush>.

> Signed-off-by: Peter Hurley <peter@...leysoftware.com>
> ---
>  drivers/tty/serial/8250/8250_pnp.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
> index 50b7c89..f603581 100644
> --- a/drivers/tty/serial/8250/8250_pnp.c
> +++ b/drivers/tty/serial/8250/8250_pnp.c
> @@ -487,7 +487,7 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
>  
>  	if (uart_console(&port8250->port) && !console_suspend_enabled) {
>  		info->override_disable = !!(dev->capabilities & PNP_DISABLE);
> -		dev->capabilities &= ~PNP_DISABLE;
> +		dev->capabilities &= ~(PNP_DISABLE | PNP_SUSPEND);
>  	}
>  
>  	pnp_set_drvdata(dev, info);
> @@ -502,6 +502,7 @@ static void serial_pnp_remove(struct pnp_dev *dev)
>  		serial8250_unregister_port(info->line);
>  		if (info->override_disable)
>  			dev->capabilities |= PNP_DISABLE;
> +		dev->capabilities |= PNP_SUSPEND;
>  	}
>  }
>  
> @@ -519,10 +520,25 @@ static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
>  static int serial_pnp_resume(struct pnp_dev *dev)
>  {
>  	struct serial_pnp_info *info = pnp_get_drvdata(dev);
> +	unsigned int ier, mcr, lcr, dll, dlm;
> +	struct uart_8250_port *port8250;
>  
>  	if (!info)
>  		return -ENODEV;
> +
> +	port8250 = serial8250_get_port(info->line);
> +	ier = serial_port_in(&port8250->port, UART_IER);
> +	mcr = serial_port_in(&port8250->port, UART_MCR);
> +	lcr = serial_port_in(&port8250->port, UART_LCR);
> +	serial_port_out(&port8250->port, UART_LCR, lcr | UART_LCR_DLAB);
> +	dll = serial_port_in(&port8250->port, UART_DLL);
> +	dlm = serial_port_in(&port8250->port, UART_DLM);
> +	serial_port_out(&port8250->port, UART_LCR, lcr & ~UART_LCR_DLAB);
> +
>  	serial8250_resume_port(info->line);
> +
> +	dev_info(&dev->dev, "IER:%02x MCR:%02x LCR:%02x DL:%02x%02x\n",
> +		 ier, mcr, lcr, dlm, dll);
>  	return 0;
>  }
>  #else
> 

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