event_timer: Add spinlock protection to event time update

Modify call flow to allow only one thread to make the smp cross call in
order to setup the event timer. Added more concurrency protections.
This helps fix a kernel data abort , where the stack looks like

Unable to handle kernel NULL pointer dereference at virtual address 0000008
pgd = d833c000
[00000008] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in: mwlan_aarp(PO)
CPU: 0    Tainted: P        W  O  (3.4.0-perf-gf36610b-dirty #3)
PC is at __rb_rotate_left+0xc/0x70
LR is at rb_insert_color+0x100/0x12c
pc : <c02400e8>    lr : <c02402c0>    psr: 00000093
sp : d7b4db58  ip : 00000000  fp : 400bf518
r10: c0e957b8  r9 : 0000047c  r8 : 00000000
r7 : c0dcc1fc  r6 : d8ed9900  r5 : d8ed9900  r4 : d8f55ac0
r3 : 00000000  r2 : d8f55ac0  r1 : c0dcc1fc  r0 : d8ed9900
Flags: nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5787d  Table: 98d3c06a  DAC: 00000015

(__rb_rotate_left+0xc/0x70) from (rb_insert_color+0x100/0x12c)
(rb_insert_color+0x100/0x12c) from (timerqueue_add+0x8c/0xbc)
(timerqueue_add+0x8c/0xbc) from (create_timer_smp+0x58/0xb8)
(create_timer_smp+0x58/0xb8) from (smp_call_function_single+0xc8/0x1c8)
(smp_call_function_single+0xc8/0x1c8) (mdp_update_pm+0xa4/0xb0)

The kernel data abort was likely due to a double add meaning adding the
same node twice, serializing the smp cross call should help this issue.

CRs-fixed: 442891
Change-Id: I572550b75ca18cdccc474103d863e8a924bccbba
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
1 file changed