From patchwork Fri Jan 6 21:34:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 134705 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 61CE4B6F74 for ; Sat, 7 Jan 2012 08:41:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758810Ab2AFVlT (ORCPT ); Fri, 6 Jan 2012 16:41:19 -0500 Received: from forward6.mail.yandex.net ([77.88.60.125]:42206 "EHLO forward6.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048Ab2AFVlS (ORCPT ); Fri, 6 Jan 2012 16:41:18 -0500 X-Greylist: delayed 385 seconds by postgrey-1.27 at vger.kernel.org; Fri, 06 Jan 2012 16:41:18 EST Received: from smtp7.mail.yandex.net (smtp7.mail.yandex.net [77.88.61.55]) by forward6.mail.yandex.net (Yandex) with ESMTP id 122721121ECE; Sat, 7 Jan 2012 01:34:51 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1325885691; bh=/Dxz/p1UcPHLw1DQj8nSd0lemg6t1I0dnMVgmB0slKg=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type: Content-Transfer-Encoding:Mime-Version; b=RzOiVlmXBa8u7+bNNd7n1BrHyeF2MSA7kwI+xkD7gA5UYKT0hKd3cN+DNbZmVnUnu 4dH0bWTYAFHJ7kj5XhZLVxLbX711Rnxhwe119S8qBFd312fU1NPEH0R0r5577O2vdv 5ievZN5xUWUGNMGvMB/jkT277lOBqDNR8U0NxWWE= Received: from smtp7.mail.yandex.net (localhost [127.0.0.1]) by smtp7.mail.yandex.net (Yandex) with ESMTP id D45F51580013; Sat, 7 Jan 2012 01:34:50 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1325885690; bh=/Dxz/p1UcPHLw1DQj8nSd0lemg6t1I0dnMVgmB0slKg=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type: Content-Transfer-Encoding:Mime-Version; b=qHkz+Igo6LaqM1XfoMn3SdAAZKD0tHiOF5iW0r55Q4PwSLtvrApd9IbyJ++xkXZjj jRJMhGdQZotMDYzAd9rEiA9oB+/zLqkzOfkfuaA1LdIqUwXMTEUejhUP/gFfqCDKFT s/wzWR5W46V1X7YJibE4I9PX66oWmd455w3Me07Y= Received: from 95-25-54-118.broadband.corbina.ru (95-25-54-118.broadband.corbina.ru [95.25.54.118]) by smtp7.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ye347uZ8-Yo3ShY7e; Sat, 7 Jan 2012 01:34:50 +0400 X-Yandex-Spam: 1 Message-ID: <1325885691.21461.8.camel@hp> Subject: [PATCH]sparc32: forced setting of mode of sun4m per-cpu timers From: Kirill Tkhai To: sparclinux Cc: "David S. Miller" , Sam Ravnborg Date: Sat, 07 Jan 2012 01:34:51 +0400 X-Mailer: Evolution 3.2.2-1 Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org SUN4M per-cpu timers have two modes of work. These are timer mode and counter mode. Kernel doesn't write anything to the register, which is connected with mode choice. So, the mode is chosen by bootloader. This patch forces to use timer mode from the kernel and to be independent of bootloader. I had this problem with OpenBIOS. Timers don't tick and kernel fails on QEMU, when it's compiled with SMP support. The patch fixes problem. Signed-off-by: Tkhai Kirill Acked-by: Sam Ravnborg --- master_l10_counter = &timers_global->l10_count; -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 422c16d..e611651 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c @@ -399,6 +399,9 @@ static void __init sun4m_init_timers(irq_handler_t counter_fn) timers_global = (void __iomem *) (unsigned long) addr[num_cpu_timers]; + /* Every per-cpu timer works in timer mode */ + sbus_writel(0x00000000, &timers_global->timer_config); + sbus_writel((((1000000/HZ) + 1) << 10), &timers_global->l10_limit);