From nobody Mon Feb 9 16:51:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109838+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109838+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697804358; cv=none; d=zohomail.com; s=zohoarc; b=m8OjgVpe7Bh2RqS1O4mo2QQwFdZ5KuKIQrweLM1909bME1x7FevGJ99HL0ugomPH4SwLj8IsCd+dmnakgphKrb3p6bBaVstoh68yA3ttMLebB/1KtkgL3JbYeFK+TY05bppYqfuGEbztglFinwBPLUOYenOveqnK7T+6iSniAvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697804358; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=C6kkXrMODAziqkUHvX4JFxtN7A7tHIkp9PqMLaJwo1U=; b=gS4zbGoPwpt9orKyCR2yUg976PYWvr1zficAm+9bzoA5t5FuaO4rwevRWHwcgkJfQsBL0saYfM2vdWJOuVJn2ritu7kbPgdTZgy0Tu+Kwv92veA+HgeAuJctcTC2nmwkN7wmmo5SHgDcsTZ4rbw9XHfUIH6xEjx/DGOLK7kMO8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109838+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697804358108213.01662344774968; Fri, 20 Oct 2023 05:19:18 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=C6kkXrMODAziqkUHvX4JFxtN7A7tHIkp9PqMLaJwo1U=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1697804357; v=1; b=jVqKX9j/6TzOEJH/fuRCSxKro07Q02Sg+NbHNEwdyDRPgbWecozQTt8yD7/wGl9Gv4TOrc5t n/HMzGDacvqbgNwBWiRtIr71gMAcacMNPed5YXbajCSuWt9HGn4Jl/0wXZC/E71DHnBRkH0z1TA kSbKoFX+duOKpq59EBldPMh8= X-Received: by 127.0.0.2 with SMTP id ASFFYY1788612xyEsu12XSpK; Fri, 20 Oct 2023 05:19:17 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.52931.1697804357135663028 for ; Fri, 20 Oct 2023 05:19:17 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-wSbe0PU-OHqRC8JUiS-97Q-1; Fri, 20 Oct 2023 08:19:12 -0400 X-MC-Unique: wSbe0PU-OHqRC8JUiS-97Q-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 788C388B77A; Fri, 20 Oct 2023 12:19:12 +0000 (UTC) X-Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.194.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 951058CEF; Fri, 20 Oct 2023 12:19:11 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Wenyi Xie Subject: [edk2-devel] [edk2-platforms PATCH 3/7] Hisilicon/M41T83RealTimeClockLib: remove superfluous instance init steps Date: Fri, 20 Oct 2023 14:18:59 +0200 Message-Id: <20231020121903.44986-4-lersek@redhat.com> In-Reply-To: <20231020121903.44986-1-lersek@redhat.com> References: <20231020121903.44986-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2CapaJ6qxgudP48pz1biFdDGx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697804358337100009 Content-Type: text/plain; charset="utf-8"; x-default="true" RealTimeClockLib instances are consumed by edk2's EmbeddedPkg/RealTimeClockRuntimeDxe driver. In its entry point function InitializeRealTimeClock(), the driver: (1) calls LibRtcInitialize(), (2) sets the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services to its own similarly-named functions -- where those functions wrap the corresponding RealTimeClockLib APIs, (3) installs EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL with a NULL protocol interface. Steps (2) and (3) conform to PI v1.8 sections II-9.7.2.4 through II-9.7.2.7. However, this means that LibRtcInitialize() (of any RealTimeClockLib instance) should not itself (a) set the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services, nor (b) install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL. The runtime service pointers will be overwritten in step (2) anyway, and step (3) will uselessly install a second (NULL-interface) EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL instance in the protocol database. (The protocol only serves to notify the DXE Foundation about said runtime services being available.) Clean up Hisilicon/M41T83RealTimeClockLib accordingly (it only has code that's redundant for step (2); it does not try to install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL). (Note that the lib instance INF file already does not list UefiRuntimeServicesTableLib.) Build-tested only (with the D06 platform). Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Wenyi Xie Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4565 Signed-off-by: Laszlo Ersek --- Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.c = | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTim= eClockLib.c b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTi= meClockLib.c index 5f9465843475..3a2cd451c4ef 100644 --- a/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockL= ib.c +++ b/Silicon/Hisilicon/Library/M41T83RealTimeClockLib/M41T83RealTimeClockL= ib.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "M41T83RealTimeClock.h" =20 extern I2C_DEVICE gRtcDevice; @@ -427,12 +426,6 @@ LibRtcInitialize ( =20 EfiInitializeLock (&mRtcLock, TPL_CALLBACK); =20 - // Setup the setters and getters - gRT->GetTime =3D LibGetTime; - gRT->SetTime =3D LibSetTime; - gRT->GetWakeupTime =3D LibGetWakeupTime; - gRT->SetWakeupTime =3D LibSetWakeupTime; - Status =3D InitializeM41T83 (); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Status : %r\nRTC M41T83 Init Failed != !!\n", -=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 (#109838): https://edk2.groups.io/g/devel/message/109838 Mute This Topic: https://groups.io/mt/102079657/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-