Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Thomas writes:
"Three small fixes for clocksource drivers:
- Proper error handling in the Atmel PIT driver
- Add CLOCK_SOURCE_SUSPEND_NONSTOP for TI SoCs so suspend works again
- Fix the next event function for Facebook Backpack-CMM BMC chips so
usleep(100) doesnt sleep several milliseconds"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource/drivers/timer-atmel-pit: Properly handle error cases
clocksource/drivers/fttmr010: Fix set_next_event handler
clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs

Changed files
+28 -13
drivers
+14 -6
drivers/clocksource/timer-atmel-pit.c
··· 180 180 data->base = of_iomap(node, 0); 181 181 if (!data->base) { 182 182 pr_err("Could not map PIT address\n"); 183 - return -ENXIO; 183 + ret = -ENXIO; 184 + goto exit; 184 185 } 185 186 186 187 data->mck = of_clk_get(node, 0); 187 188 if (IS_ERR(data->mck)) { 188 189 pr_err("Unable to get mck clk\n"); 189 - return PTR_ERR(data->mck); 190 + ret = PTR_ERR(data->mck); 191 + goto exit; 190 192 } 191 193 192 194 ret = clk_prepare_enable(data->mck); 193 195 if (ret) { 194 196 pr_err("Unable to enable mck\n"); 195 - return ret; 197 + goto exit; 196 198 } 197 199 198 200 /* Get the interrupts property */ 199 201 data->irq = irq_of_parse_and_map(node, 0); 200 202 if (!data->irq) { 201 203 pr_err("Unable to get IRQ from DT\n"); 202 - return -EINVAL; 204 + ret = -EINVAL; 205 + goto exit; 203 206 } 204 207 205 208 /* ··· 230 227 ret = clocksource_register_hz(&data->clksrc, pit_rate); 231 228 if (ret) { 232 229 pr_err("Failed to register clocksource\n"); 233 - return ret; 230 + goto exit; 234 231 } 235 232 236 233 /* Set up irq handler */ ··· 239 236 "at91_tick", data); 240 237 if (ret) { 241 238 pr_err("Unable to setup IRQ\n"); 242 - return ret; 239 + clocksource_unregister(&data->clksrc); 240 + goto exit; 243 241 } 244 242 245 243 /* Set up and register clockevents */ ··· 258 254 clockevents_register_device(&data->clkevt); 259 255 260 256 return 0; 257 + 258 + exit: 259 + kfree(data); 260 + return ret; 261 261 } 262 262 TIMER_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit", 263 263 at91sam926x_pit_dt_init);
+11 -7
drivers/clocksource/timer-fttmr010.c
··· 130 130 cr &= ~fttmr010->t1_enable_val; 131 131 writel(cr, fttmr010->base + TIMER_CR); 132 132 133 - /* Setup the match register forward/backward in time */ 134 - cr = readl(fttmr010->base + TIMER1_COUNT); 135 - if (fttmr010->count_down) 136 - cr -= cycles; 137 - else 138 - cr += cycles; 139 - writel(cr, fttmr010->base + TIMER1_MATCH1); 133 + if (fttmr010->count_down) { 134 + /* 135 + * ASPEED Timer Controller will load TIMER1_LOAD register 136 + * into TIMER1_COUNT register when the timer is re-enabled. 137 + */ 138 + writel(cycles, fttmr010->base + TIMER1_LOAD); 139 + } else { 140 + /* Setup the match register forward in time */ 141 + cr = readl(fttmr010->base + TIMER1_COUNT); 142 + writel(cr + cycles, fttmr010->base + TIMER1_MATCH1); 143 + } 140 144 141 145 /* Start */ 142 146 cr = readl(fttmr010->base + TIMER_CR);
+3
drivers/clocksource/timer-ti-32k.c
··· 97 97 return -ENXIO; 98 98 } 99 99 100 + if (!of_machine_is_compatible("ti,am43")) 101 + ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP; 102 + 100 103 ti_32k_timer.counter = ti_32k_timer.base; 101 104 102 105 /*