Skip to contentSkip to conversation

Write shared touch initial status only once

PATCH In review Ping Cheng 2 participants 4 messages Sep 16 – Sep 22

Subsystems (3)
lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH 1/2 Write shared touch initial status only once

From: Ping Cheng <[email protected]>

To match the same logic as with other shared data during registeration, use WRITE_ONCE for is_touch_on too.

---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_sys.c +1 -1
index 8dc7aa1c0a26..33fa491fba92 100644
@@ -2386,7 +2386,7 @@ static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
 		 * match historic default.
 		 */
 		if (wacom_wac->is_soft_touch_switch)
-			wacom_wac->shared->is_touch_on = true;
+			WRITE_ONCE(wacom_wac->shared->is_touch_on, true);
 	}
 
 	if (wacom_wac->features.device_type & WACOM_DEVICETYPE_TOUCH) {
Signature · 1 line
2.55.0
author
#1 lore raw

Hi Lee,

Do you have any questions about my patches, especially this first one? I added it to make the assignment consistent with your patch. Since the is_soft_touch_switch can only be set by pad, we would only get to this assignment once. It won't be assigned more than once with the current firmware logic. If you don't see an issue with the patch, can you give it an acked-by?

The second patch adds the softkey touch switch back, which is important. I hope my fix can be merged upstream along with your patchset. Otherwise we break userland.

Thank you,
Ping

Quoted 28 lines · Ping Cheng

From: Ping Cheng <[email protected]>

To match the same logic as with other shared data during registeration, use WRITE_ONCE for is_touch_on too.

---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_sys.c +1 -2
index 8dc7aa1c0a26..33fa491fba92 100644
@@ -2386,7 +2386,7 @@ static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
                 * match historic default.
                 */
                if (wacom_wac->is_soft_touch_switch)
-                       wacom_wac->shared->is_touch_on = true;
+                       WRITE_ONCE(wacom_wac->shared->is_touch_on, true);
        }
 
        if (wacom_wac->features.device_type & WACOM_DEVICETYPE_TOUCH) {
--

2.55.0

Reviewed-by
#2 lore raw
Quoted 10 lines

Do you have any questions about my patches, especially this first one? I added it to make the assignment consistent with your patch. Since the is_soft_touch_switch can only be set by pad, we would only get to this assignment once. It won't be assigned more than once with the current firmware logic. If you don't see an issue with the patch, can you give it an acked-by?

The second patch adds the softkey touch switch back, which is important. I hope my fix can be merged upstream along with your patchset. Otherwise we break userland.

Honestly, you know this driver much better than I do.

The change looks sound to my uninformed eyes though.

Bear in mind that the subject line does not match the style expected of the subsystem - or anywhere else for that matter. =:-)

Quoted 5 lines · Ping Cheng
Quoted 4 lines

From: Ping Cheng <[email protected]>

To match the same logic as with other shared data during registeration,

Spell check.

Quoted 3 lines
Quoted 3 lines

use WRITE_ONCE for is_touch_on too.

Fixes:

With those fixed:

Quoted 21 lines
Quoted 21 lines
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_sys.c +1 -2
index 8dc7aa1c0a26..33fa491fba92 100644
@@ -2386,7 +2386,7 @@ static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
                 * match historic default.
                 */
                if (wacom_wac->is_soft_touch_switch)
-                       wacom_wac->shared->is_touch_on = true;
+                       WRITE_ONCE(wacom_wac->shared->is_touch_on, true);
        }
 
        if (wacom_wac->features.device_type & WACOM_DEVICETYPE_TOUCH) {
--

2.55.0

Signature · 1 line
Lee Jones
author
#3 lore raw
Quoted 12 lines · Lee Jones
Quoted 11 lines

Do you have any questions about my patches, especially this first one? I added it to make the assignment consistent with your patch. Since the is_soft_touch_switch can only be set by pad, we would only get to this assignment once. It won't be assigned more than once with the current firmware logic. If you don't see an issue with the patch, can you give it an acked-by?

The second patch adds the softkey touch switch back, which is important. I hope my fix can be merged upstream along with your patchset. Otherwise we break userland.

Quoted 6 lines

Honestly, you know this driver much better than I do.

The change looks sound to my uninformed eyes though.

Bear in mind that the subject line does not match the style expected of the subsystem - or anywhere else for that matter. =:-)

I was so eager to get the patches out...

Quoted 10 lines
Quoted 5 lines · Ping Cheng
Quoted 4 lines

From: Ping Cheng <[email protected]>

To match the same logic as with other shared data during registeration,

Spell check.

Quoted 2 lines
Quoted 2 lines

use WRITE_ONCE for is_touch_on too.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Fixes:

With those fixed:

Thanks for the review. A second set of eyes are always helpful.

Cheers,
Ping

Quoted 24 lines
Quoted 17 lines
Quoted 17 lines
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_sys.c +1 -1
index 8dc7aa1c0a26..33fa491fba92 100644
@@ -2386,7 +2386,7 @@ static void wacom_set_shared_values(struct wacom_wac *wacom_wac)
                 * match historic default.
                 */
                if (wacom_wac->is_soft_touch_switch)
-                       wacom_wac->shared->is_touch_on = true;
+                       WRITE_ONCE(wacom_wac->shared->is_touch_on, true);
        }
 
Quoted 4 lines
Quoted 4 lines
drivers/hid/wacom_sys.c +0 -1
        if (wacom_wac->features.device_type & WACOM_DEVICETYPE_TOUCH) {
--

2.55.0

--
Lee Jones