[U-Boot] [PATCH] arm: zynq: correct the argument to lldiv

Typecast the argument with unsigned long long for proper calculation of lldiv
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com --- -Fixes the issue of rounding of the multiplication result to 32-bit value --- arch/arm/cpu/armv7/zynq/timer.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c index 2be253c..09a5547 100644 --- a/arch/arm/cpu/armv7/zynq/timer.c +++ b/arch/arm/cpu/armv7/zynq/timer.c @@ -107,7 +107,8 @@ void __udelay(unsigned long usec) if (usec == 0) return;
- countticks = lldiv(TIMER_TICK_HZ * usec, 1000000); + countticks = lldiv(((unsigned long long)TIMER_TICK_HZ * usec), + 1000000);
/* decrementing timer */ timeend = readl(&timer_base->counter) - countticks;

On 02/17/2014 07:12 AM, Siva Durga Prasad Paladugu wrote:
Typecast the argument with unsigned long long for proper calculation of lldiv
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com
-Fixes the issue of rounding of the multiplication result to 32-bit value
We found this in connection to eeprom write test.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Albert: This is the bug fixed I was talking you about on IRC. Will add it to my zynq pull request if this is fine for others.
Thanks, Michal

Hi Michal,
On Mon, 17 Feb 2014 07:50:26 +0100, Michal Simek monstr@monstr.eu wrote:
On 02/17/2014 07:12 AM, Siva Durga Prasad Paladugu wrote:
Typecast the argument with unsigned long long for proper calculation of lldiv
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com
-Fixes the issue of rounding of the multiplication result to 32-bit value
We found this in connection to eeprom write test.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Albert: This is the bug fixed I was talking you about on IRC. Will add it to my zynq pull request if this is fine for others.
Fine for me at least. As soon as my current PR to u-boot/master is applied (cc: Tom), I'll resume applying patches, starting with your Zynq PR, so if it was updated meanwhile, I'll apply the updated one.
Thanks, Michal
Amicalement,

On 02/17/2014 10:07 AM, Albert ARIBAUD wrote:
Hi Michal,
On Mon, 17 Feb 2014 07:50:26 +0100, Michal Simek monstr@monstr.eu wrote:
On 02/17/2014 07:12 AM, Siva Durga Prasad Paladugu wrote:
Typecast the argument with unsigned long long for proper calculation of lldiv
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com
-Fixes the issue of rounding of the multiplication result to 32-bit value
We found this in connection to eeprom write test.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Albert: This is the bug fixed I was talking you about on IRC. Will add it to my zynq pull request if this is fine for others.
Fine for me at least. As soon as my current PR to u-boot/master is applied (cc: Tom), I'll resume applying patches, starting with your Zynq PR, so if it was updated meanwhile, I'll apply the updated one.
I am keeping my eyes on it too.
Thanks, Michal
participants (3)
-
Albert ARIBAUD
-
Michal Simek
-
Siva Durga Prasad Paladugu