Skip to content

Commit 1d1a81b

Browse files
committed
Use explicit_bzero instead of memset to fix POWER9 alignment exception.
Fixes #161
1 parent 938547c commit 1d1a81b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/radeon/vce_v1_0.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@ int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data)
193193
data[3] = sign->val[i].nonce[3];
194194
data[4] = cpu_to_le32(le32_to_cpu(sign->len) + 64);
195195

196+
#ifdef __linux__
196197
memset(&data[5], 0, 44);
198+
#else
199+
/* Workaround for alignment exception on POWER9 */
200+
explicit_bzero(&data[5], 44);
201+
#endif
197202
memcpy(&data[16], &sign[1], rdev->vce_fw->size - sizeof(*sign));
198203

199204
data += (le32_to_cpu(sign->len) + 64) / 4;

0 commit comments

Comments
 (0)