All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
	linux-arm-kernel@lists.infradead.org, mturquette@linaro.org,
	jiada_wang@mentor.com, broonie@kernel.org, vapier@gentoo.org,
	ralf@linux-mips.org, kyungmin.park@samsung.com,
	myungjoo.ham@samsung.com, shawn.guo@linaro.org,
	sebastian.hesselbarth@gmail.com, LW@KARO-electronics.de,
	t.figa@samsung.com, g.liakhovetski@gmx.de,
	laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	linux-mips@linux-mips.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations
Date: Sat, 24 Aug 2013 17:16:43 +0200	[thread overview]
Message-ID: <5218CE5B.1020906@gmail.com> (raw)
In-Reply-To: <20130823231314.GR6617@n2100.arm.linux.org.uk>

On 08/24/2013 01:13 AM, Russell King - ARM Linux wrote:
> On Fri, Aug 23, 2013 at 05:03:45PM +0200, Sylwester Nawrocki wrote:
>> >  This patch adds common __clk_get(), __clk_put() clkdev helpers which
>> >  replace their platform specific counterparts when the common clock
>> >  API is enabled.
>> >
>> >  The owner module pointer field is added to struct clk so a reference
>> >  to the clock supplier module can be taken by the clock consumers.
>> >
>> >  Signed-off-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>> >  Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>
> I'm mostly happy with this now.
>
>> >  +int __clk_get(struct clk *clk)
>> >  +{
>> >  +	if (clk&&  !try_module_get(clk->owner))
>> >  +		return 0;
>> >  +
>> >  +	return 1;
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_get);
>> >  +
>> >  +void __clk_put(struct clk *clk)
>> >  +{
>> >  +	if (WARN_ON_ONCE(IS_ERR(clk)))
>> >  +		return;
>> >  +
>> >  +	if (clk)
>> >  +		module_put(clk->owner);
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_put);
>
> Why are these exported?  clkdev can only be built into the kernel, as can
> the common clk framework - they can't be modular.  So why would a module
> wish to access these directly?

I must have been mislead by the fact that some ARM sub-architecture exports
those, have added them initially and then didn't think enough about it and
left these in. Actually, at some point I noticed the exporting is not 
needed,
but never did get around to remove it. Thanks. The updated series to 
follow.

WARNING: multiple messages have this Message-ID (diff)
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations
Date: Sat, 24 Aug 2013 15:16:43 +0000	[thread overview]
Message-ID: <5218CE5B.1020906@gmail.com> (raw)
In-Reply-To: <20130823231314.GR6617@n2100.arm.linux.org.uk>

On 08/24/2013 01:13 AM, Russell King - ARM Linux wrote:
> On Fri, Aug 23, 2013 at 05:03:45PM +0200, Sylwester Nawrocki wrote:
>> >  This patch adds common __clk_get(), __clk_put() clkdev helpers which
>> >  replace their platform specific counterparts when the common clock
>> >  API is enabled.
>> >
>> >  The owner module pointer field is added to struct clk so a reference
>> >  to the clock supplier module can be taken by the clock consumers.
>> >
>> >  Signed-off-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>> >  Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>
> I'm mostly happy with this now.
>
>> >  +int __clk_get(struct clk *clk)
>> >  +{
>> >  +	if (clk&&  !try_module_get(clk->owner))
>> >  +		return 0;
>> >  +
>> >  +	return 1;
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_get);
>> >  +
>> >  +void __clk_put(struct clk *clk)
>> >  +{
>> >  +	if (WARN_ON_ONCE(IS_ERR(clk)))
>> >  +		return;
>> >  +
>> >  +	if (clk)
>> >  +		module_put(clk->owner);
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_put);
>
> Why are these exported?  clkdev can only be built into the kernel, as can
> the common clk framework - they can't be modular.  So why would a module
> wish to access these directly?

I must have been mislead by the fact that some ARM sub-architecture exports
those, have added them initially and then didn't think enough about it and
left these in. Actually, at some point I noticed the exporting is not 
needed,
but never did get around to remove it. Thanks. The updated series to 
follow.





WARNING: multiple messages have this Message-ID (diff)
From: sylvester.nawrocki@gmail.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations
Date: Sat, 24 Aug 2013 17:16:43 +0200	[thread overview]
Message-ID: <5218CE5B.1020906@gmail.com> (raw)
In-Reply-To: <20130823231314.GR6617@n2100.arm.linux.org.uk>

On 08/24/2013 01:13 AM, Russell King - ARM Linux wrote:
> On Fri, Aug 23, 2013 at 05:03:45PM +0200, Sylwester Nawrocki wrote:
>> >  This patch adds common __clk_get(), __clk_put() clkdev helpers which
>> >  replace their platform specific counterparts when the common clock
>> >  API is enabled.
>> >
>> >  The owner module pointer field is added to struct clk so a reference
>> >  to the clock supplier module can be taken by the clock consumers.
>> >
>> >  Signed-off-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>> >  Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>
> I'm mostly happy with this now.
>
>> >  +int __clk_get(struct clk *clk)
>> >  +{
>> >  +	if (clk&&  !try_module_get(clk->owner))
>> >  +		return 0;
>> >  +
>> >  +	return 1;
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_get);
>> >  +
>> >  +void __clk_put(struct clk *clk)
>> >  +{
>> >  +	if (WARN_ON_ONCE(IS_ERR(clk)))
>> >  +		return;
>> >  +
>> >  +	if (clk)
>> >  +		module_put(clk->owner);
>> >  +}
>> >  +EXPORT_SYMBOL(__clk_put);
>
> Why are these exported?  clkdev can only be built into the kernel, as can
> the common clk framework - they can't be modular.  So why would a module
> wish to access these directly?

I must have been mislead by the fact that some ARM sub-architecture exports
those, have added them initially and then didn't think enough about it and
left these in. Actually, at some point I noticed the exporting is not 
needed,
but never did get around to remove it. Thanks. The updated series to 
follow.

  reply	other threads:[~2013-08-24 15:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 15:03 [PATCH v3 0/5] clk: clock deregistration support Sylwester Nawrocki
2013-08-23 15:03 ` Sylwester Nawrocki
2013-08-23 15:03 ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 1/5] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 2/5] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:22   ` Sylwester Nawrocki
2013-08-23 15:22     ` Sylwester Nawrocki
2013-08-23 15:22     ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 23:13   ` Russell King - ARM Linux
2013-08-23 23:13     ` Russell King - ARM Linux
2013-08-23 23:13     ` Russell King - ARM Linux
2013-08-24 15:16     ` Sylwester Nawrocki [this message]
2013-08-24 15:16       ` Sylwester Nawrocki
2013-08-24 15:16       ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 4/5] clk: Assign module owner of a clock being registered Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 5/5] clk: Implement clk_unregister Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki
2013-08-23 15:03   ` Sylwester Nawrocki

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=5218CE5B.1020906@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=LW@KARO-electronics.de \
    --cc=broonie@kernel.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=jiada_wang@mentor.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mturquette@linaro.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=ralf@linux-mips.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=shawn.guo@linaro.org \
    --cc=t.figa@samsung.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /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.