In linux 4.14 the ability to resume from s3/sleep on an opal hardware encrypted SATA ssd was added, by unlocking the drive on resume from s3. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/block/sed-opal.c?h=v4.14&id=dbec491b12b52888d120e5be8f15886b3216eb19&qt=grep&q=sed-opal Linux 5.10.7 breaks that. The ssd is not unlocked on resume from s3. I am able to do an alt-sysreq-b reboot to an installation medium to verify that its not unlocked. Reverting to 5.10.6 fixes that. This also occurs in linux 5.11. I bisected this to commit 271822bbf9fea586aabdcd3b10b303837863ccce scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE $ git bisect log git bisect start bad: [659361086d8b2ee2c8318f390029a350a6e7fb61] Linux 5.10.7 git bisect bad 659361086d8b2ee2c8318f390029a350a6e7fb61 good: [5650152ddab1a6b367e6804deea344e001bd656e] Linux 5.10.6 git bisect good 3a009ea166de1d0b804ddc6274b559c2ce0eebf3 bad: [cb5a170e979e7d1b15185c9943c546bda2bc6445] powerpc: Handle .text.{hot,unlikely}.* in linker script git bisect bad cb5a170e979e7d1b15185c9943c546bda2bc6445 good: [0d6eeee3b9d4e08a9698038998d2752f157207f3] erspan: fix version 1 check in gre_parse_header() git bisect good 0d6eeee3b9d4e08a9698038998d2752f157207f3 good: [46e4355836104706853819244adf21ae1e3cd621] scsi: ufs-pci: Ensure UFS device is in PowerDown mode for suspend-to-disk ->poweroff() git bisect good 46e4355836104706853819244adf21ae1e3cd621 bad: [8532d3ec57e55e7df3c1f04fcf1b67d7610cb69c] lib/genalloc: fix the overflow when size is too big git bisect bad 8532d3ec57e55e7df3c1f04fcf1b67d7610cb69c good: [2d8b9f991de7c86fe64b09efedff75562036ba0e] scsi: ide: Do not set the RQF_PREEMPT flag for sense requests git bisect good 2d8b9f991de7c86fe64b09efedff75562036ba0e good: [a97d55de10aa7d75eca047adeaaee3a11cd64a09] scsi: scsi_transport_spi: Set RQF_PM for domain validation commands git bisect good a97d55de10aa7d75eca047adeaaee3a11cd64a09 bad: [2179bae04b12532812e7c9eb9cc5fa6d4131e577] local64.h: make <asm/local64.h> mandatory git bisect bad 2179bae04b12532812e7c9eb9cc5fa6d4131e577 bad: [271822bbf9fea586aabdcd3b10b303837863ccce] scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE git bisect bad 271822bbf9fea586aabdcd3b10b303837863ccce first bad commit: [271822bbf9fea586aabdcd3b10b303837863ccce] scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE
Thank you for having reported this. Please apply the attached patch to kernel v5.11 and report which kernel warnings are reported when booting the resulting patched kernel. Please note that the attached patch is not a fix but rather an attempt to extract more information about how the SED OPAL code is incompatible with the Linux power management model.
Created attachment 295369 [details] Debug patch.
I patched kernel 5.10.17 and there was no debug messages from your patch in either the console, dmesg, or the journal. I booted with parameters no_console_suspend=1 and ignore_loglevel. Your patch does however fix the issue. If I boot without your patch, resume from S3 hangs and I need to reboot using alt-sysreq-b. If I boot with your patch, resume from S3 is normal and the drive is obviously being unlocked. When power is cut from the drive during S3, it locks itself automatically and needs to be unlocked by the kernel on resume.
Forgot to mention that CONFIG_PM=y in the kernel configs that I use.
Fixed in 5.10.20 and 5.11.3.