Skip to content

Instantly share code, notes, and snippets.

@christian-heusel
Last active January 25, 2024 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christian-heusel/24cef89c3a2da632b88b3e44cbd53144 to your computer and use it in GitHub Desktop.
Save christian-heusel/24cef89c3a2da632b88b3e44cbd53144 to your computer and use it in GitHub Desktop.

Bisecting Kernel Regressions

gromit


Chapter 0 -- Disclaimer

ich hab auch keine Ahnung ¯\_(^_^)_/¯

Chapter 1 -- Es gibt einen Bug? :o

  • kernel.org:
    mainline: 6.8-rc1 - 2024-01-21
    
  • install via aur/linux-mainline
  • reboot
  • alles funktioniert
  • ?!
  • dmesg -> aha, nicht ganz alles!

Chapter 2 -- Na gut, bisecte ich das eben :p

$ git rev-list --count v6.7..v6.8-rc1
13052
  • git bisect - Use binary search to find the commit that introduced a bug

    • git bisect start
    • git bisect bad <ref>
    • git bisect good <ref>
  • Was tu ich jetzt also pro revision?

    $ git bisect start v6.8-rc1
    status: waiting for good commit(s), bad commit known
    $ git bisect good v6.7   
    Bisecting: 6785 revisions left to test after this (roughly 13 steps)
    [ba5afb9a84df2e6b26a1b6389b98849cd16ea757] fs: rework listmount() implementation
    

Chapter 3 -- oh shit, wie teste ich das denn?

PKGBUILD FTW

  • modifiziere aur/linux-mainline

    • baue von commit statt tag
    • baue die docs nicht
    • pkgver() einbauen um den commit im Paket sichtbar zu machen
  • integration mit mkinitcpio etc.

  • offload-build (hehe)


Chapter 3 -- oh shit, wie teste ich das denn?

mkosi

  • kann grob das folgende:
    1. Baue eine OS Dateistruktur auf
    2. Package das in ein output format
    3. (optional) Boote via systemd-nspawn oder qemu
  • Unterstützt gängige Linux Distributionen (unabhängig des "Hosts")

Chapter 3 -- oh shit, wie teste ich das denn?

mkosi

mkosi-kernel

mkosi.local.conf:

[Content]
BuildSources=/home/chris/Documents/shared_projects/linux-mkosi:kernel

[Distribution]
Distribution=debian

Chapter 4 -- Bugreport

Commit: 7a36b901a6eb0e9945341db71ed3c45c7721cfa9
("ACPI: OSL: Use a threaded interrupt handler for SCI")
  • bug reporting guidelines lesen
    • ...
    • Reproduzierbarkeit sicherstellen
    • Distropatches ausschließen
    • Nach Duplikaten suchen
    • Neuste Version checken
    • MAINTAINERS file für bug report checken
    ACPI
    B: https://bugzilla.kernel.org
    

Ergebnis: https://bugzilla.kernel.org/show_bug.cgi?id=218407


Chapter 4 -- Bugreport


Chapter 5 -- Lösung

--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -1162,7 +1162,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
        }

        ret = devm_request_irq(&pdev->dev, gpio_dev->irq, amd_gpio_irq_handler,
-                              IRQF_SHARED, KBUILD_MODNAME, gpio_dev);
+                              IRQF_SHARED | IRQF_ONESHOT, KBUILD_MODNAME, gpio_dev);
        if (ret)
                goto out2;

--
2.34.1

Test:

https://lore.kernel.org/all/q336uhrwuvhaf2x4fc6tneaavgugcyszgn75vzbrr4ksf7oxhi@3qcwff6nuvei/


Zusätzliche Resourcen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment