All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak@ti.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: omap: clock: Get rid of unwanted clkdm assocations within clks
Date: Mon, 11 Jun 2012 14:31:57 +0530	[thread overview]
Message-ID: <4FD5B405.7040309@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1206080734350.14977@utopia.booyaka.com>

Hi Paul,

>> So why should getting rid of some *unused* data have any testing
>> overhead?
>
> Your definition of 'unused' seems to be different than mine:
>
> $ egrep -rn 'c(lk|)->clkdm' arch/arm/
> arch/arm/mach-omap2/omap_hwmod.c:560:	if (oh->_clk->clkdm&&  oh->_clk->clkdm->flags&  CLKDM_NO_AUTODEPS)
> arch/arm/mach-omap2/omap_hwmod.c:563:	return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
> arch/arm/mach-omap2/omap_hwmod.c:584:	if (oh->_clk->clkdm&&  oh->_clk->clkdm->flags&  CLKDM_NO_AUTODEPS)
> arch/arm/mach-omap2/omap_hwmod.c:587:	return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);

I did have a look at these (which are part of _add/_del_initiator_dep()
functions) while I was working on $SUBJECT patch, and was not very sure
of what these functions are expected to do.
They check for a CLKDM_NO_AUTODEPS flag which is not defined across any
clockdomain data files across any OMAP2+ platform.
What it then means is they add a sleep/static dependency for the
modules/hwmods clkdm with mpu on *all* platforms.
The AUTODEPS on the other hand are needed only on OMAP3 I guess, and
AUTODEPS need a sleep/wakeup (Not just a sleep dependency that
the above functions add) dependency not just with MPU but also with
DSP, besides AUTODEPS are already handled very well in the clockdomain
framework for OMAP3.

> arch/arm/mach-omap2/omap_hwmod.c:612:	if (!oh->_clk->clkdm)
> arch/arm/mach-omap2/omap_hwmod.c:2998:	if (!c->clkdm)
> arch/arm/mach-omap2/omap_hwmod.c:3001:	return c->clkdm->pwrdm.ptr;

I have fixed some of these dereferencing in hwmod to derive a clkdm/
pwrdm for a given hwmod by giving a precedence to a clkdm directly
associated with the hwmod and if missing only then looking for
something through the clk route. What I did miss is to update the
OMAP2/3 hwmod data file for some of the clks from where I was removing
the clkdm assocaitions (There are about ~10 clocks from $SUBJECT patch
which figure in hwmod data files out of the 75 from which I get rid of
the clkdms pointers)

> arch/arm/mach-omap2/clock.c:96:	if (!clk->clkdm_name)
> arch/arm/mach-omap2/clock.c:99:	clkdm = clkdm_lookup(clk->clkdm_name);
> arch/arm/mach-omap2/clock.c:102:			 clk->name, clk->clkdm_name);
> arch/arm/mach-omap2/clock.c:103:		clk->clkdm = clkdm;
> arch/arm/mach-omap2/clock.c:106:			 "clkdm %s\n", clk->name, clk->clkdm_name);

These are part of the init code to resolve clkdm_name into a clkdm
pointer.

> arch/arm/mach-omap2/clock.c:292:	if (clkdm_control&&  clk->clkdm)
> arch/arm/mach-omap2/clock.c:293:		clkdm_clk_disable(clk->clkdm, clk);
> arch/arm/mach-omap2/clock.c:332:	if (clkdm_control&&  clk->clkdm) {
> arch/arm/mach-omap2/clock.c:333:		ret = clkdm_clk_enable(clk->clkdm, clk);
> arch/arm/mach-omap2/clock.c:336:			     "%d\n", clk->name, clk->clkdm->name, ret);
> arch/arm/mach-omap2/clock.c:354:	if (clkdm_control&&  clk->clkdm)
> arch/arm/mach-omap2/clock.c:355:		clkdm_clk_disable(clk->clkdm, clk);

These are only applicable for gate clocks.

