Tiny_power_button kernel module causing confusion

The most recent nixos-rebuild on my laptop had me confused because all of a sudden the power key would shut it down, even though prior to the rebuild it would be ignored as per my systemd.logind.settings.Login.HandlePowerKey = "ignore" setting

Logs showed SIGRTMIN+4 was sent, quick search turned up CONFIG_ACPI_TINY_POWER_BUTTON_SIGNAL , and hey it’s set to 38 AKA SIGRTMIN+4 in my kernel config. I unloaded the tiny_power_button module, blacklisted it, everything is normal again

Seems like this module should be opt-in, no? Or at least automatically disabled if systemd.logind is enabled. Maybe we new config option for it that has some warnings if systemd.logind is also enabled?

Spoke too soon. Apparently tiny_power_button is what makes the power button work to begin with. Could it be that something changed about how systemd handles SIGRTMIN+4? Should have posted this as a help thread :sweat_smile:

Ok, downgraded to linux 6.12.113 and things work as normal. In 6.18.57 the power key always powers off the system. 7.2.11 also works as normal. systemd is 260.5. Hopefully this is helpful to someone.

2 Likes

Thanks you so much for your investigation, I wasted quite a lot of time looking into this (and rebooted countless times).

Via [SOLVED] [linux-lts 6.18.57] Power button dead / PWRF missing / Kernel & Hardware / Arch Linux Forums I landed on https://lore.kernel.org/stable/5fe757e7aa54c38df3525d313598db99@stwm.de/ which states that ab06eb9204010c61e754bf4e71ee6f554584714d should be

Queued the fix for 6.18

I haven’t been able to find it though:

I am trying to patch my kernel:

  boot.kernelPatches = [
    {
      # https://discourse.nixos.org/t/tiny-power-button-kernel-module-causing-confusion/80683/2
      name = "acpi_power-button-fix";
      patch = pkgs.fetchpatch {
        url = "https://github.com/torvalds/linux/commit/ab06eb9204010c61e754bf4e71ee6f554584714d.patch";
        hash = "sha256-NQFFvI3yOUT9thJYiiXfVnzGsj2gUSO1HLT6l1p2Ucs=";
      };
    }
  ];

I’m having the same issue, rolling the kernel back to 6.18.56 fixes it.

Tried the commit you mentioned but it didn’t help, curious if it works for you?

  boot.kernelPatches = [
    {
      name = "power-button-fix-ab06eb920401";
      patch = pkgs.fetchpatch {
        url = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/?id=ab06eb9204010c61e754bf4e71ee6f554584714d";
        hash = "sha256-NQFFvI3yOUT9thJYiiXfVnzGsj2gUSO1HLT6l1p2Ucs=";
      };
    }
  ];
1 Like

No, it didn’t. I am now reverting to 6.18.56 for now:

let
  # https://github.com/NixOS/nixpkgs/blame/nixos-26.05/pkgs/os-specific/linux/kernel/kernels-org.json
  pinnedNixpkgs =
    import
      (fetchTarball {
        url = "https://github.com/NixOS/nixpkgs/archive/a4afc66e374e4ea187767ecc2dea99722d780f39.tar.gz";
        sha256 = "0qadldv7vqlv33y9xjr0fvk3jcnc8v33vc7qzqlbsf4lqh5d15di";
      })
      {
        system = pkgs.system;
      };
in
{
  boot.kernelPackages =
    assert pkgs.linuxPackages.kernel.version == "6.18.57";
    assert pinnedNixpkgs.linuxPackages.kernel.version == "6.18.56";
    pinnedNixpkgs.linuxPackages;
}
3 Likes

Thanks everyone for the investigation and fix!

I’m on nixos-unstable and needed to set the revision to 764c4eaef7cbff1c8342c9ff01ea6ced7d2b3ccc.

1 Like

I ran into this on Linux 6.18.58. I found that upgrading to Linux 7.2.12 works:

{ pkgs, ... }:
{
  boot.kernelPackages = pkgs.linuxPackages_7_2;
}

I haven’t checked Linux 7.3.

Fixed for me with kernel 6.18.60 (currently available in NixOS 26.05).

3 Likes