fix random crashes due to floating point operation

Unprotected floating point operation in kernel might corrupt
NEON register and cause many random native crashes.
Add kernel_neon_begin and kenrel_neon_end to protect floating
point operation in wt6670f module.

Change-Id: I2a3a4a3ac1ce78513211ca669eb25c808653f0cc
Reviewed-on: https://gerrit.mot.com/2251071
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
This commit is contained in:
liujg6 2022-04-24 10:11:52 +08:00 • committed by Jianguo Liu
commit 11664d82f8

View file

@ -20,6 +20,7 @@
#include "wt6670f.h"
#include <linux/proc_fs.h>
#include <linux/uaccess.h>
#include <asm/neon.h>
#define MAX_USER_STR 1024
@ -154,7 +155,10 @@ static u16 wt6670f_get_vbus_voltage(void)
pr_err(">>>>>>wt6670f get vbus voltage = %04x %02x %02x\n", tmp,
data[0], data[1]);
return (u16)(tmp * 18.98);
kernel_neon_begin();
tmp = (u16)(tmp * 18.98);
kernel_neon_end();
return tmp;
}
static u16 wt6670f_get_id(u8 reg)