On 29 March 2016 at 08:26, Kinney, Michael D <[email protected]> wrote: > Ard, > > Many handlers running at the same TPL are ok as long as each of the handlers > run for very short periods of time. Any event handlers that execute as > raised TPL for extended periods of time will impact other event handlers. >
That is *exactly* the point Heyi made before. > In a worst case scenario, if the execution time at raised TPL in a handler or > group of handlers is greater than or equal to their poll rates, then a live > lock condition can occur where the code at lower TPLs never gets to make > forward progress. > > This means that event handlers at raised TPL need to be very efficient and do > their work quickly and potentially just set some flags or queue some data for > work to be done at a lower TPL at a slower event rate. > ... to the extent possible, which is limited by the FIFO size in this case. So we need to poll at a rate which guarantees, based on the baud rate and the FIFO size, that the number of characters received during the poll interval cannot exceed the size of the FIFO. So I think we are all in agreement about the mechanics of TPL priorities and the underlying problem Heyi is trying to solve. What I would like to clarify is whether polling at exactly the rate calculated by Heyi's formula should guarantee us no dropped characters, and if the observation to the contrary is the result of flaws in the ARM implementation. We do account for time spent dispatching events in the timer code when setting the next timeout, and to some extent, nested interrupts are supported (i.e., as soon as the TPL is lowered, a new timer interrupt may fire which completes before the old timer interrupt handling is fully completed) Or we may simply have some drivers that are hogging the timer event and interfering with the polling. In any case, the copy-paste issue is just a bit annoying, but considering the above, it may be a symptom of something more severe going on. Thanks, Ard. _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

