From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Hiremath, Vaibhav" <hvaibhav@ti.com>
Cc: "AnilKumar, Chimata" <anilkumar@ti.com>,
"wg@grandegger.com" <wg@grandegger.com>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"Nori, Sekhar" <nsekhar@ti.com>, "Gole, Anant" <anantgole@ti.com>
Subject: Re: [PATCH v4 3/3] can: c_can: Add runtime PM support to Bosch C_CAN/D_CAN controller
Date: Fri, 03 Aug 2012 21:09:25 +0200 [thread overview]
Message-ID: <501C21E5.9080106@pengutronix.de> (raw)
In-Reply-To: <79CD15C6BA57404B839C016229A409A83EA7F150@DBDE01.ent.ti.com>
[-- Attachment #1: Type: text/plain, Size: 1830 bytes --]
On 08/03/2012 08:32 AM, Hiremath, Vaibhav wrote:
> On Thu, Aug 02, 2012 at 18:43:11, AnilKumar, Chimata wrote:
>> Add Runtime PM support to C_CAN/D_CAN controller. The runtime PM
>> APIs control clocks for C_CAN/D_CAN IP and prevent access to the
>> register of C_CAN/D_CAN IP when clock is turned off.
>>
>> Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
>> ---
>> drivers/net/can/c_can/c_can_platform.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
>> index d0a66cf..83a1e17 100644
>> --- a/drivers/net/can/c_can/c_can_platform.c
>> +++ b/drivers/net/can/c_can/c_can_platform.c
>> @@ -32,6 +32,7 @@
>> #include <linux/clk.h>
>> #include <linux/of.h>
>> #include <linux/of_device.h>
>> +#include <linux/pm_runtime.h>
>>
>> #include <linux/can/dev.h>
>>
>> @@ -177,6 +178,9 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
>> goto exit_free_device;
>> }
>>
>> + pm_runtime_enable(&pdev->dev);
>> + pm_runtime_get_sync(&pdev->dev);
>> +
>
> If module is inserted or built into the kernel, module stays in enabled
> state always, isn't that wrong?
> Ideally, you should enable the module when it is required or being used.
Good point.
If you don't access the module's registers in the probe- (or its
subroutines) it should be enough to enable the module in the open()
function. Have a look at clk_prepare_enable / clk_disable_unprepare in
the flexcan driver.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-08-03 19:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 13:13 [PATCH v3 0/3] Add DT support to C_CAN/D_CAN controller AnilKumar Ch
2012-08-02 13:13 ` [PATCH v4 1/3] can: c_can: Modify c_can device names AnilKumar Ch
2012-08-06 9:36 ` Marc Kleine-Budde
[not found] ` <501F9031.8050709-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-08-06 9:41 ` AnilKumar, Chimata
2012-08-02 13:13 ` [PATCH v4 2/3] can: c_can: Add device tree support to Bosch C_CAN/D_CAN controller AnilKumar Ch
2012-08-06 9:37 ` Marc Kleine-Budde
2012-08-02 13:13 ` [PATCH v4 3/3] can: c_can: Add runtime PM " AnilKumar Ch
[not found] ` <1343913191-14722-4-git-send-email-anilkumar-l0cyMroinI0@public.gmane.org>
2012-08-03 6:32 ` Hiremath, Vaibhav
2012-08-03 19:09 ` Marc Kleine-Budde [this message]
2012-08-06 6:48 ` Hiremath, Vaibhav
[not found] ` <79CD15C6BA57404B839C016229A409A83EA85CC3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-08-07 10:39 ` AnilKumar, Chimata
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=501C21E5.9080106@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=anantgole@ti.com \
--cc=anilkumar@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=hvaibhav@ti.com \
--cc=linux-can@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=wg@grandegger.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;
as well as URLs for NNTP newsgroup(s).