Viresh Kumar viresh.kumar@linaro.org writes:
On 28 May 2014 19:55, Frederic Weisbecker fweisbec@gmail.com wrote:
On Fri, May 23, 2014 at 08:55:04PM +0530, Viresh Kumar wrote:
[...]
@@ -78,21 +78,22 @@ static void clps711x_clockevent_set_mode(enum clock_event_mode mode, case CLOCK_EVT_MODE_PERIODIC: enable_irq(IRQ_TC2OI); break;
case CLOCK_EVT_MODE_ONESHOT:
/* Not supported */ case CLOCK_EVT_MODE_SHUTDOWN: case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_RESUME: /* Left event sources disabled, no more interrupts appear */ break;
default:
return -ENOSYS; }
return 0;
If oneshot is not supported, the mode is never called to the driver?
Yes.
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 2756351..8491da9 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -124,24 +124,26 @@ static int timer_set_next_event(unsigned long delta, return 0; }
-static void timer_set_mode(enum clock_event_mode mode, +static int timer_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) { unsigned long flags;
local_irq_save(flags); switch (mode) { case CLOCK_EVT_MODE_ONESHOT: case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_SHUTDOWN: /* disable the matching interrupt */
local_irq_save(flags); __raw_writel(0x00, mmp_timer_base + TMR_IER(0));
local_irq_restore(flags); break; case CLOCK_EVT_MODE_RESUME:
case CLOCK_EVT_MODE_PERIODIC:
Why periodic is removed here?
See below..
break;
default:
return -ENOSYS; }
local_irq_restore(flags);
return 0;
}
static struct clock_event_device ckevt = { @@ -149,7 +151,7 @@ static struct clock_event_device ckevt = { .features = CLOCK_EVT_FEAT_ONESHOT,
PERIODIC isn't supported and it would never be called.
.rating = 200, .set_next_event = timer_set_next_event,
.set_mode = timer_set_mode,
.set_dev_mode = timer_set_mode,
};
[...]
static cycle_t clksrc_read(struct clocksource *cs) diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c index 1dea6cf..2282858 100644 --- a/arch/arm/mach-sa1100/time.c +++ b/arch/arm/mach-sa1100/time.c @@ -56,7 +56,7 @@ sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; }
-static void +static int sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) { switch (mode) { @@ -68,9 +68,11 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) break;
case CLOCK_EVT_MODE_RESUME:
case CLOCK_EVT_MODE_PERIODIC:
Same here?
See below..
break;
default:
return -ENOSYS; }
return 0;
}
#ifdef CONFIG_PM @@ -109,7 +111,7 @@ static struct clock_event_device ckevt_sa1100_osmr0 = { .features = CLOCK_EVT_FEAT_ONESHOT,
Same here.
OK, but strictly speaking, removing the ONESHOT and PERIODIC cases like this has nothing to do with this patch. The fact that they are there even though they will never be called by the core is independent of this series, and having those changes in this patch is distracting and not really related to your goal.
If you want to remove modes that are never called because of feature flags, that should probably be a preliminary cleanup patch and separated out from this change.
Mixing them together is distracting.
Kevin