public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andy Shevchenko <andriy.shevchenko@intel.com>,
	Jiri Slaby <jirislaby@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-serial@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] serial: core: Add wakeup() and start_pending_tx() for power management
Date: Fri, 15 Oct 2021 12:13:43 +0300	[thread overview]
Message-ID: <YWlGR/xVJjX8q2j5@atomide.com> (raw)
In-Reply-To: <YWbSJCEkqQ0KzQ5E@kroah.com>

* Greg Kroah-Hartman <gregkh@linuxfoundation.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

  reply	other threads:[~2021-10-15  9:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  6:29 [PATCHv2 0/4] Get rid of pm_runtime_irq_safe() for 8250_omap Tony Lindgren
2021-09-30  6:29 ` [PATCH 1/4] serial: core: Add wakeup() and start_pending_tx() for power management Tony Lindgren
2021-09-30  7:10   ` Andy Shevchenko
2021-09-30  7:26     ` Tony Lindgren
2021-10-13 12:33   ` Greg Kroah-Hartman
2021-10-15  9:13     ` Tony Lindgren [this message]
2021-09-30  6:29 ` [PATCH 2/4] serial: 8250: Implement wakeup for TX and use it for 8250_omap Tony Lindgren
2021-09-30  7:17   ` Andy Shevchenko
2021-09-30  7:29     ` Tony Lindgren
2021-09-30  6:29 ` [PATCH 3/4] serial: 8250_omap: Require a valid wakeirq for deeper idle states Tony Lindgren
2021-09-30  6:29 ` [PATCH 4/4] serial: 8250_omap: Drop the use of pm_runtime_irq_safe() Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2021-10-15 11:26 [PATCHv3 0/4] Get rid of pm_runtime_irq_safe() for 8250_omap Tony Lindgren
2021-10-15 11:26 ` [PATCH 1/4] serial: core: Add wakeup() and start_pending_tx() for power management Tony Lindgren
2021-10-18  7:09   ` Johan Hovold
2021-10-21  6:32     ` Tony Lindgren

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=YWlGR/xVJjX8q2j5@atomide.com \
    --to=tony@atomide.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=vigneshr@ti.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox