input: misc: inv: fix race in shutdown and suspend
Problem description:
- Write to shutdown flag is not mutex protected
- nvi_work_func may be scheduled after shutdown or suspend
- kfifo is being freed for shutdown, which could
corrupt memory if there is a further access to
kfifo by nvi_pm_exit and its function calls
Fix description:
- Encapsulate write to shutdown flag with a mutex,
to ensure readers get valid information
- Wait for nvi_work_func to complete during shutdown and suspend
- Free kfifo only during remove
Bug
1361923
Change-Id: I64dabfb21a289354e7f7c58ac408dc48bcff9267
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/283813
Reviewed-on: http://git-master/r/330859
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>