Thanks!
It's clearly a logic flaw here, but not as I expected. The actual issue I was seeing seem to be related to timing jitter, however...
Looking at the handling at line 655-658 it seems to be in line with the docs, not the conventions of these names.
Here's a example:
(Nabbed from TI datasheet on DRV8811 and assumed to be fair use...)
The first thing one notices is that the hold time is related only to the time between last step pulse start and dir change. It is thus not an additive limit as in the code, but a question of which delay is larger, t-high or t-holdoff.
This only affects those running their drivers close to the limit as it will prevent emc2 from actually generating the shortest pulses specifically allowed by the user.
It seems the setup time is used correctly.
Based on this the docs should state that the dir pin is held during entire step pulse and the hold value is an option to add a extra hold.period after this.
The setup time also adds to the pulse it seems, although I am not sure I actually understand when a pulse is actually "over".
Hope the graph helps to illustrate my point.
I work with high frequency hardware (like memory and such) where this kind of distinction is very important.
The actual flank used as trigger is almost exclusively used as the timing reference for setup/delays and holdoffs.