linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lethal@linux-sh.org (Paul Mundt)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/11] ST SPEAr: Added basic header files for SPEAr platform
Date: Wed, 10 Mar 2010 23:16:46 +0900	[thread overview]
Message-ID: <20100310141645.GB22729@linux-sh.org> (raw)
In-Reply-To: <4B977067.3050108@st.com>

On Wed, Mar 10, 2010 at 03:41:51PM +0530, Viresh KUMAR wrote:
> On 3/10/2010 3:01 PM, Linus Walleij wrote:
> > 2010/3/10 Viresh KUMAR <viresh.kumar@st.com>:
> >> Linus Walleij:
> >>> If this file is only supposed to be used from plat-spear/time.c, move it down
> >>> into plat-spear/gpt.h and #include "gpt.h" so noone else will
> >>> accidentally use it.
> >>
> >> GPT's on SPEAr can be used from time.c, platform specific drivers and machine
> >> specific drivers or any driver wishing to use hardware timer.
> >> In first two cases "gpt.h" will work, but in rest of cases we need gpt.h to be
> >> in plat-spear/include/plat
> >>
> >> Is it okay?
> > 
> > If you have or have already planned to write such platform, machine
> > or subsystem drivers, it's OK, if there are no such users and you cannot
> > easily give one, it's overdesigned IMHO. Some realistic examples of such
> > drivers will make me change my mind :-)
> > 
> > The reason I persist is that I've seen such unutilized timer API:s before and
> > no other user than the system timer in sight. I never understood what they
> > were to be used for, and I still don't, so help me understand. The kernel
> > has many internal timer API:s based on clockevent available already so
> > why add yet another, platform-specific one?
> > 
> 
> As you may have seen in spear.h files in mach folders, we have multiple hardware
> timers in our design (3 in spear3xx, 4 in spear6xx and each timer have two
> independent channels. That doubles the timers count, so it is 6 and 8).
> One timer (or two channels) are used by clock event and clock source, but rest of
> the timers are still available. So we need some way to export this functionality
> of our hardware. It can be considered simply as a driver for GPT.
> 
> What do you say?
> 
This is hardly a unique situation for your platform, this is true for
most platforms. There's no reason why clockevents couldn't just be
extended and drivers could then just grab unused clockevents and pin them
accordingly. Most of the infrastructure is already in place for something
like that, without really having to do anything special.

Having said that, most drivers have pretty lame reasons for trying to get
at fixed timer channels, and most of the time they can easily get by with
an hrtimer instead. There's also the issue that you're effectively
bypassing nohz by having some timer channel off on the side doing who
knows what. You would need a pretty compelling reason for why you are
sidestepping all of the existing infrastructure anyways.

There are still some legitimate users for dedicated timers that we may
want to have decoupled from sched_clock() (like the trace clock) and so
on, but when people start rolling their own timer APIs it always sets off
warning bells, as it's almost always because they want to do something in
a driver that existing infrastructure already provides for them.

