Hi

Am 22.09.25 um 15:42 schrieb Melissa Wen:


On 22/09/2025 08:54, Thomas Zimmermann wrote:
Hi Melissa

Am 19.09.25 um 17:54 schrieb Melissa Wen:
Hi all,

I just talked with Thomas that these two patches are preventing amdgpu
driver to be unloaded:

`modprobe: FATAL: Module amdgpu is in use.`

and there is no process using the driver.

What's the exact STR for this problem? After Christian's comments, I tried to reproduce the issue, but it works on my system. I do

- boot up with amdgpu in text mode (multiuser.target)
- login by serial console
- 'rmmod amdgpu'

That last step turns my test system's display off and unloads amdgpu. The kernel is a recent drm-tip at v6.17-rc6.

- I booted up in graphical.target;
- Connected via ssh, dropped the graphical interface to text mode (multiuser.target), and tried to remove the module with `modprobe -r amdgpu`

I do

- boot into graphical
- ssh into the test system
- via ssh: sudo systemctl isolate multi-user.target
- via ssh: sudo modprobe -r amdgpu

Works as expected.


The issue happened in the latest 6.16 kernel version from Debian (I don't have the machine with me atm to check the exact version), but also with mainline kernel from last week.

I bisected kernel from 6.16 and 6.15 and IIRC git bisect pointed to `drm/framebuffer: Acquire internal references on GEM handles`, but as it triggers another trace and AFAIU fixes `drm/gem: Acquire references on GEM handles for framebuffers`, I reverted both pacthes and amdgpu loaded/unloaded as expected.

IGT amdgpu-specific tests for loading and unloading are also failing because it's not able to unload the module.
I didn't run the generic test.

I'm using an AMD Cezanne laptop with a touch-screen capable display (hp envy x360 convertible) with Debian + Gnome.
I looked for process using the modules, but I didn't find any.

After you switched to multi-user, what is in /sys/kernel/debug/dri/<YOUR DRM DEV>/
framebuffer ?

There should only be a single fb allocated by fbcon.


BTW, I don't discard that this work uncovered a preexist problem, for example. Since those patches are addressing other issues, as mentioned by Maarten, I'll debug the amdgpu driver further and check the points raised.

Thanks

Best regards
Thomas



Best Regards,

Melissa


Best regards
Thomas


We agreed that the best approach now is to completely revert the work
done for improving DMA bug handling to avoid any loose ends. With these
reverts we are just back to the old behavior and amdgpu loading and
unloading will return to normal.

Best Regards,

Melissa

Melissa Wen (2):
   Revert "drm/framebuffer: Acquire internal references on GEM handles"
   Revert "drm/gem: Acquire references on GEM handles for framebuffers"

  drivers/gpu/drm/drm_framebuffer.c | 31 +--------------
  drivers/gpu/drm/drm_gem.c         | 64 +++++--------------------------
  drivers/gpu/drm/drm_internal.h    |  2 -
  include/drm/drm_framebuffer.h     |  7 ----
  4 files changed, 11 insertions(+), 93 deletions(-)




--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Reply via email to