Input: synaptics-rmi4 - add missed operations in remove
Subsystems (2)
PATCH 1/1 Input: synaptics-rmi4 - add missed operations in remove
The driver forgets to deal with work and workqueue in remove like what is done when probe fails.
Add the missed operations to fix it.
--- drivers/input/rmi4/rmi_f54.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/input/rmi4/rmi_f54.c +3 -0
@@ -730,6 +730,9 @@ static void rmi_f54_remove(struct rmi_function *fn)video_unregister_device (&f54->vdev);v4l2_device_unregister (&f54->v4l2); +cancel_delayed_work_sync (&f54->work); +flush_workqueue (f54->workqueue); +destroy_workqueue (f54->workqueue); }struct rmi_function_handler rmi_f54_handler = {
Signature · 1 line
2.23.0
Dmitry Torokhov
maintainerQuoted 3 lines · Chuhong Yuan
The driver forgets to deal with work and workqueue in remove like what is done when probe fails.
Add the missed operations to fix it.
Is it really possible for the work to still be pending when fully registered device is properly unregistered? I thought we'd wait for successful data acquisition in rmi_f54_buffer_queue() before unregister can complete.
Quoted 23 lines
Signed-off-by Chuhong Yuan <[email protected]>--- drivers/input/rmi4/rmi_f54.c | 3 +++ 1 file changed, 3 insertions(+)drivers/input/rmi4/rmi_f54.c +3
-0@@ -730,6 +730,9 @@ static void rmi_f54_remove(struct rmi_function *fn)video_unregister_device (&f54->vdev);v4l2_device_unregister (&f54->v4l2); +cancel_delayed_work_sync (&f54->work); +flush_workqueue (f54->workqueue); +destroy_workqueue (f54->workqueue); }struct rmi_function_handler rmi_f54_handler = {Signature · 1 line
2.23.0
Thanks.
Signature · 1 line
Dmitry
Quoted 11 lines · Dmitry Torokhov
Quoted 3 lines · Chuhong Yuan
The driver forgets to deal with work and workqueue in remove like what is done when probe fails.
Add the missed operations to fix it.Is it really possible for the work to still be pending when fully registered device is properly unregistered? I thought we'd wait for successful data acquisition in
rmi_f54_buffer_queue()before unregister can complete.
In fact, I am not familiar with the mechanism here...
I have checked other drivers with video_unregister_device and found none of them deals with work in remove.
Therefore, I think your opinion should be right and we only need to deal with the workqueue.
Regards,
Chuhong
Quoted 28 lines
Quoted 21 lines
Signed-off-by Chuhong Yuan <[email protected]>--- drivers/input/rmi4/rmi_f54.c | 3 +++ 1 file changed, 3 insertions(+)drivers/input/rmi4/rmi_f54.c +3
-1@@ -730,6 +730,9 @@ static void rmi_f54_remove(struct rmi_function *fn)video_unregister_device (&f54->vdev);v4l2_device_unregister (&f54->v4l2); +cancel_delayed_work_sync (&f54->work); +flush_workqueue (f54->workqueue); +destroy_workqueue (f54->workqueue); }struct rmi_function_handler rmi_f54_handler = { --Quoted 2 lines
2.23.0
Thanks.
--
Dmitry
Dmitry Torokhov
maintainerQuoted 14 lines · Chuhong Yuan
Quoted 11 lines · Dmitry Torokhov
Quoted 3 lines · Chuhong Yuan
The driver forgets to deal with work and workqueue in remove like what is done when probe fails.
Add the missed operations to fix it.Is it really possible for the work to still be pending when fully registered device is properly unregistered? I thought we'd wait for successful data acquisition in
rmi_f54_buffer_queue()before unregister can complete.
Quoted 5 lines
In fact, I am not familiar with the mechanism here...
I have checked other drivers withvideo_unregister_deviceand found none of them deals with work in remove.
Therefore, I think your opinion should be right and we only need to deal with the workqueue.
OK, please send the updated patch then.
Thanks!
Signature · 1 line
Dmitry