Re: [PATCH RESEND] HID: multitouch: Add memory barriers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 17, 2022 at 11:32:48AM +0000, Andri Yngvason wrote:
> This fixes a race with the release-timer by adding acquire/release
> barrier semantics.

What race?

> 
> I noticed that contacts were sometimes sticking, even with the "sticky
> fingers" quirk enabled. This fixes that problem.
> 
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Andri Yngvason <andri@xxxxxxxxxxx>
> ---
>  drivers/hid/hid-multitouch.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 2e72922e36f5..91a4d3fc30e0 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -1186,7 +1186,7 @@ static void mt_touch_report(struct hid_device *hid,
>  	int contact_count = -1;
>  
>  	/* sticky fingers release in progress, abort */
> -	if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))
> +	if (test_and_set_bit_lock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))

So this is now a lock?

Why not just use a real lock instead?

thanks,

greg k-h



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux