002-mips_clocksource_init_war.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- a/arch/mips/kernel/cevt-r4k.c
  2. +++ b/arch/mips/kernel/cevt-r4k.c
  3. @@ -15,6 +15,22 @@
  4. #include <asm/cevt-r4k.h>
  5. /*
  6. + * Compare interrupt can be routed and latched outside the core,
  7. + * so a single execution hazard barrier may not be enough to give
  8. + * it time to clear as seen in the Cause register. 4 time the
  9. + * pipeline depth seems reasonably conservative, and empirically
  10. + * works better in configurations with high CPU/bus clock ratios.
  11. + */
  12. +
  13. +#define compare_change_hazard() \
  14. + do { \
  15. + irq_disable_hazard(); \
  16. + irq_disable_hazard(); \
  17. + irq_disable_hazard(); \
  18. + irq_disable_hazard(); \
  19. + } while (0)
  20. +
  21. +/*
  22. * The SMTC Kernel for the 34K, 1004K, et. al. replaces several
  23. * of these routines with SMTC-specific variants.
  24. */
  25. @@ -30,6 +46,7 @@ static int mips_next_event(unsigned long
  26. cnt = read_c0_count();
  27. cnt += delta;
  28. write_c0_compare(cnt);
  29. + compare_change_hazard();
  30. res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0;
  31. return res;
  32. }
  33. @@ -99,22 +116,6 @@ static int c0_compare_int_pending(void)
  34. return (read_c0_cause() >> cp0_compare_irq) & 0x100;
  35. }
  36. -/*
  37. - * Compare interrupt can be routed and latched outside the core,
  38. - * so a single execution hazard barrier may not be enough to give
  39. - * it time to clear as seen in the Cause register. 4 time the
  40. - * pipeline depth seems reasonably conservative, and empirically
  41. - * works better in configurations with high CPU/bus clock ratios.
  42. - */
  43. -
  44. -#define compare_change_hazard() \
  45. - do { \
  46. - irq_disable_hazard(); \
  47. - irq_disable_hazard(); \
  48. - irq_disable_hazard(); \
  49. - irq_disable_hazard(); \
  50. - } while (0)
  51. -
  52. int c0_compare_int_usable(void)
  53. {
  54. unsigned int delta;