Thread (5 messages) flat view 5 messages, 2 authors, 2011-02-07

[PATCH 3/4] ARM: Xilinx: Adding timer support to the platform

From: Jamie Iles <hidden>
Date: 2011-02-07 14:59:04
Also in: lkml

Possibly related (same subject, not in this thread)

On Mon, Feb 07, 2011 at 07:16:01AM -0700, John Linn wrote:
quoted
-----Original Message-----
From: Jamie Iles [mailto:jamie at jamieiles.com]
Sent: Saturday, February 05, 2011 6:04 PM
To: John Linn
Cc: linux-arm-kernel at lists.infradead.org;
linux-kernel at vger.kernel.org; linux at arm.linux.org.uk;
quoted
catalin.marinas at arm.com; glikely at secretlab.ca; Kiran Sutariya
Subject: Re: [PATCH 3/4] ARM: Xilinx: Adding timer support to the
platform
quoted
Hi John,

A couple more nitpicks.

Jamie

On Sat, Feb 05, 2011 at 09:17:16AM -0700, John Linn wrote:
quoted
+static irqreturn_t xttcpss_clock_event_interrupt(int irq, void
*dev_id)
quoted
quoted
+{
+	struct clock_event_device *evt = &xttcpss_clockevent;
+	struct xttcpss_timer *timer = dev_id;
+	u32 ctrl_reg;
+
+	/* Acknowledge the interrupt and call event handler */
+	xttcpss_write(timer->base_addr + XTTCPSS_ISR_OFFSET,
+		xttcpss_read(timer->base_addr + XTTCPSS_ISR_OFFSET));
+
+	if (timer->mode == CLOCK_EVT_MODE_ONESHOT) {
+
+		/* Disable the counter as it would keep running. */
+		ctrl_reg = xttcpss_read(timer->base_addr +
+					XTTCPSS_CNT_CNTRL_OFFSET);
+		ctrl_reg |= ~(XTTCPSS_CNT_CNTRL_ENABLE_MASK);
The clock events framework should reprogram the next event so you
don't
quoted
actually need to disable the timer here.  Once the event handler has
been called the timer will be reenabled with a new period, and as
we're
quoted
running with interrupts disabled here we don't need to stop the timer.
What about if there's not another event to be started?
Then the clockevents code can set the mode to CLOCK_EVT_MODE_SHUTDOWN 
and this should disable the timer.  For NOHZ, AFAICT the 
clockevents/tick code will make sure that the next tick always falls 
within your max_delta_ns.

Jamie
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help