> arch/arm/mach-omap2/clock.c:441:	if (clk->clkdm != NULL)
> arch/arm/mach-omap2/clock.c:442:		pwrdm_state_switch(clk->clkdm->pwrdm.ptr);

This again part of disable unused clocks should also matter only for
gate clocks.

>
> That is just the result of a casual grep, not even a code analysis.
>
> Removing this data is not like removing some macros where one can get a
> compiler error if they turn out to be needed.  Problems with this ares
> only likely to show up at runtime.
>
> By the way, I hope you're testing the patches that you send to the lists,
> at the very least to the minimal PM testing that I do that is documented
> e.g. here:
>
> http://www.pwsan.com/omap/bootlogs/20120508/prcm_devel_a_3.5__0135f6a04642c192bdf4b36e06937d3387e174ff/

yes, I am, atleast with the platforms that I have access to,
2430sdp/N800/3430sdp/3630beagle-xm/4430panda/4460panda.

I don't have any 35xxevm/3517evm/5912osk or cmt3517 platforms.

regards,
Rajendra

>
> Otherwise the testing burden is just getting pushed to other people who
> already have too much to do.
>
> ...
>
> So to repeat myself on this:
>
> 1. The patch that removes some of the struct clk clkdm_name strings should
>     be part of or otherwise grouped with the CCF conversion patch series
>
> 2. The CCF conversion patch series needs to be fully PM-tested
>
>
> - Paul


WARNING: multiple messages have this Message-ID (diff)
From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: omap: clock: Get rid of unwanted clkdm assocations within clks
Date: Mon, 11 Jun 2012 14:31:57 +0530	[thread overview]
Message-ID: <4FD5B405.7040309@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1206080734350.14977@utopia.booyaka.com>

Hi Paul,

>> So why should getting rid of some *unused* data have any testing
>> overhead?
>
> Your definition of 'unused' seems to be different than mine:
>
> $ egrep -rn 'c(lk|)->clkdm' arch/arm/
> arch/arm/mach-omap2/omap_hwmod.c:560:	if (oh->_clk->clkdm&&  oh->_clk->clkdm->flags&  CLKDM_NO_AUTODEPS)
> arch/arm/mach-omap2/omap_hwmod.c:563:	return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
> arch/arm/mach-omap2/omap_hwmod.c:584:	if (oh->_clk->clkdm&&  oh->_clk->clkdm->flags&  CLKDM_NO_AUTODEPS)
> arch/arm/mach-omap2/omap_hwmod.c:587:	return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);

I did have a look at these (which are part of _add/_del_initiator_dep()
functions) while I was working on $SUBJECT patch, and was not very sure
of what these functions are expected to do.
They check for a CLKDM_NO_AUTODEPS flag which is not defined across any
clockdomain data files across any OMAP2+ platform.
What it then means is they add a sleep/static dependency for the
modules/hwmods clkdm with mpu on *all* platforms.
The AUTODEPS on the other hand are needed only on OMAP3 I guess, and
AUTODEPS need a sleep/wakeup (Not just a sleep dependency that
the above functions add) dependency not just with MPU but also with
DSP, besides AUTODEPS are already handled very well in the clockdomain
framework for OMAP3.

> arch/arm/mach-omap2/omap_hwmod.c:612:	if (!oh->_clk->clkdm)
> arch/arm/mach-omap2/omap_hwmod.c:2998:	if (!c->clkdm)
> arch/arm/mach-omap2/omap_hwmod.c:3001:	return c->clkdm->pwrdm.ptr;

I have fixed some of these dereferencing in hwmod to derive a clkdm/
pwrdm for a given hwmod by giving a precedence to a clkdm directly
associated with the hwmod and if missing only then looking for
something through the clk route. What I did miss is to update the
OMAP2/3 hwmod data file for some of the clks from where I was removing
the clkdm assocaitions (There are about ~10 clocks from $SUBJECT patch
which figure in hwmod data files out of the 75 from which I get rid of
the clkdms pointers)

