public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Issue seen since commit f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP")
@ 2022-10-10 18:57 Jerry Snitselaar
  2022-10-11  6:40 ` Christoph Hellwig
  2022-10-11 12:15 ` Robin Murphy
  0 siblings, 2 replies; 4+ messages in thread
From: Jerry Snitselaar @ 2022-10-10 18:57 UTC (permalink / raw)
  To: Christoph Hellwig, Robin Murphy; +Cc: Joerg Roedel, iommu, linux-kernel

I've been looking at an odd issue that shows up with commit
f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP").  What is being
seen is the bnx2fc driver calling dma_free_coherent(), and eventually
hits the BUG_ON() in vunmap().  bnx2fc_free_session_resc() does a
spin_lock_bh() around the dma_free_coherent() calls, and looking at
preempt.h that will trigger in_interrupt() to return positive, so that
makes sense. The really odd part is this only happens with the
shutdown of the kernel after a system install. Reboots after that do not
hit the BUG_ON() in vunmap().

I still need to grab a system and try to see what it is doing on the
subsequent shutdowns, because it seems to me that any time
bnx2fc_free_session_resc() is called it will end up there, unless the
allocs are not coming from vmalloc() in the later boots. Between the
comments in dma_free_attrs(), and preempt.h, dma_free_coherent()
shouldn't be called under a spin_lock_bh(), yes? I think the comments
in dma_free_attrs() might be out of date with commit f5ff79fddf0e
("dma-mapping: remove CONFIG_DMA_REMAP") in place since now it is more
general that you can land in vunmap(). Also, should that WARN_ON() in
dma_free_attrs() trigger as well for the BH disabled case?

It was also reproduced with a 6.0-rc5 kernel build[1].

Regards,
Jerry


[1] https://koji.fedoraproject.org/koji/buildinfo?buildID=2061881


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-12  2:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 18:57 Issue seen since commit f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP") Jerry Snitselaar
2022-10-11  6:40 ` Christoph Hellwig
2022-10-11 12:15 ` Robin Murphy
2022-10-12  2:47   ` Jerry Snitselaar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox