Skip to content

Commit b320467

Browse files
committed
Merge branch 'for-6.1/multitouch' into for-linus
- fix broken atomic checks by adding memory barriers (Andri Yngvason)
2 parents 684e00c + be6e2b5 commit b320467

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ static void mt_touch_report(struct hid_device *hid,
11861186
int contact_count = -1;
11871187

11881188
/* sticky fingers release in progress, abort */
1189-
if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))
1189+
if (test_and_set_bit_lock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))
11901190
return;
11911191

11921192
scantime = *app->scantime;
@@ -1267,7 +1267,7 @@ static void mt_touch_report(struct hid_device *hid,
12671267
del_timer(&td->release_timer);
12681268
}
12691269

1270-
clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags);
1270+
clear_bit_unlock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags);
12711271
}
12721272

12731273
static int mt_touch_input_configured(struct hid_device *hdev,
@@ -1699,11 +1699,11 @@ static void mt_expired_timeout(struct timer_list *t)
16991699
* An input report came in just before we release the sticky fingers,
17001700
* it will take care of the sticky fingers.
17011701
*/
1702-
if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))
1702+
if (test_and_set_bit_lock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags))
17031703
return;
17041704
if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags))
17051705
mt_release_contacts(hdev);
1706-
clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags);
1706+
clear_bit_unlock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags);
17071707
}
17081708

17091709
static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)

0 commit comments

Comments
 (0)