netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	koen@dominion.thruhere.net, mugunthanvnm@ti.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] net: davinci_mdio: enable and disable clock
Date: Thu, 02 Aug 2012 22:28:48 +0200	[thread overview]
Message-ID: <501AE300.2090707@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1208021416550.18867@utopia.booyaka.com>

On 02.08.2012 22:20, Paul Walmsley wrote:
> Hi
> 
> On Thu, 2 Aug 2012, Daniel Mack wrote:
> 
>> Make the driver control the device clocks. Appearantly, the Davinci
>> platform probes this driver with the clock all powered up, but on OMAP,
>> this isn't the case.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
> 
>> ---
>>  drivers/net/ethernet/ti/davinci_mdio.c | 16 ++++++++++++++--
>>  1 file changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
>> index cd7ee20..b4b6015 100644
>> --- a/drivers/net/ethernet/ti/davinci_mdio.c
>> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
>> @@ -332,6 +332,8 @@ static int __devinit davinci_mdio_probe(struct platform_device *pdev)
>>  		goto bail_out;
>>  	}
>>  
>> +	clk_enable(data->clk);
>> +
> 
> This doesn't look right.  This clock should be enabled by the
> pm_runtime_get_sync() call just above this.  It shouldn't be necessary
> to enable it again unless something isn't right with the integration
> data. Likewise the pm_runtime_put_sync() calls should be superfluous.

Aah, thanks for the heads-up. To explain, I first worked with a dirty
hack to alias the clock, and I definitely needed these extra calls then.

> What hwmod data/device tree file are you using with this?

Later, I added the hwmod to move away from these hacks, and indeed, that
lets the pm runtime code handle the clock enabling. With that in place,
the patch we're talking about here is in fact unnecessary.

The second one though (the one that adds DT bindings) should go in.

I will send a separate one later that fixes the IS_ERR(data->clk) error
that Russell spotted. But that's now unrelated.


Thanks for the review,
Daniel

  reply	other threads:[~2012-08-02 20:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 19:43 [PATCH 1/2] net: davinci_mdio: enable and disable clock Daniel Mack
2012-08-02 19:43 ` [PATCH 2/2] net: davinci_mdio: add DT bindings Daniel Mack
2012-08-02 19:53 ` [PATCH 1/2] net: davinci_mdio: enable and disable clock Russell King - ARM Linux
2012-08-02 20:17   ` Daniel Mack
2012-08-02 20:20 ` Paul Walmsley
2012-08-02 20:28   ` Daniel Mack [this message]
2012-08-03  5:16 ` Vaibhav Hiremath
2012-08-03  5:22   ` Daniel Mack
2012-08-03  5:53     ` Hiremath, Vaibhav

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=501AE300.2090707@gmail.com \
    --to=zonque@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul@pwsan.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).