Skip to content

Commit 85ce70f

Browse files
committed
Merge branches 'sched-urgent-for-linus' and 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler and timer fixes from Ingo Molnar: "Contains a fix for a scheduler bug that manifested itself as a 3D performance regression and a crash fix for the ARM Cadence TTC clock driver" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Calculate effective load even if local weight is 0 * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource: cadence_ttc: Fix mutex taken inside interrupt context
3 parents 9b6c4ea + 9722c2d + e59da0a commit 85ce70f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

drivers/clocksource/cadence_ttc_timer.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@
6767
* struct ttc_timer - This definition defines local timer structure
6868
*
6969
* @base_addr: Base address of timer
70+
* @freq: Timer input clock frequency
7071
* @clk: Associated clock source
7172
* @clk_rate_change_nb Notifier block for clock rate changes
7273
*/
7374
struct ttc_timer {
7475
void __iomem *base_addr;
76+
unsigned long freq;
7577
struct clk *clk;
7678
struct notifier_block clk_rate_change_nb;
7779
};
@@ -196,9 +198,8 @@ static void ttc_set_mode(enum clock_event_mode mode,
196198

197199
switch (mode) {
198200
case CLOCK_EVT_MODE_PERIODIC:
199-
ttc_set_interval(timer,
200-
DIV_ROUND_CLOSEST(clk_get_rate(ttce->ttc.clk),
201-
PRESCALE * HZ));
201+
ttc_set_interval(timer, DIV_ROUND_CLOSEST(ttce->ttc.freq,
202+
PRESCALE * HZ));
202203
break;
203204
case CLOCK_EVT_MODE_ONESHOT:
204205
case CLOCK_EVT_MODE_UNUSED:
@@ -273,6 +274,8 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base)
273274
return;
274275
}
275276

277+
ttccs->ttc.freq = clk_get_rate(ttccs->ttc.clk);
278+
276279
ttccs->ttc.clk_rate_change_nb.notifier_call =
277280
ttc_rate_change_clocksource_cb;
278281
ttccs->ttc.clk_rate_change_nb.next = NULL;
@@ -298,16 +301,14 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base)
298301
__raw_writel(CNT_CNTRL_RESET,
299302
ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET);
300303

301-
err = clocksource_register_hz(&ttccs->cs,
302-
clk_get_rate(ttccs->ttc.clk) / PRESCALE);
304+
err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE);
303305
if (WARN_ON(err)) {
304306
kfree(ttccs);
305307
return;
306308
}
307309

308310
ttc_sched_clock_val_reg = base + TTC_COUNT_VAL_OFFSET;
309-
setup_sched_clock(ttc_sched_clock_read, 16,
310-
clk_get_rate(ttccs->ttc.clk) / PRESCALE);
311+
setup_sched_clock(ttc_sched_clock_read, 16, ttccs->ttc.freq / PRESCALE);
311312
}
312313

313314
static int ttc_rate_change_clockevent_cb(struct notifier_block *nb,
@@ -334,6 +335,9 @@ static int ttc_rate_change_clockevent_cb(struct notifier_block *nb,
334335
ndata->new_rate / PRESCALE);
335336
local_irq_restore(flags);
336337

338+
/* update cached frequency */
339+
ttc->freq = ndata->new_rate;
340+
337341
/* fall through */
338342
}
339343
case PRE_RATE_CHANGE:
@@ -367,6 +371,7 @@ static void __init ttc_setup_clockevent(struct clk *clk,
367371
if (clk_notifier_register(ttcce->ttc.clk,
368372
&ttcce->ttc.clk_rate_change_nb))
369373
pr_warn("Unable to register clock notifier.\n");
374+
ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk);
370375

371376
ttcce->ttc.base_addr = base;
372377
ttcce->ce.name = "ttc_clockevent";
@@ -396,7 +401,7 @@ static void __init ttc_setup_clockevent(struct clk *clk,
396401
}
397402

398403
clockevents_config_and_register(&ttcce->ce,
399-
clk_get_rate(ttcce->ttc.clk) / PRESCALE, 1, 0xfffe);
404+
ttcce->ttc.freq / PRESCALE, 1, 0xfffe);
400405
}
401406

402407
/**

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3923,7 +3923,7 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg)
39233923
{
39243924
struct sched_entity *se = tg->se[cpu];
39253925

3926-
if (!tg->parent || !wl) /* the trivial, non-cgroup case */
3926+
if (!tg->parent) /* the trivial, non-cgroup case */
39273927
return wl;
39283928

39293929
for_each_sched_entity(se) {

0 commit comments

Comments
 (0)