Bug 263008 - smartpqi: panic: malloc(M_WAITOK) with sleeping prohibited
Summary: smartpqi: panic: malloc(M_WAITOK) with sleeping prohibited
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Warner Losh
URL: https://reviews.freebsd.org/D35601
Keywords: crash
Depends on:
Blocks:
 
Reported: 2022-04-02 16:23 UTC by Yuri
Modified: 2023-12-27 12:43 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri 2022-04-02 16:23:28 UTC
Hitting the following panic on boot, changing BUS_DMA_WAITOK to
BUS_DMA_NOWAIT in os_dma_mem_alloc() helps.

panic: malloc(M_WAITOK) with sleeping prohibited
cpuid = 3
time = 1643658859
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
0xfffffe00c7b20ae0
vpanic() at vpanic+0x17f/frame 0xfffffe00c7b20b30
panic() at panic+0x43/frame 0xfffffe00c7b20b90
malloc_dbg() at malloc_dbg+0xd4/frame 0xfffffe00c7b20bb0
malloc_domainset() at malloc_domainset+0x36/frame 0xfffffe00c7b20c20
bounce_bus_dmamem_alloc() at bounce_bus_dmamem_alloc+0x5b/frame
0xfffffe00c7b20c50
os_dma_mem_alloc() at os_dma_mem_alloc+0xe3/frame 0xfffffe00c7b20c90
pqisrc_build_send_raid_request() at
pqisrc_build_send_raid_request+0x78/frame 0xfffffe00c7b20d30
pqisrc_write_current_time_to_host_wellness() at
pqisrc_write_current_time_to_host_wellness+0xff/frame
0xfffffe00c7b20df0os_wellness_periodic() at
os_wellness_periodic+0x1a/frame 0xfffffe00c7b20e10
softclock_call_cc() at softclock_call_cc+0x14d/frame 0xfffffe00c7b20ec0
softclock_thread() at softclock_thread+0xc6/frame 0xfffffe00c7b20ef0
fork_exit() at fork_exit+0x80/frame 0xfffffe00c7b20f30
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00c7b20f30
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2022-04-11 13:48:36 UTC
I'm not sure if the smartpqi maintainers are on bugzilla, maybe Warner can point them to this bug?
Comment 2 Warner Losh freebsd_committer freebsd_triage 2022-06-27 15:21:52 UTC
(In reply to Mark Johnston from comment #1)
I missed that I was mentioned here...

They usually are on bugzilla, it's unusual they didn't reply to this.

I'll commit it and try to reestablish connection to them since they go through ebbs and flows of FreeBSD support resources at times for reasons that are opaque to me...
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-06-27 17:08:05 UTC
A commit in branch main references this bug:

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

commit f4497b9f77795ece4d2f2fad4c0329d82d53bc63
Author:     Yuri <yuri@aetern.org>
AuthorDate: 2022-06-27 15:48:31 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-06-27 17:06:31 +0000

    smartpqi: Allocate DMA memory NOWAIT

    We're not allowed to wait in this allocation path, so allocate the
    memory NOWAIT instead of WAITOK. The code already copes with the
    failures that may result, so no additional code is needed.

    PR: 263008
    Reviewed by: markj, Scott Benesh at Microsemi, imp
    Differential Revision: https://reviews.freebsd.org/D35601

 sys/dev/smartpqi/smartpqi_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 4 Warner Losh freebsd_committer freebsd_triage 2023-10-16 17:28:40 UTC
Updated to show this doesn't affect 14, only 13.2.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2023-12-27 12:43:17 UTC
^Triage: assign to committer who resolved (directly to 13).