Update v5.4 patches

Changes:
 - SAM:
   - Battery: Take UEFI battery limiter into accound when scheduling
     delayed update
   - Clean up code, minor fixes

 - Misc:
   - Drop efivarfs fix (included in upstream v5.4.81)

Links:
 - SAM: 61b9bb859c
 - kernel: 40d9b6d1ac
This commit is contained in:
Maximilian Luz 2020-12-06 01:18:47 +01:00
parent abc6a3cac6
commit 2547ebd6af
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02
9 changed files with 79 additions and 140 deletions

View file

@ -1,4 +1,4 @@
From a1b2093a952698727718e91f49a7ce400428231f Mon Sep 17 00:00:00 2001
From c4a532b01ec70f86cf9b9bedc3204dfc1c540d4f Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Tue, 17 Sep 2019 17:17:56 +0200
Subject: [PATCH] platform/x86: Surface 3 battery platform operation region

View file

@ -1,4 +1,4 @@
From 82cc4970866415a875af4b5f00d68c000b2004f1 Mon Sep 17 00:00:00 2001
From 61cb0d8cd2357c097d2677e7750a84cd8b5586a8 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Sun, 18 Oct 2020 16:42:44 +0900
Subject: [PATCH] (surface3-oemb) add DMI matches for Surface 3 with broken DMI

View file

@ -1,4 +1,4 @@
From 7fd387741f2193bc49782f44fe09668f6d37a747 Mon Sep 17 00:00:00 2001
From 3af00ec1d18257ce796983eed0300f2004218577 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Thu, 24 Sep 2020 18:02:06 +0900
Subject: [PATCH] mwifiex: pcie: skip cancel_work_sync() on reset failure path
@ -156,7 +156,7 @@ index f7ce9b6db6b4..72d0c01ff359 100644
--
2.29.2
From 223a4b9423d221e83f61d85cf8c68489d0e7da73 Mon Sep 17 00:00:00 2001
From d45b400ba9f478a658e707e3b67da8ae7df8d4d1 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Mon, 28 Sep 2020 17:46:49 +0900
Subject: [PATCH] mwifiex: pcie: add DMI-based quirk impl for Surface devices
@ -364,7 +364,7 @@ index 000000000000..5326ae7e5671
--
2.29.2
From 030293040e0ec5b630c6d8863d1a0711025dea35 Mon Sep 17 00:00:00 2001
From 050654a714fdcd741635bc0ea0491654571d27a5 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Tue, 29 Sep 2020 17:25:22 +0900
Subject: [PATCH] mwifiex: pcie: add reset_d3cold quirk for Surface gen4+
@ -565,7 +565,7 @@ index 5326ae7e5671..8b9dcb5070d8 100644
--
2.29.2
From aab2aefd6523057d463329506ba6306f2c4eda2c Mon Sep 17 00:00:00 2001
From accc6c892c0e450aaa911e9e4ebd8158083e7e0b Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Tue, 29 Sep 2020 17:32:22 +0900
Subject: [PATCH] mwifiex: pcie: add reset_wsid quirk for Surface 3
@ -744,7 +744,7 @@ index 8b9dcb5070d8..3ef7440418e3 100644
--
2.29.2
From 1041568b5bf520d1055771d3d63e7961be3088ff Mon Sep 17 00:00:00 2001
From a2d4cbba0b60bd83eb6027c33a265511c88916d9 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Wed, 30 Sep 2020 18:08:24 +0900
Subject: [PATCH] mwifiex: pcie: (OEMB) add quirk for Surface 3 with broken DMI
@ -806,7 +806,7 @@ index f0a6fa0a7ae5..34dcd84f02a6 100644
--
2.29.2
From f378561870ef90a2a064343a60513544ef864e3d Mon Sep 17 00:00:00 2001
From 8b6918e998bc1eaf86c7ef98c4992318a7e4902b Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Thu, 24 Sep 2020 01:56:29 +0900
Subject: [PATCH] mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
@ -883,7 +883,7 @@ index d14e55e3c9da..5894566ec480 100644
--
2.29.2
From 6aeea6c9454707c1a5d2428717c8100ee22eb09c Mon Sep 17 00:00:00 2001
From faf56fcc7e8efdb3c819e93b3971a16444dfca4b Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Thu, 24 Sep 2020 01:56:34 +0900
Subject: [PATCH] mwifiex: pcie: use shutdown_sw()/reinit_sw() on
@ -1025,7 +1025,7 @@ index 263d918767bd..bd6791dc3a0f 100644
--
2.29.2
From 689e323b33bca77de3947843fa03c8fb34adc157 Mon Sep 17 00:00:00 2001
From d744decd5b3a73945d0b0b22084df57c0bf321bb Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Mon, 24 Aug 2020 17:11:35 +0900
Subject: [PATCH] mwifiex: pcie: add enable_device_dump module parameter
@ -1074,7 +1074,7 @@ index bd6791dc3a0f..d7ff898c1767 100644
--
2.29.2
From 33e25dba1e72a663f71ab867e82058cad49caa7b Mon Sep 17 00:00:00 2001
From 3e6912a7af65f5e6de84fca22ed86d30c901422d Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Sun, 4 Oct 2020 00:11:49 +0900
Subject: [PATCH] mwifiex: pcie: disable bridge_d3 for Surface gen4+
@ -1229,7 +1229,7 @@ index 3ef7440418e3..a95ebac06e13 100644
--
2.29.2
From 925633622ed00a9f0ae091dc21badbe58f06c1b1 Mon Sep 17 00:00:00 2001
From 091916139c8f402926e816771b0e0fb7bfc1e87a Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Sun, 4 Oct 2020 00:25:48 +0900
Subject: [PATCH] mwifiex: add allow_ps_mode module parameter
@ -1291,7 +1291,7 @@ index 9e6dc289ec3e..20f5ee3fe7e3 100644
--
2.29.2
From 901cc34baf06df3f8c29702bdcf2f6fd5708219b Mon Sep 17 00:00:00 2001
From 3caeb635372d3d2b3fbe9e8bf6563c52d4143210 Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Sun, 4 Oct 2020 00:38:48 +0900
Subject: [PATCH] mwifiex: print message when changing ps_mode
@ -1326,7 +1326,7 @@ index 20f5ee3fe7e3..8020a2929069 100644
--
2.29.2
From eac4c3440cc018e90874f40fd069e48af4e39f1b Mon Sep 17 00:00:00 2001
From c2becaf4c8c640844ece032ea3daf38d9be21c4e Mon Sep 17 00:00:00 2001
From: Tsuchiya Yuto <kitakar@gmail.com>
Date: Sun, 4 Oct 2020 00:59:37 +0900
Subject: [PATCH] mwifiex: disable ps_mode explicitly by default instead

