This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: FIFO DSRs... the 2nd
"Stefan Sommerfeld" <sommerfeld@mikrom.de> writes:
> Hi Sergei,
>
> I don't think your implementation of call_pending_DSRs_inner() is
> save. You cannot reset the dsr_list and dsr_list_tail entries before
> running the dsr routines, because the irqs are activated while the dsr
> routines run, so another irq with a dsr could happend. This will
> result in a change of the dsr order and also dsr could be missed
> because the irq->next pointer is changed. The dsr_list and
> dsr_list_tail pointer must be current while the dsrs are running.
I believe you are wrong here.
Under interrupts disabled I take the entire current list of DSRs out of
sight of post_dsr() routine (except it can modify 'dsr_count' of an ISR
in the list), so if post_dsr() is called while I handle current DSRs, it
will add DSR to a fresh list that will later be handled at top level (in
the unlock_inner()).
Please notice that any of the 3 algorithms have the same race that is
handled in the unlock_inner(). I mean that neither of 3 algorithm
guarantee that there is no pended DSRs at the return of
call_pending_DSRs_inner().
-- Sergei.