From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web10.3877.1591696908626037091 for ; Tue, 09 Jun 2020 03:01:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=yjCSeJ/f; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.68, mailfrom: pete@akeo.ie) Received: by mail-wr1-f68.google.com with SMTP id c3so20553567wru.12 for ; Tue, 09 Jun 2020 03:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MOvMusezSPhCfTceLYP8X2lYiOHcCiGCOpEByCFq4qI=; b=yjCSeJ/f+6X6p397nmSRUywEucrmmr6tNXD+kKe+I9OpIcEA3SkcAwdHRPfesGjyg4 AnkD7Zd1ddpk+d6M+ZS+P3ElapXT5KA4tKS02E0URnAwnD2oevXHINlW7wBPJaRVJwJJ xvpX6SCdETjSmKA2bepufhFpMnO/jb2VPtgrVBbKlog+8A/3z1inkWsQ2Cx9DXS89iNr j1OtsMQ9ooCLCBUSh1XbZTeOsOPonH4qH2vdXRESILRLdkNCz6uo4lKumS6xBJ6GJSGw 8/At+L6ozQ23lR7VVClQbTMfIerOVxOXk1JhFuJ+0oPs2gVLxHG75UVs6MXquQnQCvls Kr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MOvMusezSPhCfTceLYP8X2lYiOHcCiGCOpEByCFq4qI=; b=LIDuRzPnGeL93144XyjBeAJsbPdp+l+LWPP7AncrzpVUOK1nxY7zES7XQrcCJD7ssT 9SL1pDe7BugwPp1a5KhojmddM978XGku9O0EHNvOPWA92kIGyFak+uI2l6RWpwjM5Yg+ NN3ZGKZmUAB9tiH01E1pwc89k2bdsrGC0yGu98Kw+bYctXrj3kBQGglSUZO1Ps3DjajO cVQ7M6zXUHS+DZxFB3cYLJ/dgONZBPUHmuAJmqTMenbC2aHXDcBh4/gtV0f77cK6HYCr oQxN9UAUTfJ6tR/JeaC6qo8BN9Bj+ZFKk7RF/qS081bBZLij/bPGHVJ+Y8jSKtxIMiRU qVlA== X-Gm-Message-State: AOAM533QlHxjGo22cReRMEA/14+C/VBsfLNUHlmhJc45oQQ/D1WKaiLB ZfX7hjXSzTet4TIBEKqm/Cdda0VTAj5tuw== X-Google-Smtp-Source: ABdhPJyW9TSQkyKOX+RiPlbTTwZ3t+UpMAdxbaNZun0uKj0hIh2ZojBImVka1dNneNY9kFnABWXTzA== X-Received: by 2002:adf:82cf:: with SMTP id 73mr3370560wrc.382.1591696906953; Tue, 09 Jun 2020 03:01:46 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.48.247]) by smtp.googlemail.com with ESMTPSA id t8sm2284626wmi.46.2020.06.09.03.01.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jun 2020 03:01:46 -0700 (PDT) Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] Platform/RaspberryPi: Revert don't connect all devices on an ordinary boot To: devel@edk2.groups.io References: <20200608155159.8748-1-pete@akeo.ie> <5009d194-b701-b602-ba3a-dd32891173bd@arm.com> <246570db-3b98-a893-fec0-85d6b13d7641@akeo.ie> <0c1125b9-146a-2b1c-e8b2-bade49ff7620@arm.com> <1616A175B5F96459.24909@groups.io> From: "Pete Batard" Message-ID: Date: Tue, 9 Jun 2020 11:01:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1616A175B5F96459.24909@groups.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit NB: This patch is now superseded by https://edk2.groups.io/g/devel/message/60941 On 2020.06.08 18:24, Pete Batard via groups.io wrote: > On 2020.06.08 18:10, Ard Biesheuvel wrote: >> On 6/8/20 7:01 PM, Pete Batard wrote: >>> On 2020.06.08 17:43, Ard Biesheuvel wrote: >>>> On 6/8/20 5:51 PM, Pete Batard wrote: >>>>> This reverts commit c8000ecccc83b728baf04ced2fedb870bc3bc1b3 on >>>>> account >>>>> of USB keyboard devices not being detected until after the timeout to >>>>> enter the Setup menu or run the UEFI Shell has expired. >>>>> >>>>> The core of the issue is that, when EfiBootManagerConnectAll() is not >>>>> invoked, PCI bus scanning only starts after the BDS wait period has >>>>> elapsed, which effectively takes away the ability to use an USB device >>>>> to enact Boot Device Selection or interact with the Setup menu. >>>>> >>>>> Signed-off-by: Pete Batard >>>> >>>> Could we move the call to >>>> >>>> EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); >>>> >>>> to the start of PlatformBootManagerBeforeConsole() instead? >>> >>> Moving EfiEventGroupSignal(&gEfiEndOfDxeEventGroupGuid) early into >>> PlatformBootManagerBeforeConsole() doesn't seem to have any effect, >>> as far as I could test. >>> >>> We can however move the EfiBootManagerConnectAll() there if that's >>> what you are asking. >>> >> >> No, the whole idea was to get rid of EfiBootManagerConnectAll(). >> >> You are saying the PCI bus scanning starts after the BDS wait period, >> right? This is strange, I wouldn't expect that. That is why I >> suggested moving the EfiEventGroupSignal() call earlier. >> >> Looking at the ArmPkg version, it appears we need a sequence like >> >> EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); >> >> EfiBootManagerDispatchDeferredImages (); >> >> FilterAndProcess (&gEfiPciRootBridgeIoProtocolGuid, NULL, Connect); >> >> and that last call is missing from the RPi4 implementation. >> >> After those calls, all the PCI I/O handles should be enumerated. > > Yup, that seems to work. > > I need to test a bit more and clean up, then I'll send a patch to > supersede this one. > > Regards, > > /Pete > >> >> >>> >>>> >>>> >>>> >>>> >>>>> --- >>>>>   Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c >>>>> | 5 +++++ >>>>>   1 file changed, 5 insertions(+) >>>>> >>>>> diff --git >>>>> a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c >>>>> b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c >>>>> index 253614a646c1..2bd625ad7e7c 100644 >>>>> --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c >>>>> +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c >>>>> @@ -655,6 +655,11 @@ PlatformBootManagerAfterConsole ( >>>>>       Print (BOOT_PROMPT); >>>>>     } >>>>> +  // >>>>> +  // Connect the rest of the devices. >>>>> +  // >>>>> +  EfiBootManagerConnectAll (); >>>>> + >>>>>     Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, >>>>> NULL, (VOID**)&EsrtManagement); >>>>>     if (!EFI_ERROR (Status)) { >>>>>       EsrtManagement->SyncEsrtFmp (); >>>>> >>>> >>> >> > > > >