Re: [PATCH v2] firmware: tegra: bpmp: populate debugfs in the background
From: Austin Schuh
Date: Tue Nov 03 2026 - 01:17:47 EST
On Tue, Oct 27, 2026 at 8:08 PM Mikko Perttunen <mperttunen@xxxxxxxxxx> wrote:
>
> No need to explain what the userspace can do. Generally please compact
> and unslopify the above. No need to explain every possible resource a
> driver might need from BPMP, or details about the patch that lets you
> disable the mirror.
Done in V3. Hopefully the comments + commit are more direct.
> >
> > Measured with initcall_debug on an Orin Nano running 6.18.39 with
> > NVIDIA's patches: with an earlier L4T release, the probe returns after
> > 1.2 seconds instead of 6.36. With the BPMP firmware from L4T 39.2.1 it
> > returns after 0.51 seconds, and the mirror is complete and renamed 2.2
> > seconds later, about 1.3 seconds after init has started.
>
> This paragraph is kind of difficult to parse. Please just say which
> device and kernel you tested with, and what the change in time is.
> A recent upstream kernel would be preferred.
In V3, I've got just the numbers, measured against 7.3-rc1.
> This seems a bit overkill. We should be able to populate multiple
> instances in parallel, just avoid removing the root unless there are no
> users left during failure cleanup.
That's an easy change, done. I started with a mutex to keep the
exclusion simple and easy to reason about.
> > +
> > root = bpmp_debugfs_get_root();
> > if (IS_ERR(root))
> > return PTR_ERR(root);
> > @@ -818,7 +821,11 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
> > }
> > }
> >
> > - bpmp->debugfs_mirror = debugfs_create_dir("debug", d);
> > + /*
> > + * Fill the mirror in under another name and rename it to "debug"
> > + * once it is complete, so that userspace never sees part of it.
> > + */
>
> 'never sees an incomplete state.'
Done.
> > + /*
> > + * Mirroring the BPMP's debugfs tree takes several requests per
> > + * directory, which on Tegra234 adds up to seconds. Nothing else
> > + * waits for it, so do it in the background rather than hold up every
> > + * device that depends on the BPMP. The workqueue is freezable so
> > + * that system suspend waits for it instead of failing its requests.
> > + */
>
> Something shorter suffices, I think --
>
> /*
> * Mirroring the BPMP's debugfs tree can take several seconds,
> * so do it asynchronously, on the freezable wq to ensure requests
> * don't fail due to system suspend.
> */
>
> Or such.
Fair, done!
>
> Thanks!
> Mikko
Thank you!
Austin