[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-07-04 Thread Marian Klein
Contact 
darrick.w...@oracle.com 

The problem is properly fixed upstream for later 5.4.X and 5.6.X
versions. Copy that.

https://lkml.org/lkml/2020/4/22/938

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-06-28 Thread Kai-Heng Feng
What's the output of `cat /sys/power/mem_sleep`?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-06-05 Thread Dimitri John Ledkov
** Package changed: linux-5.4 (Ubuntu) => linux (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-05-20 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: linux-5.4 (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-04-10 Thread cosine
The hibernation bug is likely linked to #1866984
(also no solution there...)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-29 Thread Marian Klein
patch exist, please apply for ubuntu 20.04:
 
marian@kubuntu2004:~/kernelubuntu/linux$ git diff
diff --git a/include/linux/swap.h b/include/linux/swap.h
index de2c67a33b7e..da1dc5a338cc 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -456,6 +456,7 @@ extern void swap_free(swp_entry_t);
 extern void swapcache_free_entries(swp_entry_t *entries, int n);
 extern int free_swap_and_cache(swp_entry_t);
 extern int swap_type_of(dev_t, sector_t, struct block_device **);
+extern void swap_relockall(void);
 extern unsigned int count_swap_pages(int, int);
 extern sector_t map_swap_page(struct page *, struct block_device **);
 extern sector_t swapdev_block(int, pgoff_t);
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 77438954cc2b..bfef2097edaa 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -271,6 +271,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int 
cmd,
break;
}
error = hibernation_restore(data->platform_support);
+   if (!error)
+   swap_relockall();
break;
 
case SNAPSHOT_FREE:
@@ -372,10 +374,16 @@ static long snapshot_ioctl(struct file *filp, unsigned 
int cmd,
 */
swdev = new_decode_dev(swap_area.dev);
if (swdev) {
+   struct block_device *bd;
offset = swap_area.offset;
-   data->swap = swap_type_of(swdev, offset, NULL);
+   data->swap = swap_type_of(swdev, offset, );
if (data->swap < 0)
error = -ENODEV;
+   
+   inode_lock(bd->bd_inode);
+   bd->bd_inode->i_flags &= ~S_SWAPFILE;
+   inode_unlock(bd->bd_inode);
+   bdput(bd);
} else {
data->swap = -1;
error = -EINVAL;
diff --git a/mm/swapfile.c b/mm/swapfile.c
index dab43523afdd..c7c83d3a313b 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1799,6 +1799,32 @@ int swap_type_of(dev_t device, sector_t offset, struct 
block_device **bdev_p)
return -ENODEV;
 }
 
+/* Re-lock swap devices after resuming from userspace suspend. */
+void swap_relockall(void)
+{
+   int type;
+
+   spin_lock(_lock);
+   for (type = 0; type < nr_swapfiles; type++) {
+   struct swap_info_struct *sis = swap_info[type];
+   struct block_device *bdev = bdgrab(sis->bdev);
+
+   /*
+* uswsusp only knows how to suspend to block devices, so we
+* can skip swap files.
+*/
+   if (!(sis->flags & SWP_WRITEOK) ||
+   !(sis->flags & SWP_BLKDEV))
+   continue;
+
+   inode_lock(bdev->bd_inode);
+   bdev->bd_inode->i_flags |= S_SWAPFILE;
+   inode_unlock(bdev->bd_inode);
+   bdput(bdev);
+   }
+   spin_unlock(_lock);
+}
+
 /*
  * Get the (PAGE_SIZE) block corresponding to given offset on the swapdev
  * corresponding to given index in swap_info (swap type).

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
Problem identified and reported upstream
https://bugzilla.kernel.org/show_bug.cgi?id=206713

** Bug watch added: Linux Kernel Bug Tracker #206713
   https://bugzilla.kernel.org/show_bug.cgi?id=206713

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
The same goes for 5.4.22-050422-generic:
sudo /usr/lib/systemd/systemd-sleep hibernate
for kernel 5.4.22-050422-generic switches off laptop, but does not resume/thaw 
to original state (it boots normally)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
sudo /usr/lib/systemd/systemd-sleep hibernate
for kernel 5.3.0-40-generic switches off laptop, but does not resume/thaw to 
original state (it boots normally)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
I also installed 
apt install linux-image-5.3.0-1008-oracle.
This kernel works for s2ram, s2disk , brightness , but the special keys 
(setting brightness,switch for external monitor, speaker volume, media playback 
keys, plane mode key) on my laptop keyboard do not work.

kernels linux-image-5.3.0-1008-oracle, linux-image-5.3.0-1011-gcp work
for s2disk, but s2ram does not work (by design?)

linux-image-5.3.0-1009-azure, linux-image-5.3.0-1009-kvm do not boot for
me.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
Ops, mistake:
linux-image-5.3.0-1010-aws and linux-image-5.3.0-1011-gcp work for s2disk, but 
s2ram does not work (by design?). linux-image-5.3.0-1008-oracle is working for 
both s2disk and s2ram.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-28 Thread Marian Klein
I booted into minimal non-GUI ubuntu20.04 1.4G with 5.4.22-050422 kernel

I removed all possible kernel modules by repeating few times next two commands:
lsmod | grep 0$  | sed 's/^\([^ ]*\).*/rmmod \1/g' > rmmods.sh
source rmmods.sh


root@kubuntu2004:/home/marian# cat 
/mnt/ub2004min/root/lsmod_fail_s2disk_5.4.22-050422-generic.txt 
Module  Size  Used by
crct10dif_pclmul   16384  1
i915 1982464  1
drm_kms_helper184320  1 i915
drm   487424  3 drm_kms_helper,i915
i2c_algo_bit   16384  1 i915
fb_sys_fops16384  1 drm_kms_helper
syscopyarea16384  1 drm_kms_helper
sysfillrect16384  1 drm_kms_helper
sysimgblt  16384  1 drm_kms_helper
sch_fq_codel   20480  1
autofs445056  2
nvme   45056  2
nvme_core 102400  4 nvme
video  49152  1 i915


dmesg


[ 1242.425985] Filesystems sync: 0.000 seconds
[ 1242.425988] Freezing user space processes ... (elapsed 0.001 seconds) done.
[ 1242.427321] OOM killer disabled.
[ 1242.427555] PM: Marking nosave pages: [mem 0x-0x0fff]
[ 1242.427557] PM: Marking nosave pages: [mem 0x00058000-0x00058fff]
[ 1242.427558] PM: Marking nosave pages: [mem 0x0009e000-0x000f]
[ 1242.427562] PM: Marking nosave pages: [mem 0x28e1-0x28e11fff]
[ 1242.427563] PM: Marking nosave pages: [mem 0x2c8f5000-0x2c955fff]
[ 1242.427567] PM: Marking nosave pages: [mem 0x2ce62000-0x2ce62fff]
[ 1242.427568] PM: Marking nosave pages: [mem 0x2e4de000-0x2fffefff]
[ 1242.427750] PM: Marking nosave pages: [mem 0x3000-0x]
[ 1242.430613] PM: Basic memory bitmaps created
[ 1242.431558] PM: Preallocating image memory... done (allocated 163748 pages)
[ 1242.788826] PM: Allocated 654992 kbytes in 0.35 seconds (1871.40 MB/s)
[ 1242.788827] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) 
done.
[ 1242.790321] printk: Suspending console(s) (use no_console_suspend to debug)
[ 1243.078179] ACPI: EC: interrupt blocked
[ 1243.086425] ACPI: Preparing to enter system sleep state S4
[ 1243.098213] ACPI: EC: event blocked
[ 1243.098214] ACPI: EC: EC stopped
[ 1243.098214] PM: Saving platform NVS memory
[ 1243.100159] Disabling non-boot CPUs ...
[ 1243.101448] smpboot: CPU 1 is now offline
[ 1243.103291] smpboot: CPU 2 is now offline
[ 1243.104851] smpboot: CPU 3 is now offline
[ 1243.106522] smpboot: CPU 4 is now offline
[ 1243.108200] smpboot: CPU 5 is now offline
[ 1243.109928] smpboot: CPU 6 is now offline
[ 1243.111501] smpboot: CPU 7 is now offline
[ 1243.113364] PM: Creating hibernation image:
[ 1243.597752] PM: Need to copy 161991 pages
[ 1243.597756] PM: Normal pages needed: 161991 + 1024, available pages: 3967507
[ 1244.202907] PM: Hibernation image created (161991 pages copied)
[ 1243.113966] PM: Restoring platform NVS memory
[ 1243.114826] ACPI: EC: EC started
[ 1243.115498] Enabling non-boot CPUs ...
[ 1243.115562] x86: Booting SMP configuration:
[ 1243.115563] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 1243.116889] CPU1 is up
[ 1243.116938] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 1243.118201] CPU2 is up
[ 1243.118241] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 1243.119427] CPU3 is up
[ 1243.119465] smpboot: Booting Node 0 Processor 4 APIC 0x1
[ 1243.120893] CPU4 is up
[ 1243.120932] smpboot: Booting Node 0 Processor 5 APIC 0x3
[ 1243.121918] CPU5 is up
[ 1243.121951] smpboot: Booting Node 0 Processor 6 APIC 0x5
[ 1243.122932] CPU6 is up
[ 1243.122961] smpboot: Booting Node 0 Processor 7 APIC 0x7
[ 1243.123889] CPU7 is up
[ 1243.128176] ACPI: Waking up from system sleep state S4
[ 1243.152424] ACPI: EC: interrupt unblocked
[ 1243.176573] ACPI: EC: event unblocked
[ 1243.394880] nvme nvme0: 7/0/0 default/read/poll queues
[ 1243.461317] acpi LNXPOWER:00: Turning OFF
[ 1243.556111] Restarting kernel threads ... done.
[ 1243.556347] PM: Basic memory bitmaps freed
[ 1243.556348] OOM killer enabled.
[ 1243.556348] Restarting tasks ... done.

There was not shutting off laptop when using s2disk.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1864930] Re: brightness setting and sleep/suspend (echo mem > /sys/power/state) , s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

2020-02-27 Thread Marian Klein
I am looking into 
https://wiki.ubuntu.com/DebuggingKernelHibernate 
and I will provide more info.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1864930

Title:
  brightness setting  and sleep/suspend (echo mem > /sys/power/state) ,
  s2ram and s2disk fail for 5.4.0 and s2disk fail for 5.4.22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-5.4/+bug/1864930/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs