You are not logged in.

#1 2021-02-16 12:04:06

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

[SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

I have an HP Envy X360 15-en0000na laptop that has been running fine with the kernels through 5.10.16 and yesterday I ran a test with kernel 5.11 - which boots fine, and runs fin until the point where the laptop is supposed to shutdown and poweroff. It shuts down apparently correctly, but then immediately reboots.  Whether I do this by selecting shutdown from the plasma desktop, or not logging in to the plasma desktop but opening a VT, and as root issuing "systemctl poweroff", or in a VT "systemctl halt" - whichever method I try it does shut down but immediately reboots.  Does anyone else with an AMD machine see this problem?  It is a clear regression in 5.11 for me compared to 5.10.x

I have reported upstream at https://bugzilla.kernel.org/show_bug.cgi?id=211799

I have two machines that are Intel, and they run kernel 5.11 and shutdown without any problem, so it is only on the AMD machine that this seems to occur.  I don't know if there is a work around available?

Hopefully this will be fixed upstream before too long.

Edit: Reported at https://bugs.archlinux.org/task/69664 also since other arch AMD users could be impacted by this bug.

Last edited by mcloaked (2021-02-21 21:56:10)


Mike C

Offline

#2 2021-02-17 00:00:04

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Do you need help with the bisection between 5.10 and 5.11?

Offline

#3 2021-02-17 13:23:21

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Thank you for the offer, loqs, but I am not set up for building the kernel - the custom  kernel I am using is built by another user, and I install the builds from his repo.  He doesn't have AMD, so he can build and I can test - but bisecting is not so easy.


Mike C

Offline

#4 2021-02-17 16:43:03

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Does your system need a special config / kernel build to boot so you can not test using the linux package?
Edit:
If I built the bisection packages for you,  would you test them?

Last edited by loqs (2021-02-17 18:12:06)

Offline

#5 2021-02-17 19:39:39

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Do the bisection  kernel packages need manual intervention between each build and test? I ask because it may mean I don't have a sensible enough time to run it all. Also does it build as a custom kernel leaving the existing kernel files and images in place so that the kernels already installed can remain in place to boot in case of a problem with the bisection kernels at each boot test point?  Also I did wonder if some of the kernel developers who have written the large number of new patches for AMD in 5.11 may have a suspicion as to where some critical changes they have made may be the cause of the issue here - and if so pulling or changing a small number of patches likely to be relevant may be quicker than full bisection?


Mike C

Offline

#6 2021-02-17 20:08:24

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

For each kernel you would need to install it,  boot it and tell me if it had the issue (assuming I am building it) or not or you could not tell because some other issue.
The kernel package can be named whatever you like.  As you are using a custom kernel I built the test pakages using the name linux assuming your custom package would use the name linux-sap.
Yes if you know which developer to contact.  Assuming you could test 5 kernels a day,  you could finish the bisection in 5 days.
Edit:

$ git bisect start
$ git bisect bad #current checkout is v5.11
$ git bisect good v5.10
Bisecting: 7761 revisions left to test after this (roughly 13 steps)
[538fcf57aaee6ad78a05f52b69a99baa22b33418] Merge branches 'acpi-scan', 'acpi-pnp' and 'acpi-sleep'

13 bisection steps plus check the initial 5.10 and 5.11 built locally to rule out tool chain issues gives 15 kernels to test.  If bisection points do not work that would add additional steps.
Edit2:
links removed

Last edited by loqs (2021-02-17 20:32:02)

Offline

#7 2021-02-17 20:29:09

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Loqs, I have sent you an email so hopefully you will get that shortly - and perhaps I can look at the details before coming back to the forum to detail any results.

Edit:  I see another user has already started bisecting and commented at https://bugzilla.kernel.org/show_bug.cgi?id=211799#c18

Last edited by mcloaked (2021-02-17 20:34:40)


Mike C

Offline

#8 2021-02-18 15:50:15

jonathon
Member
Registered: 2016-09-19
Posts: 128

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

mcloaked wrote:

the custom  kernel I am using is built by another user

Following up on loqs' earlier question (which you seem to have skipped over): which kernel are you using, and does the same issue occur with the standard `linux` kernel?

The bug report you opened says it happens with the `linux` kernel in testing, though apparently that's not the one you're running, so it is very definitely worth confirming before giving someone extra work to do.

Last edited by jonathon (2021-02-18 16:12:39)

Offline

#9 2021-02-18 15:58:19

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Maybe give masking 'lvm2-monitor.service' a shot. There are some new issues atm. For me, it spins up HDDs right before shutdown.

sudo systemctl mask lvm2-monitor.service

sys2064

Offline

#10 2021-02-18 16:24:23

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

jonathon wrote:
mcloaked wrote:

the custom  kernel I am using is built by another user

Following up on loqs' earlier question (which you seem to have skipped over): which kernel are you using, and does the same issue occur with the standard `linux` kernel?

The bug report you opened says it happens with the `linux` kernel in testing, though apparently that's not the one you're running, so it is very definitely worth confirming before giving someone extra work to do.

I have been working with loqs yesterday and today doing a kernel bisect - it will take another day or two to complete.  Hopefully that process will identify the commit that caused the problem.  Another user on the upstream report is also working on a kernel bisect, with slightly different hardware, so these two efforts will hopefully home in on the commit that needs to be reworked. Once this work, currently in progress, is done then I will report back here.


Mike C

Offline

#11 2021-02-18 17:39:54

jonathon
Member
Registered: 2016-09-19
Posts: 128

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

That's great! My worry is that the `linux` kernel (currently in testing) is being held back because you have reported an issue with it that may not actually exist. Just for my own edification, would you be kind enough to confirm that the issue exists with the `linux` kernel?

For example, Debian included a patch that broke things for AMD cards that was removed/reverted in some Arch kernels:

<damentz[m]> heftig: looks like the amdgpu/radeon "fix" in debian really messed up amd systems, I'd recommend pushing out a zen2 with the latest revert in master

Last edited by jonathon (2021-02-18 17:45:19)

Offline

#12 2021-02-18 20:39:15

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

jonathon mcloaked is bisecting between v5.10 and v5.11 with no additional commits or pacthes using the .config from the Arch 5.11 package.

It looked very similar to https://gitlab.freedesktop.org/drm/amd/-/issues/1499 but the fix did not help.
Edit:
Although bisection is still on track to end in the same commit as the cause.

git bisect start
# bad: [f40ddce88593482919761f74910f42f4b84c004b] Linux 5.11
git bisect bad f40ddce88593482919761f74910f42f4b84c004b
# good: [2c85ebc57b3e1817b6ce1a6b703928e113a90442] Linux 5.10
git bisect good 2c85ebc57b3e1817b6ce1a6b703928e113a90442
# bad: [538fcf57aaee6ad78a05f52b69a99baa22b33418] Merge branches 'acpi-scan', 'acpi-pnp' and 'acpi-sleep'
git bisect bad 538fcf57aaee6ad78a05f52b69a99baa22b33418
# bad: [15b447361794271f4d03c04d82276a841fe06328] mm/lru: revise the comments of lru_lock
git bisect bad 15b447361794271f4d03c04d82276a841fe06328
# skip: [b10733527bfd864605c33ab2e9a886eec317ec39] Merge tag 'amd-drm-next-5.11-2020-12-09' of git://people.freedesktop.org/~agd5f/linux into drm-next
git bisect skip b10733527bfd864605c33ab2e9a886eec317ec39
# good: [e4b3c3b3faafe8d471c352d64cc87ccc6a1cede6] drm/i915/vbt: Update the version and expected size of BDB_GENERAL_DEFINITIONS map
git bisect good e4b3c3b3faafe8d471c352d64cc87ccc6a1cede6
# good: [9713158cb2a918c3f6f5522eed23cdeb61f22e75] drm/amdgpu: Add and use seperate reg headers for dcn302
git bisect good 9713158cb2a918c3f6f5522eed23cdeb61f22e75
# bad: [2c075f38a708c578a752b738a45e8c26923eac2e] Merge branch 'radeon-fixes' (Radeon and amdgpu fixes)
git bisect bad 2c075f38a708c578a752b738a45e8c26923eac2e
# good: [6ad253cc3436269fc6bcff03d704c672f368da0a] media: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
git bisect good 6ad253cc3436269fc6bcff03d704c672f368da0a
# good: [5785dd7a8ef0de8049f40a1a109de6a1bf17b479] drm/msm: Fix duplicate gpu node in icc summary
git bisect good 5785dd7a8ef0de8049f40a1a109de6a1bf17b479
# good: [63ee07d5a8d7f279187984dbdf6bbfd571c937dd] media: uapi: Add MEDIA_BUS_FMT_RGB888_3X8_DELTA media bus format
git bisect good 63ee07d5a8d7f279187984dbdf6bbfd571c937dd
# good: [767358119fca655056eb7340eb8a0ec4652bc888] crypto: qat - add clock enable CSR to chip info
git bisect good 767358119fca655056eb7340eb8a0ec4652bc888
# bad: [115a385c08d8d1874b3496d134cba0cc218f0fda] drm/amd/display: Do full modeset when DSC debugfs is changed
git bisect bad 115a385c08d8d1874b3496d134cba0cc218f0fda
# bad: [4d3efadd374ac4038f556d8505c665b0cc931a46] drm/radeon/radeon: Move prototype into shared header
git bisect bad 4d3efadd374ac4038f556d8505c665b0cc931a46
# good: [0e961589f53e6d5164f308dd10c0e3c0b655f6ee] drm/amdgpu: switch to use smuio callbacks for AI family
git bisect good 0e961589f53e6d5164f308dd10c0e3c0b655f6ee
# bad: [7eff65d6c59c49271c7eb2118016e9e3feea536e] drm/amd/amdgpu/amdgpu_vm_cpu: Fix 'amdgpu_vm_cpu_prepare()'s doc-rot
git bisect bad 7eff65d6c59c49271c7eb2118016e9e3feea536e

Last edited by loqs (2021-02-18 20:44:08)

Offline

#13 2021-02-18 21:22:48

jonathon
Member
Registered: 2016-09-19
Posts: 128

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Awesome - sorry for the noise.

I'm going to test out the patch and see whether it helps my Ryzen laptop - it has been freezing on suspend more than normal recently so I wonder now whether this is related...

Offline

#14 2021-02-18 23:14:24

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

With a great deal of help from loqs a kernel bisection has been completed, and the bad commit identified.  This has been reported in the upstream bug at:

https://bugzilla.kernel.org/show_bug.cgi?id=211799#c19

Hopefully a solution will be found that fixes this issue before too long.


Mike C

Offline

#15 2021-02-19 04:51:46

scruffidog
Member
Registered: 2010-01-10
Posts: 28

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

I think I'm hitting the same bug with the that custom kernel which can be found in AUR as linux-amd-znver2-5.11.v.0-2. Same symptoms and I just wrote up a comment on the AUR entry. So quickly summarizing: when I do a poweroff or any combination of commands to power off, the machine actually does not, rebooting instead. Thought the problem was the user (me) the first few times it happens but finally realized that it might be something with the kernel. So I switched back to the vanilla kernel, linux-5.11-arch2-1 and the behavior was normal.

ps: same machine as OP, not sure if config or BIOS version is the same but here's mine:

efi: EFI v2.70 by INSYDE Corp.
efi: ACPI=0xcdffe000 ACPI 2.0=0xcdffe014 ESRT=0xcb877d18 TPMFinalLog=0xcdf1a000 SMBIOS=0xcb6f2000 SMBIOS 3.0=0xcb6f0000 MEMATTR=0xb6f18018 RNG=0xcb6eeb98 TPMEventLog=0xb6f1a018
efi: seeding entropy pool
SMBIOS 3.2.0 present.
[DMI: HP HP ENVY x360 Convertible 15m-ee0xxx/876F, BIOS F.15 11/12/2020

Last edited by scruffidog (2021-02-19 04:55:50)

Offline

#16 2021-02-19 04:57:37

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

Offline

#17 2021-02-19 11:45:44

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVED] kernel 5.11 on AMD Ryzen 7 laptop won't shutdown correctly

I have installed and tested the kernel you quote from arch [testing] repo, and it fixes the issue for me.


Mike C

Offline

Board footer

Powered by FluxBB