Update v4.19 patches

Changes:
 - SAM:
   - Retry more SAM requests on communication failure to increase
     stability.
   - Fix bug in PCI platform power state initialization preventing the
     Intel LPSS driver from loading on 7th generation Surface devices.

Links:
 - SAM: bfab2be7d3
 - kernel: 5ae90020d0
This commit is contained in:
Maximilian Luz 2020-11-09 21:53:25 +01:00
parent a6922b2636
commit 7f370a054c
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02
11 changed files with 190 additions and 198 deletions

View file

@ -1,4 +1,4 @@
From 499a3fc8d3eaecb325078e20ab9af8ae3db9869e Mon Sep 17 00:00:00 2001
From 70760ba2af9429393d3481855d2fd9a218868e72 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 28 Sep 2019 18:00:43 +0200
Subject: [PATCH] platform/x86: Surface 3 battery platform operation region

View file

@ -1,4 +1,4 @@
From 9e03012c9a960d8874b0e73715ea5e874423f1a5 Mon Sep 17 00:00:00 2001
From cd1d9ba158d82020a36c2e1f83deb07befa0b343 Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Sun, 5 Jul 2020 14:56:20 +0300
Subject: [PATCH] dmaengine: dw: Initialize channel before each transfer

View file

@ -1,4 +1,4 @@
From 003010b5d9a3b27eaa95cc14c330173060b14c07 Mon Sep 17 00:00:00 2001
From 6d30417a163d26513e4001780c29436338ab9ca7 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 70d1cb3eb11fe9b78fa193570d037428b6dec4ea Mon Sep 17 00:00:00 2001
From f1904136b15c64eff095a3c0236ed42110712445 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 27 Jul 2019 17:51:37 +0200
Subject: [PATCH] platform/x86: surfacepro3_button: Fix device check
@ -92,7 +92,7 @@ index 1b491690ce07..96627627060e 100644
--
2.29.2
From 8fc9430c6f015abdc2bfb99606268741260e4ce7 Mon Sep 17 00:00:00 2001
From 2c6bda020d773258435450901126b5f662b4ec99 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 27 Jul 2019 17:52:01 +0200
Subject: [PATCH] Input: soc_button_array - Add support for newer surface
@ -297,7 +297,7 @@ index 55cd6e0b409c..8f21c062c85d 100644
--
2.29.2
From 1b07afa7a3f18c5f9dba5e75d699041b712bd879 Mon Sep 17 00:00:00 2001
From daebfe972cfc4b31d4f5cb12fc3d2c1d1f39c94a Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoide@redhat.com>
Date: Sat, 5 Oct 2019 14:11:58 +0200
Subject: [PATCH] Input: soc_button_array - partial revert of support for newer
@ -386,7 +386,7 @@ index 8f21c062c85d..5983733d78dd 100644
--
2.29.2
From 266031a4c24c8d9b91774c80fb8e98cb9dacda54 Mon Sep 17 00:00:00 2001
From c607dd59be2f32e56f7059ecb98430238c4dff50 Mon Sep 17 00:00:00 2001
From: "Tsuchiya Yuto (kitakar5525)" <kitakar@gmail.com>
Date: Mon, 11 May 2020 17:40:21 +0900
Subject: [PATCH] Input: soc_button_array - fix Wdiscarded-qualifiers for

View file

@ -1,4 +1,4 @@
From cacf4579399486621367171238a82ec6df64bf16 Mon Sep 17 00:00:00 2001
From 052738d90decca5a736bb6ca2884196f45ef740c Mon Sep 17 00:00:00 2001
From: kitakar5525 <34676735+kitakar5525@users.noreply.github.com>
Date: Sat, 28 Sep 2019 17:48:21 +0200
Subject: [PATCH] nvme: Backport changes for suspend

View file

@ -1,4 +1,4 @@
From cc37e06fbfa6b8e97b2059865fc328a983e9c0b2 Mon Sep 17 00:00:00 2001
From df9b30ae19e9a71868de2bb47dd8f1e3f13b1e11 Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 28 Sep 2019 17:58:17 +0200
Subject: [PATCH] Add support for Intel IPTS touch devices
@ -230,10 +230,10 @@ index b0d76a7a0946..81fba8e5ab05 100644
if (i915_gem_suspend(dev_priv))
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index db2e9af49ae6..99bc0c92c411 100644
index 37c80cfecd09..948eb874342d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3232,6 +3232,9 @@ void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
@@ -3236,6 +3236,9 @@ void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
struct sg_table *pages);

View file

