From: Archit Taneja <archit@ti.com>
To: Rajendra Nayak <rnayak@ti.com>
Cc: paul@pwsan.com, tomi.valkeinen@ti.com, linux-omap@vger.kernel.org
Subject: Re: [RFC 1/2] ARM: OMAP2+: hwmod: Add refcounting for modulemode shared by multiple hwmods
Date: Tue, 27 May 2014 16:19:20 +0530 [thread overview]
Message-ID: <53846DB0.2010809@ti.com> (raw)
In-Reply-To: <538466F1.3070806@ti.com>
Hi,
On Tuesday 27 May 2014 03:50 PM, Rajendra Nayak wrote:
> On Monday 26 May 2014 04:14 PM, Archit Taneja wrote:
>> Generally, IP blocks/modules within a clock domain each have their own
>> CM_x_CLKCTRL register, each having it's own MODULEMODE field to manage the
>> module.
<snip>
>> @@ -2751,6 +2820,13 @@ static int __init _register(struct omap_hwmod *oh)
>> if (_lookup(oh->name))
>> return -EEXIST;
>>
>> + if (oh->prcm.omap4.flags & HWMOD_OMAP4_MODULEMODE_SHARED &&
>> + !oh->prcm.omap4.modulemode_ref) {
>
> You might also want to check for someone populating a modulemode_ref but
> failing to populate the flag?
>
> Alternatively, Since you expect a modulemode_ref to be always available for all modules which
> share modulemode, that in itself can be used to identify such modules without the
> need of an additional flag?
It does seem redundant to have a flag at the moment. But the flag make
things more visible. 'prcm.omap4.modulemode' seems to work without a
flag too, so I suppose I'll remove the flag.
>
>> + pr_err("omap_hwmod: %s shares modulemode, but doesn't hold a ref to it\n",
>> + oh->name);
>> + return -EINVAL;
>> + }
>> +
>> list_add_tail(&oh->node, &omap_hwmod_list);
>>
>> INIT_LIST_HEAD(&oh->master_ports);
>> @@ -2759,6 +2835,15 @@ static int __init _register(struct omap_hwmod *oh)
>>
>> oh->_state = _HWMOD_STATE_REGISTERED;
>>
>> + if (oh->prcm.omap4.flags & HWMOD_OMAP4_MODULEMODE_SHARED) {
>> + struct modulemode_shared *mmode = oh->prcm.omap4.modulemode_ref;
>> +
>> + if (!mmode->registered) {
>> + spin_lock_init(&mmode->lock);
>> + mmode->registered = true;
>
> If this is only used to keep track of the spin_lock being initialized, maybe it'll be
> more readable if you just call it mmode->spin_lock_init = true.
Yes, I'll fix this.
Archit
next prev parent reply other threads:[~2014-05-27 10:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 10:26 [PATCH] ARM: OMAP5: DSS hwmod data Tomi Valkeinen
2014-03-12 10:26 ` [PATCH] ARM: OMAP5: Add omap5 DSS related " Tomi Valkeinen
2014-03-12 10:33 ` [PATCH] ARM: OMAP5: DSS " Tomi Valkeinen
2014-03-16 11:41 ` Dmitry Lifshitz
2014-03-17 6:13 ` Tomi Valkeinen
2014-03-17 13:22 ` Dmitry Lifshitz
2014-03-17 13:28 ` Tomi Valkeinen
2014-03-17 14:22 ` Dmitry Lifshitz
2014-03-18 5:29 ` Tomi Valkeinen
2014-03-18 8:19 ` Dmitry Lifshitz
2014-03-18 8:37 ` Tomi Valkeinen
2014-03-18 12:23 ` Dmitry Lifshitz
2014-05-08 4:37 ` Paul Walmsley
2014-05-08 5:48 ` Archit Taneja
2014-05-08 16:01 ` Paul Walmsley
2014-05-09 6:19 ` Archit Taneja
2014-05-09 6:36 ` Tomi Valkeinen
2014-05-14 19:44 ` Paul Walmsley
2014-05-26 10:44 ` [RFC 1/2] ARM: OMAP2+: hwmod: Add refcounting for modulemode shared by multiple hwmods Archit Taneja
2014-05-26 10:44 ` [RFC 2/2] ARM: OMAP5: hwmod data: Make DSS hwmods share MODULEMODE fields Archit Taneja
2014-05-27 10:20 ` [RFC 1/2] ARM: OMAP2+: hwmod: Add refcounting for modulemode shared by multiple hwmods Rajendra Nayak
2014-05-27 10:49 ` Archit Taneja [this message]
2014-06-17 9:54 ` [RFC v2 0/2] arm: omap2+: hwmod: Allow hwmods to share same modulemode register filed Archit Taneja
2014-06-17 9:54 ` [RFC v2 1/2] arm: omap2+: hwmod: Add refcounting for modulemode shared by multiple hwmods Archit Taneja
2014-06-17 9:54 ` [RFC v2 2/2] arm: omap5 hwmod data: Example: Make DSS hwmods share MODULEMODE fields Archit Taneja
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=53846DB0.2010809@ti.com \
--to=archit@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=tomi.valkeinen@ti.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).