diff mbox

powerpc: fixup QE_General4 errata

Message ID 1314102605-9718-1-git-send-email-Joakim.Tjernlund@transmode.se (mailing list archive)
State Accepted, archived
Commit ae5f8c19827493e5a8d48c2c6a8a92201a94f08b
Delegated to: Kumar Gala
Headers show

Commit Message

Joakim Tjernlund Aug. 23, 2011, 12:30 p.m. UTC
QE_General4 should only round up the divisor iff divisor is > 3.
Rounding up lower divisors makes the error too big, causing USB
on MPC832x to fail.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
 arch/powerpc/sysdev/qe_lib/qe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Timur Tabi Aug. 23, 2011, 5:48 p.m. UTC | #1
Joakim Tjernlund wrote:
> QE_General4 should only round up the divisor iff divisor is > 3.
> Rounding up lower divisors makes the error too big, causing USB
> on MPC832x to fail.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

Acked-by: Timur Tabi <timur@freescale.com>
Kumar Gala Nov. 24, 2011, 7:45 a.m. UTC | #2
On Aug 23, 2011, at 7:30 AM, Joakim Tjernlund wrote:

> QE_General4 should only round up the divisor iff divisor is > 3.
> Rounding up lower divisors makes the error too big, causing USB
> on MPC832x to fail.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
> arch/powerpc/sysdev/qe_lib/qe.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

applied to merge

- k
diff mbox

Patch

diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 093e0ae..5399316 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -216,7 +216,7 @@  int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
 	/* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says
 	   that the BRG divisor must be even if you're not using divide-by-16
 	   mode. */
-	if (!div16 && (divisor & 1))
+	if (!div16 && (divisor & 1) && (divisor > 3))
 		divisor++;
 
 	tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |