From: Arnd Bergmann <arnd@arndb.de>
To: Stuart Menefy <stuart.menefy@st.com>
Cc: Peppe CAVALLARO <peppe.cavallaro@st.com>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
John Stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure
Date: Tue, 01 Mar 2011 16:43:19 +0000 [thread overview]
Message-ID: <201103011743.19847.arnd@arndb.de> (raw)
In-Reply-To: <4D6D0EA3.9000504@st.com>
On Tuesday 01 March 2011, Stuart Menefy wrote:
> On 24/02/11 17:20, Arnd Bergmann wrote:
>
> > Why is this code useful to you? In the scenarios I've seen, the
> > board can always assign a timer to a specific device in a fixed
> > way that can be describe in a board file or device tree.
>
> What we were trying to do was separate the code which actually manipulates
> the timer hardware from the code which wants that timer service. In this
> case it was a network device driver which is used on multiple SoC devices,
> while the timer hardware tends to differ from device to device.
Right. It certainly makes sense to have an well-defined interface between
the user and the provider of a timer interrupt.
> The other user of this code which we have is an OProfile driver, which
> with this change can now be independent of the hardware it is running on,
> while the previous version manipulated the timer hardware directly.
Ok.
> > Also, what is the difference between this and clkdev?
>
> clkdev can be used to find a struct clk, which is fine if you just want to
> read the time. In this instance we want to get interrupts from the timer
> hardware, which isn't supported by the clk infrastructure.
(adding Russell to Cc)
Is this something that could sensibly be added to clk/clkdev?
> If anything this duplicates clockevents. The main reason for not using
> clockevents was that nobody else does! Currently clockevents are
> used strictly for time keeping within the kernel, and most architectures
> only register those which are intended to be used for this purpose.
> We felt a bit nervous about adding code to register all the device's timers
> as clockevents, and having the network device driver pick up one of those
> for its own use.
I see. Using a clock_event_device for anything but the system timer tick
is currently not supported, so it certainly would not be straightforward.
I think you need a bit of both, clkdev and clockevent. I think the
options you have are:
1. copy the clkdev code to make it possible to associate a device with
a periodic timer.
2. extend the clkdev/clk code to handle periodic interrupts and reuse
the infrastructure there.
3. extend the clockevent code to make it possible for regular device
drivers to use a clockevent source.
I have no idea which makes the most sense (or if there are other ideas).
Maybe Russell, Thomas or John can comment.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Stuart Menefy <stuart.menefy@st.com>
Cc: Peppe CAVALLARO <peppe.cavallaro@st.com>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
John Stultz <johnstul@us.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Russell King - ARM Linux" <linux@arm.linux.org.uk>
Subject: Re: [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure
Date: Tue, 1 Mar 2011 17:43:19 +0100 [thread overview]
Message-ID: <201103011743.19847.arnd@arndb.de> (raw)
In-Reply-To: <4D6D0EA3.9000504@st.com>
On Tuesday 01 March 2011, Stuart Menefy wrote:
> On 24/02/11 17:20, Arnd Bergmann wrote:
>
> > Why is this code useful to you? In the scenarios I've seen, the
> > board can always assign a timer to a specific device in a fixed
> > way that can be describe in a board file or device tree.
>
> What we were trying to do was separate the code which actually manipulates
> the timer hardware from the code which wants that timer service. In this
> case it was a network device driver which is used on multiple SoC devices,
> while the timer hardware tends to differ from device to device.
Right. It certainly makes sense to have an well-defined interface between
the user and the provider of a timer interrupt.
> The other user of this code which we have is an OProfile driver, which
> with this change can now be independent of the hardware it is running on,
> while the previous version manipulated the timer hardware directly.
Ok.
> > Also, what is the difference between this and clkdev?
>
> clkdev can be used to find a struct clk, which is fine if you just want to
> read the time. In this instance we want to get interrupts from the timer
> hardware, which isn't supported by the clk infrastructure.
(adding Russell to Cc)
Is this something that could sensibly be added to clk/clkdev?
> If anything this duplicates clockevents. The main reason for not using
> clockevents was that nobody else does! Currently clockevents are
> used strictly for time keeping within the kernel, and most architectures
> only register those which are intended to be used for this purpose.
> We felt a bit nervous about adding code to register all the device's timers
> as clockevents, and having the network device driver pick up one of those
> for its own use.
I see. Using a clock_event_device for anything but the system timer tick
is currently not supported, so it certainly would not be straightforward.
I think you need a bit of both, clkdev and clockevent. I think the
options you have are:
1. copy the clkdev code to make it possible to associate a device with
a periodic timer.
2. extend the clkdev/clk code to handle periodic interrupts and reuse
the infrastructure there.
3. extend the clockevent code to make it possible for regular device
drivers to use a clockevent source.
I have no idea which makes the most sense (or if there are other ideas).
Maybe Russell, Thomas or John can comment.
Arnd
next prev parent reply other threads:[~2011-03-01 16:43 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 10:17 [PATCH 0/4] simple generic timer infrastructure and stmmac example Peppe CAVALLARO
2011-02-22 10:17 ` Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure Peppe CAVALLARO
2011-02-22 10:17 ` Peppe CAVALLARO
2011-02-24 17:20 ` Arnd Bergmann
2011-02-24 17:20 ` Arnd Bergmann
2011-03-01 15:20 ` Stuart Menefy
2011-03-01 15:20 ` Stuart Menefy
2011-03-01 16:43 ` Arnd Bergmann [this message]
2011-03-01 16:43 ` Arnd Bergmann
2011-03-01 20:26 ` Russell King - ARM Linux
2011-03-01 20:26 ` Russell King - ARM Linux
2011-03-01 20:41 ` Arnd Bergmann
2011-03-01 20:41 ` Arnd Bergmann
2011-03-01 16:48 ` Thomas Gleixner
2011-03-01 16:48 ` Thomas Gleixner
2011-03-02 17:35 ` Peppe CAVALLARO
2011-03-02 17:35 ` Peppe CAVALLARO
2011-03-03 8:45 ` Arnd Bergmann
2011-03-03 8:45 ` Arnd Bergmann
2011-03-03 10:25 ` Peppe CAVALLARO
2011-03-03 10:25 ` Peppe CAVALLARO
2011-03-03 13:55 ` Arnd Bergmann
2011-03-03 13:55 ` Arnd Bergmann
2011-03-04 6:53 ` Peppe CAVALLARO
2011-03-04 6:53 ` Peppe CAVALLARO
2012-06-12 3:04 ` Paul Mundt
2012-06-12 3:04 ` Paul Mundt
2011-02-22 10:17 ` [PATCH (sh-2.6) 2/4] sh_timer: add the support to use the generic Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (sh-2.6) 2/4] sh_timer: add the support to use the generic timer Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (net-2.6) 3/4] stmmac: switch to use the new " Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (net-2.6) 3/4] stmmac: switch to use the new generic timer interface Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (net-2.6) 4/4] stmmac: rework and improvement the stmmac Peppe CAVALLARO
2011-02-22 10:17 ` [PATCH (net-2.6) 4/4] stmmac: rework and improvement the stmmac timer Peppe CAVALLARO
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=201103011743.19847.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=stuart.menefy@st.com \
--cc=tglx@linutronix.de \
/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.