Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1324849imm; Tue, 2 Oct 2018 06:33:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XUYE7daJjP/9velzpYPMggkDSqJtPyWGddSC0HI6K3NHGe/KMy+5YDm3OOBARo68w7ftG X-Received: by 2002:a65:6249:: with SMTP id q9-v6mr14367122pgv.392.1538487192111; Tue, 02 Oct 2018 06:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538487192; cv=none; d=google.com; s=arc-20160816; b=jtaDqCkAvhrDvifrlYJzxlzbGlXmI+5EugdNRSya6U/V1Np8Oc5RMr/lk7onthWgrv ZdWBEdlLGNTnfVqQb3oj0boRb7660EAJ/m6t9Ub9JgcK6UsuzXTv631mW9Odbx8lV3XB TUT4lMSpUB9jESbzNSxiVSFVYutvPd7P2kRj+3zojXT8l69gICS+YIPNbHjpC9EkaNeA u96UuWHJ4XJg21P+EoPHRU0bDrEyRUeg5AR2TE77seLnc17wZjhisxt3XEWt4ALX7Lq7 spWS3evxVmfcRglVWpenhSWVnAAzDRInrsq1y8ZXQDH8HV1wjAno88Ka+TpZvYbktOyF eDMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=irrw6lzZrZ9c8IoLlpu/xYOiRRGX2lSrIPtINIn9gvI=; b=fnE2XREi2g0cggZ4UvM7HofHCMKOxk8s1aW0qDhwdAndVYrB1UDaSSgKk96Xg3XL+b pu6Ab517ZFeOFkL9M+neqLbelX9mfnXAUBakP0/czo4bif/A1FvoTNfC4J9F2pPRNdoW lcvb3xoijXd7VX1uQ0kBpoBq3P04Ca4yiEd7byptrDyH5aWsfWtmbm/N1kT7Agq2KhV2 gmI4NvGmYtiCU90zdDqMt3rwfabmj/o4P/o/1QjjGaxtGdh+f4+4i6GfHVQ3XcbXdfrd 3g2byC/t9TNtS2uxcdq9xVef/xKyGQbsz4yZvWvWbUHctf7WtN8SBGxvtcmIISyVjAt8 a3rw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u189-v6si17052517pfu.263.2018.10.02.06.32.57; Tue, 02 Oct 2018 06:33:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731272AbeJBUP1 (ORCPT + 99 others); Tue, 2 Oct 2018 16:15:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34390 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729775AbeJBUP0 (ORCPT ); Tue, 2 Oct 2018 16:15:26 -0400 Received: from localhost (24-104-73-23-ip-static.hfc.comcastbusiness.net [24.104.73.23]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 43AFBC3F; Tue, 2 Oct 2018 13:32:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Gerlach , Keerthy , Tony Lindgren , Sasha Levin Subject: [PATCH 4.14 029/137] ARM: hwmod: RTC: Dont assume lock/unlock will be called with irq enabled Date: Tue, 2 Oct 2018 06:23:50 -0700 Message-Id: <20181002132500.496336811@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002132458.446916963@linuxfoundation.org> References: <20181002132458.446916963@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dave Gerlach [ Upstream commit 6d609b35c815ba20132b7b64bcca04516bb17c56 ] 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 Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-omap2/omap_hwmod_reset.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- 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(struc */ 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_h */ 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); }