Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp478521yba; Thu, 18 Apr 2019 04:43:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi0znVHd2LiLzbJmgUof4xDWBCOQWi6y5KqDAV2lCXRBVJr4Rvons68OO44eRyx01de05t X-Received: by 2002:a63:494f:: with SMTP id y15mr88975538pgk.56.1555587801143; Thu, 18 Apr 2019 04:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555587801; cv=none; d=google.com; s=arc-20160816; b=XbXzQ4Vzd0j/a6+RbuEtLRjvLBdaQ0OBYamciBuD1bu+2RW7gBoLw/e5qLYNmzg5fS 3xs7t7qWvKiYgz5fTi1F4LHntzTSub+R+a5PoQ6FQjI9unSH8CdpAlRJ0VWdW4KZapG1 eOhEWj4llIuc0t8OqFai7lEECQ8S6mhe1xJOKQW1AiUWnHlHWhd0FQE2/19tSiXCN+BW RWLjGdFMG2dhPHRMEeh2R+df9fosMn+c/qBZosLyu3ZuyxzgRA/FrOJ34+PnU/LGtbl8 5c+0923BOd3NkGQaw+p0vlsfmK4Wos20OD2dluv8xzpqSO4Lbi/fxtGKFskKtqJosCav OW7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PPNVvj2myBt2QeHAMt5EoRNrApWzBDH4PJTi3ss/nPA=; b=myJU7Km4tgns4NIpn+coZig8WlXHupSVuPJAO0FQLO8q9uNMFxd3d6baiP0nB/bi91 z51G8AfUlI0m39vulJlSKls8EqIbHP+d5rFD11KiQlEJ7kR0OvSI+77ElTwrVlAYJTEf jKCLWiNtlC8um/Kjk80r0MohD54cz4Cp6FVzcKkQe6nbHj0+minSm5QKyqyHO5+jhrV6 dDpymgk82W5fUX0Z/wwFBWQ+3XDxLeb3Ou9TXG0fa8WLLfGSRz5a9dEUyNoNk6J9q0cD U1XWB2OQ6Z1Axvf/RXueQNlDzOCSzCrXnciMP/dpi6N/A4NoEEh6vRg1OyiOJXl1Gelm DXCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn14si1809059plb.7.2019.04.18.04.43.03; Thu, 18 Apr 2019 04:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388749AbfDRLmH (ORCPT + 99 others); Thu, 18 Apr 2019 07:42:07 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37097 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388535AbfDRLmG (ORCPT ); Thu, 18 Apr 2019 07:42:06 -0400 Received: by mail-wr1-f68.google.com with SMTP id w10so2597589wrm.4 for ; Thu, 18 Apr 2019 04:42:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PPNVvj2myBt2QeHAMt5EoRNrApWzBDH4PJTi3ss/nPA=; b=lC6Mkx7hgJli8Wmg+b4G02c+WA318DucznKA37vm5O7v6gSyFQy5OuSCYYPPtOQdXa xfUD39jHZQRQA9/wzvoY9nuB6oCzyiY0HRH6+ngHKRyrQq4Xgoes2Lx7eYE6Z/XXWCik ue00YfVbTZRQFIHUAMW1kzYquuUVdX/xagcbT177Vj5W8WNM4EfVcXkxfWKDeE1WY44j z2A7PP9GAvrNXAAO2pvQVEBjvOaQcmUh8hEVjmvRnVbPVxzlrZZoahLjbYCkvU12hzzJ GNu7NA7EBeaogaJf95SeflHcE7MlhAqKGEF6Fl7Ndyl9jCRasu93QE+fFWUemc0QdA6O 8wIA== X-Gm-Message-State: APjAAAUfgRkWTHEsZHj+0iRXHhZ1pnnjtk5GZPkE4FBM2Gpzc6mJjvOe KVIQhwqQQldvjJwWt9R0ceVKR9KSI8k= X-Received: by 2002:adf:db05:: with SMTP id s5mr63275734wri.247.1555587723693; Thu, 18 Apr 2019 04:42:03 -0700 (PDT) Received: from shalem.localdomain (84-106-84-65.cable.dynamic.v4.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id e12sm1481740wrt.94.2019.04.18.04.42.02 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 04:42:03 -0700 (PDT) Subject: Re: [PATCH] ACPI / LPSS: Don't skip late system PM ops for hibernate on BYT/CHT To: "Robert R. Howell" , Kai-Heng Feng , "rjw@rjwysocki.net" Cc: "lenb@kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20190403054352.30120-1-kai.heng.feng@canonical.com> <0a770539-dfe9-2eb6-a90a-82f065a23a3f@uwyo.edu> From: Hans de Goede Message-ID: Date: Thu, 18 Apr 2019 13:42:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <0a770539-dfe9-2eb6-a90a-82f065a23a3f@uwyo.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Robert, On 11-04-19 21:50, Robert R. Howell wrote: > 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: > 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. Ok, so you have hibernation sort of working, with a bunch of hacks. This is exactly why I usually do not spend any time on trying to get hibernation to work. Still since my patch is regressing things for you I will try to take a look at this and see if I can reproduce and come up with a fix. But this is not going to be a high priority thing for me to work on. In the mean time I've gone ahead and submitted my version of the fix for the problem Kai-Heng was seeing, since that does not seem to make your problem worse; and it will be good to get that problem fixed. Regards, Hans