From nobody Fri Apr 26 05:34:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43483+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43483+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1562770410; cv=none; d=zoho.com; s=zohoarc; b=SLnNaHJl66kOIqoLtqavhPeRgysao7flfGIj6X+PCROIK6q7VWf6HDCiwJdNmveAJMAoEWlAuR6heFXs/yq7nU0GCRiFZDCfyP90tEb+OePWwdcRgfJGS4DX/hiA4Zq5fUnHv+BwXSPaT55xgaVIThVZEM68NHX9eT5pgw2s+kE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562770410; h=Content-Type:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=O4oo5BYeCa/bMgel0nElaHgtG0ADD0Np9uXGQkNd7bQ=; b=UdUsMirI247hLaOkkxnCRRCju3W7VSVSgGRl4bvMviqjc9PdH1BZB6NcXcGWHqKGpI8hP3Sd734qnjl3gi0Aa0xSLlyfyCwsDvM9quoSsvyuE8c0bS4QhSOhBorsA3yKrZIqGmUmE5sS3BaSXuxxuag+fOXP66HUgJgvGPhMYhA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43483+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156277041005510.16979079998066; Wed, 10 Jul 2019 07:53:30 -0700 (PDT) Return-Path: X-Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by groups.io with SMTP; Wed, 10 Jul 2019 07:53:28 -0700 X-IronPort-AV: E=Sophos;i="5.62,474,1554768000"; d="scan'208";a="684741737" X-Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 10 Jul 2019 14:53:22 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id 73BEEA1C62; Wed, 10 Jul 2019 14:53:20 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 10 Jul 2019 14:53:19 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.162.106) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 10 Jul 2019 14:53:18 +0000 From: "Alexander Graf via Groups.Io" To: CC: Leif Lindholm Subject: [edk2-devel] [PATCH] PL031: Actually disable interrupts Date: Wed, 10 Jul 2019 16:53:11 +0200 Message-ID: <20190710145311.12184-1-graf@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.162.106] X-ClientProxiedBy: EX13D01UWA001.ant.amazon.com (10.43.160.60) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,graf@amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562770409; bh=kiILUs/IzuhURKxca9889vh5F79LOK9QvzM9IBDp3aA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=T8Y1j2jlpcXUSaLEAWA4iIn2fUvFvs5OJSwWctbGqpKAIIa9OzsZs3t+95lLO/q9nXp 77IvlH43FvIpSpA65W/XVoph/XkHQuULj5PQYr4BRH8IZEjNQabpqBq8oYEGSVldP27Lz O615NujS2+ugGx7NDSVYGQ+LXjfSMr9mYUc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PL031 interrupt mask register (IMSC) is not very clearly documented in the PL031 specification. However, bit 0 (RTCIMSC) indicates whether interrupts are enabled, not disabled. So before this commit, we were actually *enabling* interrupts for the RTC. This patch changes the logic to instead disable interrupts when they are not disabled already. Signed-off-by: Alexander Graf Reviewed-by: Leif Lindholm --- .../Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeCloc= kLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib= .c index b630a5cfbf..75c95985d4 100644 --- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c +++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c @@ -80,8 +80,8 @@ InitializePL031 ( } =20 // Ensure interrupts are masked. We do not want RTC interrupts in UEFI - if ((MmioRead32 (mPL031RtcBase + PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGIS= TER) & PL031_SET_IRQ_MASK) !=3D PL031_SET_IRQ_MASK) { - MmioOr32 (mPL031RtcBase + PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTER, = PL031_SET_IRQ_MASK); + if ((MmioRead32 (mPL031RtcBase + PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGIS= TER) & PL031_SET_IRQ_MASK) !=3D 0) { + MmioWrite32 (mPL031RtcBase + PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTE= R, 0); } =20 // Clear any existing interrupts --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43483): https://edk2.groups.io/g/devel/message/43483 Mute This Topic: https://groups.io/mt/32416951/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-