Skip to content

Commit f675553

Browse files
committed
Merge tag 'drm-misc-fixes-2023-09-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull: * DRM MM-test fixes * Fbdev Kconfig fixes * ivpu: * IRQ-handling fixes * meson: * Fix memory leak in HDMI EDID code * nouveau: * Correct type casting * Fix memory leak in scheduler * u_memcpya() fixes * virtio: * Fence cleanups Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230921153712.GA14059@linux-uq9g
2 parents ce9ecca + f75f71b commit f675553

File tree

12 files changed

+31
-25
lines changed

12 files changed

+31
-25
lines changed

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,8 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
10461046
if (status == 0)
10471047
return IRQ_NONE;
10481048

1049-
REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
1049+
/* Disable global interrupt before handling local buttress interrupts */
1050+
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
10501051

10511052
if (REG_TEST_FLD(VPU_40XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
10521053
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE");
@@ -1092,6 +1093,12 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
10921093
schedule_recovery = true;
10931094
}
10941095

1096+
/* This must be done after interrupts are cleared at the source. */
1097+
REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
1098+
1099+
/* Re-enable global interrupt */
1100+
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
1101+
10951102
if (schedule_recovery)
10961103
ivpu_pm_schedule_recovery(vdev);
10971104

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ config DRM_FBDEV_EMULATION
136136
bool "Enable legacy fbdev support for your modesetting driver"
137137
depends on DRM
138138
select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
139-
default y
139+
default FB
140140
help
141141
Choose this option if you have a need for the legacy fbdev
142142
support. Note that this support also provides the linux console

drivers/gpu/drm/meson/meson_encoder_hdmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ static void meson_encoder_hdmi_hpd_notify(struct drm_bridge *bridge,
334334
return;
335335

336336
cec_notifier_set_phys_addr_from_edid(encoder_hdmi->cec_notifier, edid);
337+
338+
kfree(edid);
337339
} else
338340
cec_notifier_phys_addr_invalidate(encoder_hdmi->cec_notifier);
339341
}

drivers/gpu/drm/nouveau/nouveau_drv.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,12 @@ u_free(void *addr)
189189
static inline void *
190190
u_memcpya(uint64_t user, unsigned int nmemb, unsigned int size)
191191
{
192-
void *mem;
193-
void __user *userptr = (void __force __user *)(uintptr_t)user;
192+
void __user *userptr = u64_to_user_ptr(user);
193+
size_t bytes;
194194

195-
size *= nmemb;
196-
197-
mem = kvmalloc(size, GFP_KERNEL);
198-
if (!mem)
199-
return ERR_PTR(-ENOMEM);
200-
201-
if (copy_from_user(mem, userptr, size)) {
202-
u_free(mem);
203-
return ERR_PTR(-EFAULT);
204-
}
205-
206-
return mem;
195+
if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
196+
return ERR_PTR(-EOVERFLOW);
197+
return vmemdup_user(userptr, bytes);
207198
}
208199

209200
#include <nvif/object.h>

drivers/gpu/drm/nouveau/nouveau_exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ nouveau_exec_job_timeout(struct nouveau_job *job)
213213

214214
nouveau_sched_entity_fini(job->entity);
215215

216-
return DRM_GPU_SCHED_STAT_ENODEV;
216+
return DRM_GPU_SCHED_STAT_NOMINAL;
217217
}
218218

219219
static struct nouveau_job_ops nouveau_exec_job_ops = {

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
207207
int
208208
nouveau_fence_emit(struct nouveau_fence *fence)
209209
{
210-
struct nouveau_channel *chan = fence->channel;
210+
struct nouveau_channel *chan = unrcu_pointer(fence->channel);
211211
struct nouveau_fence_chan *fctx = chan->fence;
212212
struct nouveau_fence_priv *priv = (void*)chan->drm->fence;
213213
int ret;

drivers/gpu/drm/nouveau/nouveau_sched.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,20 @@ nouveau_sched_run_job(struct drm_sched_job *sched_job)
375375
static enum drm_gpu_sched_stat
376376
nouveau_sched_timedout_job(struct drm_sched_job *sched_job)
377377
{
378+
struct drm_gpu_scheduler *sched = sched_job->sched;
378379
struct nouveau_job *job = to_nouveau_job(sched_job);
380+
enum drm_gpu_sched_stat stat = DRM_GPU_SCHED_STAT_NOMINAL;
379381

380-
NV_PRINTK(warn, job->cli, "Job timed out.\n");
382+
drm_sched_stop(sched, sched_job);
381383

382384
if (job->ops->timeout)
383-
return job->ops->timeout(job);
385+
stat = job->ops->timeout(job);
386+
else
387+
NV_PRINTK(warn, job->cli, "Generic job timeout.\n");
388+
389+
drm_sched_start(sched, true);
384390

385-
return DRM_GPU_SCHED_STAT_ENODEV;
391+
return stat;
386392
}
387393

388394
static void

drivers/gpu/drm/tests/drm_mm_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ static void drm_test_mm_insert_range(struct kunit *test)
939939
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size, 0, max - 1));
940940
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size, 0, max / 2));
941941
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size,
942-
max / 2, max / 2));
942+
max / 2, max));
943943
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size,
944944
max / 4 + 1, 3 * max / 4 - 1));
945945

drivers/gpu/drm/virtio/virtgpu_submit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ static void virtio_gpu_complete_submit(struct virtio_gpu_submit *submit)
361361
submit->buf = NULL;
362362
submit->buflist = NULL;
363363
submit->sync_file = NULL;
364-
submit->out_fence = NULL;
365364
submit->out_fence_fd = -1;
366365
}
367366

drivers/video/console/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ config DUMMY_CONSOLE_ROWS
7373
config FRAMEBUFFER_CONSOLE
7474
bool "Framebuffer Console support"
7575
depends on FB_CORE && !UML
76+
default DRM_FBDEV_EMULATION
7677
select VT_HW_CONSOLE_BINDING
7778
select CRC32
7879
select FONT_SUPPORT

0 commit comments

Comments
 (0)