View file

@ -1,4 +1,4 @@
From a7f415f0b4939e259377d41d17d4f0a27c8c11a6 Mon Sep 17 00:00:00 2001
From 352847b758c4214c6f71ff8f0f7c84572a7421ae Mon Sep 17 00:00:00 2001
From: Dorian Stoll <dorian.stoll@tmsp.io>
Date: Mon, 27 Jan 2020 21:16:20 +0100
Subject: [PATCH] mei: Add IPTS device IDs
@ -53,7 +53,7 @@ index 75ab2ffbf235..78790904d77c 100644
--
2.29.2
From fa79598271ccaf3f2441910af75997f8c96803ab Mon Sep 17 00:00:00 2001
From ec05c68a677969b6476ab4cd7211195b1abf97e3 Mon Sep 17 00:00:00 2001
From: Dorian Stoll <dorian.stoll@tmsp.io>
Date: Fri, 20 Dec 2019 23:15:58 +0100
Subject: [PATCH] uapi: Add MEI bus ID
@ -79,7 +79,7 @@ index 9a61c28ed3ae..47fc20975245 100644
--
2.29.2
From e41de175c54706bf42e661a6555ccbf3950f4f6c Mon Sep 17 00:00:00 2001
From cf6108463298a4dc6e3c9438dad00ffc1e64c992 Mon Sep 17 00:00:00 2001
From: Dorian Stoll <dorian.stoll@tmsp.io>
Date: Mon, 27 Jan 2020 21:22:42 +0100
Subject: [PATCH] input: Add support for Intel Precise Touch & Stylus

