From: Tony Lindgren <tony@atomide.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
Jiri Slaby <jirislaby@kernel.org>,
Johan Hovold <johan@kernel.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] serial: 8250: Implement wakeup for TX and use it for 8250_omap
Date: Thu, 30 Sep 2021 10:29:37 +0300 [thread overview]
Message-ID: <YVVnYfEOw/78ZyI8@atomide.com> (raw)
In-Reply-To: <CAHp75VeZ98Se+BBDdMeJmwu39CbXEL08RF4BR+uu5oJAycEb=A@mail.gmail.com>
* Andy Shevchenko <andy.shevchenko@gmail.com> [210930 07:18]:
> On Thu, Sep 30, 2021 at 9:30 AM Tony Lindgren <tony@atomide.com> wrote:
> >
> > We can use the wakeup() and uart_start_pending_tx() calls to wake up an
> > idle serial port and send out the pending TX buffer on runtime PM resume.
>
> > This allows us to remove the depedency to pm_runtime_irq_safe() for
>
> dependency
>
> > 8250_omap driver in the following patches.
> >
> > We manage the port runtime_suspended flag in the serial port driver as
> > only the driver knows when the hardware is runtime PM suspended. Note that
> > The current flag for rpm_tx_active cannot be used as it is TX specific
> > for 8250_port.
> >
> > We already have serial8250_start_tx() call serial8250_rpm_get_tx(), and
> > serial8250_stop_tx() call serial8250_rpm_put_tx() to take care of the
> > runtime PM usage count for TX. To have the serial port driver call
> > uart_start_pending_tx() on runtime resume, we must now use just
> > pm_runtime_get() for serial8250_start_tx() instead of the sync version.
> >
> > With these changes we must now also flip 8250_omap driver over to call
> > uart_start_pending_tx(). That's currently the only user of UART_CAP_RPM.
>
> Do I understand the flow correctly:
> 1) if we suspended, we request resume
> 2) until resume is not fulfilled we return error code to user space
> to try again
> ?
Correct. I think the only thing we can currently do is return -EAGAIN
when the serial port registers are not accessible.
> In this case we have no register access to the powered off device and
> ACPI, for example, may have a chance to resume the device in a
> non-atomic way. Is this the correct interpretation?
Yes that's correct. That works as long as the serial port device driver
implements PM runtime resume function, and then at the end of it calls
uart_start_pending_tx().
Regards,
Tony
next prev parent reply other threads:[~2021-09-30 7:29 UTC|newest]
Thread overview: 12+ 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
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 [this message]
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 2/4] serial: 8250: Implement wakeup for TX and use it " 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=YVVnYfEOw/78ZyI8@atomide.com \
--to=tony@atomide.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy.shevchenko@gmail.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