AW: [PATCH 1/1] kern_tc.c: th_generation starts with 1 after overflow for single-core

Gabriel.Moyano at dlr.de Gabriel.Moyano at dlr.de
Fri May 27 09:49:02 UTC 2022


> On 27.05.22 10:51, Sebastian Huber wrote:
> > Hello Gabriel,
> >
> > the uniprocessor version uses an optimization at the reader side:
> >
> > #if defined(RTEMS_SMP)
> >      } while (gen == 0 || gen != th->th_generation); #else
> >      } while (gen != th->th_generation); #endif
> >
> > This is possible since the windup happens with interrupts disabled. I
> > guess you need this optimization somewhere in the PPS/NTP code.

Yes, you are right that is for the PPS code.
The value of th_generation is saved in pps_capture() and I shouldn't add a while waiting it to be different that 0 there.
If its value is 0, then the pps_event() returns early.
This is something that could happen in very particular circumstance (pps event happens when the th_generation is 0).

> > Could you please add the details to the commit message and not the
> > cover letter. The cover letter is not committed.

Sure.

> > Could you please have a look at:
> >
> > https://lists.rtems.org/pipermail/devel/2022-May/071609.html
> 
> It would be also good to have a test case for the problem you are trying to fix. The PPS/NTP code is a bit complicated and the test
> coverage of this area is far below the score average.
> 

One way to test this is waiting to the overflow of th_generation, do you think that it is feasibly to add such a test if its duration is a long time?

Btw. Could you check this https://lists.rtems.org/pipermail/devel/2022-May/071662.html ?


More information about the devel mailing list