From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.670.1591637044420120026 for ; Mon, 08 Jun 2020 10:24:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=R0q/fvIE; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.128.65, mailfrom: pete@akeo.ie) Received: by mail-wm1-f65.google.com with SMTP id y20so328050wmi.2 for ; Mon, 08 Jun 2020 10:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vvUgg7fFsVSHh3o9+1NSTWf7KBmIVFrb/x5EZQAzqg4=; b=R0q/fvIE+l0ST3XTn2z44sfBR6fgixZlsbEJyYkbxeh69tF5wXLjCvKo/tN8uRzpV1 VjlWTPysc0osk90zisAo5JVrAhteJ0mBi6nxK4dOLYiKjQcmF7K5TDt1g5MlH/Btkrq8 sUy5uTo/fpThUwc1fPZVYgDx1MbfTgN3cRPABWNRFIgwIfBC5tuhq0pkSPt70wHvp9xy 8kpuw4wLGjkzz3WgXZ9aHX0f0UjT5Gv050f/P3q21fVX2Rk4Dm9x9cOBEgrC69n94o5R Eyo4msY7bmcpdeAIgVG+6F7azIc1OP7xKECZl5ZWtZy5DNd7CnEy04HXC5tb3JIH2gQv wqgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vvUgg7fFsVSHh3o9+1NSTWf7KBmIVFrb/x5EZQAzqg4=; b=KM9kVIUEwhHsLJh6aKgDHBzYgerzpLtWqBkSZwxMDFxPyeTWkznsx04styxYW6oV4/ cGUnQWwHmqNq88rRDOVtAnzOKg1GkZTA79awsp9fH0D5j6jt6Sv43zbT4TEKBaKInvHp QrNbidGR8yljwT5BqWuufef5NL+drftteWv7UqdfMMdE6Rb9aeEYpUVAkK7QA1YWaso4 BgWlgTWYr8LuSHeKIF1KCFWT5S9P9F5XNPhKnf48LXp99v8ya9mF0TUCAG+rPN2hAdxP O2kPhv7bjwvRC47f64TF6KS1p5wDx3dGdbg8zOBQCNGCC2UgSmVmgpGTiHTrzfk8icpB bxDw== X-Gm-Message-State: AOAM531m5WarDj9TPMbgEcF0okj82qhCSclRloQZ9R1LZf++D4IDmqXi llkwdW23YNSs3Zns6qfzM13uSg== X-Google-Smtp-Source: ABdhPJymmxQOtxfBI1dQwIh2gslJR0usnudQKrHxHqV+DBSxgpqO9h4mEwZzh2+4euBtqOdxUjOj4w== X-Received: by 2002:a1c:4954:: with SMTP id w81mr393916wma.86.1591637042986; Mon, 08 Jun 2020 10:24:02 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.48.247]) by smtp.googlemail.com with ESMTPSA id r11sm409186wre.25.2020.06.08.10.24.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jun 2020 10:24:02 -0700 (PDT) Subject: Re: [edk2-platforms][PATCH 1/1] Platform/RaspberryPi: Revert don't connect all devices on an ordinary boot To: Ard Biesheuvel , devel@edk2.groups.io Cc: leif@nuviainc.com 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> From: "Pete Batard" Message-ID: <6fa3746e-2951-31c0-ab1b-5f175b3d4d5b@akeo.ie> Date: Mon, 8 Jun 2020 18:24:01 +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: <0c1125b9-146a-2b1c-e8b2-bade49ff7620@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit 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 (); >>>> >>> >> >