In cases like these, it's better to see what precisely you plan to do
with these timer channels before getting in to API semantics, though.

  reply	other threads:[~2010-03-10 14:16 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03  5:07 [PATCH 00/11] Adding Support for SPEAr Platform under ARM architecture Viresh KUMAR
2010-03-03  5:07 ` [PATCH 01/11] ST SPEAr: Added ARM PrimeXsys System Controller SP810 header file Viresh KUMAR
2010-03-03  5:07   ` [PATCH 02/11] ST SPEAr: Added basic header files for SPEAr3xx machine family Viresh KUMAR
2010-03-03  5:07     ` [PATCH 03/11] ST SPEAr: Added basic header files for SPEAr6xx " Viresh KUMAR
2010-03-03  5:07       ` [PATCH 04/11] ST SPEAr: Added basic header files for SPEAr platform Viresh KUMAR
2010-03-03  5:07         ` [PATCH 05/11] ST SPEAr: Added clock framework for SPEAr platform and machines Viresh KUMAR
2010-03-03  5:07           ` [PATCH 06/11] ST SPEAr: Added source files for SPEAr platform Viresh KUMAR
2010-03-03  5:07             ` [PATCH 07/11] ST SPEAr: Added source files for SPEAr3xx machine family Viresh KUMAR
2010-03-03  5:07               ` [PATCH 08/11] ST SPEAr: Added source files for SPEAr6xx " Viresh KUMAR
2010-03-03  5:07                 ` [PATCH 09/11] ST SPEAr: Added support for SPEAr platform and machines in arch/arm/ Viresh KUMAR
2010-03-03  5:07                   ` [PATCH 10/11] ST SPEAr: Added default configuration files for SPEAr machines Viresh KUMAR
2010-03-03  5:07                     ` [PATCH 11/11] ST SPEAr: Updated Maintainers and added Documentation/arm/SPEAr Viresh KUMAR
2010-03-11 20:18                     ` [PATCH 10/11] ST SPEAr: Added default configuration files for SPEAr machines Linus Walleij
2010-03-11 20:26                       ` Russell King - ARM Linux
2010-03-12  4:12                       ` Viresh KUMAR
2010-03-09  6:46               ` [PATCH 07/11] ST SPEAr: Added source files for SPEAr3xx machine family Linus Walleij
2010-03-09  7:05                 ` Viresh KUMAR
2010-03-10  5:15                   ` Linus Walleij
2010-03-10  6:10                     ` viresh kumar
2010-03-11 10:41                 ` Russell King - ARM Linux
2010-03-12  5:19                   ` Viresh KUMAR
2010-03-11 11:22             ` [PATCH 06/11] ST SPEAr: Added source files for SPEAr platform Linus Walleij
2010-03-11  7:00           ` [PATCH 05/11] ST SPEAr: Added clock framework for SPEAr platform and machines Linus Walleij
2010-03-11 10:18             ` Shiraz HASHIM
2010-03-12  8:46               ` Linus Walleij
2010-03-12  4:19             ` Viresh KUMAR
2010-03-11 10:28           ` Russell King - ARM Linux
2010-03-12  4:22             ` Viresh KUMAR
2010-03-10  5:40         ` [PATCH 04/11] ST SPEAr: Added basic header files for SPEAr platform Linus Walleij
2010-03-10  6:32           ` Viresh KUMAR
2010-03-10  9:31             ` Linus Walleij
2010-03-10 10:11               ` Viresh KUMAR
2010-03-10 14:16                 ` Paul Mundt [this message]
2010-03-10 16:36                   ` Thomas Gleixner
2010-03-10 22:16                     ` Tony Lindgren
2010-03-10 23:29                       ` Paul Mundt
2010-03-10 23:42                         ` Thomas Gleixner
2010-03-11  6:43                 ` Linus Walleij
2010-03-11  9:47                   ` Shiraz HASHIM
2010-03-11 11:26                     ` Linus Walleij
2010-03-09 20:42     ` [PATCH 02/11] ST SPEAr: Added basic header files for SPEAr3xx machine family Linus Walleij
2010-03-10  6:01       ` Viresh KUMAR
2010-03-10  6:07         ` Linus Walleij
2010-03-11 10:33     ` Russell King - ARM Linux
2010-03-12  4:39       ` Viresh KUMAR
2010-03-09 20:14   ` [PATCH 01/11] ST SPEAr: Added ARM PrimeXsys System Controller SP810 header file Linus Walleij
2010-03-10  5:09     ` Viresh KUMAR
2010-03-11 10:45     ` Russell King - ARM Linux
2010-03-12  5:19       ` Viresh KUMAR
2010-03-07 15:54 ` [PATCH 00/11] Adding Support for SPEAr Platform under ARM architecture viresh kumar
2010-03-08 13:48   ` Armando VISCONTI

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=20100310141645.GB22729@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.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 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).