> arch/arm/mach-omap2/clock.c:96:	if (!clk->clkdm_name)
> arch/arm/mach-omap2/clock.c:99:	clkdm = clkdm_lookup(clk->clkdm_name);
> arch/arm/mach-omap2/clock.c:102:			 clk->name, clk->clkdm_name);
> arch/arm/mach-omap2/clock.c:103:		clk->clkdm = clkdm;
> arch/arm/mach-omap2/clock.c:106:			 "clkdm %s\n", clk->name, clk->clkdm_name);

These are part of the init code to resolve clkdm_name into a clkdm
pointer.

> arch/arm/mach-omap2/clock.c:292:	if (clkdm_control&&  clk->clkdm)
> arch/arm/mach-omap2/clock.c:293:		clkdm_clk_disable(clk->clkdm, clk);
> arch/arm/mach-omap2/clock.c:332:	if (clkdm_control&&  clk->clkdm) {
> arch/arm/mach-omap2/clock.c:333:		ret = clkdm_clk_enable(clk->clkdm, clk);
> arch/arm/mach-omap2/clock.c:336:			     "%d\n", clk->name, clk->clkdm->name, ret);
> arch/arm/mach-omap2/clock.c:354:	if (clkdm_control&&  clk->clkdm)
> arch/arm/mach-omap2/clock.c:355:		clkdm_clk_disable(clk->clkdm, clk);

These are only applicable for gate clocks.

> arch/arm/mach-omap2/clock.c:441:	if (clk->clkdm != NULL)
> arch/arm/mach-omap2/clock.c:442:		pwrdm_state_switch(clk->clkdm->pwrdm.ptr);

This again part of disable unused clocks should also matter only for
gate clocks.

>
> That is just the result of a casual grep, not even a code analysis.
>
> Removing this data is not like removing some macros where one can get a
> compiler error if they turn out to be needed.  Problems with this ares
> only likely to show up at runtime.
>
> By the way, I hope you're testing the patches that you send to the lists,
> at the very least to the minimal PM testing that I do that is documented
> e.g. here:
>
> http://www.pwsan.com/omap/bootlogs/20120508/prcm_devel_a_3.5__0135f6a04642c192bdf4b36e06937d3387e174ff/

yes, I am, atleast with the platforms that I have access to,
2430sdp/N800/3430sdp/3630beagle-xm/4430panda/4460panda.

I don't have any 35xxevm/3517evm/5912osk or cmt3517 platforms.

regards,
Rajendra

>
> Otherwise the testing burden is just getting pushed to other people who
> already have too much to do.
>
> ...
>
> So to repeat myself on this:
>
> 1. The patch that removes some of the struct clk clkdm_name strings should
>     be part of or otherwise grouped with the CCF conversion patch series
>
> 2. The CCF conversion patch series needs to be fully PM-tested
>
>
> - Paul

  reply	other threads:[~2012-06-11  9:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 10:24 [PATCH] ARM: omap: clock: Get rid of unwanted clkdm assocations within clks Rajendra Nayak
2012-05-17 10:24 ` Rajendra Nayak
2012-06-07  6:28 ` Rajendra Nayak
2012-06-07  6:28   ` Rajendra Nayak
2012-06-07  7:07   ` Paul Walmsley
2012-06-07  7:07     ` Paul Walmsley
2012-06-07 10:52     ` Rajendra Nayak
2012-06-07 10:52       ` Rajendra Nayak
2012-06-08  7:40       ` Paul Walmsley
2012-06-08  7:40         ` Paul Walmsley
2012-06-08  8:08         ` Rajendra Nayak
2012-06-08  8:08           ` Rajendra Nayak
2012-06-08 14:24           ` Paul Walmsley
2012-06-08 14:24             ` Paul Walmsley
2012-06-11  9:01             ` Rajendra Nayak [this message]
2012-06-11  9:01               ` Rajendra Nayak

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=4FD5B405.7040309@ti.com \
    --to=rnayak@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@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 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.