From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755002AbdJLMrx (ORCPT ); Thu, 12 Oct 2017 08:47:53 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:57094 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbdJLMrv (ORCPT ); Thu, 12 Oct 2017 08:47:51 -0400 X-Google-Smtp-Source: AOwi7QC0Xt/lfHbh7jdU7OyyLWImz91vQGFFboYdOmFvQ1dte3L3+oLP20ge62acHsOX/wSChH0shA== Subject: Re: PROBLEM: Kernel BUG in mfgpt_tick (cs5535-clockevt.c) on ALIX 2c3 - null call To: David Kozub Cc: Thomas Gleixner , linux-kernel@vger.kernel.org References: <8de07c60-8d37-802a-837c-a6cf356d1535@linaro.org> <29c0b5e6-3285-a307-4045-6b2b9f9747d6@linaro.org> From: Daniel Lezcano Message-ID: Date: Thu, 12 Oct 2017 14:47:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/2017 22:48, David Kozub wrote: [ ... ] >> >> +       disable_timer(timer); >> +       cs5535_mfgpt_write(timer, MFGPT_REG_COUNTER, 0); >> + >>        /* Set up the IRQ on the MFGPT side */ >>        if (cs5535_mfgpt_setup_irq(timer, MFGPT_CMP2, &timer_irq)) { >>                printk(KERN_ERR DRV_NAME ": Could not set up IRQ %d\n", > > I tried that and the handler is still called. So I did some more random > experiments and I found out that if I call disable_timer(timer) twice, > then the issue is resolved (the handler is not called before the > registration is finished.) And I don't have to set MFGPT_REG_COUNTER to 0. Aha! we are close to a fix. > I have no idea why do I have to call disable_timer twice. For testing purpose, can you try by adding mmiowb() and/or wmb() after disable_timer()? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog