In some instances, bluetooth devices can prevent the device from going
to sleep or cause spurious wake-ups. Add a note to the sleep script on
how bluetooth can be turned off completely during suspend.
On a recent version of kernels, "intel_ipts" module will be used by companion
driver "ipts_surface". So, unload the module first on unloading whole IPTS
modules and load the module last on loading whole IPTS modules.
Otherwise, unloading "intel_ipts" will fail.
Unloading the module will automatically unload "intel_ipts" module but
I did not remove the line for clarity and for kernels that don't have
the companion driver ("ipts_surface").
On my 5.3 kernel:
$ lsmod | grep -e "Used by" -e "ipts"
Module Size Used by
ipts_surface 16384 0
intel_ipts 45056 1 ipts_surface
hid 143360 6 i2c_hid,usbhid,hid_multitouch,hid_sensor_hub,intel_ipts,hid_generic
mei 122880 5 mei_hdcp,intel_ipts,mei_me
i915 2273280 18 intel_ipts
Tested on kernel 5.3.12 and 4.19.85 that use the "ipts_surface" companion driver with IPTS lines
uncommented on sleep script.
Instead of relying on udev rules targeted specifically at the nouveau
driver, users should consider installing and customizing the Surface DTX
daemon. This daemon is specifically intended to dispatch all necessary
related to clipboard detachment/attachment.
These are adjustments needed in order for the type cover to work properly:
ATTR -> ATTRS
SUBSYSTEMS -> SUBSYSTEM
{iProduct} -> {product}
The initial sleep command was causing things to not work, so this was removed as well.
On the Pro 7 and Laptop 3, intel_lpss_pci fails to probe and thus keeps
the system from booting. Add a patch to fix this.
Note: The added patch is on it's way upstream.
See: https://lkml.org/lkml/2019/10/16/1230
There's no need to support someone who's not maintaining anything anymore. IIRC qzed isn't looking for donations, but IMO he's well worthy of them! So I'd suggest you replace this with your own qzed!
If bluetooth is disabled in the BIOS, the bluetoothd process won't be
running. bluetoothctl waits for that process to launch, which means it
timeouts indefinitly, breaking suspend entirely.
By checking if bluetoothd is running before calling bluetoothctl suspend
works fine even if bluetooth is disabled in the BIOS.
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
The patched firmware seems to work as intended. As it is a direct
replacement and should not cause any further issues, we can drop the
backup of the original firmware. In case any unforseen issues arise, we
can always get it from the official driver/firmware packages again.
See: https://github.com/jakeday/linux-surface/issues/574
By using nmcli, users who don't use a systemd based distribution (Gentoo etc.),
can run the sleep script manually, or hook it up to their service manager manually.
This also removes the forced restart if people willingly disabled NetworkManager.
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
See: https://github.com/jakeday/linux-surface/issues/574
As long as that issue exist, and noone of us understands how to work
with HID descriptors and fix them, replace the file with the one from
MSHW0137 which is confirmed to be working properly.
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
On Surface Book 2 it is not possible to archive stable S0ix while bluetooth is
enabled but no device is connected. Either S0ix fails completely, or the
residency is pretty bad. When bluetooth is disabled, or a device such as the pen
is connected, S0ix works fine and residency is great again.
By disabling bluetooth when no device is connected, we get proper S0ix in all
situations. And since no device is connected, the reset won't really matter.
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
This commit will update suspend.patch for 4.19
Backported these two patches:
- torvalds/linux@4eaefe8c62
(nvme-pci: Allow PCI bus-level PM to be used if ASPM is disabled)
- torvalds/linux@accd2dd72c
(PCI/ASPM: Add pcie_aspm_enabled())
on top of these patches that are already backported by commit
qzed/linux-surface@e8a3d85b22
(Update NVMe part of suspend.patch):
- torvalds/linux@d916b1be94
(nvme-pci: use host managed power state for suspend)
- torvalds/linux@1a87ee657c
(nvme: export get and set features)
- torvalds/linux@d6135c3a1e
(nvme-pci: Sync queues on reset)
Tested and confirmed that suspend is working on Surface Book 1 with
THNSN5512GPU7 TOSHIBA NVMe SSD which has issue resuming from suspend
with PCI bus-level PM.
Link to issue: https://github.com/jakeday/linux-surface/issues/123
(Surface Book with Performance Base: NVMe SSD breaks suspend (s2idle))