@ -1,4 +1,4 @@
From 06f303aa916cda090b16dc65f3e0619ae1d1f9f1 Mon Sep 17 00:00:00 2001
From 5afba653a3e671651e7be9cb5013052d0ca17c6f Mon Sep 17 00:00:00 2001
From: Chuhong Yuan <hslester96@gmail.com>
Date: Wed, 24 Jul 2019 19:27:45 +0800
Subject: [PATCH] mwifiex: pcie: Use dev_get_drvdata
@ -49,7 +49,7 @@ index 991b9cc18000..2aa0436d3548 100644
--
2.29.2
From 2b3f03f528381d8efdb83d43f4d9d295dcc09f1b Mon Sep 17 00:00:00 2001
From 75dc6b5e5c146d581a8426ee147a3c9c29f72236 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
@ -206,7 +206,7 @@ index f7ce9b6db6b4..72d0c01ff359 100644
--
2.29.2
From 14e3a0b204c5a998b5b0873757c551e934411069 Mon Sep 17 00:00:00 2001
From c11275e5e471354de2f773b2ba56f2c4cac670d9 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
@ -414,7 +414,7 @@ index 000000000000..5326ae7e5671
--
2.29.2
From c2f0354a1f66c24ce1d7cba579601a3a677dcad3 Mon Sep 17 00:00:00 2001
From 6a92751db695e0c4d1fa11c7262b7243780701cf 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+
@ -615,7 +615,7 @@ index 5326ae7e5671..8b9dcb5070d8 100644
--
2.29.2
From 334cc2d7ef55aefc664a1652a10b07ca3892a9e6 Mon Sep 17 00:00:00 2001
From 8cb4d4c4d8512a266e7377237763d4e9b490b51b 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
@ -794,7 +794,7 @@ index 8b9dcb5070d8..3ef7440418e3 100644
--
2.29.2
From 1bacc3349013e74daeda5ffd9b79eaf8d1767784 Mon Sep 17 00:00:00 2001
From 2b6bc66e9628040514043f14244ee28b5dd6075c 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
@ -856,7 +856,7 @@ index f0a6fa0a7ae5..34dcd84f02a6 100644
--
2.29.2
From d6938cf12fc888775a98a17f3a6621e9250ee45e Mon Sep 17 00:00:00 2001
From 13d60f95ed62da9406621666b873f04ef7e9293b 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
@ -933,7 +933,7 @@ index e48b47f42554..ceac611ef086 100644
--
2.29.2
From b38c4b6616f13cfd2f02ee97a3bd34562b40a97e Mon Sep 17 00:00:00 2001
From 9298d8eb9eb2ce4c90dd610852232be0d0ff9de8 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
@ -1075,7 +1075,7 @@ index 290427c98630..d80eb18fb0d1 100644
--
2.29.2
From fc4220fde9f826159b3d9e2519652b37da473089 Mon Sep 17 00:00:00 2001
From 718c6e5e202491287451a9ee70a0d2d5cb36e1cc 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
@ -1124,7 +1124,7 @@ index d80eb18fb0d1..ea766584d3b7 100644
--
2.29.2
From 34df63e9063f14a1e61f7602c61b498c93ec9ed5 Mon Sep 17 00:00:00 2001
From b0679b97fe1fa838118ee8b64f73dd97a91d5a2c 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+
@ -1279,7 +1279,7 @@ index 3ef7440418e3..a95ebac06e13 100644
--
2.29.2
From 0c81c19f58f53ae517560ccf93b1ea773cccc98c Mon Sep 17 00:00:00 2001
From 889f70e63ccb360ae1b755e402a2ce3785c2e9b8 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
@ -1341,7 +1341,7 @@ index 650191db25cb..dd1f08a2325f 100644
--
2.29.2
From a31c76382e21d9b4cfe82a6382124f29f670383c Mon Sep 17 00:00:00 2001
From 49a4dafa705206127dc5014292611b8c3c9668b1 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
@ -1376,7 +1376,7 @@ index dd1f08a2325f..ee88da92b97c 100644
--
2.29.2
From 5c67ce2123bfdbb8bf281cc2bc49b7aa2afa7e6b Mon Sep 17 00:00:00 2001
From 75ce976858e49042095efef9d99f4b7aa0613596 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 8d21f4f4f4846dcc0bfffb04ac334282e60b0509 Mon Sep 17 00:00:00 2001
From e21ef376317ab346591f8ca7f5d731a5ac8a33ce 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 57296dc70cc52019878857232e94db3f1a3569cf Mon Sep 17 00:00:00 2001
From c780d459a104486a8548c6932034d64d98478213 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 8ba4122fb340..f9a24b56fec0 100644
--
2.29.2
From 338675ab867f045eff4106fde8f8f941e3ad9352 Mon Sep 17 00:00:00 2001
From 95ca57ce335257965baed58508954be3aa1eecf1 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 be77582b7b07355bfcc4cac4da80f2da43c4f097 Mon Sep 17 00:00:00 2001
From c0287fbdf248c6aa637c71aa17c7a25554bc683a Mon Sep 17 00:00:00 2001
From: qzed <qzed@users.noreply.github.com>
Date: Mon, 26 Aug 2019 01:15:40 +0200
Subject: [PATCH] ACPI: Fix buffer/integer type mismatch
@ -81,7 +81,7 @@ index b272c329d45d..cf547883a993 100644
--
2.29.2
From 4331e6ee0f21ce7e51c03325d3693238203af948 Mon Sep 17 00:00:00 2001
From 6fca03fe46be728664002d081f306b20ac50537d 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
@ -269,7 +269,7 @@ index c66a04d24f1d..1b18d12d217f 100644
--
2.29.2
From fa8c370c44eaef3cd75200b51247a04c12b779d7 Mon Sep 17 00:00:00 2001
From 44d22b18a786031006bb06155acdd3da9450c907 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Tue, 31 Jul 2018 07:50:37 +0200
Subject: [PATCH] PCI: pciehp: Differentiate between surprise and safe removal
@ -468,7 +468,7 @@ index 5c58c22e0c08..18f83e554c73 100644
--
2.29.2
From 5790c8b33cc4b0a19a5b1c2c065baf3ba3b1c5cf Mon Sep 17 00:00:00 2001
From a72bf1f7000b012b6f876adc1f26d0e6d8ae5602 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sun, 19 Aug 2018 16:29:00 +0200
Subject: [PATCH] PCI: pciehp: Drop unnecessary includes
@ -607,7 +607,7 @@ index 18f83e554c73..c512b2ed85ed 100644
--
2.29.2
From b83555bde6d001be3bb9e09996684da2c2518f67 Mon Sep 17 00:00:00 2001
From 7e56e7d001a7808839ba6fe38f7731054a75b5a1 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sun, 19 Aug 2018 16:29:00 +0200
Subject: [PATCH] PCI: pciehp: Drop hotplug_slot_ops wrappers
@ -820,7 +820,7 @@ index d4b7049cbc70..576362d0b1cd 100644
--
2.29.2
From b2639a0c1b7648269b338daf87ce4a149203fbe8 Mon Sep 17 00:00:00 2001
From 5283b2bc9b1cfdbefcf761a27288cd4362054689 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sat, 8 Sep 2018 09:59:01 +0200
Subject: [PATCH] PCI: pciehp: Tolerate Presence Detect hardwired to zero
@ -1018,7 +1018,7 @@ index 576362d0b1cd..7f4173d6771a 100644
--
2.29.2
From f3bc2638976b69fbfc0f40f70b4211ff84e9c92d Mon Sep 17 00:00:00 2001
From 591a23298a05a7c7493ec2a0416f067803f37758 Mon Sep 17 00:00:00 2001
From: Patrick Talbert <ptalbert@redhat.com>
Date: Wed, 5 Sep 2018 09:12:53 +0200
Subject: [PATCH] PCI/ASPM: Do not initialize link state when aspm_disabled is
@ -1063,7 +1063,7 @@ index cb474338f39d..18aa830e79e4 100644
--
2.29.2
From a088c61501b4416c22057520accb8351a2e9ff6c Mon Sep 17 00:00:00 2001
From abf218f97266461d64033060138826e7c5801251 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sun, 19 Aug 2018 16:29:00 +0200
Subject: [PATCH] PCI: Simplify disconnected marking
@ -1149,7 +1149,7 @@ index 2c3b5bd59b18..dee5a7507403 100644
--
2.29.2
From 47fec40f2551fb4a56c32276642fa0eac3e0e8b8 Mon Sep 17 00:00:00 2001
From 35f7a64d5411b13edccdc510280315536ad984d1 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Tue, 18 Sep 2018 21:46:17 +0200
Subject: [PATCH] PCI: pciehp: Unify controller and slot structs
@ -2341,7 +2341,7 @@ index 8da87931bd45..b9c1396db6fe 100644
--
2.29.2
From a82359ba7d6698eeaf7ce9c50d0f57aa2d88350d Mon Sep 17 00:00:00 2001
From ce21a78c2d2533f9572392e6238055663729e898 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sat, 8 Sep 2018 09:59:01 +0200
Subject: [PATCH] PCI: pciehp: Rename controller struct members for clarity
@ -2648,7 +2648,7 @@ index 4a17d71e15d3..e4d6ec960630 100644
--
2.29.2
From 15686c23a0c8f9e876195fc50469bef486a6d5a0 Mon Sep 17 00:00:00 2001
From 24d4ad1309949d2dd3ed503245e1940f64d8ce03 Mon Sep 17 00:00:00 2001
From: Lukas Wunner <lukas@wunner.de>
Date: Sat, 8 Sep 2018 09:59:01 +0200
Subject: [PATCH] PCI: pciehp: Reshuffle controller struct for clarity
@ -2779,7 +2779,7 @@ index 2499489158cc..df82a0335515 100644
--
2.29.2
From 8928c2cdfbf667c87ce75074627ee4f2de854d0c Mon Sep 17 00:00:00 2001
From 26f4cb74e76953195269393fa42f34ec211f077a Mon Sep 17 00:00:00 2001
From: Keith Busch <keith.busch@intel.com>
Date: Thu, 20 Sep 2018 10:27:17 -0600
Subject: [PATCH] PCI: Make link active reporting detection generic
@ -2976,7 +2976,7 @@ index ec6c48ecd7d5..74c8e9190fed 100644
--
2.29.2
From 828f314baaea82376c69919db201d7a9468c7544 Mon Sep 17 00:00:00 2001
From 8521cb5e0771b4f7a1858b5473d9463e280a1290 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:53:53 -0500
Subject: [PATCH] PCI: Do not skip power-managed bridges in pci_enable_wake()
@ -3027,7 +3027,7 @@ index 99292b338401..2898b7c1ac4b 100644
--
2.29.2
From 2f6cfa13e7a7d6413bea8b242e4838c632013c77 Mon Sep 17 00:00:00 2001
From 1a7e191a554c4ac45f51ab24f71fba44cc3db3d5 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:38:19 -0500
Subject: [PATCH] PCI: pciehp: Disable hotplug interrupt during suspend
@ -3141,7 +3141,7 @@ index 0693870a9e24..b5c7f5ef597a 100644
--
2.29.2
From 6bb05aa2d4cdb7b8f72c0247ce047d27c2805a1c Mon Sep 17 00:00:00 2001
From 2fab3a73aa17c0bd7c61c49e40276c9fcadb6a67 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:41:46 -0500
Subject: [PATCH] PCI: pciehp: Do not handle events if interrupts are masked
@ -3183,7 +3183,7 @@ index b5c7f5ef597a..242b9f30210a 100644
--
2.29.2
From 776d86cb203ee0b0aa77dbbb7ceb675fec976221 Mon Sep 17 00:00:00 2001
From 2280d316dc6c07931a23953b50e207b48702c0bd Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:41:47 -0500
Subject: [PATCH] PCI/portdrv: Resume upon exit from system suspend if left
@ -3236,7 +3236,7 @@ index 23a5a0c2c3fe..5badf8a1ce0a 100644
--
2.29.2
From a0b5807960f56c96f7ac90fd19c7937bf8c01c15 Mon Sep 17 00:00:00 2001
From 8b7a2b01ef0ff71797f30cdfc5cf516a45cc5b80 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:41:48 -0500
Subject: [PATCH] PCI/portdrv: Add runtime PM hooks for port service drivers
@ -3348,7 +3348,7 @@ index 5badf8a1ce0a..59d2567e2db2 100644
--
2.29.2
From 611f6b8b569b4a7ed5721bbe1cf92343c09689ca Mon Sep 17 00:00:00 2001
From 2ff989f95f1fcc1d04b9cb88f24860859680e184 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:41:49 -0500
Subject: [PATCH] PCI: pciehp: Implement runtime PM callbacks
@ -3405,7 +3405,7 @@ index 8e6e4ce869fb..e5de25ebc4cf 100644
--
2.29.2
From 17d21b61dd014649657455e08cd58b2eab669ae5 Mon Sep 17 00:00:00 2001
From 6ded56d0a9cc634784d92c8316646b6dfb3b0855 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:57:05 -0500
Subject: [PATCH] ACPI / property: Allow multiple property compatible _DSD
@ -3700,7 +3700,7 @@ index cd412817654f..4e2e30e340fe 100644
--
2.29.2
From e13a0cc908833740788dca823b99b0d7f4e57b44 Mon Sep 17 00:00:00 2001
From dd9d941f47115a86182ef719d44cab491a7dc6ae Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 27 Sep 2018 16:57:14 -0500
Subject: [PATCH] PCI / ACPI: Whitelist D3 for more PCIe hotplug ports
@ -3865,7 +3865,7 @@ index e9ede82ee2c2..0a5efc437bd1 100644
--
2.29.2
From b7c856bcec6d02044f1737ff3d7fbfeda431f6a5 Mon Sep 17 00:00:00 2001
From c889fe03a79ed9eb837e3c3a94421e7c90f44827 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Mon, 7 Jan 2019 16:09:40 +0300
Subject: [PATCH] PCI: pciehp: Assign ctrl->slot_ctrl before writing it to
@ -3919,7 +3919,7 @@ index 242b9f30210a..7074d4923811 100644
--
2.29.2
From b661fc6fc2c48a267e112a43dcd93a3c2a931f83 Mon Sep 17 00:00:00 2001
From e9602252dc92abb532e67f5f9619593345fec693 Mon Sep 17 00:00:00 2001
From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: Thu, 31 Jan 2019 20:07:46 +0300
Subject: [PATCH] PCI: pciehp: Disable Data Link Layer State Changed event on
@ -4008,7 +4008,7 @@ index 7074d4923811..a37ff79a6e9e 100644
--
2.29.2
From 559532f683fcdfd1d94bd26d6e276d947b5e5c4c Mon Sep 17 00:00:00 2001
From 6f78ee460a37322033317ab3c64ad953dc36a2d8 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
@ -4034,7 +4034,6 @@ via ACPI, out-of-band interrupts, and the surface_hotplug driver
however, device removal/addition will only be detected on device resume.
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Patchset: surface-sam
---
drivers/pci/pci.c | 31 +++++++++++++++++++++++++++++--
@ -4094,91 +4093,69 @@ index b53a6772ee09..70af1713767f 100644
--
2.29.2
From 53572f59250be10aaaf6dd82f773291c6df58108 Mon Sep 17 00:00:00 2001
From 4675fefaed2fe4c65ed5b2f69ca8ed7d9c0b544b Mon Sep 17 00:00:00 2001
From: Maximilian Luz <luzmaximilian@gmail.com>
Date: Sat, 31 Oct 2020 19:48:06 +0100
Subject: [PATCH] PCI: Update platform power state when updating PCI state
Date: Mon, 9 Nov 2020 14:23:00 +0100
Subject: [PATCH] PCI: Run platform power transition on initial D0 entry
On some devices and platforms, the initial platform power state is not
in sync with the power state of the PCI device.
Specifically, on the Surface Book 2 and 3, some ACPI power regions that
should be "on" for the D0 state (and others) are initialized as "off" in
ACPI, whereas the PCI device is in D0. As the state is updated in
pci_enable_device_flags() without ensuring that the platform state is
also updated, the power resource will never be properly turned on.
Instead, it lives in a sort of on-but-marked-as-off zombie-state, which
confuses things down the line when attempting to transition the device
into D3cold: As the resource is already marked as off, it won't be
turned off and the device does not fully enter D3cold, causing increased
power consumption during (runtime-)suspend.
pci_enable_device_flags() updates the state of a PCI device by reading
from the the PCI_PM_CTRL register. This may change the stored power
state of the device without running the appropriate platform power
transition.
Ensuring that the platform power state is in sync with the PCI power
state when updating the latter guarantees that all required ACPI power
regions are powered on/off in accordance with the requirements
(specified in the ACPI _PRn fields) for the current PCI power state.
Due to the stored power-state being changed, the later call to
pci_set_power_state(..., PCI_D0) in do_pci_enable_device() can evaluate
to a no-op if the stored state has been changed to D0 via that. This
will then prevent the appropriate platform power transition to be run,
which can on some devices and platforms lead to platform and PCI power
state being entirely different, i.e. out-of-sync. On ACPI platforms,
this can lead to power resources not being turned on, even though they
are marked as required for D0.
Specifically, on the Microsoft Surface Book 2 and 3, some ACPI power
regions that should be "on" for the D0 state (and others) are
initialized as "off" in ACPI, whereas the PCI device is in D0. As the
state is updated in pci_enable_device_flags() without ensuring that the
platform state is also updated, the power resource will never be
properly turned on. Instead, it lives in a sort of on-but-marked-as-off
zombie-state, which confuses things down the line when attempting to
transition the device into D3cold: As the resource is already marked as
off, it won't be turned off and the device does not fully enter D3cold,
causing increased power consumption during (runtime-)suspend.
By replacing pci_set_power_state() in do_pci_enable_device() with
pci_power_up(), we can force pci_platform_power_transition() to be
called, which will then check if the platform power state needs updating
and appropriate actions need to be taken.
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Patchset: surface-sam
---
drivers/pci/pci.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
drivers/pci/pci.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 70af1713767f..da8254eeba77 100644
index 70af1713767f..18caa27c774f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1587,7 +1587,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
{
struct pci_dev *bridge;
- int err;
+ int err = 0;
int i, bars = 0;
@@ -1520,9 +1520,7 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)
u16 cmd;
u8 pin;
/*
@@ -1597,9 +1597,35 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
* (e.g. if the device really is in D0 at enable time).
*/
if (dev->pm_cap) {
+ pci_power_t current_state;
u16 pmcsr;
+
pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
- dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
+ current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
+
+ /*
+ * On some platforms, the initial power state may not be in
+ * sync with the PCI power state. Specifically, on ACPI based
+ * platforms, power-resources for the current state may not
+ * have been properly enabled (or power-resources not required
+ * for the current state disabled) yet. Thus, ensure that the
+ * platform power state reflects the PCI state.
+ *
+ * Update platform state before actually setting current state
+ * so that it can still be accessed in platform code, if
+ * necessary.
+ */
+ if (platform_pci_power_manageable(dev))
+ err = platform_pci_set_power_state(dev, current_state);
+
+ // always update current state
+ dev->current_state = current_state;
+
+ if (err) {
+ pci_err(dev, "failed to update platform power state: %d\n",
+ err);
+ return err;
+ }
}
- err = pci_set_power_state(dev, PCI_D0);
- if (err < 0 && err != -EIO)
- return err;
+ pci_power_up(dev);
if (atomic_inc_return(&dev->enable_cnt) > 1)
bridge = pci_upstream_bridge(dev);
if (bridge)
--
2.29.2
From 4589e6b130e1ee76e64094c06d7831fcfddfd386 Mon Sep 17 00:00:00 2001
From c2807442e76fa5fd4fc7fa89f24f81603cd6b67e 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
@ -4252,7 +4229,7 @@ index 1edf5a1836ea..ee1518650d55 100644
--
2.29.2
From a9676aa474e9a0a056251ee93e902f3368dafcd0 Mon Sep 17 00:00:00 2001
From 80f85033c27b0dcadbf76db3462e17a02435fcf0 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
@ -4354,7 +4331,7 @@ index 7f40b6aab689..76e3b1d7db45 100644
--
2.29.2
From 7dd08a5b102a9e7b955ebe79acd7100a8c6ef14c Mon Sep 17 00:00:00 2001
From 31b1c16f7f5513a4f51e277a697cf9ba584dcc90 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
@ -4394,12 +4371,12 @@ Patchset: surface-sam
.../clients/surface_acpi_notify.c | 884 ++++++
.../clients/surface_aggregator_cdev.c | 299 ++
.../clients/surface_aggregator_registry.c | 609 ++++
.../clients/surface_battery.c | 1191 ++++++++
.../surface_aggregator/clients/surface_dtx.c | 1275 ++++++++
.../surface_aggregator/clients/surface_hid.c | 919 ++++++
.../clients/surface_battery.c | 1188 ++++++++
.../surface_aggregator/clients/surface_dtx.c | 1277 ++++++++
.../surface_aggregator/clients/surface_hid.c | 916 ++++++
.../clients/surface_hotplug.c | 269 ++
.../clients/surface_perfmode.c | 122 +
drivers/misc/surface_aggregator/controller.c | 2553 +++++++++++++++++
drivers/misc/surface_aggregator/controller.c | 2555 +++++++++++++++++
drivers/misc/surface_aggregator/controller.h | 288 ++
drivers/misc/surface_aggregator/core.c | 842 ++++++
drivers/misc/surface_aggregator/ssh_msgb.h | 201 ++
@ -4412,14 +4389,14 @@ Patchset: surface-sam
drivers/misc/surface_aggregator/trace.h | 625 ++++
include/linux/mod_devicetable.h | 5 +-
include/linux/surface_acpi_notify.h | 39 +
include/linux/surface_aggregator/controller.h | 815 ++++++
include/linux/surface_aggregator/controller.h | 832 ++++++
include/linux/surface_aggregator/device.h | 430 +++
include/linux/surface_aggregator/serial_hub.h | 655 +++++
include/uapi/linux/surface_aggregator/cdev.h | 58 +
include/uapi/linux/surface_aggregator/dtx.h | 150 +
scripts/mod/devicetable-offsets.c | 3 +-
scripts/mod/file2alias.c | 10 +-
48 files changed, 18754 insertions(+), 7 deletions(-)
48 files changed, 18769 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
@ -7148,7 +7125,7 @@ index 000000000000..7320922ba755
+obj-$(CONFIG_SURFACE_PERFMODE) += surface_perfmode.o
diff --git a/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
new file mode 100644
index 000000000000..9010f3aafd28
index 000000000000..7a5b8f280036
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
@@ -0,0 +1,884 @@
@ -7740,8 +7717,8 @@ index 000000000000..9010f3aafd28
+ return san_rqst_fixup_suspended(d, &rqst, buffer);
+ }
+
+ status = ssam_retry(ssam_request_sync_onstack, SAN_REQUEST_NUM_TRIES,
+ d->ctrl, &rqst, &rsp, SAN_GSB_MAX_RQSX_PAYLOAD);
+ status = __ssam_retry(ssam_request_sync_onstack, SAN_REQUEST_NUM_TRIES,
+ d->ctrl, &rqst, &rsp, SAN_GSB_MAX_RQSX_PAYLOAD);
+
+ if (!status) {
+ gsb_rqsx_response_success(buffer, rsp.pointer, rsp.length);
@ -8343,7 +8320,7 @@ index 000000000000..7ebd0977fb37
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/clients/surface_aggregator_registry.c b/drivers/misc/surface_aggregator/clients/surface_aggregator_registry.c
new file mode 100644
index 000000000000..282f4409535b
index 000000000000..215308c79666
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_aggregator_registry.c
@@ -0,0 +1,609 @@
@ -8631,7 +8608,7 @@ index 000000000000..282f4409535b
+ u8 opmode;
+ int status;
+
+ status = ssam_bas_query_opmode(sdev->ctrl, &opmode);
+ status = ssam_retry(ssam_bas_query_opmode, sdev->ctrl, &opmode);
+ if (status < 0) {
+ dev_err(&sdev->dev, "failed to query base state: %d\n", status);
+ return status;
@ -8958,10 +8935,10 @@ index 000000000000..282f4409535b
+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..540a5bd8957a
index 000000000000..0a4e48754afc
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_battery.c
@@ -0,0 +1,1191 @@
@@ -0,0 +1,1188 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Surface battery and AC device driver.
@ -8983,9 +8960,6 @@ index 000000000000..540a5bd8957a
+
+#include <linux/surface_aggregator/device.h>
+
+#define SPWR_RETRY 3
+#define spwr_retry(fn, args...) ssam_retry(fn, SPWR_RETRY, args)
+
+#define SPWR_AC_BAT_UPDATE_DELAY msecs_to_jiffies(5000)
+
+
@ -9210,7 +9184,7 @@ index 000000000000..540a5bd8957a
+
+static int spwr_battery_load_sta(struct spwr_battery_device *bat)
+{
+ return spwr_retry(ssam_bat_get_sta, bat->sdev, &bat->sta);
+ return ssam_retry(ssam_bat_get_sta, bat->sdev, &bat->sta);
+}
+
+static int spwr_battery_load_bix(struct spwr_battery_device *bat)
@ -9220,7 +9194,7 @@ index 000000000000..540a5bd8957a
+ if (!spwr_battery_present(bat))
+ return 0;
+
+ status = spwr_retry(ssam_bat_get_bix, bat->sdev, &bat->bix);
+ status = ssam_retry(ssam_bat_get_bix, bat->sdev, &bat->bix);
+
+ // enforce NULL terminated strings in case anything goes wrong...
+ bat->bix.model[ARRAY_SIZE(bat->bix.model) - 1] = 0;
@ -9236,7 +9210,7 @@ index 000000000000..540a5bd8957a
+ if (!spwr_battery_present(bat))
+ return 0;
+
+ return spwr_retry(ssam_bat_get_bst, bat->sdev, &bat->bst);
+ return ssam_retry(ssam_bat_get_bst, bat->sdev, &bat->bst);
+}
+
+static int spwr_battery_set_alarm_unlocked(struct spwr_battery_device *bat,
@ -9245,7 +9219,7 @@ index 000000000000..540a5bd8957a
+ __le32 value_le = cpu_to_le32(value);
+
+ bat->alarm = value;
+ return spwr_retry(ssam_bat_set_btp, bat->sdev, &value_le);
+ return ssam_retry(ssam_bat_set_btp, bat->sdev, &value_le);
+}
+
+static int spwr_battery_set_alarm(struct spwr_battery_device *bat, u32 value)
@ -9322,7 +9296,7 @@ index 000000000000..540a5bd8957a
+ int status;
+ u32 old = ac->state;
+
+ status = spwr_retry(ssam_bat_get_psrc, ac->sdev, &ac->state);
+ status = ssam_retry(ssam_bat_get_psrc, ac->sdev, &ac->state);
+ if (status < 0)
+ return status;
+
@ -9850,7 +9824,7 @@ index 000000000000..540a5bd8957a
+ int status;
+
+ // make sure the device is there and functioning properly
+ status = spwr_retry(ssam_bat_get_sta, ac->sdev, &sta);
+ status = ssam_retry(ssam_bat_get_sta, ac->sdev, &sta);
+ if (status)
+ return status;
+
@ -9913,7 +9887,7 @@ index 000000000000..540a5bd8957a
+ int status;
+
+ // make sure the device is there and functioning properly
+ status = spwr_retry(ssam_bat_get_sta, bat->sdev, &sta);
+ status = ssam_retry(ssam_bat_get_sta, bat->sdev, &sta);
+ if (status)
+ return status;
+
@ -10155,10 +10129,10 @@ index 000000000000..540a5bd8957a
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/clients/surface_dtx.c b/drivers/misc/surface_aggregator/clients/surface_dtx.c
new file mode 100644
index 000000000000..6e2cef16f208
index 000000000000..46e340229dc5
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_dtx.c
@@ -0,0 +1,1275 @@
@@ -0,0 +1,1277 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Surface Book (gen. 2 and later) detachment system (DTX) driver.
@ -10445,7 +10419,7 @@ index 000000000000..6e2cef16f208
+ struct sdtx_base_info info;
+ int status;
+
+ status = ssam_bas_get_base(ddev->ctrl, &raw);
+ status = ssam_retry(ssam_bas_get_base, ddev->ctrl, &raw);
+ if (status < 0)
+ return status;
+
@ -10463,7 +10437,7 @@ index 000000000000..6e2cef16f208
+ u8 mode;
+ int status;
+
+ status = ssam_bas_get_device_mode(ddev->ctrl, &mode);
+ status = ssam_retry(ssam_bas_get_device_mode, ddev->ctrl, &mode);
+ if (status < 0)
+ return status;
+
@ -10475,7 +10449,7 @@ index 000000000000..6e2cef16f208
+ u8 latch;
+ int status;
+
+ status = ssam_bas_get_latch_status(ddev->ctrl, &latch);
+ status = ssam_retry(ssam_bas_get_latch_status, ddev->ctrl, &latch);
+ if (status < 0)
+ return status;
+
@ -10497,22 +10471,22 @@ index 000000000000..6e2cef16f208
+ return 0;
+
+ case SDTX_IOCTL_LATCH_LOCK:
+ return ssam_bas_latch_lock(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_lock, ddev->ctrl);
+
+ case SDTX_IOCTL_LATCH_UNLOCK:
+ return ssam_bas_latch_unlock(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_unlock, ddev->ctrl);
+
+ case SDTX_IOCTL_LATCH_REQUEST:
+ return ssam_bas_latch_request(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_request, ddev->ctrl);
+
+ case SDTX_IOCTL_LATCH_CONFIRM:
+ return ssam_bas_latch_confirm(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_confirm, ddev->ctrl);
+
+ case SDTX_IOCTL_LATCH_HEARTBEAT:
+ return ssam_bas_latch_heartbeat(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_heartbeat, ddev->ctrl);
+
+ case SDTX_IOCTL_LATCH_CANCEL:
+ return ssam_bas_latch_cancel(ddev->ctrl);
+ return ssam_retry(ssam_bas_latch_cancel, ddev->ctrl);
+
+ case SDTX_IOCTL_GET_BASE_INFO:
+ return sdtx_ioctl_get_base_info(ddev,
@ -10893,14 +10867,14 @@ index 000000000000..6e2cef16f208
+ ddev = container_of(work, struct sdtx_device, mode_work.work);
+
+ // get operation mode
+ status = ssam_bas_get_device_mode(ddev->ctrl, &mode);
+ status = ssam_retry(ssam_bas_get_device_mode, ddev->ctrl, &mode);
+ if (status) {
+ dev_err(ddev->dev, "failed to get device mode: %d\n", status);
+ return;
+ }
+
+ // get base info
+ status = ssam_bas_get_base(ddev->ctrl, &base);
+ status = ssam_retry(ssam_bas_get_base, ddev->ctrl, &base);
+ if (status) {
+ dev_err(ddev->dev, "failed to get base info: %d\n", status);
+ return;
@ -11044,19 +11018,19 @@ index 000000000000..6e2cef16f208
+ */
+ smp_mb__after_atomic();
+
+ status = ssam_bas_get_base(ddev->ctrl, &base);
+ status = ssam_retry(ssam_bas_get_base, ddev->ctrl, &base);
+ if (status) {
+ dev_err(ddev->dev, "failed to get base state: %d\n", status);
+ return;
+ }
+
+ status = ssam_bas_get_device_mode(ddev->ctrl, &mode);
+ status = ssam_retry(ssam_bas_get_device_mode, ddev->ctrl, &mode);
+ if (status) {
+ dev_err(ddev->dev, "failed to get device mode: %d\n", status);
+ return;
+ }
+
+ status = ssam_bas_get_latch_status(ddev->ctrl, &latch);
+ status = ssam_retry(ssam_bas_get_latch_status, ddev->ctrl, &latch);
+ if (status) {
+ dev_err(ddev->dev, "failed to get latch status: %d\n", status);
+ return;
@ -11134,15 +11108,17 @@ index 000000000000..6e2cef16f208
+ * Note that we also need to do this before registring the event
+ * notifier, as that may access the state values.
+ */
+ status = ssam_bas_get_base(ddev->ctrl, &ddev->state.base);
+ status = ssam_retry(ssam_bas_get_base, ddev->ctrl, &ddev->state.base);
+ if (status)
+ return status;
+
+ status = ssam_bas_get_device_mode(ddev->ctrl, &ddev->state.device_mode);
+ status = ssam_retry(ssam_bas_get_device_mode, ddev->ctrl,
+ &ddev->state.device_mode);
+ if (status)
+ return status;
+
+ status = ssam_bas_get_latch_status(ddev->ctrl, &ddev->state.latch_status);
+ status = ssam_retry(ssam_bas_get_latch_status, ddev->ctrl,
+ &ddev->state.latch_status);
+ if (status)
+ return status;
+
@ -11436,10 +11412,10 @@ index 000000000000..6e2cef16f208
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/clients/surface_hid.c b/drivers/misc/surface_aggregator/clients/surface_hid.c
new file mode 100644
index 000000000000..8a9a389ac396
index 000000000000..3fead99ee583
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_hid.c
@@ -0,0 +1,919 @@
@@ -0,0 +1,916 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Surface System Aggregator Module (SSAM) HID device driver.
@ -11464,9 +11440,6 @@ index 000000000000..8a9a389ac396
+#include <linux/surface_aggregator/controller.h>
+#include <linux/surface_aggregator/device.h>
+
+#define SHID_RETRY 3
+#define shid_retry(fn, args...) ssam_retry(fn, SHID_RETRY, args)
+
+
+enum surface_hid_descriptor_entry {
+ SURFACE_HID_DESC_HID = 0,
@ -11582,7 +11555,7 @@ index 000000000000..8a9a389ac396
+
+ rsp.length = 0;
+
+ status = shid_retry(ssam_request_sync_onstack, shid->ctrl,
+ status = ssam_retry(ssam_request_sync_onstack, shid->ctrl,
+ &rqst, &rsp, sizeof(*slice));
+ if (status)
+ return status;
@ -11634,7 +11607,7 @@ index 000000000000..8a9a389ac396
+
+ buf[0] = report_id;
+
+ return shid_retry(ssam_request_sync, shid->ctrl, &rqst, NULL);
+ return ssam_retry(ssam_request_sync, shid->ctrl, &rqst, NULL);
+}
+
+static int ssam_hid_get_raw_report(struct surface_hid_device *shid,
@ -11655,7 +11628,7 @@ index 000000000000..8a9a389ac396
+ rsp.length = 0;
+ rsp.pointer = buf;
+
+ return shid_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ return ssam_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ sizeof(report_id));
+}
+
@ -11740,7 +11713,7 @@ index 000000000000..8a9a389ac396
+ rsp.length = 0;
+ rsp.pointer = buf;
+
+ status = shid_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ status = ssam_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ sizeof(entry));
+ if (status)
+ return status;
@ -11767,7 +11740,7 @@ index 000000000000..8a9a389ac396
+ rqst.length = sizeof(value_u8);
+ rqst.payload = &value_u8;
+
+ return shid_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, NULL,
+ return ssam_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, NULL,
+ sizeof(value_u8));
+}
+
@ -11791,7 +11764,7 @@ index 000000000000..8a9a389ac396
+ rsp.length = 0;
+ rsp.pointer = buf;
+
+ status = shid_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ status = ssam_retry(ssam_request_sync_onstack, shid->ctrl, &rqst, &rsp,
+ sizeof(payload));
+ if (status)
+ return status;
@ -12636,7 +12609,7 @@ index 000000000000..9afddfc6a358
+MODULE_LICENSE("GPL");
diff --git a/drivers/misc/surface_aggregator/clients/surface_perfmode.c b/drivers/misc/surface_aggregator/clients/surface_perfmode.c
new file mode 100644
index 000000000000..006601b3bea6
index 000000000000..e13f4995b28b
--- /dev/null
+++ b/drivers/misc/surface_aggregator/clients/surface_perfmode.c
@@ -0,0 +1,122 @@
@ -12692,7 +12665,7 @@ index 000000000000..006601b3bea6
+ if (mode < __SAM_PERF_MODE__MIN || mode > __SAM_PERF_MODE__MAX)
+ return -EINVAL;
+
+ return __ssam_tmp_perf_mode_set(sdev, &mode_le);
+ return ssam_retry(__ssam_tmp_perf_mode_set, sdev, &mode_le);
+}
+
+static ssize_t perf_mode_show(struct device *dev, struct device_attribute *attr,
@ -12702,7 +12675,7 @@ index 000000000000..006601b3bea6
+ struct ssam_perf_info info;
+ int status;
+
+ status = ssam_tmp_perf_mode_get(sdev, &info);
+ status = ssam_retry(ssam_tmp_perf_mode_get, sdev, &info);
+ if (status) {
+ dev_err(dev, "failed to get current performance mode: %d\n",
+ status);
@ -12764,10 +12737,10 @@ index 000000000000..006601b3bea6
+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..27332aed13a5
index 000000000000..5b0c65437b70
--- /dev/null
+++ b/drivers/misc/surface_aggregator/controller.c
@@ -0,0 +1,2553 @@
@@ -0,0 +1,2555 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Main SSAM/SSH controller structure and functionality.
@ -14585,7 +14558,8 @@ index 000000000000..27332aed13a5
+ result.length = 0;
+ result.pointer = buf;
+
+ status = ssam_request_sync_onstack(ctrl, &rqst, &result, sizeof(params));
+ status = ssam_retry(ssam_request_sync_onstack, ctrl, &rqst, &result,
+ sizeof(params));
+ if (status) {
+ ssam_err(ctrl, "failed to enable event source (tc: 0x%02x, "
+ "iid: 0x%02x, reg: 0x%02x)\n", id.target_category,
@ -14653,7 +14627,8 @@ index 000000000000..27332aed13a5
+ result.length = 0;
+ result.pointer = buf;
+
+ status = ssam_request_sync_onstack(ctrl, &rqst, &result, sizeof(params));
+ status = ssam_retry(ssam_request_sync_onstack, ctrl, &rqst, &result,
+ sizeof(params));
+ if (status) {
+ ssam_err(ctrl, "failed to disable event source (tc: 0x%02x, "
+ "iid: 0x%02x, reg: 0x%02x)\n", id.target_category,
@ -14687,7 +14662,7 @@ index 000000000000..27332aed13a5
+ __le32 __version;
+ int status;
+
+ status = ssam_ssh_get_firmware_version(ctrl, &__version);
+ status = ssam_retry(ssam_ssh_get_firmware_version, ctrl, &__version);
+ if (status)
+ return status;
+
@ -14729,7 +14704,7 @@ index 000000000000..27332aed13a5
+
+ ssam_dbg(ctrl, "pm: notifying display off\n");
+
+ status = ssam_ssh_notif_display_off(ctrl, &response);
+ status = ssam_retry(ssam_ssh_notif_display_off, ctrl, &response);
+ if (status)
+ return status;
+
@ -14768,7 +14743,7 @@ index 000000000000..27332aed13a5
+
+ ssam_dbg(ctrl, "pm: notifying display on\n");
+
+ status = ssam_ssh_notif_display_on(ctrl, &response);
+ status = ssam_retry(ssam_ssh_notif_display_on, ctrl, &response);
+ if (status)
+ return status;
+
@ -14810,7 +14785,7 @@ index 000000000000..27332aed13a5
+
+ ssam_dbg(ctrl, "pm: notifying D0 exit\n");
+
+ status = ssam_ssh_notif_d0_exit(ctrl, &response);
+ status = ssam_retry(ssam_ssh_notif_d0_exit, ctrl, &response);
+ if (status)
+ return status;
+
@ -14852,7 +14827,7 @@ index 000000000000..27332aed13a5
+
+ ssam_dbg(ctrl, "pm: notifying D0 entry\n");
+
+ status = ssam_ssh_notif_d0_entry(ctrl, &response);
+ status = ssam_retry(ssam_ssh_notif_d0_entry, ctrl, &response);
+ if (status)
+ return status;
+
@ -21373,10 +21348,10 @@ index 000000000000..8e3e86c7d78c
+#endif /* _LINUX_SURFACE_ACPI_NOTIFY_H */
diff --git a/include/linux/surface_aggregator/controller.h b/include/linux/surface_aggregator/controller.h
new file mode 100644
index 000000000000..447cda590409
index 000000000000..d128c68c04e0
--- /dev/null
+++ b/include/linux/surface_aggregator/controller.h
@@ -0,0 +1,815 @@
@@ -0,0 +1,832 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Surface System Aggregator Module (SSAM) controller interface.
@ -21625,7 +21600,7 @@ index 000000000000..447cda590409
+ })
+
+/**
+ * ssam_retry - Retry request in case of I/O errors or timeouts.
+ * __ssam_retry - Retry request in case of I/O errors or timeouts.
+ * @request: The request function to execute. Must return an integer.
+ * @n: Number of tries.
+ * @args: Arguments for the request function.
@ -21637,7 +21612,7 @@ index 000000000000..447cda590409
+ *
+ * Return: Returns the return value of the last execution of @request.
+ */
+#define ssam_retry(request, n, args...) \
+#define __ssam_retry(request, n, args...) \
+ ({ \
+ int __i, __s = 0; \
+ \
@ -21649,6 +21624,23 @@ index 000000000000..447cda590409
+ __s; \
+ })
+
+/**
+ * ssam_retry - Retry request in case of I/O errors or timeouts up to three
+ * times in total.
+ * @request: The request function to execute. Must return an integer.
+ * @args: Arguments for the request function.
+ *
+ * Executes the given request function, i.e. calls @request. In case the
+ * request returns %-EREMOTEIO (indicates I/O error) or -%ETIMEDOUT (request
+ * or underlying packet timed out), @request will be re-executed again, up to
+ * three times in total.
+ *
+ * See __ssam_retry() for a more generic macro for this purpose.
+ *
+ * Return: Returns the return value of the last execution of @request.
+ */
+#define ssam_retry(request, args...) \
+ __ssam_retry(request, 3, args)
+
+/**
+ * struct ssam_request_spec - Blue-print specification of SAM request.

View file

@ -41,16 +41,16 @@ sha256sums=('698c908c846b9ba2ba545cd229a67571fe4de18bb5547429a00d786abe556646'
'4e68572e7cc4c5368f0236e0792660ae8498373988625dca46e509399a7eaea6'
'a13581d3c6dc595206e4fe7fcf6b542e7a1bdbe96101f0f010fc5be49f99baf2'
'dacf6a14239e151bae71587e6e604faeadd1e63975edeba4bb8033806b68c67a'
'ea4ecb074b7da55a9e41aa94d16d39847bc861b347b3c5fb118f958f3066c477'
'ec7f00b497369b43ce1ed3bfbd01cfecd8e1e1525f1cc294670c22b68a673e01'
'cfe0ab5a6713490380ad0123f040a4889f11c45c27106e76e90b967a380c9f0f'
'b73b1ece41ce596da7cbed9e9a5fba2e6383ca3f039004ab188a18c11012601b'
'eb74146731751b76bd5edd0bb5127ad2ca089d9a9e38a55761ed0911688fa80f'
'fe2d1edbb73f4c90cbbfc4e270ff39474db6095368125a3cf89f099ac40edaa0'
'd3f61a02cdfb7fbb7a3f7dcebc96b4874dbcf3392f3e8349b3775ecc6a472107'
'132fe7136f5382d3785107f21ab0f74a8229a99368ab6d771c8f3c88d7bdde1f'
'441cc7f501314f59397f2a3af77fc45921bc0e3d8894cc2fb3b8a7ed9e735878'
'cc19f511f564f0e291d27cec15f5360737ddc17777e5b642a5fa68935576e456')
'574f8b661e8be65f22ab0ec6ba08b3fde3b03462aaa72cfb88a5879079281bcb'
'681bbda16f24fa7ad5a457f5d2b7e328df91f2b2bdd413a1359abdab4ec8c5bf'
'a7ea548a62a6187dc333fe404e9b69783a5eb6092929a51562660a6ed30f8439'
'215704ce7da99de0cda1aff9518408e73dd382cde745ec6c328a74ca453d0ccd'
'8b992d4792a9d20f059ece1378792052ac14d60675393e7d7ed9085a59b3d013'
'634e7d3671e0b6fdd23ee15345e6b3a251f7b54830408806aa7589714bc88ea9'
'929ab55dd2d6fcbe1a1645f8fa8c26ad9dee9a0812b5b9d5b85c5005daed7fc6'
'349b7e420f066b41993c3171e2b5e45855dc22a455f721b5e034ee56094b3de4'
'e44492419a044fa5cbeb2ee51caf3be9ca140adabfdf90e3c4196edbecd77db6'
'4673163be424c813178d479e893ad3e0b40c4c3171fd23658218e32bacf1f77d')
export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase