From owner-freebsd-arm@FreeBSD.ORG Fri Feb 28 03:56:34 2014 Return-Path: Delivered-To: freebsd-arm@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 AEAE3C9D for ; Fri, 28 Feb 2014 03:56:34 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 840DD19AB for ; Fri, 28 Feb 2014 03:56:34 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WJEYr-0003u1-Dd for freebsd-arm@FreeBSD.org; Fri, 28 Feb 2014 03:56:33 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s1S3uUiC041523 for ; Thu, 27 Feb 2014 20:56:30 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19ROvVE+BOXIUwrd3QtgMQZ Subject: Using WFI instruction on all armv7-based systems From: Ian Lepore To: freebsd-arm Content-Type: text/plain; charset="us-ascii" Date: Thu, 27 Feb 2014 20:56:30 -0700 Message-ID: <1393559790.1149.143.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 03:56:34 -0000 When I first got multiple cores running in my imx6 work, I noticed that my core temperature climbed to 78C and stuck there even with the board 100% idle, and it didn't go up if I loaded the board to 100% busy. It turns out the cpu_sleep() routine we've been using didn't work right for armv7 and the idle thread was just spinning, so all cores were running flat-out all the time. I added code to do the wait-for-interrupt the new armv7 way, using the WFI instruction instead of a coprocessor function. Now the temperature idles at 54C. This change should help all armv7 chips run cooler, not just imx6. I've tested it on imx53 and on my BeagleBone White. After adding the WFI on imx6 I had a lot of trouble with the system hanging during boot. I eventually tracked it down to the chip's power management features -- it was disabling clocks to parts of the ARM cores needed to wake up from WFI, and we don't have the support code yet to use the alternate interrupt controller in low power mode and all that other complicated clocks-and-power stuff. I mention the imx6 problem just in case the same sort of thing crops up on some of the other armv7 chips that I don't have here to test. If you notice strange crashes or hangs, uneven jerky system response, bad timekeeping (like ntpd keeps stepping the clock) then maybe your chip also automatically powers down important stuff during WFI. Let me know and we'll figure out how to fix it, or some way to make WFI optional until it can be fixed. -- Ian