Skip to contentSkip to conversation

drm/nouveau: select FW caching

PATCH In review Dave Airlie 3 participants 7 messages Feb 7, 2025 – Feb 19, 2025

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/nouveau: select FW caching

From: Dave Airlie <[email protected]>

nouveau tries to load some firmware during suspend that it loaded earlier, but with fw caching disabled it hangs suspend, so just rely on FW cache enabling instead of working around it in the driver.

Fixes 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
---
 drivers/gpu/drm/nouveau/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/Kconfig +1 -0
index ce840300578d8..1050a4617fc15 100644
@@ -4,6 +4,7 @@ config DRM_NOUVEAU
 	depends on DRM && PCI && MMU
 	select IOMMU_API
 	select FW_LOADER
+	select FW_CACHE if PM_SLEEP
 	select DRM_CLIENT_SELECTION
 	select DRM_DISPLAY_DP_HELPER
 	select DRM_DISPLAY_HDMI_HELPER
Signature · 1 line
2.48.1
maintainer
#1 lore raw

(+ Luis, Russ)

Quoted 17 lines · Dave Airlie

From: Dave Airlie <[email protected]>

nouveau tries to load some firmware during suspend that it loaded earlier, but with fw caching disabled it hangs suspend, so just rely on FW cache enabling instead of working around it in the driver.

Fixes 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
---
 drivers/gpu/drm/nouveau/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/Kconfig +0 -0
index ce840300578d8..1050a4617fc15 100644

drivers/gpu/drm/nouveau/Kconfig config DRM_NOUVEAU · line 7

Quoted 4 lines
drivers/gpu/drm/nouveau/Kconfig +1 -0
@@ -4,6 +4,7 @@ config DRM_NOUVEAU
 	depends on DRM && PCI && MMU
 	select IOMMU_API
 	select FW_LOADER
+	select FW_CACHE if PM_SLEEP

CONFIG_FW_CACHE was added, as the Kconfig says, it "can prevent suspend on many platforms".

@Luis, Russ: I assume this mostly means embedded platforms?

I wonder if we should not insist on FW_CACHE if NOUVEAU_PLATFORM_DRIVER, or even only force FW_CACHE if DRM_NOUVEAU_GSP_DEFAULT?

maintainer
#2 lore raw
Quoted 1 line · Danilo Krummrich

only force FW_CACHE if DRM_NOUVEAU_GSP_DEFAULT?

Please scratch that, it was a horrible idea.

#3 lore raw
Quoted 4 lines · Danilo Krummrich
Quoted 1 line · Danilo Krummrich

only force FW_CACHE if DRM_NOUVEAU_GSP_DEFAULT?

Please scratch that, it was a horrible idea.

What I recommend is to look into why we disable it by default, I think its sold old obscure reasoning but now suspect it was udev being dumb, in line with why we also try to defensively try to ignore duplicate udev requests for module requests causing a flood. Refer to commit 9b9879fc03275ff ("modules: catch concurrent module loads, treat them as idempotent") for details.

Luis

maintainer
#4 lore raw
Quoted 2 lines · Luis Chamberlain

What I recommend is to look into why we disable it by default, I think

I think FW_CACHE is enabled by default, no?

Quoted 5 lines

its sold old obscure reasoning but now suspect it was udev being dumb, in line with why we also try to defensively try to ignore duplicate udev requests for module requests causing a flood. Refer to commit 9b9879fc03275ff ("modules: catch concurrent module loads, treat them as idempotent") for details.

Thanks, that helps a lot.

Given that this commit landed in v6.5 I guess there's not really a concern to force enable FW_CACHE for Nouveau as a fix for commit 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM"), which landed in v6.7.

#5 lore raw
Quoted 12 lines · Danilo Krummrich
Quoted 2 lines · Luis Chamberlain

What I recommend is to look into why we disable it by default, I think

I think FW_CACHE is enabled by default, no?

Quoted 5 lines

its sold old obscure reasoning but now suspect it was udev being dumb, in line with why we also try to defensively try to ignore duplicate udev requests for module requests causing a flood. Refer to commit 9b9879fc03275ff ("modules: catch concurrent module loads, treat them as idempotent") for details.

Quoted 3 lines

Thanks, that helps a lot.

Given that this commit landed in v6.5

That commit lets us ignore the udev floods for superfluous module requests only.

Quoted 3 lines

I guess there's not really a concern to
force enable FW_CACHE for Nouveau as a fix for commit 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM"), which landed in v6.7.

I'd recommmend to look into *why* folks didn't like fw cache to look at disabling it in the first place, and look and see if udev was acting up and doing stupid things preventing suspend.

Luis

author maintainer
#6 lore raw
Quoted 21 lines · Luis Chamberlain
Quoted 12 lines · Danilo Krummrich
Quoted 2 lines · Luis Chamberlain

What I recommend is to look into why we disable it by default, I think

I think FW_CACHE is enabled by default, no?

Quoted 5 lines

its sold old obscure reasoning but now suspect it was udev being dumb, in line with why we also try to defensively try to ignore duplicate udev requests for module requests causing a flood. Refer to commit 9b9879fc03275ff ("modules: catch concurrent module loads, treat them as idempotent") for details.

Quoted 3 lines

Thanks, that helps a lot.

Given that this commit landed in v6.5

That commit lets us ignore the udev floods for superfluous module requests only.

Quoted 7 lines
Quoted 3 lines

I guess there's not really a concern to
force enable FW_CACHE for Nouveau as a fix for commit 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM"), which landed in v6.7.

I'd recommmend to look into *why* folks didn't like fw cache to look at disabling it in the first place, and look and see if udev was acting up and doing stupid things preventing suspend.

This has been on in Fedora for ever, Linus said it was originally on by default and Greg thinks Android folks had a regression, I don't think the intersections of nouveau and platforms which had problems a long time ago is interesting enough to care,

All distros should enable this, it fixes problems, if Android finds a regression with nouveau it'll bisect to here.

Dave.

Quoted 2 lines

Luis