[PATCH] drm/nouveau: Do not fail module init on debugfs errors
Danilo Krummrich
dakr at kernel.org
Thu Jul 3 22:23:11 UTC 2025
On Thu, Jul 03, 2025 at 09:19:49PM +0000, Aaron Thompson wrote:
> From: Aaron Thompson <dev at aaront.org>
>
> If CONFIG_DEBUG_FS is enabled, nouveau_drm_init() returns an error if it
> fails to create the "nouveau" directory in debugfs. One case where that
> will happen is when debugfs access is restricted by
> CONFIG_DEBUG_FS_ALLOW_NONE or by the boot parameter debugfs=off, which
> cause the debugfs APIs to return -EPERM.
>
> So just ignore errors from debugfs. Note that nouveau_debugfs_root may
> be an error now, but that is a standard pattern for debugfs. From
> include/linux/debugfs.h:
>
> "NOTE: it's expected that most callers should _ignore_ the errors
> returned by this function. Other debugfs functions handle the fact that
> the "dentry" passed to them could be an error and they don't crash in
> that case. Drivers should generally work fine even if debugfs fails to
> init anyway."
>
> Fixes: 97118a1816d2 ("drm/nouveau: create module debugfs root")
> Cc: stable at vger.kernel.org
> Signed-off-by: Aaron Thompson <dev at aaront.org>
Applied to drm-misc-fixes, thanks!
More information about the dri-devel
mailing list