ar71xx: fix occasional kernel hangs during boot on AR934x
authorGabor Juhos <juhosg@openwrt.org>
Sun, 13 Nov 2011 11:26:52 +0000 (11:26 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 13 Nov 2011 11:26:52 +0000 (11:26 +0000)
commit819f6df245417fdc72ad1b3f1b49caf9c417a8bf
tree02d1026a16ab6c9e288a8a15ecbe9188e0650889
parent003cbe35e26efa7b1df844709a4bdeee8f21624c
ar71xx: fix occasional kernel hangs during boot on AR934x

The patch taken from the linux-mips mailing list.

The Kernel hangs occasionally during boot after
"Calibrating delay loop..". This is caused by the
c0_compare_int_usable() routine in cevt-r4k.c
returning false which causes the system to disable
the timer and hang later. The false return happens
because the routine is using a series of four calls
to irq_disable_hazard() as a delay while it waits
for the timer changes to propagate to the cp0 cause
register. On newer MIPS cores, like the 74K, the
series of irq_disable_hazard() calls turn into ehb
instructions and can take as little as a few clock
ticks for all 4 instructions. This is not enough of
a delay, so the routine thinks the timer is not
working.

This fix uses up to a max number of cycle counter
ticks for the delay and uses back_to_back_c0_hazard()
instead of irq_disable_hazard() to handle the hazard
condition between cp0 writes and cp0 reads.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29009 3c298f89-4303-0410-b956-a3cf2f4a3e73
target/linux/ar71xx/patches-2.6.39/902-fix-occasional-kernel-hangs-during-boot.patch [new file with mode: 0644]