Am 09.04.2018 um 23:06 schrieb Laura Abbott:
There's an ongoing effort to remove VLAs[1] from the kernel to eventually
turn on -Wvla. The single VLA usage in the amdkfd driver is actually
constant across all current platforms.
Actually that isn't correct.
Could be that we haven't upstreamed KFD support for them, but Vega10 have a different interrupt ring entry size and so would cause the error message here.
Switch to a constant size array
instead.
I would say to just make make the array bigger.
Regards,
Christian.
[1] https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Laura Abbott <labbott@xxxxxxxxxx>
---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
index 035c351f47c5..c9863858f343 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
@@ -139,10 +139,12 @@ static void interrupt_wq(struct work_struct *work)
 {
ÂÂÂÂÂ struct kfd_dev *dev = container_of(work, struct kfd_dev,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ interrupt_work);
+ÂÂÂ uint32_t ih_ring_entry[4];
-ÂÂÂ uint32_t ih_ring_entry[DIV_ROUND_UP(
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ dev->device_info->ih_ring_entry_size,
-ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ sizeof(uint32_t))];
+ÂÂÂ if (dev->device_info->ih_ring_entry_size > (4 * sizeof(uint32_t))) {
+ÂÂÂÂÂÂÂ dev_err(kfd_chardev(), "Ring entry too small\n");
+ÂÂÂÂÂÂÂ return;
+ÂÂÂ }
ÂÂÂÂÂ while (dequeue_ih_ring_entry(dev, ih_ring_entry))
ÂÂÂÂÂÂÂÂÂ dev->device_info->event_interrupt_class->interrupt_wq(dev,