Received: by 10.192.165.156 with SMTP id m28csp1485919imm; Wed, 11 Apr 2018 20:59:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx48a0nsGghImLAUOQX73I23zRfDo72xKzpVqPSR4yYq+1zuKzCrAK8K+Uxmt/fjq2oTpQDtf X-Received: by 10.98.15.195 with SMTP id 64mr6156607pfp.63.1523505577193; Wed, 11 Apr 2018 20:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523505577; cv=none; d=google.com; s=arc-20160816; b=ncWvsTsHty6J8YK6hOyq/IB7EgDBj2hcpP5MWrSC/7hAWGobuYxNmQjay5DWq6/tZI aM6CmBeNU/sCE5O0gXtD9rwvPnnQe+rZHLzIhTxXaJyEWqnplA0qduB15+c9kJg0JN+Y lCo9EeFSHrhUlwDZqHSKCbZguENyZRoC9OreEtiZzKi6Wz3BCoBOy7rBCiZc7IUTx825 bGgbIrR44Fru3h8f8zxH4tE/1MO0uQVvP80/0Khf896wi+Nuq6ZM+S78XFV0MY8pui3a 7v8Y/rVbfKG1B/eZgparboVdm5jB8YWl+biO6leTAwOARz2Y81oYBu6oP69hNF3qCG5b K8ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=s5JsDeCb3UTISj+a5SY65DtyDxTbI3pVeiDVWRTNdMk=; b=ff8CZKf0HkuUZOXbWbukmHb6HkO0q1wVheuIFA27uOw3BUsSDCkZOQ/nV5aU1xAYV7 BITZW5qtiV5GtPt+vFbIhWcMoQrWnTchwCJjz3GbSgGB0hFrNv0Wvj8Gvrg/mnMtQt3E vQZcQGcJjgiwF7PyLyxBn1mhDWwSJfSih/UeNCbwNLKMFxHjRiQ1c3p+ehsrZngfi/GZ PxAxAuZ5HN8qb4dIg9sVGbksIIPKQuNKfGINmZYyEy25athzHpGhX7qgb96Wdhc83/s3 E5niwGYZ20U2lHnIAbdSqIb6rhkd6KVrXPRq6UNUvAJcMA1BIIEJP0lnZsAHzSeqqagh 2t5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wg9QrCqz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6-v6si2534167pln.61.2018.04.11.20.59.00; Wed, 11 Apr 2018 20:59:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wg9QrCqz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753046AbeDLDzv (ORCPT + 99 others); Wed, 11 Apr 2018 23:55:51 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:65153 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752959AbeDLDzs (ORCPT ); Wed, 11 Apr 2018 23:55:48 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3C3tIDo012150; Wed, 11 Apr 2018 22:55:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1523505318; bh=BfI5ni+/sXL1FkHOHOjfATzfFR3sAZaWrueHe9L5oeI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wg9QrCqz+5I15CvPI43SoDQMDcr5Y4nnb+2h2A3IDtJNx+Q1lr0cyQlO7GBzXU7OR UDEFTrXNWo6cyNhaGXS70Q2x5bVA9WG6PlF6jvqbNuXAyVbRohcJ95LB0HKB+dDto8 FS8EIgVtufFb3MEi5WUhPaAyJznMPFsZ558lN4E4= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3tINg008540; Wed, 11 Apr 2018 22:55:18 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 11 Apr 2018 22:55:18 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 11 Apr 2018 22:55:18 -0500 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3C3sQpu010150; Wed, 11 Apr 2018 22:55:15 -0500 From: Keerthy To: , , CC: , , , , , , , , Subject: [PATCH 13/14] ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled Date: Thu, 12 Apr 2018 09:23:58 +0530 Message-ID: <1523505239-16229-14-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> References: <1523505239-16229-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Gerlach When the RTC lock and unlock functions were introduced it was likely assumed that they would always be called from irq enabled context, hence the use of local_irq_disable/enable. This is no longer true as the RTC+DDR path makes a late call during the suspend path after irqs have been disabled to enable the RTC hwmod which calls both unlock and lock, leading to IRQs being reenabled through the local_irq_enable call in omap_hwmod_rtc_lock call. To avoid this change the local_irq_disable/enable to local_irq_save/restore to ensure that from whatever context this is called the proper IRQ configuration is maintained. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy --- arch/arm/mach-omap2/omap_hwmod_reset.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c index b68f9c0..d5ddba0 100644 --- a/arch/arm/mach-omap2/omap_hwmod_reset.c +++ b/arch/arm/mach-omap2/omap_hwmod_reset.c @@ -92,11 +92,13 @@ static void omap_rtc_wait_not_busy(struct omap_hwmod *oh) */ void omap_hwmod_rtc_unlock(struct omap_hwmod *oh) { - local_irq_disable(); + unsigned long flags; + + local_irq_save(flags); omap_rtc_wait_not_busy(oh); omap_hwmod_write(OMAP_RTC_KICK0_VALUE, oh, OMAP_RTC_KICK0_REG); omap_hwmod_write(OMAP_RTC_KICK1_VALUE, oh, OMAP_RTC_KICK1_REG); - local_irq_enable(); + local_irq_restore(flags); } /** @@ -110,9 +112,11 @@ void omap_hwmod_rtc_unlock(struct omap_hwmod *oh) */ void omap_hwmod_rtc_lock(struct omap_hwmod *oh) { - local_irq_disable(); + unsigned long flags; + + local_irq_save(flags); omap_rtc_wait_not_busy(oh); omap_hwmod_write(0x0, oh, OMAP_RTC_KICK0_REG); omap_hwmod_write(0x0, oh, OMAP_RTC_KICK1_REG); - local_irq_enable(); + local_irq_restore(flags); } -- 1.9.1