[Linux] Shutdown hangs - Page 1
Forum section: electronics / general

author: blueskull
author_rank: Unknown
timestamp: February 07, 2021, 08:24:17 am
content: I recently ran into a problem with shutting down my system on a new laptop.The symptom is that it fails to power off when I click power off in Gnome desktop.It is not an ACPI issue as I can power it off using poweroff command or shutdown -P command.However, normally I believe shutdown -h can also put it into power off mode (so halt is treated as poweroff in modern Linux OSes), but in my case it only halts the system not shutting it down.Journal shows the system has reached completely halt, with everything cleanly unmounted and cleaned up after.So, I guess the question is, how can I force systemd-halt.service to power off the computer?

author: PKTKS
author_rank: Super Contributor
timestamp: February 07, 2021, 10:51:35 am
content: Quote from: blueskull on February 07, 2021, 08:58:50 amThere is a short answer (here) and a loooooong proper answerposted after the short one.The short answer is that these "generic" fit all - suited for casual - kernelsdo the things the possible worst way..Vast majority of kernel modules are compiled in_kernel thus resultingin a kernel image 50 times bigger than a proper hand crafted one.ACPI specification is mostly implemented in modules and sincethese modules will attach IRQ handlers to the kernel.. the orderin which these handlers and the proper BUS (ACPI uses mostly I2C and SMB)will interact on a target system.That said ... potterix systemd like things - which just "load that shit all parallel"all built in kernel... have a great chance to improperly assign IRQs..It happens not only in ACPI but USB as well devices will wrongly claimIRQs due to wrong IRQ priority.It may be solved by crafted kernels.. but the obvious solutionis to load the modules orderly and assign strictly required IRQs.It is not going to happen on the potterix systemd things..Paul

author: PKTKS
author_rank: Super Contributor
timestamp: February 07, 2021, 11:08:26 am
content: The LOOOONG answer...ACPI was meant to replace BIOS INT15H APM services.Obviously by removing power controllers from a specific matchedhardware via BIOS.. to a combination of software/firmware on ACPI tables..we now rely into the fact that the OS will be able not only to identifythe whole plethora of components on the system.. but also be ableto map each and every system out there...For that old folks will remember that PC-AT PSUs received things likePS_ON , PG and other lines... resulting in ATX form factors.Chips like HY510N or TPS5510 and others became part of ATX PSUs.On the MOBO side.. the SUPER I/O chipset was overloaded with LPC buscrammed with I2C, SMB the real BIOS and several other things..Laptops are now a source of complicated problems because what wasonce a simple BIOS matter... became a complicated problem of "matching"the Super I/O with a proper firmware from a proper model manufacturer..ENE/ ITE are now mostly requiring specific programmable Super I/Oto handle ACPI and several parts of hardware..Desktops are not requiring these complicated Super I/O versions butnevertheless we are required to compile a proper kernel that will matchthe devices in which ACPI is expected to handle...That shit is growing by dozens..A proper kernel ... properly compiled just need to care loading the BUSmodules first ... I2C and SMB... and when properly attached..the strictly required ACPI modules should be orderly loaded to claimstrictly the needed IRQsThis way we do not risk the chance to have races or dead locks in IRQ handlers..Obviously a SYTEMV rc.d proper matched loader is required..And more obviously .. the required "halt or "shutdown" shouldbe handled by dedicated systems counter part of INIT.It never fails when properly done.It required different AMD /INTEL and VIA kernels and modules..That FIT ALL LOAD ALL things may work.. but chances are that it failssome point in betweenAttached an expected proper device class dependency tree.Note the IRQ subsystem where ACPI tables play their rollPaul

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: February 14, 2021, 03:11:57 am
content: Quote from: blueskull on February 07, 2021, 08:24:17 amUEFI? Been known to hang shutdowns on some implementations.Simple to test, add noefi as a kernel option on boot and see if it has any impact. Worth a toss.

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: February 14, 2021, 03:25:18 am
content: That's how they fix them, firmware updates in the kernel. Used to be a big problem with Lenovo laptops with EUFI Linux shutdown hangs until the FW update arrived.

author: Monkeh
author_rank: Super Contributor
timestamp: February 14, 2021, 04:05:42 am
content: Either your kernel wasn't configured right, or there's a bug. Try building 5.10 with the same config. If it works, great, bisect.

author: Monkeh
author_rank: Super Contributor
timestamp: February 14, 2021, 06:46:01 am
content: Quote from: blueskull on February 14, 2021, 06:24:22 amWell, technically you're describing correct behaviour. 'halt' should not power down, although it sometimes does seem to. Again, a bisect would be informative if only the kernel has changed.