Bug in arch/powerpc/sysdev/fsl_gtm.c

Jean-Denis Boyer jdboyer at media5corp.com
Thu Feb 17 01:59:11 EST 2011

There is a bug in the function gtm_set_ref_timer16.
When called, it correctly sets the requested timer,
but the other timer that shares the register GTCFR is reset.

The parameter 'clear' passed to macro clrsetbits_8 should not be
a bitwise complement, since the macro already complements it.

Here is a patch that should fix this issue.

--- linux-
+++ linux/arch/powerpc/sysdev/fsl_gtm.c
@@ -203,13 +203,10 @@
 	spin_lock_irqsave(&gtm->lock, flags);
-	 * Properly reset timers: stop, reset, set up prescalers, reference
+	 * Properly set timers: stop, set up prescalers, reference
 	 * value and clear event register.
-	clrsetbits_8(tmr->gtcfr, ~(GTCFR_STP(num) | GTCFR_RST(num)),
-				 GTCFR_STP(num) | GTCFR_RST(num));
-	setbits8(tmr->gtcfr, GTCFR_STP(num));
+	setbits8(tmr->gtcfr, GTCFR_STP(num) | GTCFR_RST(num));
 	if (tmr->gtpsr)
 		out_be16(tmr->gtpsr, psr);


Jean-Denis Boyer, Eng.
Media5 Corporation - Mediatrix, M5T, Media5Boss
4229 Garlock Street, Sherbrooke (Québec), J1L 2C8, CANADA
(819)829-8749 x5241

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fsl_gtm.patch
Type: application/octet-stream
Size: 585 bytes
Desc: fsl_gtm.patch
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20110216/844241c2/attachment.obj>

More information about the Linuxppc-dev mailing list