[Bug 283027] LinuxKPI PCI -- kernel panic: malloc(M_WAITOK) with sleeping prohibited

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 05 Sep 2025 23:29:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283027

--- Comment #9 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=bbeeb585315645db20118ef349a4e3dc83b148cc

commit bbeeb585315645db20118ef349a4e3dc83b148cc
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-09-04 20:22:00 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-09-05 23:24:14 +0000

    LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach

    In linux_pci_attach_device() allocate a LinuxKPI pci_dev for each device in
    the hierarchy up to the root port[1] as we cannot do that later on demand
    as we may be in a context where we may not sleep.

    Take special care of DRM as there is a non-PCI device in the chain which
    needs to be skipped.

    iwlwifi(4) can hit this case called from a callout.

    While here leave a comment sa the cleanup order of
    linux_pci_attach_device() needs correction seperately.

    Sponsored by:   The FreeBSD Foundation (initially)
    PR:             283027
    Suggested by:   jhb [1]
    MFC after:      3 days
    Reviewed by:    dumbbell
    Differential Revision:  https://reviews.freebsd.org/D52069

 sys/compat/linuxkpi/common/src/linux_pci.c | 47 +++++++++++++++++++++++++-----
 1 file changed, 40 insertions(+), 7 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.