Xiangyu Lu 80bb3ef109 ARM: 8027/1: fix do_div() bug in big-endian systems
In big-endian systems, "%1" get the most significant part of the value, cause the instruction to get the wrong result.

When viewing ftrace record in big-endian ARM systems, we found that
the timestamp errors:

swapper-0   [001] 1325.970000:   0:120:R ==> [001]    16:120:R events/1
events/1-16 [001] 1325.970000:   16:120:S ==> [001]    0:120:R swapper
swapper-0   [000] 1325.1000000:  0:120:R   + [000]    15:120:R events/0
swapper-0   [000] 1325.1000000:  0:120:R ==> [000]    15:120:R events/0
swapper-0   [000] 1326.030000:   0:120:R   + [000]  1150:120:R sshd
swapper-0   [000] 1326.030000:   0:120:R ==> [000]  1150:120:R sshd

When viewed ftrace records, it will call the do_div(n, base) function, which achieved arch/arm/include/asm/div64.h in. When n = 10000000, base = 1000000, in do_div(n, base) will execute "umull %Q0, %R0, %1, %Q2".

Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Cc: <stable@vger.kernel.org> # 2.6.20+
Signed-off-by: Alex Wu <wuquanming@huawei.com>
Signed-off-by: Xiangyu Lu <luxiangyu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2014-04-22 22:23:57 +01:00
..
2012-03-28 18:30:01 +01:00
2013-11-15 13:34:37 +09:00
2012-07-05 09:50:55 +01:00
2011-03-31 11:26:23 -03:00
2013-04-17 21:38:10 +02:00
2013-07-02 13:43:38 -07:00
2011-03-31 11:26:23 -03:00
2012-09-14 09:21:59 -05:00
2012-09-14 13:53:39 +00:00
2014-01-28 14:06:25 +00:00
2013-04-17 21:38:10 +02:00
2014-02-25 11:33:37 +00:00
2012-07-24 15:27:28 +08:00
2013-01-23 13:29:17 -05:00
2013-07-08 22:08:51 +01:00
2013-11-15 09:32:16 +09:00
2013-10-09 20:04:08 -05:00
2013-05-21 14:24:11 +00:00
2014-04-05 14:19:54 -07:00
2014-02-25 11:33:37 +00:00
2014-03-18 16:39:40 -04:00
2011-03-31 11:26:23 -03:00
2014-03-18 16:39:40 -04:00
2011-07-12 11:19:29 -05:00