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

Anyway to get sleep/suspend working? #23

Open
lonniemmercer opened this issue Jul 13, 2020 · 17 comments
Open

Anyway to get sleep/suspend working? #23

lonniemmercer opened this issue Jul 13, 2020 · 17 comments

Comments

@lonniemmercer
Copy link

No description provided.

@mikeeq
Copy link
Owner

mikeeq commented Jun 23, 2021

My build has already been using this fix, but maybe something has gone wrong in your installation so please follow this article: https://wiki.t2linux.org/guides/dkms/#fixing-suspend

Nevertheless even with a fix, suspend sometimes works, sometimes not.

@mikeeq mikeeq closed this as completed Jun 23, 2021
@folke
Copy link

folke commented Jul 6, 2021

@mikeeq see my fix at mikeeq/mbp-fedora-kernel#14 (comment)

I assume it's already working for people without a touchbar, but for me I need to unload hid_apple as well to make the keyboard working again on resume.

@mikeeq
Copy link
Owner

mikeeq commented Aug 26, 2021

Let's check if it's finally working or not.

@mikeeq mikeeq reopened this Aug 26, 2021
@AdityaGarg8
Copy link

The script is fine. It's the touchbar module which is buggy and hangs the system when modprobe -r is run.

@AdityaGarg8
Copy link

That seems to affect the keyboard

@justinpchang
Copy link

@AdityaGarg8 Is there a fix for this? I also have a keyboard with a touchbar and they both do not work after suspend. I am now having to restart my computer any time the lid closes. I would be willing to just disable my touchbar completely if that fixes something

@AdityaGarg8
Copy link

@justinpchang , remove the ibridge drivers for suspend.

@justinpchang
Copy link

justinpchang commented Sep 4, 2021

@AdityaGarg8 I unloaded apple_ibridge driver and the other touch bar ones that use it with mod probe -r and I still get the same behavior on suspend. Is this not the correct way to remove them?

@AdityaGarg8
Copy link

AdityaGarg8 commented Sep 4, 2021

@justinpchang , run

sudo dkms uninstall -m apple-ibridge -v 0.1
sudo rm -r /usr/src/apple-ibridge-0.1
sudo rm -r /var/lib/dkms/apple-ibridge
sudo rm /lib/systemd/system-sleep/rmmod_tb.sh

This will remove the driver completely alongwith the touch bar unloading script, since it won't be required now.

Restart after running the commands.

@justinpchang
Copy link

@AdityaGarg8 Thanks! For future people with the same issue, I think my system is set up differently so I had to find the apple-ibridge and apple-ib-tb driver locations with modinfo, then removed them and the script. Then I had to run dracut -f and after reboot, suspend works.

@szilardx
Copy link

