Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3496199imm; Sun, 16 Sep 2018 20:24:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJqSQ/Kkx0t31Y+9cPZ0PF9RM2QAtJ5VSrjO03vShwQ1l5x6/RJ3na/6dOEmjTS18icGWv X-Received: by 2002:a17:902:74c8:: with SMTP id f8-v6mr7419540plt.95.1537154659255; Sun, 16 Sep 2018 20:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537154659; cv=none; d=google.com; s=arc-20160816; b=zNpKLcUIHrI8TOpJe9OEPBHFWylY9wpDD4oBQCUlKlOnHiCNDzRFZYeQMOWVsOKcAx gAO+6ytg4kWMX1IOoBJdzXxz+mU3vXKVhI/JZx8Nh4leeW1Aj8qd1pDIzoD+arXXX5KC XtrjNvoKJa0WYpU774QKYXhxsdwD5lZE7Kcap8UpXPnKt9oG4ENC+zB0mvaNDk8Iy6jB 1kbZ9WgoItHXG2VE0FR5ljy2ICXe6a35e40Mfj6SvEUA8kvyddP2ynmWbASeVrFdfTmI ZBJ3IpI7YrW/ozfv1EMzGTZN9fkk3sEUR65ldUQ3z2iiyvnKfdFbe2BJwlTm3nt0FyyK J8bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=yWBm5eSKbRkU040jDQdXHBNCrQjq/8+1dLz0majuX4U=; b=nck3XK6GFFc3UsNDW4yFChj32BsA0BAYhSOX1YwcUWsBXwn+PackcIs8zGZ6DSFc9K rNYQv8FsBbUaU4T433xQ/v6adBYmF8/bIqLjD/uTJH19aDgP7441PpccgEVDSMA8bgiA swfEzbtfflziDOzLC3tclI8WVXJ0K7jX7YmIXju6v3EVojDvpwdtmnTVsV7rieYCca9I eocpmIBtGmlf7zw8k9/EJ2Fg3n94DIxSCjEUs/b5nmS8p6UCL3qew4OOXvdWyrLcB+eh iVDEzbOU00uT19f91DflqutmGqIiBWcW7LRJ4ovBy2AymdsgNSP6JiV8BAxau6YtkVhj 5dYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=J46DT3O0; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si13952274pgi.416.2018.09.16.20.24.04; Sun, 16 Sep 2018 20:24:19 -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=@microsoft.com header.s=selector1 header.b=J46DT3O0; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730124AbeIQI32 (ORCPT + 99 others); Mon, 17 Sep 2018 04:29:28 -0400 Received: from mail-eopbgr710114.outbound.protection.outlook.com ([40.107.71.114]:1680 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728969AbeIQI32 (ORCPT ); Mon, 17 Sep 2018 04:29:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yWBm5eSKbRkU040jDQdXHBNCrQjq/8+1dLz0majuX4U=; b=J46DT3O0YRE3a2h5uXtwin2sUWENCopst1CjCvQKlZN8HiHQgq5SrXz1omNaI4OUCKsjTCNh59mcAyLED0R+FuCOJYPMSroFeiUF9exHFYXxXdw/eQmcP8B0kJXS7EKVn4tjHaj5zJ6Rb3wMUotqxysgF+Woz3QvoOltquCRvFY= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.5; Mon, 17 Sep 2018 03:04:11 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1185.003; Mon, 17 Sep 2018 03:04:11 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Dave Gerlach , Keerthy , Tony Lindgren , Sasha Levin Subject: [PATCH AUTOSEL 4.14 31/87] ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled Thread-Topic: [PATCH AUTOSEL 4.14 31/87] ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled Thread-Index: AQHUTjLnAYF8TwVOs0GpSx6YQ05a4w== Date: Mon, 17 Sep 2018 03:02:43 +0000 Message-ID: <20180917030220.245686-31-alexander.levin@microsoft.com> References: <20180917030220.245686-1-alexander.levin@microsoft.com> In-Reply-To: <20180917030220.245686-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0776;6:XdRqTn3MJPru0MLvP/hL6zgZIH9voQ4MrP0UXgtq5fOLcDHYZ6UohYFriCGMo7o4qhoxx2QOFlfrC1N4vzhdKT17KxbXI29AtnsxrNFXA3Fv3syKuNLuSn4IcqSoJ1B/0Iv2fdm3cPYe6F/q9HaLeV3zHuMLeX9ztmwATGyo5d5Kpms7dR1s2DfQ2jCbuUeJ7VlzUMu9PDRZUI8fMXjPskbKAWFPbTHlWcY8al9W7T/7bJCtqbUB8XjhYfgy28k0whyTXp3KNCTBSidY6ZWkyYFvhnLQGzHh8uaI37BZBBNDyhirQ0UqoWQNZNrc2AkzenKvuJU3Mmp7lc3cutdnlqAvgbsXDFIfblZsqVlKAs/c3EgptDPLCPjHVEOS/NlHgACQx5NkDArnEIHoZ9YgieMYkzQ2YMU4/yEoKTJlcPTSg7ZMPrn0D84sgljDglw+F4gL6KgIcSo8dXZip0/SjA==;5:HLCTQOpnvXO0GUH6pseWiGdHIuCa3tbq+OhVuCUxgV5nNknki9cSQgJD0K/LBpENeqZJUL3TRaRXwMZN3JF1lRL7Q4sdKMO1B8x7LRNZ/nPgHOdixwlVjZkCuA49lwnqZWL4bbUdiQtL4901vBqBWzv3m5AAqRipb3qbXMx1saY=;7:DNKfyUDB9glrp1I9qKgku4ZZiFBfq7zkipFLEnQyb1vhNg2EJVvCOumn3rulfrv4485Q16CKiHonLXR1BesLKuNGeUFZAurmWwaFgOgR0CVD/4gaaCbnM7XQTgyhUP4tzKkOSmFvL8YtRMuUxW2DnkEh2RtY8bJpRfI/3z/ZS9ssSPBFocqlTaQYLM2G36HlfX+3FDIBb0/n9s8mOrZzIMCHBQhpnk11e8U4N6bRsd+xgX+nVxGaJchBG0YoNGnO x-ms-office365-filtering-correlation-id: 3c27fb87-aa36-4d5e-e089-08d61c4a3de8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:CY4PR21MB0776; x-ms-traffictypediagnostic: CY4PR21MB0776: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(31051911155226)(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231355)(944501410)(52105095)(2018427008)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050)(76991041);SRVR:CY4PR21MB0776;BCL:0;PCL:0;RULEID:;SRVR:CY4PR21MB0776; x-forefront-prvs: 0798146F16 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(136003)(346002)(376002)(396003)(199004)(189003)(5250100002)(53936002)(72206003)(14454004)(102836004)(478600001)(4326008)(6346003)(2501003)(25786009)(6666003)(10290500003)(110136005)(54906003)(6436002)(66066001)(8936002)(316002)(107886003)(76176011)(2906002)(217873002)(6116002)(3846002)(22452003)(14444005)(6506007)(486006)(5660300001)(7736002)(2616005)(11346002)(446003)(97736004)(476003)(6486002)(105586002)(81166006)(99286004)(186003)(81156014)(575784001)(2900100001)(8676002)(86612001)(68736007)(86362001)(26005)(36756003)(305945005)(256004)(106356001)(6512007)(1076002)(10090500001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0776;H:CY4PR21MB0776.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: 6tsMBB/a/WuTrpQwaQkTLi4I/KotUUAOWai3VywNcPAPb3umO0++1O7Ex5G8D03+KP1H5v6y82T9g5KU/xgjcNgCcpQMZ3YMu3Z3ftGcFdpKXa/RzXmFpwSPDvEUrxRqWR1PvyYRwZ9zhibArawcPV2bvf7kFg3d3a6DdQ1LiP0gz/Mh0gkNCZ/gFR1jbxp+/R+CFZU1RaPmVJ5s3baNjbivMnj3mp+ZdXdFgq1jHG3Hw2DYgM3Bzx3LAF2f7nE3sODlZfYX+qP9wwsdlZHlLvLTIgjzeK9KqXesJGjb/heHvErgtxQ2ZYyRLWmYoSGdMP0aK8aJeUy6So64n5Nowk4CXXq8x9WhWz+FggrCRLo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c27fb87-aa36-4d5e-e089-08d61c4a3de8 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2018 03:02:43.3844 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0776 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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/o= map_hwmod_reset.c index b68f9c0aff0b..d5ddba00bb73 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 *o= h) */ 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); } =20 /** @@ -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); } --=20 2.17.1