From patchwork Thu Jul 5 20:32:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 169270 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A2AB2C01BC for ; Fri, 6 Jul 2012 06:38:54 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Smsjs-0007Te-Di; Thu, 05 Jul 2012 20:33:25 +0000 Received: from mail-gh0-f177.google.com ([209.85.160.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SmsjU-0007TL-DY for linux-arm-kernel@lists.infradead.org; Thu, 05 Jul 2012 20:33:03 +0000 Received: by ghbf11 with SMTP id f11so8530888ghb.36 for ; Thu, 05 Jul 2012 13:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZCW2Ip/v3yKE/0hAm4J8X3B2DsSuRhfjAohX9UJI96g=; b=rX8fly87S/OPXoKL0rmh0/CWoQYh+GzKE9y8IOJZR8iVLtbpMP1AgHmAD0cEeoVODx MF0RT/1MfUl1lzGuFycgBcuUHEz5tiQx3SU7TV+QmzlqCOsJF+mO0ekumigV9AUBdRr7 Jr1HNMsYLI3b33oNNGOarMdY5mG1jzV4I33O4UpljPpR+ZpPp59yzzwArNMGP/RLAjzQ U7HH2dhWOpq2Ltml1SSgzhp6ZRfJuUkZQ0rnxRyfBIzpSWdWDMBHkN6mEv81EdMqGfnJ OyumWvCVoSneKuXUAHJbK6Xsb0KOQy4griQtjv4z9bKmk1or8mPcfdxTg8uP0gWLRtwk lIlg== MIME-Version: 1.0 Received: by 10.60.26.65 with SMTP id j1mr28685227oeg.9.1341520376305; Thu, 05 Jul 2012 13:32:56 -0700 (PDT) Received: by 10.76.119.79 with HTTP; Thu, 5 Jul 2012 13:32:56 -0700 (PDT) In-Reply-To: <201207051823.26243.marex@denx.de> References: <201207040030.36713.marex@denx.de> <20120704151944.GB18739@n2100.arm.linux.org.uk> <20120705160855.GA20175@S2101-09.ap.freescale.net> <201207051823.26243.marex@denx.de> Date: Thu, 5 Jul 2012 17:32:56 -0300 Message-ID: Subject: Re: MX28 poweroff issue From: Fabio Estevam To: Marek Vasut X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Cc: Russell King - ARM Linux , Otavio Salvador , Detlev Zundel , Attila Kinali , Shawn Guo , Linux ARM kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hi Marek, On Thu, Jul 5, 2012 at 1:23 PM, Marek Vasut wrote: > Won't mdelay() be better? > > It removes the warning, but can't some other stray interrupt trigger it again? Could you please try the change below? I do not have access to my mx28 right now. diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c index 02d36de..6c7f81e 100644 --- a/arch/arm/mach-mxs/timer.c +++ b/arch/arm/mach-mxs/timer.c @@ -149,6 +149,9 @@ static const char *clock_event_mode_label[] const = { static void mxs_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) { + unsigned long flags; + + local_irq_save(flags); /* Disable interrupt in timer module */ timrot_irq_disable(); @@ -173,13 +176,16 @@ static void mxs_set_mode(enum clock_event_mode mode, /* Remember timer mode */ mxs_clockevent_mode = mode; + local_irq_restore(flags); switch (mode) { case CLOCK_EVT_MODE_PERIODIC: pr_err("%s: Periodic mode is not implemented\n", __func__); break; case CLOCK_EVT_MODE_ONESHOT: + local_irq_save(flags); timrot_irq_enable(); + local_irq_restore(flags); break; case CLOCK_EVT_MODE_SHUTDOWN: case CLOCK_EVT_MODE_UNUSED: