Re: 2.5.40-mm2

Andrew Morton
2002-10-06T22:02:01Z

Andrew Morton wrote:
>
> ...
> int del_timer_sync(timer_t *timer)
> {
> - tvec_base_t *base = tvec_bases;
> int i, ret;
>
> ret = del_timer(timer);
>
> for (i = 0; i < NR_CPUS; i++) {
> + tvec_base_t *base;
> +
> if (!cpu_online(i))
> continue;
> + base = tvec_bases + i;
> if (base->running_timer == timer) {
> - while (base->running_timer == timer) {
> + while (base->running_timer == timer)
> cpu_relax();
> - preempt_disable();
> - preempt_enable();
> - }
> break;
> }
> base++;

Oh, OK. There's a base++ hidden at the end there :(

So the code as-is will work OK if all your online CPUs are
adjacent, starting at CPU0. It is incorrect if you have
gaps in your online map.