--- zzzz-none-000/linux-3.10.107/arch/mips/include/asm/smtc_ipi.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/include/asm/smtc_ipi.h 2021-11-10 11:53:54.000000000 +0000 @@ -6,12 +6,10 @@ #include -//#define SMTC_IPI_DEBUG - -#ifdef SMTC_IPI_DEBUG +#ifdef CONFIG_MIPS_MT_SMTC_IPI_DEBUG #include #include -#endif /* SMTC_IPI_DEBUG */ +#endif /* CONFIG_MIPS_MT_SMTC_IPI_DEBUG */ /* * An IPI "message" @@ -22,10 +20,10 @@ int type; void *arg; int dest; -#ifdef SMTC_IPI_DEBUG +#ifdef CONFIG_MIPS_MT_SMTC_IPI_DEBUG int sender; long stamp; -#endif /* SMTC_IPI_DEBUG */ +#endif /* CONFIG_MIPS_MT_SMTC_IPI_DEBUG */ }; /* @@ -41,11 +39,11 @@ */ struct smtc_ipi_q { - struct smtc_ipi *head; + volatile struct smtc_ipi *head; spinlock_t lock; - struct smtc_ipi *tail; - int depth; - int resched_flag; /* reschedule already queued */ + volatile struct smtc_ipi *tail; + volatile int depth; + atomic_t resched_flag; /* reschedule already queued */ }; static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) @@ -60,10 +58,10 @@ p->flink = NULL; q->tail = p; q->depth++; -#ifdef SMTC_IPI_DEBUG +#ifdef CONFIG_MIPS_MT_SMTC_IPI_DEBUG p->sender = read_c0_tcbind(); p->stamp = read_c0_count(); -#endif /* SMTC_IPI_DEBUG */ +#endif /* CONFIG_MIPS_MT_SMTC_IPI_DEBUG */ spin_unlock_irqrestore(&q->lock, flags); } @@ -74,7 +72,7 @@ if (q->head == NULL) p = NULL; else { - p = q->head; + p = (struct smtc_ipi *)q->head; q->head = q->head->flink; q->depth--; /* Arguably unnecessary, but leaves queue cleaner */ @@ -106,7 +104,7 @@ q->head = q->tail = p; p->flink = NULL; } else { - p->flink = q->head; + p->flink = (struct smtc_ipi *)q->head; q->head = p; } q->depth++;