From patchwork Thu Oct 9 19:06:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 398113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-wi0-x23d.google.com (mail-wi0-x23d.google.com [IPv6:2a00:1450:400c:c05::23d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C28481400D2 for ; Fri, 10 Oct 2014 06:12:33 +1100 (EST) Received: by mail-wi0-f189.google.com with SMTP id ex7sf193264wid.26 for ; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:sender:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe:content-type; bh=KSC1igarvoNAxhdQfB9o+T70AyV4q4kGs27apiYmUuA=; b=q//muZ4IkqsCXnelGszdsMdcWa4UuKE0M7R74OqnJg/SCAhvubbQaTNyfR7IkVLPte 1HyproHI/Pv/xHk2dK75Z38Lwq9xC7740G6hHyZAA5mRc0wJjmUBeMKIVtT7lXF75Puv t3ymj2ZokpA1NidLyAiz4QPtulm3J+p9zw4AHZBEuc3u2C3MYdyqYrNYg2JCdF75SMO/ spHkSmaXK0Lq37bPTtx/4bw0uYYZDrrULyCNolz8sLbYX/LW5hjBpCs/imNXxe+1wyy+ mxm6+s3jmteQXx/8PTInk4YJejZvHsZGzfoFdS9V3IWHbSlUf1RK/eIySq6voy9FNK65 LOhw== X-Received: by 10.180.100.106 with SMTP id ex10mr1562wib.7.1412881950697; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.99.161 with SMTP id er1ls9003wib.4.canary; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) X-Received: by 10.181.25.234 with SMTP id it10mr36444wid.1.1412881950381; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [2a00:1450:4010:c04::235]) by gmr-mx.google.com with ESMTPS id us10si649940lbc.1.2014.10.09.12.12.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Oct 2014 12:12:30 -0700 (PDT) Received-SPF: pass (google.com: domain of jhovold@gmail.com designates 2a00:1450:4010:c04::235 as permitted sender) client-ip=2a00:1450:4010:c04::235; Received: by mail-lb0-x235.google.com with SMTP id l4so1742493lbv.40 for ; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) X-Received: by 10.153.4.11 with SMTP id ca11mr20796191lad.24.1412881950319; Thu, 09 Oct 2014 12:12:30 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id ju7sm1201070lbc.0.2014.10.09.12.12.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 12:12:28 -0700 (PDT) Sender: rtc-linux@googlegroups.com Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1XcJ5o-0006hh-Us; Thu, 09 Oct 2014 21:09:40 +0200 From: Johan Hovold To: Alessandro Zummo , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= Cc: Andrew Morton , Felipe Balbi , Lokesh Vutla , Guenter Roeck , Colin Foe-Parker , AnilKumar Ch , nsekhar@ti.com, t-kristo@ti.com, j-keerthy@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Johan Hovold Subject: [rtc-linux] [PATCH 08/12] rtc: omap: restore irq state after reading TC registers Date: Thu, 9 Oct 2014 21:06:30 +0200 Message-Id: <1412881594-25678-9-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1412881594-25678-1-git-send-email-johan@kernel.org> References: <1412881594-25678-1-git-send-email-johan@kernel.org> X-Original-Sender: jhovold@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jhovold@gmail.com designates 2a00:1450:4010:c04::235 as permitted sender) smtp.mail=jhovold@gmail.com; dkim=pass header.i=@gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Make sure to restore local irq state when reading the timer/calendar (TC) registers, so that omap_rtc_read_time() can be called with interrupts disabled. Signed-off-by: Johan Hovold --- drivers/rtc/rtc-omap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 0ef016553a97..62e2e9a9887a 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -239,8 +239,10 @@ static void bcd2tm(struct rtc_time *tm) static int omap_rtc_read_time(struct device *dev, struct rtc_time *tm) { + unsigned long flags; + /* we don't report wday/yday/isdst ... */ - local_irq_disable(); + local_irq_save(flags); rtc_wait_not_busy(); tm->tm_sec = rtc_read(OMAP_RTC_SECONDS_REG); @@ -250,7 +252,7 @@ static int omap_rtc_read_time(struct device *dev, struct rtc_time *tm) tm->tm_mon = rtc_read(OMAP_RTC_MONTHS_REG); tm->tm_year = rtc_read(OMAP_RTC_YEARS_REG); - local_irq_enable(); + local_irq_restore(flags); bcd2tm(tm); return 0;