]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: avoid bogus "vram limit (0) must be a power of 2" warning
authorMateusz Jończyk <mat.jonczyk@o2.pl>
Wed, 6 Jul 2022 20:01:44 +0000 (22:01 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2022 19:55:44 +0000 (15:55 -0400)
commit34f45aefe827b42da2a969cf476bd8cb2e5a40a2
treecece28a1fffb28a2a801442a7031ba6adbb9ee2b
parent8909faeb436d9edc03414b2699dc584219a1e3b5
drm/radeon: avoid bogus "vram limit (0) must be a power of 2" warning

I was getting the following message on boot on Linux 5.19-rc5:
        radeon 0000:01:05.0: vram limit (0) must be a power of 2
(I didn't use any radeon.vramlimit commandline parameter).

This is caused by
commit 1bfff44680bc ("drm/radeon: use kernel is_power_of_2 rather than local version")
which removed radeon_check_pot_argument() and converted its users to
is_power_of_2(). The two functions differ in its handling of 0, which is
the default value of radeon_vram_limit: radeon_check_pot_argument()
"incorrectly" considered it a power of 2, while is_power_of_2() does not.

An appropriate conditional silences the warning message.

It is not necessary to add a similar test to other callers of
is_power_of_2() in radeon_device.c. The matching commit in amdgpu:
commit 0c8cdd12722d ("drm/amdgpu: use kernel is_power_of_2 rather than local version")
is unaffected by this bug.

Tested on Radeon HD 3200.

Not ccing stable, this is not serious enough.

Fixes: 1bfff44680bc ("drm/radeon: use kernel is_power_of_2 rather than local version")
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_device.c