Patch "drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amdgpu-fix-shift-type-in-amdgpu_debugfs_sdma_sch.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d2ab9b677450b7a77cb3dbd48a158d3f538b9c73
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Wed Jan 8 12:41:28 2025 +0300

    drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()
    
    [ Upstream commit 6ec6cd9acbaa844391a1f75a824a3a9d18978fcb ]
    
    The "mask" and "val" variables are type u64.  The problem is that the
    BIT() macros are type unsigned long which is just 32 bits on 32bit
    systems.
    
    It's unlikely that people will be using this driver on 32bit kernels
    and even if they did we only use the lower AMDGPU_MAX_SDMA_INSTANCES (16)
    bits.  So this bug does not affect anything in real life.
    
    Still, for correctness sake, u64 bit masks should use BIT_ULL().
    
    Fixes: d2e3961ae371 ("drm/amdgpu: add amdgpu_sdma_sched_mask debugfs")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Reviewed-by: Mario Limonciello <mario.limonciello@xxxxxxx>
    Link: https://lore.kernel.org/r/d39a9325-87a4-4543-b6ec-1c61fca3a6fc@stanley.mountain
    Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index 113f0d2426187..f40531fea11ad 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
@@ -358,13 +358,13 @@ static int amdgpu_debugfs_sdma_sched_mask_set(void *data, u64 val)
 	if (!adev)
 		return -ENODEV;
 
-	mask = (1 << adev->sdma.num_instances) - 1;
+	mask = BIT_ULL(adev->sdma.num_instances) - 1;
 	if ((val & mask) == 0)
 		return -EINVAL;
 
 	for (i = 0; i < adev->sdma.num_instances; ++i) {
 		ring = &adev->sdma.instance[i].ring;
-		if (val & (1 << i))
+		if (val & BIT_ULL(i))
 			ring->sched.ready = true;
 		else
 			ring->sched.ready = false;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux