From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.web10.5689.1609855790017936405 for ; Tue, 05 Jan 2021 06:09:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=Tv+m2Yn/; spf=pass (domain: akeo.ie, ip: 209.85.128.46, mailfrom: pete@akeo.ie) Received: by mail-wm1-f46.google.com with SMTP id c124so3116266wma.5 for ; Tue, 05 Jan 2021 06:09:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MHjLaw5q4sbtF6Owtfaz7tDd4CEiISYGXbvuhsG15HY=; b=Tv+m2Yn/XncbS04VdTCmK5E9L+UHdMBQqZhDNe8ON+ZRqLuqL3hC7JCdW4kK9shFlt VtxvzsNT7B6R6YWfYrL9VSkl2jJIosuFsozvpBZWGoVdx2tDza0hanjxOBHSYiMFT4zK NB7LO3eRvbqJLK9CCpd/9FUy0tv+35krXIPCbGXBpNzTF4lFP5raDUGbrrUwNiQo5ikH 2t0ZODiFzIX2XYLVEJ6QCdNRZmnZJlFlqWXLbW8TnAuaouoMfAXrYDmav92ubhLCnkFI nCkM27SBo9HRO5xGgwcsaYtlA04KDHFmgTW8iUm1YtoWjiVHnsqaAapyseuw0U00cYkx xFwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MHjLaw5q4sbtF6Owtfaz7tDd4CEiISYGXbvuhsG15HY=; b=kpGer5JgCgNOHxDA4FfUroHqESC+yOI+xdgXlHGMXl/M9umJ6HCh4jZewQOyKplu1v PhRVa5a2j6v4oBd62AmTFcR3e9hHmG0FXi8k3whgdLmiItMkjYpkP2daKvomoXz/n+cR phcLHxjoTm4gknLVAptVhKBJaDQYKsSFUumd4heeX8warK6q3bJNEb9VjVtX6oE0ce8o XK73WaiP7hwVj48tYOs40K0HpP2z170jxyqRMxlMLGbuwihvjrQEJcuijAQiR/ubCID7 wsobPOx2gdz3auHFlK9s2OFavKhipuS0sCmIOZv8owULnsHPUJ0LJTY/O2JQUIhb3p9e CJlw== X-Gm-Message-State: AOAM532nLPVgxsb+q1UJvC5RrPboo6hibMHXm27Y0fOCvKGfSwDx6H+O CBFaEHcKLLoODa52KmgQKJ13AB4hNtilEBii X-Google-Smtp-Source: ABdhPJxC2R7yOQPoczvq5WcSxk1rnWpuSNz4hJf/nIJOIvmzO0iYh/NImYvpaQq0kUXB01ATc/qiwQ== X-Received: by 2002:a1c:5644:: with SMTP id k65mr3642042wmb.62.1609855788333; Tue, 05 Jan 2021 06:09:48 -0800 (PST) Return-Path: Received: from localhost.localdomain ([84.203.63.11]) by smtp.gmail.com with ESMTPSA id v4sm97004399wrw.42.2021.01.05.06.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 06:09:47 -0800 (PST) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com Subject: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi: Fix Linux kernel panic on reset/poweroff Date: Tue, 5 Jan 2021 14:09:36 +0000 Message-Id: <20210105140936.1519-1-pete@akeo.ie> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Commit 94e9fba43d7e132be3c582c676968a7f408072c1 introduced an unconditional call to PcdGet32 after we exit boot services, that produces a kernel panic on Linux reset. This addendum to the previous commit ensures that we only read the PCD and apply the delay while we are still in UEFI, which is what we want anyway as the goal was to fix the storage of NV variables set by the user from within the UEFI firmware interface. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Library/ResetLib/ResetLib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/Library/ResetLib/ResetLib.c b/Platform/Ra= spberryPi/Library/ResetLib/ResetLib.c index 4a50166dd63b..a70eee485ddf 100644 --- a/Platform/RaspberryPi/Library/ResetLib/ResetLib.c +++ b/Platform/RaspberryPi/Library/ResetLib/ResetLib.c @@ -52,13 +52,13 @@ LibResetSystem ( * Only if still in UEFI.=0D */=0D EfiEventGroupSignal (&gRaspberryPiEventResetGuid);=0D - }=0D =0D - Delay =3D PcdGet32 (PcdPlatformResetDelay);=0D - if (Delay !=3D 0) {=0D - DEBUG ((DEBUG_INFO, "Platform will be reset in %d.%d seconds...\n",=0D - Delay / 1000000, (Delay % 1000000) / 100000));=0D - MicroSecondDelay (Delay);=0D + Delay =3D PcdGet32 (PcdPlatformResetDelay);=0D + if (Delay !=3D 0) {=0D + DEBUG ((DEBUG_INFO, "Platform will be reset in %d.%d seconds...\n",= =0D + Delay / 1000000, (Delay % 1000000) / 100000));=0D + MicroSecondDelay (Delay);=0D + }=0D }=0D DEBUG ((DEBUG_INFO, "Platform %a.\n",=0D (ResetType =3D=3D EfiResetShutdown) ? "shutdown" : "reset"));=0D --=20 2.29.2.windows.2