Hi,
With a fresh install (F37 from here) on a MBP 13 2019 any pointer how to get suspend working? Tried it with Ubuntu, and suspend was working fine with that (https://github.com/AdityaGarg8/T2-Ubuntu/releases/tag/v6.0.7-1)
The system suspends properly - based on logs, but I cannot wake it up. Not with keyboard, power button, lid, external input.
Only solution is to keep the power button pressed to power cycle the machine.
Thanks!

@lsimonis
Copy link

lsimonis commented Jan 4, 2023

Hi, With a fresh install (F37 from here) on a MBP 13 2019 any pointer how to get suspend working? Tried it with Ubuntu, and suspend was working fine with that (https://github.com/AdityaGarg8/T2-Ubuntu/releases/tag/v6.0.7-1) The system suspends properly - based on logs, but I cannot wake it up. Not with keyboard, power button, lid, external input. Only solution is to keep the power button pressed to power cycle the machine. Thanks!

same behavior with mbp 15 2019 + F37

@vassil-one
Copy link

MacBookPro16,1 / Fedora 37 / 6.2.13-300.mbp.fc38,x86_64
lsmod output here - https://pastebin.com/SXZfnNQM
dmesg -T output here - https://pastebin.com/qAGmADpi

Suspend/resume issue - takes long time for the system to come back on wake and keyboard/touchpad not working.

@Elias-Graf
Copy link

I would be really happy if it was possible to get this working. It's sort of essential for a laptop to go to sleep.

I've just installed the latest version, 38, and it still seems broken.

I switched from T2-Ubuntu, and like other user have reported here, over there, it is working.

I'm happy to help and provide logs :).

@rydymth
Copy link

rydymth commented Aug 9, 2023

Hi!
I believe it is the brcmfmac module. I read your dmesg logs and I have a similar problem.

After runing systemctl suspend, my screen goes blank for a second and then comes back up for a second, then again goes black and then comes back up again...

What worked for me is i ran this:
modprobe -r brcmfmac_wcc brcmfmac
and then i did the systemctl suspend

This worked. But obviously there must be a better way to do it or automate it. For some reason, when I suspend, the systemd just skips the rmmod.sh in /lib/systemd/system-sleep/rmmod.sh
Will try a systemctl approach and let you know soon.

@rydymth
Copy link

rydymth commented Aug 13, 2023

Hello there!
Sorry for late reply...
Well I got the suspend working...
The resume takes like around 5-7 secs AFTER the screen lights up. What i did was the same as i have commented above. I just put it in the right folder this time which is:
/usr/lib/systemd/system-sleep/rmmod.sh
Inside this folder i have the pre and post config as follows :

#!/bin/bash
[ "$1" = "post" ] && exec bash /usr/local/sbin/post.sh
[ "$1" = "pre" ] && exec bash /usr/local/sbin/pre.sh
exit 0

The pre.sh contains:

#!/bin/bash
systemctl stop NetworkManager.service
modprobe -r brcmfmac_wcc
modprobe -r brcmfmac

The post.sh contains :

modprobe brcmfmac_wcc
modprobe brcmfmac
systemctl start NetworkManager.service
bash /usr/local/sbin/power.sh

And finally the power.sh contains:

sudo modprobe msr
sudo rdmsr 0x1FC
sudo wrmsr 0x1FC value

The above script, tho might be incorrect or not well optimised, just increases the frequency mac runs at. Following the guide on this github page which was there on the t2linux website.
Also a similar solution was already given at the t2linux-fedora-kernel.
But Ive have got 2 other problems...
My trackpad and keyboard dont work sometimes and bluetooth is buggy.(Sometimes it works sometimes it doesnt)...
So ill try to see what and where the issue is. But Im unable to figure what module is responsible for the apple's keyboard and trackpad. Will update soon....
Edit after 5 hours of posting the above:
Everything works just fine...
I believe this is a good solution that works.

@06Games
Copy link

06Games commented Sep 1, 2023

Hello there! Sorry for late reply... Well I got the suspend working... The resume takes like around 5-7 secs AFTER the screen lights up. What i did was the same as i have commented above. I just put it in the right folder this time which is: /usr/lib/systemd/system-sleep/rmmod.sh Inside this folder i have the pre and post config as follows :

#!/bin/bash
[ "$1" = "post" ] && exec bash /usr/local/sbin/post.sh
[ "$1" = "pre" ] && exec bash /usr/local/sbin/pre.sh
exit 0

The pre.sh contains:

#!/bin/bash
systemctl stop NetworkManager.service
modprobe -r brcmfmac_wcc
modprobe -r brcmfmac

The post.sh contains :

modprobe brcmfmac_wcc
modprobe brcmfmac
systemctl start NetworkManager.service
bash /usr/local/sbin/power.sh

And finally the power.sh contains:

sudo modprobe msr
sudo rdmsr 0x1FC
sudo wrmsr 0x1FC value

The above script, tho might be incorrect or not well optimised, just increases the frequency mac runs at. Following the guide on this github page which was there on the t2linux website. Also a similar solution was already given at the t2linux-fedora-kernel. But Ive have got 2 other problems... My trackpad and keyboard dont work sometimes and bluetooth is buggy.(Sometimes it works sometimes it doesnt)... So ill try to see what and where the issue is. But Im unable to figure what module is responsible for the apple's keyboard and trackpad. Will update soon.... Edit after 5 hours of posting the above: Everything works just fine... I believe this is a good solution that works.

Thanks, that worked.

I've combined all your scripts into one :

#!/usr/bin/env bash
if [ "${1}" = "pre" ]; then
        systemctl stop NetworkManager
        modprobe -r brcmfmac_wcc brcmfmac
elif [ "${1}" = "post" ]; then
        modprobe brcmfmac_wcc brcmfmac
        systemctl start NetworkManager
        modprobe -r apple-bce & modprobe apple-bce

        modprobe msr
        rdmsr 0x1FC
        wrmsr 0x1FC value
fi

For the keyboard and trackpad, I had to add this line to the post actions:

modprobe -r apple-bce & modprobe apple-bce

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

No branches or pull requests