mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry <dbaryshkov@gmail.com>
To: "Haavard Skinnemoen" <haavard.skinnemoen@atmel.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	hskinnemoen@atmel.com, domen.puncer@telargo.com,
	lethal@linux-sh.org, tony@atomide.com,
	rmk+kernel@arm.linux.org.uk, paul@pwsan.com
Subject: Re: [PATCH 1/3] Clocklib: add generic framework for managing clocks.
Date: Wed, 26 Mar 2008 19:52:34 +0300	[thread overview]
Message-ID: <bc64b4640803260952s58ad0645ve11766fdfa45e785@mail.gmail.com> (raw)
In-Reply-To: <20080326170441.795fb928@hskinnemo-gx620.norway.atmel.com>

Hi,

2008/3/26, Haavard Skinnemoen <haavard.skinnemoen@atmel.com>:
> On Wed, 26 Mar 2008 18:52:03 +0300
>  Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
>
>  > +struct clk {
>  > +     struct list_head node;
>  > +     struct clk      *parent;
>  > +
>  > +     const char      *name;
>  > +     struct module   *owner;
>  > +
>  > +     int             users;
>  > +     unsigned long   rate;
>  > +     int             delay;
>  > +
>  > +     int (*can_get)  (struct clk *, struct device *);
>  > +     int (*set_parent) (struct clk *, struct clk *);
>  > +     int (*enable)   (struct clk *);
>  > +     void (*disable) (struct clk *);
>  > +     unsigned long (*getrate) (struct clk*);
>  > +     int (*setrate)  (struct clk *, unsigned long);
>  > +     long (*roundrate) (struct clk *, unsigned long);
>  > +
>  > +     void            *priv;
>  > +};
>
>
> Hmm...this is exactly twice as big as the struct I'm currently using,
>  it doesn't contain all the fields I need, and it's undocumented.

I've added a more sofisticated arch convertion patch (the clocklib for
ARM PXA chips).

Basically mode becomes enable/disable (however it may be better to merge back
those pointers into one function). And dev and index go to priv data.

The documentation will come later.

>
>  I have quite a few clocks, so the increased memory consumption is quite
>  significant. What are the advantages of this?

At maximum 55, IIUC. I counted 32 or so additional bytes in the struct
(over avr32-specific one). That would count up to 1.5 K overhead. Is
that really too much for current kernels?


OTOH this would bring unification of platform code, allow
configurations when a non-platform driver would provide it's own
clocks (think about multi-function companion chips when there is a
"core" which manages "clocks" for it's "periferal" devices. Currently
if one tries to implement such driver, he is forced to either bind it
to platform code, or to implement non-standard
my_device_clock_enable()-like functions.

Also you aren't forced to use this API. simply don't select
HAVE_CLOCK_LIB and leave
all things as they are. E.g. gpiolib is now merged, however not all
gpio-providing platforms
are using it.

-- 
With best wishes
Dmitry

  parent reply	other threads:[~2008-03-26 16:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26 15:49 [PATCH 0/3] Clocklib: generic clocks framework Dmitry Baryshkov
2008-03-26 15:52 ` [PATCH 1/3] Clocklib: add generic framework for managing clocks Dmitry Baryshkov
2008-03-26 16:04   ` Haavard Skinnemoen
2008-03-26 16:14     ` Paul Mundt
2008-03-26 17:04       ` Dmitry
2008-03-26 20:09       ` Russell King
2008-03-26 16:52     ` Dmitry [this message]
2008-03-26 17:44       ` Paul Mundt
2008-03-27  9:52         ` Dmitry
2008-03-26 17:44       ` Juergen Beisert
2008-03-27  9:06       ` Haavard Skinnemoen
2008-03-27  9:18         ` Russell King
2008-03-27  9:26           ` Haavard Skinnemoen
2008-03-27  9:33             ` Russell King
2008-03-27  9:50               ` Paul Mundt
2008-03-27  9:53               ` Haavard Skinnemoen
2008-03-27 10:08                 ` Dmitry
2008-03-27 10:20                   ` Haavard Skinnemoen
2008-03-27 13:33                     ` Dmitry
2008-03-27  9:29           ` pHilipp Zabel
2008-03-27  9:36             ` Russell King
2008-03-28 14:23     ` Pavel Machek
2008-03-29 12:36       ` Haavard Skinnemoen
2008-03-26 15:52 ` [PATCH 2/3] Clocklib: debugfs support Dmitry Baryshkov
2008-03-26 15:53 ` [PATCH 3/3] Clocklib: support sa1100 sub-arch Dmitry Baryshkov
2008-03-26 16:17 ` [PATCH 4/4] Clocklib: support ARM pxa sub-arch Dmitry Baryshkov
2008-06-26 12:50 [PATCH 0/3] Clocklib: generic framework for clocks managing [v3] Dmitry Baryshkov
2008-06-26 12:51 ` [PATCH 1/3] Clocklib: add generic framework for managing clocks Dmitry Baryshkov
2008-06-26 15:00   ` pHilipp Zabel
2008-06-26 15:03     ` Dmitry Baryshkov
2008-07-03 20:31   ` Ben Dooks
2008-07-04  8:44     ` Pavel Machek
2008-07-04  9:04     ` Dmitry Baryshkov
2008-07-04  9:12       ` Haavard Skinnemoen

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=bc64b4640803260952s58ad0645ve11766fdfa45e785@mail.gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=domen.puncer@telargo.com \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=hskinnemoen@atmel.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=tony@atomide.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

all inboxes | Powered by JetHome®