Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754844Ab3COQI6 (ORCPT ); Fri, 15 Mar 2013 12:08:58 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:59959 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993Ab3COQI4 (ORCPT ); Fri, 15 Mar 2013 12:08:56 -0400 MIME-Version: 1.0 Date: Sat, 16 Mar 2013 00:08:54 +0800 Message-ID: Subject: udelay function delays the wrong time interval in multiprocessor system, if ARCH_HAS_READ_CURRENT_TIMER is not defined and on current timer is used. From: chpoph To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Viresh Kumar , Nicolas Pitre , Liviu Dudau , Russell King , Greg Kroah-Hartman , will.deacon@arm.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 906 Lines: 22 If ARCH_HAS_READ_CURRENT_TIMER is not defined and on current timer is used for udelay, then __loop_delay and __loop_const_udelay is used to delay a specific time interval. but in delay-loop.S, loops_per_jiffy (not per cpu data) is used to calculate the number of loops. in SMP system, udelay delays the wrong time interval if two cpus running at different frequency. In arch/arm/lib/delay.c arm_delay_ops is set to arm_delay_ops. /* * Default to the loop-based delay implementation. */ struct arm_delay_ops arm_delay_ops = { .delay = __loop_delay, .const_udelay = __loop_const_udelay, .udelay = __loop_udelay, }; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/