linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dma-api debugfs directory is not created since debugfs is not initialized
@ 2021-04-27 11:34 Corentin Labbe
  2021-04-27 11:39 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Corentin Labbe @ 2021-04-27 11:34 UTC (permalink / raw)
  To: gregkh, rafael, hch, m.szyprowski, robin.murphy; +Cc: iommu, linux-kernel

Hello

I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y.
But the dma-api directory does show up in debugfs, but lot of other directory exists in it.

After debugging it seems due to commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized")
Reverting the commit permit to "dma-api" debugfs to be found. (but seems not the right way to fix it).

Regards

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

* Re: dma-api debugfs directory is not created since debugfs is not initialized
  2021-04-27 11:34 dma-api debugfs directory is not created since debugfs is not initialized Corentin Labbe
@ 2021-04-27 11:39 ` Greg KH
  2021-04-27 12:32   ` Robin Murphy
  2021-04-27 15:36   ` Corentin Labbe
  0 siblings, 2 replies; 5+ messages in thread
From: Greg KH @ 2021-04-27 11:39 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: rafael, hch, m.szyprowski, robin.murphy, iommu, linux-kernel

On Tue, Apr 27, 2021 at 01:34:27PM +0200, Corentin Labbe wrote:
> Hello
> 
> I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y.
> But the dma-api directory does show up in debugfs, but lot of other directory exists in it.

Does it show up properly in 5.12?

> After debugging it seems due to commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized")
> Reverting the commit permit to "dma-api" debugfs to be found. (but seems not the right way to fix it).

We have had some odd start-up ordering issues that the above commit has
caused to show.  Given that this commit is now in stable kernels, with
no report of this issue so far, I'm worried that maybe this is a dma
subsystem ordering issue?

thanks,

greg k-h

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

* Re: dma-api debugfs directory is not created since debugfs is not initialized
  2021-04-27 11:39 ` Greg KH
@ 2021-04-27 12:32   ` Robin Murphy
  2021-04-27 12:41     ` Greg KH
  2021-04-27 15:36   ` Corentin Labbe
  1 sibling, 1 reply; 5+ messages in thread
From: Robin Murphy @ 2021-04-27 12:32 UTC (permalink / raw)
  To: Greg KH, Corentin Labbe; +Cc: rafael, hch, m.szyprowski, iommu, linux-kernel

On 2021-04-27 12:39, Greg KH wrote:
> On Tue, Apr 27, 2021 at 01:34:27PM +0200, Corentin Labbe wrote:
>> Hello
>>
>> I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y.
>> But the dma-api directory does show up in debugfs, but lot of other directory exists in it.
> 
> Does it show up properly in 5.12?
> 
>> After debugging it seems due to commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized")
>> Reverting the commit permit to "dma-api" debugfs to be found. (but seems not the right way to fix it).
> 
> We have had some odd start-up ordering issues that the above commit has
> caused to show.  Given that this commit is now in stable kernels, with
> no report of this issue so far, I'm worried that maybe this is a dma
> subsystem ordering issue?

Both debugfs_init() and dma_debug_init() do run at core_initcall level, 
and disassembling the vmlinux from my current working tree does indeed 
suggest that they somehow end up in the wrong relative order:

[...]
ffff80001160d0c8 <__initcall__kmod_debug__325_918_dma_debug_init1>:
ffff80001160d0c8:       feb0d528        .word   0xfeb0d528

[...]

ffff80001160d108 <__initcall__kmod_debugfs__357_848_debugfs_init1>:
ffff80001160d108:       fff4326c        .word   0xfff4326c
[...]


I always had the impression that initcall ordering tended to work out 
roughly alphabetical, such that entries from fs/* might come before 
kernel/*, but I guess it's at the whims of the linker in the end :/

Perhaps the easiest thing to do is split out dma_debug_fs_init() and run 
that at a later level? We do want the dma-debug infrastructure itself to 
be up as early as possible, but I think the debugfs view of its 
internals can happily wait until closer to the time that there's 
actually a userspace to be able to look at it.

Robin.

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

* Re: dma-api debugfs directory is not created since debugfs is not initialized
  2021-04-27 12:32   ` Robin Murphy
@ 2021-04-27 12:41     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-04-27 12:41 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Corentin Labbe, rafael, hch, m.szyprowski, iommu, linux-kernel

On Tue, Apr 27, 2021 at 01:32:50PM +0100, Robin Murphy wrote:
> On 2021-04-27 12:39, Greg KH wrote:
> > On Tue, Apr 27, 2021 at 01:34:27PM +0200, Corentin Labbe wrote:
> > > Hello
> > > 
> > > I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y.
> > > But the dma-api directory does show up in debugfs, but lot of other directory exists in it.
> > 
> > Does it show up properly in 5.12?
> > 
> > > After debugging it seems due to commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized")
> > > Reverting the commit permit to "dma-api" debugfs to be found. (but seems not the right way to fix it).
> > 
> > We have had some odd start-up ordering issues that the above commit has
> > caused to show.  Given that this commit is now in stable kernels, with
> > no report of this issue so far, I'm worried that maybe this is a dma
> > subsystem ordering issue?
> 
> Both debugfs_init() and dma_debug_init() do run at core_initcall level, and
> disassembling the vmlinux from my current working tree does indeed suggest
> that they somehow end up in the wrong relative order:
> 
> [...]
> ffff80001160d0c8 <__initcall__kmod_debug__325_918_dma_debug_init1>:
> ffff80001160d0c8:       feb0d528        .word   0xfeb0d528
> 
> [...]
> 
> ffff80001160d108 <__initcall__kmod_debugfs__357_848_debugfs_init1>:
> ffff80001160d108:       fff4326c        .word   0xfff4326c
> [...]
> 
> 
> I always had the impression that initcall ordering tended to work out
> roughly alphabetical, such that entries from fs/* might come before
> kernel/*, but I guess it's at the whims of the linker in the end :/

init call ordering happens from link ordering.

> Perhaps the easiest thing to do is split out dma_debug_fs_init() and run
> that at a later level? We do want the dma-debug infrastructure itself to be
> up as early as possible, but I think the debugfs view of its internals can
> happily wait until closer to the time that there's actually a userspace to
> be able to look at it.

That seems like a better idea here, there's no need for "special
treatment" of debugfs.

thanks,

greg k-h

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

* Re: dma-api debugfs directory is not created since debugfs is not initialized
  2021-04-27 11:39 ` Greg KH
  2021-04-27 12:32   ` Robin Murphy
@ 2021-04-27 15:36   ` Corentin Labbe
  1 sibling, 0 replies; 5+ messages in thread
From: Corentin Labbe @ 2021-04-27 15:36 UTC (permalink / raw)
  To: Greg KH; +Cc: rafael, hch, m.szyprowski, robin.murphy, iommu, linux-kernel

Le Tue, Apr 27, 2021 at 01:39:16PM +0200, Greg KH a écrit :
> On Tue, Apr 27, 2021 at 01:34:27PM +0200, Corentin Labbe wrote:
> > Hello
> > 
> > I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y.
> > But the dma-api directory does show up in debugfs, but lot of other directory exists in it.
> 
> Does it show up properly in 5.12?
> 

No (Tested on a qemu x86_64)

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

end of thread, other threads:[~2021-04-27 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 11:34 dma-api debugfs directory is not created since debugfs is not initialized Corentin Labbe
2021-04-27 11:39 ` Greg KH
2021-04-27 12:32   ` Robin Murphy
2021-04-27 12:41     ` Greg KH
2021-04-27 15:36   ` Corentin Labbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).