All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Pramod Gurav <gpramod@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	bryanh@codeaurora.org, jslaby@suse.cz
Subject: Re: [PATCH v2 2/2] tty: serial: msm: Disable pclk when port is closed
Date: Thu, 9 Apr 2015 07:04:20 -0700	[thread overview]
Message-ID: <20150409140420.GA9663@codeaurora.org> (raw)
In-Reply-To: <28dae70b3f6435d2e0178c31154af9f5.squirrel@www.codeaurora.org>

On 04/09, Pramod Gurav wrote:
> 
> On Thu, April 9, 2015 5:21 am, Stephen Boyd wrote:
> >
> > It's not clear to me at all when this clock is enabled and when it's
> > disabled during the lifetime of this driver. For example, why do we have
> > a .pm op to turn clocks on and off? Shouldn't they already be on? Can
> > you please explain when the clocks are turned on and off and what
> > userspace actions cause that to happen? Looking at drivers like
> > amba-pl010.c I don't see any .pm op, just a
> > clk_prepare_enable/clk_disable_unprepare pair in the startup and
> > shutdown ops.
> 
> 
> When a userspce opens a serial port the uart_startup (in serial_core)
> function is executed which changes the uart_pm state to UART_PM_STATE_ON.
> So when this port is release/closed by the application
> uart_close(serial_core) changes the uart_pm state to UART_PM_STATE_OFF if
> its not console. But it is not done in uart_shutdown function.
> 
> So ideally clk_prepare_enable/clk_disable_unprepare must be called in .pm
> only. So, we can get rid of these operations from msm_startup function as
> these will be called anyway using .pm ops.
> 
> About .pm in uart_ops, there are few drivers which have it for an example,
> atmel_serial, sh-sci etc. That is where they do
> clk_prepare_enable/clk_disable_unprepare. And moreover when there is
> suspend across system these function will handled through .pm.

Ok. If the .pm op is called at the right time then it seems to be
possible to drop the clock operations from startup/shutdown. Do
other drivers hook the .pm op to do runtime PM as well? Because
it would be nice to move this driver to use runtime PM sometime
in the future as well. 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2015-04-09 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 13:28 [PATCH v2 1/2] tty: serial: msm: Add mask value for UART_DM registers Pramod Gurav
2015-04-08 13:28 ` [PATCH v2 2/2] tty: serial: msm: Disable pclk when port is closed Pramod Gurav
2015-04-08 23:51   ` Stephen Boyd
2015-04-09  5:36     ` Pramod Gurav
2015-04-09 14:04       ` Stephen Boyd [this message]
2015-04-08 23:31 ` [PATCH v2 1/2] tty: serial: msm: Add mask value for UART_DM registers Stephen Boyd

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=20150409140420.GA9663@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=bryanh@codeaurora.org \
    --cc=gpramod@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.