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: <YWlGR/xVJjX8q2j5@atomide.com>
Date:   Fri, 15 Oct 2021 12:13:43 +0300
From:   Tony Lindgren <tony@...mide.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Andy Shevchenko <andriy.shevchenko@...el.com>,
        Jiri Slaby <jirislaby@...nel.org>,
        Johan Hovold <johan@...nel.org>,
        Vignesh Raghavendra <vigneshr@...com>,
        linux-serial@...r.kernel.org, linux-omap@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] serial: core: Add wakeup() and start_pending_tx()
 for power management

* Greg Kroah-Hartman <gregkh@...uxfoundation.org> [211013 12:34]:
> On Thu, Sep 30, 2021 at 09:29:03AM +0300, Tony Lindgren wrote:
> > --- a/drivers/tty/serial/serial_core.c
> > +++ b/drivers/tty/serial/serial_core.c
> > @@ -91,6 +91,23 @@ static inline struct uart_port *uart_port_check(struct uart_state *state)
> >  	return state->uart_port;
> >  }
> >  
> > +/*
> > + * This routine can be used before register access to wake up a serial
> > + * port that has been runtime PM suspended by the serial port driver.
> > + * Note that the runtime_suspended flag is managed by the serial port
> > + * device driver runtime PM.
> > + */
> > +static int uart_port_wakeup(struct uart_port *port)
> > +{
> > +	if (!atomic_read(&port->runtime_suspended))
> > +		return 0;
> 
> And if the value changes right after you read this?
> 
> Why not use a real lock here?  Don't use an atomic if you don't need it.

Yeah good point, we should just use port->lock.

Regards,

Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