sym53c8xx timer rework
Quoted 5 lines
/*
(quoted diff) +2
-2-** Stop the ncr_timeout process -** Set release_stage to 1 and wait that ncr_timeout() set it to 2. +** Stop the ncr_timeout process - lock it to ensure no timer is running +** on a different CPU, or anything
Review
Quoted 10 lines
(quoted diff) +3
-6*/ - np->release_stage = 1; - for (i = 50 ; i && np->release_stage != 2 ; i--) MDELAY (100); - if (np->release_stage != 2) - printk("%s: the timer seems to be already stopped\n", - ncr_name(np)); - else np->release_stage = 2; + NCR_LOCK_NCB(np, flags); + del_timer(&np->timer); + NCR_UNLOCK_NCB(np, flags);
I'm only reading the diff, but this change looks wrong. The simplest solution is del_timer_sync() instead of LOCK;del_timer;UNLOCK.
Why do you acqurie the NCB spinlock? the _timeout function runs without it.
--
Manfred
Quoted 7 lines · Studierende der Universitaet des Saarlandes
Review
Quoted 3 lines
(quoted diff) +3
-0+ NCR_LOCK_NCB(np, flags); + del_timer(&np->timer); + NCR_UNLOCK_NCB(np, flags);I'm only reading the diff, but this change looks wrong. The simplest solution is
del_timer_sync()instead of LOCK;del_timer;UNLOCK.
I didn't even realize there was a del_timer_sync(). That does what is needed. 3 lines become 1, I guess.
Thanks, CC:ed to Gerard and crew.
Signature · 4 lines
Tim Hockin Systems Software Engineer Sun Microsystems, Cobalt Server Appliances [email protected]