Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] nouveau: tegra: clk_fuse leak on power_down failure --
commit 4446c1485fff0b05a5e79c1e4d70e14c4beda300 Author: Sasha Levin <[email protected]> drm/nouveau/tegra: Keep the fuse clock enabled while the GPU is powered This commit modifies nouveau's Tegra power management sequence to keep the fuse clock enabled while the GPU is powered. This resolves an issue where the GM20B GPU would fail to initialize on some boots. > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > index 3c8d0878891ad..31f8eaa9d6509 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c [ ... ] > @@ -95,6 +100,8 @@ nvkm_device_tegra_power_down(struct nvkm_device_tegra > *tdev) > return ret; > } > > + clk_disable_unprepare(tdev->clk_fuse); > + > return 0; > } [Severity: Medium] Does this code leak the clk_fuse enable and prepare counts if regulator_disable() fails? If regulator_disable() fails and returns an error, the function immediately returns early. Because the new clk_disable_unprepare() call is positioned at the very end of this function, it is skipped entirely on this error path. Since callers like nvkm_device_tegra_dtor() ignore the return value of nvkm_device_tegra_power_down() and proceed to free the device structure, would this result in a permanent resource leak where the clk_fuse's prepare and enable counts are never decremented? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=3
