mips-malta.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. http://lkml.indiana.edu/hypermail/linux/kernel/1105.3/02199.html
  2. diff -Nur linux-2.6.39.orig/arch/mips/include/asm/smp-ops.h linux-2.6.39/arch/mips/include/asm/smp-ops.h
  3. --- linux-2.6.39.orig/arch/mips/include/asm/smp-ops.h 2011-05-19 06:06:34.000000000 +0200
  4. +++ linux-2.6.39/arch/mips/include/asm/smp-ops.h 2011-08-29 04:39:03.360480881 +0200
  5. @@ -56,8 +56,43 @@
  6. #endif /* !CONFIG_SMP */
  7. -extern struct plat_smp_ops up_smp_ops;
  8. -extern struct plat_smp_ops cmp_smp_ops;
  9. -extern struct plat_smp_ops vsmp_smp_ops;
  10. +static inline int register_up_smp_ops(void)
  11. +{
  12. +#ifdef CONFIG_SMP_UP
  13. + extern struct plat_smp_ops up_smp_ops;
  14. +
  15. + register_smp_ops(&up_smp_ops);
  16. +
  17. + return 0;
  18. +#else
  19. + return -ENODEV;
  20. +#endif
  21. +}
  22. +
  23. +static inline int register_cmp_smp_ops(void)
  24. +{
  25. +#ifdef CONFIG_MIPS_CMP
  26. + extern struct plat_smp_ops cmp_smp_ops;
  27. +
  28. + register_smp_ops(&cmp_smp_ops);
  29. +
  30. + return 0;
  31. +#else
  32. + return -ENODEV;
  33. +#endif
  34. +}
  35. +
  36. +static inline int register_vsmp_smp_ops(void)
  37. +{
  38. +#ifdef CONFIG_MIPS_MT_SMP
  39. + extern struct plat_smp_ops vsmp_smp_ops;
  40. +
  41. + register_smp_ops(&vsmp_smp_ops);
  42. +
  43. + return 0;
  44. +#else
  45. + return -ENODEV;
  46. +#endif
  47. +}
  48. #endif /* __ASM_SMP_OPS_H */
  49. diff -Nur linux-2.6.39.orig/arch/mips/mipssim/sim_setup.c linux-2.6.39/arch/mips/mipssim/sim_setup.c
  50. --- linux-2.6.39.orig/arch/mips/mipssim/sim_setup.c 2011-05-19 06:06:34.000000000 +0200
  51. +++ linux-2.6.39/arch/mips/mipssim/sim_setup.c 2011-08-29 04:39:03.390480572 +0200
  52. @@ -59,18 +59,17 @@
  53. prom_meminit();
  54. -#ifdef CONFIG_MIPS_MT_SMP
  55. - if (cpu_has_mipsmt)
  56. - register_smp_ops(&vsmp_smp_ops);
  57. - else
  58. - register_smp_ops(&up_smp_ops);
  59. -#endif
  60. + if (cpu_has_mipsmt) {
  61. + if (!register_vsmp_smp_ops())
  62. + return;
  63. +
  64. #ifdef CONFIG_MIPS_MT_SMTC
  65. - if (cpu_has_mipsmt)
  66. register_smp_ops(&ssmtc_smp_ops);
  67. - else
  68. - register_smp_ops(&up_smp_ops);
  69. + return;
  70. #endif
  71. + }
  72. +
  73. + register_up_smp_ops();
  74. }
  75. static void __init serial_init(void)
  76. diff -Nur linux-2.6.39.orig/arch/mips/mti-malta/malta-init.c linux-2.6.39/arch/mips/mti-malta/malta-init.c
  77. --- linux-2.6.39.orig/arch/mips/mti-malta/malta-init.c 2011-05-19 06:06:34.000000000 +0200
  78. +++ linux-2.6.39/arch/mips/mti-malta/malta-init.c 2011-08-29 04:39:03.700480601 +0200
  79. @@ -29,6 +29,7 @@
  80. #include <asm/system.h>
  81. #include <asm/cacheflush.h>
  82. #include <asm/traps.h>
  83. +#include <asm/smp-ops.h>
  84. #include <asm/gcmpregs.h>
  85. #include <asm/mips-boards/prom.h>
  86. @@ -358,15 +359,14 @@
  87. #ifdef CONFIG_SERIAL_8250_CONSOLE
  88. console_config();
  89. #endif
  90. -#ifdef CONFIG_MIPS_CMP
  91. /* Early detection of CMP support */
  92. if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ))
  93. - register_smp_ops(&cmp_smp_ops);
  94. - else
  95. -#endif
  96. -#ifdef CONFIG_MIPS_MT_SMP
  97. - register_smp_ops(&vsmp_smp_ops);
  98. -#endif
  99. + if (!register_cmp_smp_ops())
  100. + return;
  101. +
  102. + if (!register_vsmp_smp_ops())
  103. + return;
  104. +
  105. #ifdef CONFIG_MIPS_MT_SMTC
  106. register_smp_ops(&msmtc_smp_ops);
  107. #endif
  108. diff -Nur linux-2.6.39.orig/arch/mips/pmc-sierra/msp71xx/msp_setup.c linux-2.6.39/arch/mips/pmc-sierra/msp71xx/msp_setup.c
  109. --- linux-2.6.39.orig/arch/mips/pmc-sierra/msp71xx/msp_setup.c 2011-05-19 06:06:34.000000000 +0200
  110. +++ linux-2.6.39/arch/mips/pmc-sierra/msp71xx/msp_setup.c 2011-08-29 04:39:03.790480302 +0200
  111. @@ -228,13 +228,11 @@
  112. */
  113. msp_serial_setup();
  114. -#ifdef CONFIG_MIPS_MT_SMP
  115. - register_smp_ops(&vsmp_smp_ops);
  116. -#endif
  117. -
  118. + if (register_vsmp_smp_ops()) {
  119. #ifdef CONFIG_MIPS_MT_SMTC
  120. - register_smp_ops(&msp_smtc_smp_ops);
  121. + register_smp_ops(&msp_smtc_smp_ops);
  122. #endif
  123. + }
  124. #ifdef CONFIG_PMCTWILED
  125. /*