Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backporting upstream battery patches #388

Merged
merged 7 commits into from
Aug 31, 2023

Conversation

Joshua-Dickens
Copy link
Member

Backporting Aaron's upstream battery patches with some kernel version checks to make sure anything below 4.19 is not running the new code and only using what was there before.

With this patch, the following distros will not be supported:

Distro                          Kernel  EOL
Debian 8                        3.16    2020-07-01
RHEL 7.3-                       3.7     2017-07-31 (Kernel changed to 3.17)
SuSE Linux Enterprise 12 SP1    3.12    2019-11-13
Ubuntu 14.04.4                  3.16    2019-03-06

This patch also removed those old kernels in .github/workflows/main.yml.

Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
jigpu and others added 2 commits August 29, 2023 13:10
Ensure we have an up-to-date version of the package index before trying
to install packages. Otherwise we may try to install an outdated version
of something that has been deleted from Ubuntu's servers.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
github: Run 'apt-get update' before 'apt-get install'
Copy link
Member

@jigpu jigpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please word-wrap the description for the "Add version checking" commit. It should be wrapped at around 72 characters.
Nevermind -- please see later comment about how this commit should be integrated into previous imports.

4.5/wacom.h Outdated
@@ -166,7 +166,9 @@ struct wacom_remote {
struct input_dev *input;
bool registered;
struct wacom_battery battery;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary if we're trying to get this patch out ASAP, but in the future consider doing a configure-time feature check rather than a direct comparison to the KERNEL_VERSION macro. See the block of checks starting at https://github.com/linuxwacom/input-wacom/blob/master/configure.ac#L195 for ideas (WACOM_POWERSUPPLY_41, WACOM_DEVM_OR_RESET, WACOM_USING_LL_DRIVER, etc.)

4.5/wacom_sys.c Outdated Show resolved Hide resolved
4.5/wacom_sys.c Outdated Show resolved Hide resolved
Copy link
Member

@jigpu jigpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Add version checking" commit should not be a standalone commit. Its changes should be directly integrated into each of the "imported" commits as appropriate. Standalone commits like this make it difficult to git bisect input-wacom for problems because those imported commits will fail to compile on pre-4.19 kernels.

Copy link
Member

@jigpu jigpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please word-wrap commit description of "Updating main.yml" commit. Descriptions should generally be wrapped so they have a width of around 72 characters (and no more than 80 characters). It might also be useful to include which feature flags triggered which new kernel tests.

4.5/wacom_wac.h Outdated Show resolved Hide resolved
4.5/wacom.h Outdated Show resolved Hide resolved
4.5/wacom_wac.c Show resolved Hide resolved
4.5/wacom_wac.h Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Show resolved Hide resolved
Currently the EKR battery remains even after we stop getting information
from the device. This can lead to a stale battery persisting indefinitely
in userspace.

The remote sends a heartbeat every 10 seconds. Delete the battery if we
miss two heartbeats (after 21 seconds). Restore the battery once we see
a heartbeat again.

Signed-off-by: Aaron Skomra <skomra@gmail.com>
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Fixes: 9f1015d45f62 ("HID: wacom: EKR: attach the power_supply on first connection")
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[joshua.dickens@wacom.com: Imported into input-wacom repository (9ac6678b95b0)]
Signed-off-by: Joshua Dickens <joshua.dickens@wacom.com>
The 'connected' variable was poorly named, and this has led to some
confusion. We can get the same information by checking if a serial number
exists in the specified EKR slot.

Signed-off-by: Aaron Skomra <skomra@gmail.com>
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[joshua.dickens@wacom.com: Imported into input-wacom repository (2834e38048f1)]
Signed-off-by: Joshua Dickens <joshua.dickens@wacom.com>
skomra and others added 2 commits August 31, 2023 13:27
Help differentiate the two remote related "serial" struct variables by
renaming "wacom_remote_data" to "wacom_remote_work_data".

Signed-off-by: Aaron Skomra <skomra@gmail.com>
Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[joshua.dickens@wacom.com: Imported into input-wacom repository (55ab9b2c42f4)]
Signed-off-by: Joshua Dickens <joshua.dickens@wacom.com>
Adding some versions to check compilation on for any version
checks/flags we have setup in the code.

4.19 - For a check in 4.5/wacom_sys.c in wacom_map_usage for
the compare_device_paths method.

4.2 - For a method in 3.17/wacom_sys.c hid_field_extract.
@jigpu
Copy link
Member

jigpu commented Aug 31, 2023

Thanks! LGTM

@jigpu jigpu merged commit 874a443 into linuxwacom:for-6.6 Aug 31, 2023
12 of 13 checks passed
@Joshua-Dickens Joshua-Dickens deleted the for-6.6 branch August 31, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants