The write_val argument was not specified as an input on the asm instruction. The compiler thought it wasn't used, even though the asm instruction does use r0, which is how write_val is passed into the function. The compiler would optimise out the argument being passed into the function. Add write_val as an input operand to prevent it being optimised out. Signed-off-by: Neil Leeder <nleeder@codeaurora.org> (cherry picked from commit e1bb10a173de0327171c2c8d16f64af34a5ca937) Change-Id: I478f79a1a34a4ee15516a1765f8c6094191454fd Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>