linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert R. Howell" <RHowell@uwyo.edu>
To: Hans de Goede <hdegoede@redhat.com>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI / LPSS: Don't skip late system PM ops for hibernate on BYT/CHT
Date: Thu, 11 Apr 2019 19:50:06 +0000	[thread overview]
Message-ID: <0a770539-dfe9-2eb6-a90a-82f065a23a3f@uwyo.edu> (raw)
In-Reply-To: <feb1808d-542c-83c2-5c70-9228473bb8d0@redhat.com>

On 4/8/19 2:16 AM, Hans de Goede wrote:> 
> 
> Hmm, interesting so you have hibernation working on a T100TA
> (with 5.0 + 02e45646d53b reverted), right ?
> 
Hi Hans and Kai-Heng

First, apologies for how long it took me to reply to both your inquiries.  
In trying to answer them I discovered some inconsistencies in how the T100TA was 
behaving on different hibernation attempts and I've been trying to sort those out.  
I haven't been completely successful in that, but here's a brief summary.

Yes I do have hibernation working (at least most of the time) on a T100TA, 
with 5.0 + 02e45646d53b reverted (more about that below), and with a systemd 
hibernate script also described below.

Trying to be more quantitative about "most of the time" is in part want I've been 
testing the last few days.  I just finished a cycle of 20 hibernates/resumes 
which were all successful at least in the sense that after resume internal 
sound was working, along with all the other critical functions I care about 
(WiFi, Bluetooth, etc.).  However I have occasionally (perhaps 1 in 10 times) 
seen something go wrong with sound on resume and the only way to get it 
working again was to a full reboot.  During the successful cycles I also 
sometimes see i2c_designware or intel_sst_acpi error messages but they 
don't seem to indicate an unrecoverable failure.  I was hoping to sort out 
what errors I was seen on the occasions where sound was lost till a reboot, 
but those are rare enough I haven't been able to sort out the difference 
between those and the "recoverable" errors.

Regarding the revert of 02e45646d53b, there were some code changes in 
adjacent lines so a simple revert wouldn't apply cleanly to 5.0.0 
but the changes were small enough that I was able to manually "merge" 
the revert and the 5.0.0 changes.  I have posted a patch file under
Bugzilla: <https://bugzilla.kernel.org/show_bug.cgi?id=202139>
showing what I actually did to revert 02e45646d53b for 5.0.0.  As I mentioned 
in an earlier message, I have NOT been able to produce a working revert of 
02e45646d53b for the 5.1-rc3 kernel.

To make hibernation work on the T100 I also had to create a script  
/usr/lib/systemd/system-sleep/t100_hibernate.sh which unloads various drivers 
(including sound) before hibernate, then restarts them afterwords.  I've inserted 
it below.  I'm not certain all the steps in it are still necessary, but the 
intermittent failures make it very difficult to determine what is absolutely essential.

-----t100_hibernate.sh  systemd script-------
#!/bin/bash
echo "Hibernate script $1 $2"
[ $2 != 'hibernate' ] && exit 0

case $1 in
        pre)
    echo "Going to $2..."
    /sbin/modprobe -r brcmfmac
    /sbin/modprobe -r hci_uart
    /sbin/modprobe -r battery
    /sbin/modprobe -r hid_multitouch
    /usr/bin/killall pulseaudio
    /sbin/modprobe -r snd_soc_sst_bytcr_rt5640
    /sbin/modprobe -r snd_soc_rt5640
    /sbin/modprobe -r snd_soc_sst_acpi
        ;;
        post)
    echo "Waking from $2..."
    /sbin/modprobe brcmfmac
    /sbin/modprobe hci_uart
    /sbin/modprobe battery
    /sbin/modprobe hid_multitouch
    # Just load the following and it will pull in other snd modules
    /sbin/modprobe snd_soc_sst_acpi
    /usr/sbin/service NetworkManager restart
    /usr/sbin/service wpa_supplicant restart
    # The above is usually enough but occasionally sound doesn't come up properly
    # and doing the following seems to restore it in those cases.
    /usr/bin/killall pulseaudio
    /usr/sbin/rmmod snd_soc_sst_bytcr_rt5640
    /usr/sbin/rmmod snd_soc_rt5640
    /usr/sbin modprobe snd_soc_rt5640
    /usr/sbin modprobe snd_soc_sst_bytcr_rt5640
        ;;
esac
-----end of script-------------------------------

I'll send a second message with the system logs which Kai-Heng requested,
with his patch applied to 5.1-rc3.

Bob Howell

> I must admit I never try hibernation myself, in experience it tends to
> have more issues then regular suspend/resume and there are already enough
> other issues to worry about on Bay and Cherry Trail based devices.
> 
> But if it works on the T100TA and 02e45646d53b broke it then I will
> try to fix this, I've a T100TA myself. Currently my T100TA is at my
> local hackerspace, so I will not have access to it until coming Friday.
> 
> Regards,
> 
> Hans
> 

  parent reply	other threads:[~2019-04-11 19:50 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03  5:43 [PATCH] ACPI / LPSS: Don't skip late system PM ops for hibernate on BYT/CHT Kai-Heng Feng
2019-04-03  8:33 ` Jarkko Nikula
2019-04-03  8:54 ` Hans de Goede
2019-04-07 20:58   ` Robert R. Howell
2019-04-07 20:58     ` Robert R. Howell
2019-04-08  3:44     ` Kai Heng Feng
2019-04-08  3:44       ` Kai Heng Feng
2019-04-11 19:50       ` Robert R. Howell
2019-04-11 19:50         ` Robert R. Howell
2019-04-08  8:16     ` Hans de Goede
2019-04-08  8:16       ` Hans de Goede
2019-04-11 19:50       ` Robert R. Howell [this message]
2019-04-11 19:50         ` Robert R. Howell
2019-04-18 11:42         ` Hans de Goede
2019-04-18 11:42           ` Hans de Goede
2019-04-19 22:44           ` Robert R. Howell
2019-04-19 22:44             ` Robert R. Howell
2019-04-23  8:07             ` Rafael J. Wysocki
2019-04-23  8:07               ` Rafael J. Wysocki
2019-04-23 20:03               ` Robert R. Howell
2019-04-23 20:03                 ` Robert R. Howell
2019-04-24  7:20                 ` Rafael J. Wysocki
2019-04-24  7:20                   ` Rafael J. Wysocki
2019-04-25 16:38                   ` Robert R. Howell
2019-04-25 16:38                     ` Robert R. Howell
2019-04-30 14:39                     ` Hans de Goede
2019-04-30 14:39                       ` Hans de Goede
2019-05-09  4:24                       ` Robert R. Howell
2019-05-09  8:50                         ` Hans de Goede
2019-05-09 18:09                           ` Robert R. Howell
2019-05-13  8:41                             ` Hans de Goede
2019-05-16 16:34                               ` Robert R. Howell
2019-05-14 10:10                             ` Hans de Goede
2019-05-16 11:11                     ` Rafael J. Wysocki
2019-05-16 16:35                       ` Robert R. Howell
2019-05-16 22:42                         ` Rafael J. Wysocki
2019-05-25  5:31                       ` Robert R. Howell
2019-06-24 10:24                         ` Rafael J. Wysocki
2019-06-24 10:51                           ` Hans de Goede
2019-06-24 23:14                             ` Rafael J. Wysocki
2019-06-26 18:43                           ` Robert R. Howell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a770539-dfe9-2eb6-a90a-82f065a23a3f@uwyo.edu \
    --to=rhowell@uwyo.edu \
    --cc=hdegoede@redhat.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).