Commit graph

24 commits

Author SHA1 Message Date
Dorian Stoll b184bf438d Make the sleep script executable by default
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-01-03 10:13:20 +09:00
Dorian Stoll 4f47a913ca Remove unloading of mwifiex from the sleep script
As of recently, this is handled in the kernel directly. I have been
running the patch + this script for some time and couldn't notice any
regressions.

Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-01-03 10:13:20 +09:00
Dorian Stoll 974707aa44 Improve readability of the sleep script a bit
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2020-01-03 10:13:20 +09:00
Maximilian Luz 04c59f410c
sleep-script: bluetooth: Add note to disable bluetooth completely
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.
2019-12-22 15:56:41 +01:00
kitakar5525 7f139b7c4f sleep-script: IPTS: fix module unloading on newer kernels
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.
2019-12-03 06:09:10 +09:00
Dorian Stoll 6abd8bbc86
sleep-script: Prevent bluetoothctl from timing out
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>
2019-10-12 00:30:24 +02:00
Dorian Stoll aee8e310e0
Remove hard systemd dependency from the sleep script
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>
2019-10-01 12:13:59 +02:00
Dorian Stoll b74befa0ca
Disable bluetooth when suspending without anything connected.
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>
2019-09-28 03:27:10 +02:00
Dorian Stoll 83e67e4a27 Improve wifi reliability after resuming from suspend
Using the old script I regulary	had the	problem, that after resuming
from suspend (or hibernate) the wifi would just break. The only way
to fix it was to restart network manager, or disable it in the GNOME
network settings.

I am not a 100% sure *why*, but this change greatly improved the wifi
stability after resume. I am running this for like 5 days now and
didn't see the wifi breaking once. I suppose, that `modprobe` vs
`modprobe -i` is what makes the difference.

Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
2019-08-26 01:00:45 +02:00
qzed fadf055d5f Update systemd-sleep script for IPTS changes
Integrate the changes discussed in [1] as proposed by @kitakar5525 in
[2]. The IPTS suspend/resume mechanism should work without the need for
unloading/reloading the corresponding modules, so we comment-out and
update the workaround and will handle any issues coming from that via
the IPTS drivers. The workaround is not completely removed yet as want
to provide an easy-to-apply temporary fix in case anything goes wrong.

[1]: https://github.com/jakeday/linux-surface/issues/544
[2]: https://github.com/jakeday/linux-surface/issues/544#issuecomment-519126757
2019-08-26 01:00:45 +02:00
Jake Day bd4eecf710 Revert "sleep script no longer needs to unload and reload modules"
This reverts commit 787756bd11.
2019-02-07 07:58:07 -05:00
Jake Day 787756bd11 sleep script no longer needs to unload and reload modules 2019-01-31 07:14:47 -05:00
Jake Day bcc46bc1e1 updating sleep script to fix resume issues 2018-06-24 13:28:16 -04:00
Jake Day b48d1d2f94 add lines, commented out, for setting d3cold_allowed flag 2018-04-01 13:36:50 -04:00
Jake Day f562512115 adding rescan to post in hibernate script 2018-04-01 13:26:25 -04:00
Jake Day e0e1fddf53 rename hibernate script 2018-04-01 13:23:07 -04:00
Zyfarok 58a2720a85
Tabs to space in hibernate.sh
Fix inconsistent use of space and tabs in hibernate.sh
2018-03-27 15:19:57 +02:00
Jake Day 45c79c046c fix for hibernate script 2018-03-08 22:21:01 -05:00
Jake Day 61c6bf8a73 resets are not needed for hibernate 2017-12-10 12:46:24 -05:00
casainho fd97d2cd27 Added hibernate.sh that is needed for wifi working after booting from hibernation 2017-11-22 10:39:56 +00:00
Jake Day 8fa5610374 removing unwanted script 2017-11-18 10:12:23 -05:00
Jake Day a2e1d27509 update script for reloading mwifiex_pice module on wake 2017-09-06 20:25:47 -04:00
Jake Day e6ec6b1cdb updating wifi interface names 2017-08-22 20:10:55 -04:00
Jake Day 5afd0ad3ba adding config files and moving kernel source 2017-08-20 19:28:05 -04:00