From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Tomeu Vizoso
<tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rabin Vincent
<rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [RFC 3/5] clk: use struct clk only for external API
Date: Fri, 27 Jun 2014 16:37:45 -0600 [thread overview]
Message-ID: <53ADF239.9050008@wwwdotorg.org> (raw)
In-Reply-To: <1403855872-14749-4-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
On 06/27/2014 01:57 AM, Tomeu Vizoso wrote:
> From: Rabin Vincent <rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
>
> In order to provide per-user accounting, this separates the struct clk
> used in the common clock framework into two structures 'struct clk_core'
> and 'struct clk'. struct clk_core will be used for internal
> manipulation and struct clk will be used in the clock API
> implementation.
>
> In this patch, struct clk is simply renamed to struct clk_core and a new
> struct clk is implemented which simply wraps it. In the next patch, the
> new struct clk will be used to implement per-user clock enable
> accounting.
> diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
> -struct clk {
> +struct clk_core {
> const char *name;
> const struct clk_ops *ops;
> struct clk_hw *hw;
> struct module *owner;
> - struct clk *parent;
> + struct clk_core *parent;
> const char **parent_names;
> - struct clk **parents;
> + struct clk_core **parents;
> u8 num_parents;
> u8 new_parent_index;
> unsigned long rate;
> unsigned long new_rate;
> - struct clk *new_parent;
> - struct clk *new_child;
> + struct clk_core *new_parent;
> + struct clk_core *new_child;
> unsigned long flags;
> unsigned int enable_count;
> unsigned int prepare_count;
> @@ -55,6 +55,10 @@ struct clk {
> struct kref ref;
> };
>
> +struct clk {
> + struct clk_core clk;
> +};
I'm confused why that field isn't a pointer instead. Don't we want to
end up with the following data structure:
(dev a's) struct clk --------v
struct clk_core -----> struct clk_hw
(dev b's) struct clk --------^
Where all 3 arrows are pointers? (and struct clk_core probably contains
a list of the struct clk that point at it).
Otherwise, we end up creating a whole struct clk_core for each client.
WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 3/5] clk: use struct clk only for external API
Date: Fri, 27 Jun 2014 16:37:45 -0600 [thread overview]
Message-ID: <53ADF239.9050008@wwwdotorg.org> (raw)
In-Reply-To: <1403855872-14749-4-git-send-email-tomeu.vizoso@collabora.com>
On 06/27/2014 01:57 AM, Tomeu Vizoso wrote:
> From: Rabin Vincent <rabin.vincent@stericsson.com>
>
> In order to provide per-user accounting, this separates the struct clk
> used in the common clock framework into two structures 'struct clk_core'
> and 'struct clk'. struct clk_core will be used for internal
> manipulation and struct clk will be used in the clock API
> implementation.
>
> In this patch, struct clk is simply renamed to struct clk_core and a new
> struct clk is implemented which simply wraps it. In the next patch, the
> new struct clk will be used to implement per-user clock enable
> accounting.
> diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
> -struct clk {
> +struct clk_core {
> const char *name;
> const struct clk_ops *ops;
> struct clk_hw *hw;
> struct module *owner;
> - struct clk *parent;
> + struct clk_core *parent;
> const char **parent_names;
> - struct clk **parents;
> + struct clk_core **parents;
> u8 num_parents;
> u8 new_parent_index;
> unsigned long rate;
> unsigned long new_rate;
> - struct clk *new_parent;
> - struct clk *new_child;
> + struct clk_core *new_parent;
> + struct clk_core *new_child;
> unsigned long flags;
> unsigned int enable_count;
> unsigned int prepare_count;
> @@ -55,6 +55,10 @@ struct clk {
> struct kref ref;
> };
>
> +struct clk {
> + struct clk_core clk;
> +};
I'm confused why that field isn't a pointer instead. Don't we want to
end up with the following data structure:
(dev a's) struct clk --------v
struct clk_core -----> struct clk_hw
(dev b's) struct clk --------^
Where all 3 arrows are pointers? (and struct clk_core probably contains
a list of the struct clk that point at it).
Otherwise, we end up creating a whole struct clk_core for each client.
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Thierry Reding <thierry.reding@gmail.com>,
Mike Turquette <mturquette@linaro.org>,
Rabin Vincent <rabin.vincent@stericsson.com>,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 3/5] clk: use struct clk only for external API
Date: Fri, 27 Jun 2014 16:37:45 -0600 [thread overview]
Message-ID: <53ADF239.9050008@wwwdotorg.org> (raw)
In-Reply-To: <1403855872-14749-4-git-send-email-tomeu.vizoso@collabora.com>
On 06/27/2014 01:57 AM, Tomeu Vizoso wrote:
> From: Rabin Vincent <rabin.vincent@stericsson.com>
>
> In order to provide per-user accounting, this separates the struct clk
> used in the common clock framework into two structures 'struct clk_core'
> and 'struct clk'. struct clk_core will be used for internal
> manipulation and struct clk will be used in the clock API
> implementation.
>
> In this patch, struct clk is simply renamed to struct clk_core and a new
> struct clk is implemented which simply wraps it. In the next patch, the
> new struct clk will be used to implement per-user clock enable
> accounting.
> diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
> -struct clk {
> +struct clk_core {
> const char *name;
> const struct clk_ops *ops;
> struct clk_hw *hw;
> struct module *owner;
> - struct clk *parent;
> + struct clk_core *parent;
> const char **parent_names;
> - struct clk **parents;
> + struct clk_core **parents;
> u8 num_parents;
> u8 new_parent_index;
> unsigned long rate;
> unsigned long new_rate;
> - struct clk *new_parent;
> - struct clk *new_child;
> + struct clk_core *new_parent;
> + struct clk_core *new_child;
> unsigned long flags;
> unsigned int enable_count;
> unsigned int prepare_count;
> @@ -55,6 +55,10 @@ struct clk {
> struct kref ref;
> };
>
> +struct clk {
> + struct clk_core clk;
> +};
I'm confused why that field isn't a pointer instead. Don't we want to
end up with the following data structure:
(dev a's) struct clk --------v
struct clk_core -----> struct clk_hw
(dev b's) struct clk --------^
Where all 3 arrows are pointers? (and struct clk_core probably contains
a list of the struct clk that point at it).
Otherwise, we end up creating a whole struct clk_core for each client.
next prev parent reply other threads:[~2014-06-27 22:37 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 7:57 [RFC 0/5] Per-user clock constraints Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 7:57 ` [RFC 1/5] clk: Add temporary mapping to the existing API Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 7:57 ` [RFC 3/5] clk: use struct clk only for external API Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
[not found] ` <1403855872-14749-4-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-06-27 22:37 ` Stephen Warren [this message]
2014-06-27 22:37 ` Stephen Warren
2014-06-27 22:37 ` Stephen Warren
[not found] ` <53ADF239.9050008-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-06-30 19:43 ` Rabin Vincent
2014-06-30 19:43 ` Rabin Vincent
2014-06-30 19:43 ` Rabin Vincent
2014-06-27 7:57 ` [RFC 4/5] clk: per-user clock accounting for debug Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 22:44 ` Stephen Warren
2014-06-27 22:44 ` Stephen Warren
[not found] ` <53ADF3C8.2060702-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-06-27 22:51 ` Stephen Warren
2014-06-27 22:51 ` Stephen Warren
2014-06-27 22:51 ` Stephen Warren
2014-06-30 19:49 ` Rabin Vincent
2014-06-30 19:49 ` Rabin Vincent
2014-06-30 19:49 ` Rabin Vincent
[not found] ` <1403855872-14749-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-06-27 7:57 ` [RFC 2/5] clk: Move all drivers to use internal API Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 7:57 ` [RFC 5/5] clk: Add floor and ceiling constraints to clock rates Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
2014-06-27 7:57 ` Tomeu Vizoso
[not found] ` <1403855872-14749-6-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2014-06-27 22:57 ` Stephen Warren
2014-06-27 22:57 ` Stephen Warren
2014-06-27 22:57 ` Stephen Warren
2014-06-27 23:10 ` Thierry Reding
2014-06-27 23:10 ` Thierry Reding
2014-07-03 14:02 ` Tomeu Vizoso
2014-07-03 14:02 ` Tomeu Vizoso
2014-06-27 22:30 ` [RFC 0/5] Per-user clock constraints Stephen Warren
2014-06-27 22:30 ` Stephen Warren
2014-06-27 22:30 ` Stephen Warren
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=53ADF239.9050008@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.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.