From owner-svn-src-all@FreeBSD.ORG Sun May 18 01:18:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C495CCD; Sun, 18 May 2014 01:18:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 296632A29; Sun, 18 May 2014 01:18:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I1Ig3P052379; Sun, 18 May 2014 01:18:42 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I1Ig7O052378; Sun, 18 May 2014 01:18:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405180118.s4I1Ig7O052378@svn.freebsd.org> From: Ian Lepore Date: Sun, 18 May 2014 01:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266388 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 01:18:43 -0000 Author: ian Date: Sun May 18 01:18:42 2014 New Revision: 266388 URL: http://svnweb.freebsd.org/changeset/base/266388 Log: MFC 265913, 265914: Interrupts need to be disabled on entry to cpu_sleep() for ARM. Given that and the need to be in a critical section when switching to idleclock mode for event timers, use spinlock_enter()/exit() to achieve both needs. Clean up some style nits. Modified: stable/10/sys/arm/arm/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sun May 18 00:55:26 2014 (r266387) +++ stable/10/sys/arm/arm/machdep.c Sun May 18 01:18:42 2014 (r266388) @@ -424,24 +424,20 @@ void cpu_idle(int busy) { - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", - busy, curcpu); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); + spinlock_enter(); #ifndef NO_EVENTTIMERS - if (!busy) { - critical_enter(); + if (!busy) cpu_idleclock(); - } #endif if (!sched_runnable()) cpu_sleep(0); #ifndef NO_EVENTTIMERS - if (!busy) { + if (!busy) cpu_activeclock(); - critical_exit(); - } #endif - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", - busy, curcpu); + spinlock_exit(); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } int