From patchwork Sun May 8 04:59:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Pedanekar X-Patchwork-Id: 765022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4850lGJ021461 for ; Sun, 8 May 2011 05:00:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750916Ab1EHFAi (ORCPT ); Sun, 8 May 2011 01:00:38 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:42183 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750843Ab1EHFAh convert rfc822-to-8bit (ORCPT ); Sun, 8 May 2011 01:00:37 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p484xgd1022154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 7 May 2011 23:59:44 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p484xeRb019843; Sun, 8 May 2011 10:29:41 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde71.ent.ti.com ([172.24.170.149]) with mapi; Sun, 8 May 2011 10:29:40 +0530 From: "Pedanekar, Hemant" To: Rabin Vincent , linux-omap Date: Sun, 8 May 2011 10:29:37 +0530 Subject: RE: !CONFIG_OMAP_32K_TIMER on OMAP4/panda Thread-Topic: !CONFIG_OMAP_32K_TIMER on OMAP4/panda Thread-Index: AcwM1wnLsSh3/zY8S+ePDK1jwGtQTwAZFbgg Message-ID: <2A3DCF3DA181AD40BDE86A3150B27B6B0374D103A2@dbde02.ent.ti.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 08 May 2011 05:00:48 +0000 (UTC) Hello, linux-omap-owner@vger.kernel.org wrote on Saturday, May 07, 2011 10:21 PM: > On a linux-next kernel built for the Pandaboard, disabling > CONFIG_OMAP_32K_TIMER makes the kernel use the gptimer as the > clocksource, but this appears to be non-functional. Judging from the > all-zeros printk timings and the fact the "sleep 1" hangs indefinitely, > it looks like the clocksource reads are always zero. > > Boot log below and .config attached. Ideas? > > [ 0.000000] Linux version 2.6.39-rc6-next-20110506+ (rabin@debian) [...] > [ 0.000000] Freeing init memory: 112K This looks similar to the issue I observed on TI816X with 32K timer disabled. I have created following patch (currently a tempfix) for making timekeeping work with MPU timer selected (other option is to use ".flags = HWMOD_INIT_NO_RESET" in hwmod data for the timer used as clocksource): commit 77cce922c00ced4407776cc0a1d84cee40b7da90 Author: Hemant Pedanekar Date: Thu Apr 28 12:59:24 2011 +0530 dmtimer: Initialize the hwmod for timer used as clocksource Since dmtimer driver still doesn't use hwmods, the 2nd timer used as clocksource is not set up. This results into timekeepoing failure when the timer used as clocksource gets reset during hwmod setup. To prevent this, explicitly call omap_hwmod_setup_one() for timer used as clocksource. Note that is is aplpicable when NOT using 32k timer which is the case for TI816X. For other configurations, this code will not be executed unless 32K timer is explicitly disabled. Signed-off-by: Hemant Pedanekar Hemant-- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 3b9cf85..290fbfa 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c @@ -229,6 +229,11 @@ static void __init omap2_gp_clocksource_init(void) "%s: failed to request dm-timer\n"; static char err2[] __initdata = KERN_ERR "%s: can't register clocksource!\n"; + char clocksource_hwmod_name[8]; /* 8 = sizeof("timerXX0") */ + + /* XXX: This may not be always true, we might get different timer */ + sprintf(clocksource_hwmod_name, "timer%d", gptimer_id + 1); + omap_hwmod_setup_one(clocksource_hwmod_name); gpt = omap_dm_timer_request(); if (!gpt)