linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>, Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Linux PM <linux-pm@vger.kernel.org>,
	linux-serial@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv3 6/8] serial: imx: add runtime pm support
Date: Fri, 14 Aug 2015 18:20:35 -0700	[thread overview]
Message-ID: <20150815012034.GC4125@localhost.localdomain> (raw)
In-Reply-To: <20150815002312.GA26089@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 2662 bytes --]

On Fri, Aug 14, 2015 at 05:23:12PM -0700, Greg Kroah-Hartman wrote:
> On Tue, Aug 11, 2015 at 10:21:25AM -0700, Eduardo Valentin wrote:
> > This change introduces the runtime pm support on imx serial
> > driver. The objective is to be able to idle the uart
> > port whenever it is not in use while still being able
> > to wake it up when needed. The key changes in this patch are:
> > 1. Move the clock handling to runtime pm. Both, ipg and per,
> > are now handled in the suspend and resume callbacks. Only
> > enabling and disabling the clocks are handled in runtime
> > suspend and resume, so we are able to use runtime pm
> > in IRQ context.
> > 2. Clocks are prepared in probe and unprepared in remove,
> > so we do not need to prepare (may sleep) in runtime pm.
> > 3. We mark the device activity based on uart and console
> > callbacks. Whenever the device is needed and we want to
> > access registers, we runtime_pm_get and then mark its
> > last usage when we are done. This is done also across
> > IRQs and DMA callbacks.
> > 4. We reuse the infrastructure in place for suspend and
> > resume, so we do not need to redo wakeup configuration,
> > or context save and restore.
> > 
> > After this change, the clocks are still sane, in the sense
> > of having balanced clock prepare and enable.
> > 
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Jiri Slaby <jslaby@suse.com>
> > Cc: linux-serial@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> > ---
> >  drivers/tty/serial/imx.c | 224 +++++++++++++++++++++++++++++++++++++----------
> >  1 file changed, 178 insertions(+), 46 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> > index 50abb60..9447a55 100644
> > --- a/drivers/tty/serial/imx.c
> > +++ b/drivers/tty/serial/imx.c
> > @@ -39,6 +39,9 @@
> >  #include <linux/of_device.h>
> >  #include <linux/io.h>
> >  #include <linux/dma-mapping.h>
> > +#include <linux/pm.h>
> > +#include <linux/pm_runtime.h>
> > +#include <linux/pm_wakeup.h>
> >  
> >  #include <asm/irq.h>
> >  #include <linux/platform_data/serial-imx.h>
> > @@ -219,6 +222,7 @@ struct imx_port {
> >  	unsigned int            saved_reg[10];
> >  	bool			context_saved;
> >  
> > +	struct device		*dev;
> 
> Do you really need this pointer?  Can't you get it from the platform
> device that you have access to that sport is the data?

Actually, not really. I can change the code to the one in sport. I will
be resending soon.

> 
> thanks,
> 
> greg k-h

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2015-08-15  1:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 17:21 [PATCHv3 0/8] serial: imx: rework pm support and add runtime pm Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 1/8] serial: imx: remove unbalanced clk_prepare Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 2/8] serial: imx: introduce serial_imx_enable_wakeup() Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 3/8] serial: imx: allow waking up on RTSD Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 4/8] serial: imx: save and restore context in the suspend path Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 5/8] serial: imx: add a flag to indicate we are " Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 6/8] serial: imx: add runtime pm support Eduardo Valentin
2015-08-15  0:23   ` Greg Kroah-Hartman
2015-08-15  1:20     ` Eduardo Valentin [this message]
2015-08-11 17:21 ` [PATCHv3 7/8] serial: imx: add pm_qos request Eduardo Valentin
2015-08-11 17:21 ` [PATCHv3 8/8] serial: imx: use SET_*SYSTEM_PM_OPS helper functions Eduardo Valentin

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=20150815012034.GC4125@localhost.localdomain \
    --to=edubezval@gmail.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).