From patchwork Thu Nov 8 17:19:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunter, Jon" X-Patchwork-Id: 1716661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A2FC1DF280 for ; Thu, 8 Nov 2012 17:22:02 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TWVlg-00087a-3D; Thu, 08 Nov 2012 17:19:54 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TWVlc-00086x-UB for linux-arm-kernel@lists.infradead.org; Thu, 08 Nov 2012 17:19:49 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA8HJjkX030379; Thu, 8 Nov 2012 11:19:45 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA8HJjJ2020316; Thu, 8 Nov 2012 11:19:45 -0600 Received: from [192.157.144.139] (192.157.144.139) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Thu, 8 Nov 2012 11:19:45 -0600 Message-ID: <509BE9B0.5040608@ti.com> Date: Thu, 8 Nov 2012 11:19:44 -0600 From: Jon Hunter User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Tony Lindgren Subject: Re: [GIT PULL] ARM: OMAP: Timer and Counter DT Updates for v3.8 References: <50941812.2070501@ti.com> <20121107004703.GS6801@atomide.com> <20121107234403.GS6801@atomide.com> In-Reply-To: <20121107234403.GS6801@atomide.com> X-Originating-IP: [192.157.144.139] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121108_121949_094125_B759A314 X-CRM114-Status: GOOD ( 18.45 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: device-tree , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On 11/07/2012 05:44 PM, Tony Lindgren wrote: > Hi Jon, > > * Tony Lindgren [121106 16:48]: >> * Jon Hunter [121102 12:01]: >>> >>> git@github.com:jonhunter/linux.git dev-dt-timer >> >> Thanks pulling into omap-for-v3.8/dt branch. > > Looks like omap-for-v3.8/dt boots OK on blaze when booted > with device tree, but then current omap-for-v3.8/tmp-merge > oopses. That's a bugger. I completely missed your patch last week sorry (I will blame the Danish beer) and had clearly not folded in to my testing! > I guess we should apply the following fix somewhere or > do we need to check other places too? I will re-test your master branch today and put it through my dmtimer tests to double check. However, in general I did ensure that we checked pdata was not NULL before accessing when I introduced the dt stuff. In my changelog [1] I had ... "5. When device-tree is present the platform_data structure will be NULL and so check for this." I just need to make sure that get_context_loss_count() is not called before checking it is populated. > Regards, > > Tony > > [] (omap_dm_timer_probe+0x110/0x310) from [] (platform_drv_probe+0x1c/0x24) > [] (platform_drv_probe+0x1c/0x24) from [] (really_probe+0x60/0x1f4) > [] (really_probe+0x60/0x1f4) from [] (driver_probe_device+0x34/0x50) > [] (driver_probe_device+0x34/0x50) from [] (__driver_attach+0x94/0x98) > [] (__driver_attach+0x94/0x98) from [] (bus_for_each_dev+0x60/0x8c) > [] (bus_for_each_dev+0x60/0x8c) from [] (bus_add_driver+0x18c/0x254) > [] (bus_add_driver+0x18c/0x254) from [] (driver_register+0x5c/0x150) > [] (driver_register+0x5c/0x150) from [] (do_one_initcall+0x2c/0x178) > [] (do_one_initcall+0x2c/0x178) from [] (do_basic_setup+0x94/0xd0) > [] (do_basic_setup+0x94/0xd0) from [] (kernel_init_freeable+0x7c/0x124) > [] (kernel_init_freeable+0x7c/0x124) from [] (kernel_init+0x8/0x1a8) > [] (kernel_init+0x8/0x1a8) from [] (ret_from_fork+0x14/0x24) > > --- a/arch/arm/plat-omap/dmtimer.c > +++ b/arch/arm/plat-omap/dmtimer.c > @@ -803,8 +803,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev) > > timer->irq = irq->start; > timer->pdev = pdev; > - timer->capability = pdata->timer_capability; > - timer->get_context_loss_count = pdata->get_context_loss_count; > + > + if (pdata) { > + timer->capability = pdata->timer_capability; You don't need this it is already handled a few lines before. > + timer->get_context_loss_count = pdata->get_context_loss_count; We could probably move this too. For example ... Cheers Jon [1] http://marc.info/?l=linux-omap&m=135065877008624&w=2 diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 38c12ef..9dca23e 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -799,12 +799,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev) timer->id = pdev->id; timer->capability = pdata->timer_capability; timer->reserved = omap_dm_timer_reserved_systimer(timer->id); + timer->get_context_loss_count = pdata->get_context_loss_count; } timer->irq = irq->start; timer->pdev = pdev; - timer->capability = pdata->timer_capability; - timer->get_context_loss_count = pdata->get_context_loss_count; /* Skip pm_runtime_enable for OMAP1 */ if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {