1. 03 Jul, 2010 1 commit
  2. 04 Jun, 2010 1 commit
  3. 03 Jun, 2010 1 commit
  4. 30 May, 2010 1 commit
  5. 09 Apr, 2010 1 commit
  6. 31 Mar, 2010 1 commit
    • Carl-Daniel Hailfinger's avatar
      Refine and fix the delay loop calculation · 253101e6
      Carl-Daniel Hailfinger authored
      
      The current delay loop calculation is still from revision 1 of flashrom,
      and since then it had a logic bug which caused all delays to be twice as
      long as intended.
      
      Fix the delay duration.
      
      Protect against delay loop overflows.
      
      Detect a non-working delay loop.
      
      Change the delay loop itself to ensure clever compiler optimizers won't
      eliminate it (as happens with clang/llvm in the current code). Some
      people suggested machine-specific asm, but the empty asm statement with
      the loop counter as register/memory input has the benefit of being
      perfectly cross-platform and working in gcc and clang.
      
      If time goes backwards (catastrophical NTP time difference, manual
      time change), timing measurements were shot because the new-old time
      subtraction yielded negative numbers which weren't handled correctly
      because the variable is unsigned. Work around that issue (a fix is
      mathematically impossible).
      
      If time goes forward too fast, pick the biggest possible timing
      measurement with a guaranteed overflow avoidance for all timing
      calculations.
      
      Check four times if the calculated timing is at most 10% too fast. This
      addresses OS scheduler interactions, e.g. being scheduled out during
      measurement which inflates measurements.
      
      If the timing looks like garbage, recalculate the timer values up to
      four times before giving up.
      
      Avoid division by zero in rare cases where timing measurements for a 250
      ms delay returned 0 us elapsed.
      
      Corresponding to flashrom svn r990.
      Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
      Acked-by: default avatarMaciej Pijanka <maciej.pijanka@gmail.com>
      253101e6
  7. 27 Mar, 2010 1 commit
  8. 24 Dec, 2009 1 commit
  9. 05 Jun, 2009 1 commit
  10. 16 May, 2009 1 commit
  11. 15 Apr, 2009 1 commit
  12. 18 Oct, 2008 1 commit
  13. 07 Sep, 2008 1 commit
  14. 17 Oct, 2007 1 commit
  15. 10 Oct, 2007 2 commits
  16. 09 Sep, 2007 2 commits
  17. 23 Aug, 2007 1 commit
  18. 06 Apr, 2007 1 commit
  19. 01 Apr, 2007 1 commit
  20. 26 Nov, 2005 1 commit
  21. 20 Mar, 2004 1 commit
  22. 18 Mar, 2004 1 commit
  23. 17 Mar, 2004 2 commits