Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a3ee24a authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Kim Low
Browse files

UPSTREAM: HID: sony: Fix race condition in sony_probe



Early on the sony_probe function calls hid_hw_start to start the hardware.
Afterwards it issues some hardware requests, initializes other functionality
like Force Feedback, power classes and others. However by the time
hid_hw_start returns, the device nodes have already been created, which leads
to a race condition by user space applications which may detect the device
prior to completion of initialization. We have observed this problem many
times, this patch fixes the problem.

This patch moves most of sony_probe to sony_input_configured, which is called
prior to device registration. This fixes the race condition and the same
approach is used in other HID drivers.

Signed-off-by: default avatarRoderick Colenbrander <roderick.colenbrander@sony.com>
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
(cherry picked from commit e1bc84d0071f59c8b38232e2cb093c47c47e4f9f)

Bug: 111431828
Signed-off-by: default avatarKim Low <kim-huei.low@sony.com>
Change-Id: I43820eb1b9339dc07d0548e4878df6153ee685d4
parent b8bd066f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment