[edk2-devel] On RPi4 and Juno, gBS->Stall(1) takes 10us and 100us respectively

Rebecca Cran quic_rcran at quicinc.com
Mon Nov 28 19:02:31 UTC 2022


I've been doing some work on USB and ended up realizing that 
gBS->Stall(1) is taking much longer than it should: on my Juno R2 it's 
stalling for 100 us, while on my Raspberry Pi 4 it's 10 us.

This appears to be causing a USB bulk transfer request that asks for a 
1ms timeout taking 100ms on the Juno.

I'm measuring the delay with the following code:


UINT64 First = GetPerformanceCounter ();

gBS->Stall (XHC_1_MICROSECOND);

UINT64 Second = GetPerformanceCounter ();

UINT64 FirstNs = GetTimeInNanoSecond (First);
UINT64 SecondNs = GetTimeInNanoSecond (Second);

DEBUG ((DEBUG_INFO, "Stalled for %llu ns (%llu ms)\n", (SecondNs - 
FirstNs), (SecondNs - FirstNs) / 1024 / 1024));



I see output such as:

Stalled for 10500 ns (0 ms)


-- 
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96656): https://edk2.groups.io/g/devel/message/96656
Mute This Topic: https://groups.io/mt/95317735/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list