Samuel Thibault, le mar. 11 juil. 2023 10:20:45 +0200, a ecrit:
> Damien Zammit, le mar. 11 juil. 2023 07:58:39 +0000, a ecrit:
> > On 11/7/23 05:47, Samuel Thibault wrote:
> > > Damien Zammit, le lun. 10 juil. 2023 09:02:10 +0000, a ecrit:
> > >> +void
> > >> +irqhelp_wait_init(struct irq *irq)
> > >> +{
> > >> + if (!irq)
> > >> + {
> > >> + log_error("cannot wait on this irq to be ready\n");
> > >> + return;
> > >> + }
> > >> +
> > >> + sem_wait(&irq->sema);
> > >> +}
> > >
> > > So, is this wait really necessary? Why?
> >
> > Yes, without this wait, netdde.static crashes randomly on startup,
> > and if it doesn't crash the first time, it can be triggered to crash
> > by running ifdown then ifup.
> >
> > I think the wait avoids a race.
>
> Ok but we should really understand what race can exist, otherwise we
> don't really know why the code works.
(put another way, the sem_wait possibly only makes the race less
probable, without making it impossible)
Samuel