View file

@ -1,4 +1,4 @@
From b729c3603c7a50b91f04074d75138227ef30df51 Mon Sep 17 00:00:00 2001
From 3e6ed2b40967944ca27b9bbffda276abd9f618ec Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sun, 16 Aug 2020 23:39:56 +0200
Subject: [PATCH] platform/x86: Add Driver to set up lid GPEs on MS Surface

View file

@ -1,4 +1,4 @@
From 1b15a4a34c2b0319cc53acec18ed52b318db72c3 Mon Sep 17 00:00:00 2001
From 09c9a18f997393f1eaff9eae7302b7a72a70affa Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 25 Jul 2020 17:19:53 +0200
Subject: [PATCH] i2c: acpi: Implement RawBytes read access
@ -109,7 +109,7 @@ index c70983780ae7..1c90651161a6 100644
--
2.29.2
From da2255761b82aae4add0b6b7ac712b2fac78958a Mon Sep 17 00:00:00 2001
From ae9241298ad53418b7d858f761a825f186ea55c8 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sun, 6 Sep 2020 04:01:19 +0200
Subject: [PATCH] platform/x86: Add driver for Surface Book 1 dGPU switch

View file

@ -1,4 +1,4 @@
From 4d73b917b67b302138b3f2ad2264d74e27df8a10 Mon Sep 17 00:00:00 2001
From 29e89c4937e2ce5a58a15bc5a3a6da860dff9c53 Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Mon, 26 Aug 2019 01:11:08 +0200
Subject: [PATCH] ACPI: Fix buffer/integer type mismatch
@ -60,7 +60,7 @@ index d3d2dbfba680..0b7f617a6e9b 100644
--
2.29.2
From 62a9adb0cbc7fe2b822016b11183f8e99ca71cfd Mon Sep 17 00:00:00 2001
From d3fb1c9090813b66b2c6675ba2e1733bab544000 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Tue, 24 Sep 2019 17:38:12 +0200
Subject: [PATCH] serdev: Add ACPI devices by ResourceSource field
@ -248,7 +248,7 @@ index a9719858c950..ce5309d00280 100644
--
2.29.2
From 2b33c419765eaad2e004bfdedebd13fd00b087db Mon Sep 17 00:00:00 2001
From 5382672190836333f3cb5018b43512ae2dd712f0 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Thu, 29 Oct 2020 22:04:38 +0100
Subject: [PATCH] PCI: Allow D3cold for hot-plug ports on Surface Books
@ -333,7 +333,7 @@ index b1b2c8ddbc92..15566ec8f75d 100644
--
2.29.2
From 7be31a12afb38de1c3d72fd2ed1a699485390049 Mon Sep 17 00:00:00 2001
From 1560d7d1475f06c40d2a28c21e716b882eba4b5a Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Mon, 9 Nov 2020 14:23:00 +0100
Subject: [PATCH] PCI: Run platform power transition on initial D0 entry
@ -395,7 +395,7 @@ index 15566ec8f75d..9b0a591fc60b 100644
--
2.29.2
From 3989bbe3148f88df0057a3f46f6c9896a117541a Mon Sep 17 00:00:00 2001
From 1fa17d7910e35dfc1e941028294f306a2229e169 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 31 Oct 2020 20:46:33 +0100
Subject: [PATCH] PCI: Add sysfs attribute for PCI device power state
@ -468,7 +468,7 @@ index e401f040f157..418927872ae6 100644
--
2.29.2
From c474ad335910e43d8941260ec0420fb4dc6883c9 Mon Sep 17 00:00:00 2001
From e9e831a8e7ceeef021fb106b8d7bebeefc792884 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Mon, 17 Aug 2020 01:23:20 +0200
Subject: [PATCH] misc: surface_sam: Add file2alias support for Surface SAM
@ -570,7 +570,7 @@ index c91eba751804..bc06f7631200 100644
--
2.29.2
From 5555669b449eaf4872833e44a3894659a78c79a3 Mon Sep 17 00:00:00 2001
From fa22e4d07bcfea11975b91daaf525aca32508695 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Mon, 17 Aug 2020 01:44:30 +0200
Subject: [PATCH] misc: Add support for Surface System Aggregator Module
@ -610,7 +610,7 @@ Patchset: surface-sam
.../clients/surface_acpi_notify.c | 886 ++++++
.../clients/surface_aggregator_cdev.c | 299 ++
.../clients/surface_aggregator_registry.c | 606 ++++
.../clients/surface_battery.c | 1188 ++++++++
.../clients/surface_battery.c | 1178 ++++++++
.../surface_aggregator/clients/surface_dtx.c | 1277 +++++++++
.../surface_aggregator/clients/surface_hid.c | 924 ++++++
.../clients/surface_hotplug.c | 267 ++
@ -619,12 +619,12 @@ Patchset: surface-sam
drivers/misc/surface_aggregator/controller.h | 285 ++
drivers/misc/surface_aggregator/core.c | 845 ++++++
drivers/misc/surface_aggregator/ssh_msgb.h | 205 ++
.../surface_aggregator/ssh_packet_layer.c | 2055 +++++++++++++
.../surface_aggregator/ssh_packet_layer.h | 188 ++
.../surface_aggregator/ssh_packet_layer.c | 2046 +++++++++++++
.../surface_aggregator/ssh_packet_layer.h | 190 ++
drivers/misc/surface_aggregator/ssh_parser.c | 228 ++
drivers/misc/surface_aggregator/ssh_parser.h | 155 +
.../surface_aggregator/ssh_request_layer.c | 1265 ++++++++
.../surface_aggregator/ssh_request_layer.h | 141 +
.../surface_aggregator/ssh_request_layer.c | 1256 ++++++++
.../surface_aggregator/ssh_request_layer.h | 143 +
drivers/misc/surface_aggregator/trace.h | 632 ++++
include/linux/mod_devicetable.h | 5 +-
include/linux/surface_acpi_notify.h | 39 +
@ -635,7 +635,7 @@ Patchset: surface-sam
include/uapi/linux/surface_aggregator/dtx.h | 146 +
scripts/mod/devicetable-offsets.c | 3 +-
scripts/mod/file2alias.c | 10 +-
48 files changed, 18829 insertions(+), 7 deletions(-)
48 files changed, 18805 insertions(+), 7 deletions(-)
create mode 100644 Documentation/driver-api/surface_aggregator/client-api.rst
create mode 100644 Documentation/driver-api/surface_aggregator/client.rst
create mode 100644 Documentation/driver-api/surface_aggregator/clients/cdev.rst
@ -5165,10 +5165,10 @@ index 000000000000..a18f85dd6881
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/clients/surface_battery.c b/drivers/misc/surface_aggregator/clients/surface_battery.c
new file mode 100644
index 000000000000..ac26a1094c6f
index 000000000000..f22fb2ceb786
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_battery.c
@@ -0,0 +1,1188 @@
@@ -0,0 +1,1178 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Surface battery and AC device driver.
@ -5622,26 +5622,16 @@ index 000000000000..ac26a1094c6f
+
+static int spwr_battery_recheck_adapter(struct spwr_battery_device *bat)
+{
+ u32 full_cap = sprw_battery_get_full_cap_safe(bat);
+ u32 remaining_cap = get_unaligned_le32(&bat->bst.remaining_cap);
+
+ if (full_cap == 0 || full_cap == SPWR_BATTERY_VALUE_UNKNOWN)
+ return 0;
+
+ if (remaining_cap == SPWR_BATTERY_VALUE_UNKNOWN)
+ return 0;
+
+ /*
+ * Handle battery update quirk:
+ * When the battery is fully charged and the adapter is plugged in or
+ * removed, the EC does not send a separate event for the state
+ * (charging/discharging) change. Furthermore it may take some time until
+ * the state is updated on the battery. Schedule an update to solve this.
+ * Handle battery update quirk: When the battery is fully charged (or
+ * charged up to the limit imposed by the UEFI battery limit) and the
+ * adapter is plugged in or removed, the EC does not send a separate
+ * event for the state (charging/discharging) change. Furthermore it
+ * may take some time until the state is updated on the battery.
+ * Schedule an update to solve this.
+ */
+
+ if (remaining_cap >= full_cap)
+ schedule_delayed_work(&bat->update_work, SPWR_AC_BAT_UPDATE_DELAY);
+
+ schedule_delayed_work(&bat->update_work, SPWR_AC_BAT_UPDATE_DELAY);
+ return 0;
+}
+
@ -8973,7 +8963,7 @@ index 000000000000..cac7227f27ea
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/controller.c b/drivers/misc/surface_aggregator/controller.c
new file mode 100644
index 000000000000..e39b11c0c007
index 000000000000..09302bfba530
--- /dev/null
+++ b/drivers/misc/surface_aggregator/controller.c
@@ -0,0 +1,2543 @@
@ -9087,7 +9077,7 @@ index 000000000000..e39b11c0c007
+
+/**
+ * ssam_event_matches_notifier() - Test if an event matches a notifier.
+ * @notif: The event notifier to test against.
+ * @n: The event notifier to test against.
+ * @event: The event to test.
+ *
+ * Return: Returns %true iff the given event matches the given notifier
@ -12875,10 +12865,10 @@ index 000000000000..1221f642dda1
+#endif /* _SURFACE_AGGREGATOR_SSH_MSGB_H */
diff --git a/drivers/misc/surface_aggregator/ssh_packet_layer.c b/drivers/misc/surface_aggregator/ssh_packet_layer.c
new file mode 100644
index 000000000000..96141a174792
index 000000000000..0205be9380bf
--- /dev/null
+++ b/drivers/misc/surface_aggregator/ssh_packet_layer.c
@@ -0,0 +1,2055 @@
@@ -0,0 +1,2046 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * SSH packet transport layer.
@ -13545,21 +13535,16 @@ index 000000000000..96141a174792
+{
+ unsigned long delta = msecs_to_jiffies(ktime_ms_delta(expires, now));
+ ktime_t aexp = ktime_add(expires, SSH_PTL_PACKET_TIMEOUT_RESOLUTION);
+ ktime_t old_exp, old_act;
+
+ /* Re-adjust / schedule reaper if it is above resolution delta. */
+ old_act = READ_ONCE(ptl->rtx_timeout.expires);
+ if (ktime_after(aexp, old_act))
+ return;
+ spin_lock(&ptl->rtx_timeout.lock);
+
+ do {
+ old_exp = old_act;
+ old_act = cmpxchg64(&ptl->rtx_timeout.expires, old_exp, expires);
+ } while (old_exp != old_act && ktime_before(aexp, old_act));
+
+ /* If we updated the reaper expiration, modify work timeout. */
+ if (old_exp == old_act && old_act != expires)
+ /* Re-adjust / schedule reaper only if it is above resolution delta. */
+ if (ktime_before(aexp, ptl->rtx_timeout.expires)) {
+ ptl->rtx_timeout.expires = expires;
+ mod_delayed_work(system_wq, &ptl->rtx_timeout.reaper, delta);
+ }
+
+ spin_unlock(&ptl->rtx_timeout.lock);
+}
+
+/* Must be called with queue lock held. */
@ -14389,14 +14374,9 @@ index 000000000000..96141a174792
+ * Mark reaper as "not pending". This is done before checking any
+ * packets to avoid lost-update type problems.
+ */
+ WRITE_ONCE(ptl->rtx_timeout.expires, KTIME_MAX);
+ /*
+ * Ensure that the reaper is marked as deactivated before we continue
+ * checking packets to prevent lost-update problems when a packet is
+ * added to the pending set and ssh_ptl_timeout_reaper_mod is called
+ * during execution of the part below.
+ */
+ smp_mb__after_atomic();
+ spin_lock(&ptl->rtx_timeout.lock);
+ ptl->rtx_timeout.expires = KTIME_MAX;
+ spin_unlock(&ptl->rtx_timeout.lock);
+
+ spin_lock(&ptl->pending.lock);
+
@ -14898,6 +14878,7 @@ index 000000000000..96141a174792
+ ptl->rx.thread = NULL;
+ init_waitqueue_head(&ptl->rx.wq);
+
+ spin_lock_init(&ptl->rtx_timeout.lock);
+ ptl->rtx_timeout.timeout = SSH_PTL_PACKET_TIMEOUT;
+ ptl->rtx_timeout.expires = KTIME_MAX;
+ INIT_DELAYED_WORK(&ptl->rtx_timeout.reaper, ssh_ptl_timeout_reap);
@ -14936,10 +14917,10 @@ index 000000000000..96141a174792
+}
diff --git a/drivers/misc/surface_aggregator/ssh_packet_layer.h b/drivers/misc/surface_aggregator/ssh_packet_layer.h
new file mode 100644
index 000000000000..c844cac0f4d7
index 000000000000..e8757d03f279
--- /dev/null
+++ b/drivers/misc/surface_aggregator/ssh_packet_layer.h
@@ -0,0 +1,188 @@
@@ -0,0 +1,190 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * SSH packet transport layer.
@ -15010,6 +14991,7 @@ index 000000000000..c844cac0f4d7
+ * @rx.blocked.seqs: Array of blocked sequence IDs.
+ * @rx.blocked.offset: Offset indicating where a new ID should be inserted.
+ * @rtx_timeout: Retransmission timeout subsystem.
+ * @rtx_timeout.lock: Lock for modifying the retransmission timeout reaper.
+ * @rtx_timeout.timeout: Timeout interval for retransmission.
+ * @rtx_timeout.expires: Time specifying when the reaper work is next scheduled.
+ * @rtx_timeout.reaper: Work performing timeout checks and subsequent actions.
@ -15051,6 +15033,7 @@ index 000000000000..c844cac0f4d7
+ } rx;
+
+ struct {
+ spinlock_t lock;
+ ktime_t timeout;
+ ktime_t expires;
+ struct delayed_work reaper;
@ -15525,10 +15508,10 @@ index 000000000000..395c61ef890b
+#endif /* _SURFACE_AGGREGATOR_SSH_PARSER_h */
diff --git a/drivers/misc/surface_aggregator/ssh_request_layer.c b/drivers/misc/surface_aggregator/ssh_request_layer.c
new file mode 100644
index 000000000000..966150542ae8
index 000000000000..bf1782c85063
--- /dev/null
+++ b/drivers/misc/surface_aggregator/ssh_request_layer.c
@@ -0,0 +1,1265 @@
@@ -0,0 +1,1256 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * SSH request transport layer.
@ -15959,21 +15942,16 @@ index 000000000000..966150542ae8
+{
+ unsigned long delta = msecs_to_jiffies(ktime_ms_delta(expires, now));
+ ktime_t aexp = ktime_add(expires, SSH_RTL_REQUEST_TIMEOUT_RESOLUTION);
+ ktime_t old_exp, old_act;
+
+ /* Re-adjust/schedule reaper if it is above resolution delta. */
+ old_act = READ_ONCE(rtl->rtx_timeout.expires);
+ if (ktime_after(aexp, old_act))
+ return;
+ spin_lock(&rtl->rtx_timeout.lock);
+
+ do {
+ old_exp = old_act;
+ old_act = cmpxchg64(&rtl->rtx_timeout.expires, old_exp, expires);
+ } while (old_exp != old_act && ktime_before(aexp, old_act));
+
+ /* If we updated the reaper expiration, modify work timeout. */
+ if (old_exp == old_act && old_act != expires)
+ /* Re-adjust / schedule reaper only if it is above resolution delta. */
+ if (ktime_before(aexp, rtl->rtx_timeout.expires)) {
+ rtl->rtx_timeout.expires = expires;
+ mod_delayed_work(system_wq, &rtl->rtx_timeout.reaper, delta);
+ }
+
+ spin_unlock(&rtl->rtx_timeout.lock);
+}
+
+static void ssh_rtl_timeout_start(struct ssh_request *rqst)
@ -16368,14 +16346,9 @@ index 000000000000..966150542ae8
+ * Mark reaper as "not pending". This is done before checking any
+ * requests to avoid lost-update type problems.
+ */
+ WRITE_ONCE(rtl->rtx_timeout.expires, KTIME_MAX);
+ /*
+ * Ensure that the reaper is marked as deactivated before we continue
+ * checking requests to prevent lost-update problems when a request is
+ * added to the pending set and ssh_rtl_timeout_reaper_mod is called
+ * during execution of the part below.
+ */
+ smp_mb__after_atomic();
+ spin_lock(&rtl->rtx_timeout.lock);
+ rtl->rtx_timeout.expires = KTIME_MAX;
+ spin_unlock(&rtl->rtx_timeout.lock);
+
+ spin_lock(&rtl->pending.lock);
+ list_for_each_entry_safe(r, n, &rtl->pending.head, node) {
@ -16564,6 +16537,7 @@ index 000000000000..966150542ae8
+
+ INIT_WORK(&rtl->tx.work, ssh_rtl_tx_work_fn);
+
+ spin_lock_init(&rtl->rtx_timeout.lock);
+ rtl->rtx_timeout.timeout = SSH_RTL_REQUEST_TIMEOUT;
+ rtl->rtx_timeout.expires = KTIME_MAX;
+ INIT_DELAYED_WORK(&rtl->rtx_timeout.reaper, ssh_rtl_timeout_reap);
@ -16796,10 +16770,10 @@ index 000000000000..966150542ae8
+}
diff --git a/drivers/misc/surface_aggregator/ssh_request_layer.h b/drivers/misc/surface_aggregator/ssh_request_layer.h
new file mode 100644
index 000000000000..ab357b2b3735
index 000000000000..9c2efdd8ae70
--- /dev/null
+++ b/drivers/misc/surface_aggregator/ssh_request_layer.h
@@ -0,0 +1,141 @@
@@ -0,0 +1,143 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * SSH request transport layer.
@ -16858,6 +16832,7 @@ index 000000000000..ab357b2b3735
+ * @tx: Transmitter subsystem.
+ * @tx.work: Transmitter work item.
+ * @rtx_timeout: Retransmission timeout subsystem.
+ * @rtx_timeout.lock: Lock for modifying the retransmission timeout reaper.
+ * @rtx_timeout.timeout: Timeout interval for retransmission.
+ * @rtx_timeout.expires: Time specifying when the reaper work is next scheduled.
+ * @rtx_timeout.reaper: Work performing timeout checks and subsequent actions.
@ -16883,6 +16858,7 @@ index 000000000000..ab357b2b3735
+ } tx;
+
+ struct {
+ spinlock_t lock;
+ ktime_t timeout;
+ ktime_t expires;
+ struct delayed_work reaper;

View file

@ -1,4 +1,4 @@
From 3c16a4327878964046179df41a798d32475447ad Mon Sep 17 00:00:00 2001
From 3b1684d25ed312de993110c8191ce1ed633f70a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= <verdre@v0yd.nl>
Date: Thu, 5 Nov 2020 13:09:45 +0100
Subject: [PATCH] hid/multitouch: Turn off Type Cover keyboard backlight when

View file

@ -1,37 +0,0 @@
From 46e81109fdc3bf5e042564437ea7b84801d8f92b Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <ardb@kernel.org>
Date: Wed, 25 Nov 2020 08:53:03 +0100
Subject: [PATCH] efivarfs: revert "fix memory leak in efivarfs_create()"
The memory leak addressed by commit fe5186cf12e3 is a false positive:
all allocations are recorded in a linked list, and freed when the
filesystem is unmounted. This leads to double frees, and as reported
by David, leads to crashes if SLUB is configured to self destruct when
double frees occur.
So drop the redundant kfree() again, and instead, mark the offending
pointer variable so the allocation is ignored by kmemleak.
Cc: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
Fixes: fe5186cf12e3 ("efivarfs: fix memory leak in efivarfs_create()")
Reported-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
fs/efivarfs/super.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index edcd6769a94b..9760a52800b4 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -21,7 +21,6 @@ LIST_HEAD(efivarfs_list);
static void efivarfs_evict_inode(struct inode *inode)
{
clear_inode(inode);
- kfree(inode->i_private);
}
static const struct super_operations efivarfs_ops = {
--
2.29.2