--- zzzz-none-000/linux-2.6.32.60/kernel/smp.c 2012-10-07 21:41:24.000000000 +0000 +++ ur8-7270-606/linux-2.6.32.60/kernel/smp.c 2013-07-24 06:26:38.000000000 +0000 @@ -100,14 +100,14 @@ */ static void csd_lock_wait(struct call_single_data *data) { - while (data->flags & CSD_FLAG_LOCK) + while ((volatile u16)(data->flags) & CSD_FLAG_LOCK) cpu_relax(); } static void csd_lock(struct call_single_data *data) { csd_lock_wait(data); - data->flags = CSD_FLAG_LOCK; + *(volatile u16 *)&(data->flags) = CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment @@ -126,7 +126,8 @@ */ smp_mb(); - data->flags &= ~CSD_FLAG_LOCK; + *(volatile u16 *)&(data->flags) &= ~CSD_FLAG_LOCK; + smp_mb(); } /* @@ -142,8 +143,10 @@ int ipi; spin_lock_irqsave(&dst->lock, flags); + smp_mb(); ipi = list_empty(&dst->list); list_add_tail(&data->list, &dst->list); + smp_mb(); spin_unlock_irqrestore(&dst->lock, flags); /* @@ -251,7 +254,9 @@ WARN_ON_ONCE(!cpu_online(smp_processor_id())); spin_lock(&q->lock); + smp_mb(); list_replace_init(&q->list, &list); + smp_mb(); spin_unlock(&q->lock); while (!list_empty(&list)) {