[PATCH 3/4] clk: kirkwood: Add CLK_IGNORE_UNUSED to ethernet ge0 and ge1 clocks

Jason Cooper jason at lakedaemon.net
Tue Oct 1 11:15:28 EDT 2013


On Tue, Oct 01, 2013 at 05:09:32PM +0200, Thomas Petazzoni wrote:
> Dear Jason Cooper,
> 
> On Tue, 1 Oct 2013 11:01:30 -0400, Jason Cooper wrote:
> > On Tue, Oct 01, 2013 at 11:17:18AM -0300, Ezequiel Garcia wrote:
> > > On Tue, Oct 01, 2013 at 09:58:00AM -0400, Jason Cooper wrote:
> > ...
> > > > However, I think the problem is that the IP block loses it's mac address
> > > > when gated.  That hasn't been solved, all you're doing is moving the
> > > > hack/workaround from one place to another less visible place.
> > > > 
> > > 
> > > There's an already existing and clock-framework-specific way of preventing
> > > a clock from being ever gated -which seems to match exactly this case-
> > > so I have a hard time seeing why we wouldn't use it.
> > > 
> > > Also: I'm wondering why you think this change would 'hide' the clock gating.
> > > It seems whenever a (future?) developer finds these clocks are not gated,
> > > one of the first places he will look for is precisely on those flags.
> > 
> > True, I'm approaching it from "I unloaded mv643xx_eth.ko, and my power
> > draw didn't change.  Let's go look at the driver."  But you are correct.
> > 
> > I'd really like to see if we can extend your patch to having the
> > driver's probe function detect the mac address in the DT, and change the
> > IGNORE_UNUSED flag on the clock.  MikeT might have some thoughts on that
> > since I don't see anyone doing that atm.
> 
> Sorry for jumping into the discussion, but how does that solve the case
> when the driver is loaded as a module, and therefore unused clocks are
> disabled before the driver ->probe() function gets called?

Sorry, I wrote the reply to JasonG just moments before and assumed a
little knowledge of that in this reply.

We would use Ezequiel's patch to ensure CLK_IGNORE_UNUSED is set for the
clock during boot, then, after boot, mv643xx_eth's probe would look for
the mac address in the DT.  If it's there, it would unset the flag
knowing that it can recover the mac address from the DT.  Then we could
get the power savings from suspend/unload.

thx,

Jason.



More information about the linux-arm-kernel mailing list