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] [day] [month] [year] [list]
Message-ID: <5c49bc0f468e9fb5ae7ff7f53443fdb1fc3c77f2.camel@linuxfoundation.org>
Date:   Mon, 23 Oct 2023 10:40:54 +0100
From:   Richard Purdie <richard.purdie@...uxfoundation.org>
To:     Tony Lindgren <tony@...mide.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Andy Shevchenko <andriy.shevchenko@...el.com>,
        Dhruva Gole <d-gole@...com>,
        Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
        John Ogness <john.ogness@...utronix.de>,
        Johan Hovold <johan@...nel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Vignesh Raghavendra <vigneshr@...com>,
        linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
        Bruce Ashfield <bruce.ashfield@...il.com>,
        Mikko Rapeli <mikko.rapeli@...aro.org>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Randy MacLeod <randy.macleod@...driver.com>
Subject: Re: [PATCH] serial: core: Fix runtime PM handling for pending tx

On Mon, 2023-10-23 at 10:48 +0300, Tony Lindgren wrote:
> Richard reported that a serial port may end up sometimes with tx data
> pending in the buffer for long periods of time.
> 
> Turns out we bail out early on any errors from pm_runtime_get(),
> including -EINPROGRESS. To fix the issue, we need to ignore -EINPROGRESS
> as we only care about the runtime PM usage count at this point. We check
> for an active runtime PM state later on for tx.
> 
> Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
> Reported-by: Richard Purdie <richard.purdie@...uxfoundation.org>

Tested-by: Richard Purdie <richard.purdie@...uxfoundation.org>

Thanks, I can confirm that since we added this into our builds/tests
we've not seen the serial data go missing.

Cheers,

Richard

> Cc: Bruce Ashfield <bruce.ashfield@...il.com>
> Cc: Mikko Rapeli <mikko.rapeli@...aro.org>
> Cc: Paul Gortmaker <paul.gortmaker@...driver.com>
> Cc: Randy MacLeod <randy.macleod@...driver.com>
> Signed-off-by: Tony Lindgren <tony@...mide.com>
> ---
>  drivers/tty/serial/serial_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -146,7 +146,7 @@ static void __uart_start(struct uart_state *state)
>  
>  	/* Increment the runtime PM usage count for the active check below */
>  	err = pm_runtime_get(&port_dev->dev);
> -	if (err < 0) {
> +	if (err < 0 && err != -EINPROGRESS) {
>  		pm_runtime_put_noidle(&port_dev->dev);
>  		return;
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