1
0
Fork 0
Commit Graph

5 Commits (67e03fec70c0ac736a199cff586812140cdf32c6)

Author SHA1 Message Date
Alistair Francis 67e03fec70 WIP
Signed-off-by: Alistair Francis <alistair@alistair23.me>
2021-02-13 10:53:48 -08:00
Robin Gong f38cc79e02 LF-175: input: keyboard: imx_sc_pwrkey: fix no release event reported
scfw only take care of the least 1 byte of payload of powerkey message.
Correct key state checking logic, otherwise, the state maybe wrong since
the upper 3 bytes maybe not 0 as expected.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
2019-11-29 18:07:26 +08:00
Anson Huang ec8d984325 MLK-22977 input: imx_sc_pwrkey: Correct message format to avoid stack corruption
The SCU message data field received from SCU side is 32 bit width,
while the message defined in imx_sc_pwrkey driver is 8 bit width,
it will cause stack corruption when SCU writes the response data,
with CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG enabled, kernel stack
protection will have panic. Correct the data field width to 32 bit
to avoid this issue.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 16:29:04 +08:00
Anson Huang d0a7bcfc04 input: keyboard: imx_sc: Correct SCFW API parameter to fix NULL pointer crash
The SCU FW API of getting button status actually needs response
data, but SCU FW API does NOT have return value for this API, so
we should call this API with response but skip return value check
to avoid below NULL pointer crash, since the msg stored in stack
could be released when mailbox receives the response data and NULL
pointer dump will occur as below:

Event: time 1564685464.345502, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1564685464.345502, -------------- SYN_REPORT ------------
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
Mem abort info:
  ESR = 0x96000006
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000006
  CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=00000008b75c6000
[0000000000000008] pgd=00000008b7611003, pud=00000008b77f4003, pmd=0000000000000000
Internal error: Oops: 96000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 112 Comm: kworker/0:5 Not tainted 5.3.0-rc3-next-20190809-01769-g17e0d18 #200
Hardware name: Freescale i.MX8QXP MEK (DT)
Workqueue:  0x0 (events)
pstate: 60000085 (nZCv daIf -PAN -UAO)
pc : process_one_work+0x3c/0x2b4
lr : worker_thread+0x134/0x3e4
sp : ffff00001216bdb0
x29: ffff00001216bdb0 x28: ffff00001005bcd8
x27: ffff80083b03e8b8 x26: ffff000011a204b0
x25: ffff80083b58c4c0 x24: ffff000011a07000
x23: 0000000112010201 x22: ffff80083cbaf840
x21: 0000000000000000 x20: ffff80083b043220
x19: ffff80083b043200 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 00000000000009a0
x9 : ffff00001216bd50 x8 : 0000000000000018
x7 : 0000000000000001 x6 : ffff80083cbaf860
x5 : ffff80083cbaf860 x4 : ffff80083cbaf858
x3 : ffff80083cbaf858 x2 : ffff80083b043228
x1 : ffff80083b043220 x0 : 0000000000000000
Call trace:
 process_one_work+0x3c/0x2b4
 worker_thread+0x134/0x3e4
 kthread+0xf8/0x124
 ret_from_fork+0x10/0x18
Code: 9278deb5 eb1f001f 9a9f12b5 b94012c0 (f94006a1)
---[ end trace 9374afe12d7955b1 ]---

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
2019-11-25 16:29:04 +08:00
Robin Gong dddcaeb960 input: keyboard: imx_sc_pwrkey: add PWRON key driver
Add PWRON key driver which is based on scfw.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2019-11-25 16:29:03 +08:00