]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/pm: use bitmap_{from,to}_arr32 where appropriate
authorYury Norov <yury.norov@gmail.com>
Thu, 28 Apr 2022 20:51:16 +0000 (13:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:41:41 +0000 (18:41 +0200)
[ Upstream commit 525d6515604eb1373ce5e6372a6b6640953b2d6a ]

The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert
bitmap to 32-bit array. This may be wrong due to endiannes issues.
Fix it by switching to bitmap_{from,to}_arr32.

CC: Alexander Gordeev <agordeev@linux.ibm.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Christian Borntraeger <borntraeger@linux.ibm.com>
CC: Claudio Imbrenda <imbrenda@linux.ibm.com>
CC: David Hildenbrand <david@redhat.com>
CC: Heiko Carstens <hca@linux.ibm.com>
CC: Janosch Frank <frankja@linux.ibm.com>
CC: Rasmus Villemoes <linux@rasmusvillemoes.dk>
CC: Sven Schnelle <svens@linux.ibm.com>
CC: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

index 4e9e2cf398591f7dba0f4cc4180162ccc5303138..5fcbec9dd45dd8cd3054729f69d8b1674f6d52d8 100644 (file)
@@ -777,7 +777,7 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
                goto failed;
        }
 
-       bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
+       bitmap_to_arr32(feature_mask, feature->allowed, 64);
 
        ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetAllowedFeaturesMaskHigh,
                                          feature_mask[1], NULL);
index b54790d3483ef16571c05be739a483296a3865d7..4a5e91b59f0cdce0f5643586e69f692ee04b2385 100644 (file)
@@ -726,7 +726,7 @@ int smu_v13_0_set_allowed_mask(struct smu_context *smu)
        if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
                goto failed;
 
-       bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
+       bitmap_to_arr32(feature_mask, feature->allowed, 64);
 
        ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetAllowedFeaturesMaskHigh,
                                              feature_mask[1], NULL);