Skip to content

Commit 83e8d8b

Browse files
committed
Merge tag 'drm-misc-next-fixes-2026-04-09' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
Short summary of fixes pull: dma-buf: - fence: fix docs for dma_fence_unlock_irqrestore() fb-helper: - unlock in error path gem-shmem: - fix PMD write update gem-vram: - remove obsolete documentation ivpu: - fix device-recovery handling Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patch.msgid.link/[email protected]
2 parents 9fb0106 + 4aa0dea commit 83e8d8b

5 files changed

Lines changed: 45 additions & 22 deletions

File tree

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ static void ivpu_job_timeout_work(struct work_struct *work)
221221

222222
abort:
223223
atomic_set(&vdev->job_timeout_counter, 0);
224+
225+
if (vdev->fw->sched_mode == VPU_SCHEDULING_MODE_OS) {
226+
ivpu_pm_trigger_recovery(vdev, "Job timeout");
227+
return;
228+
}
229+
224230
ivpu_jsm_state_dump(vdev);
225231
ivpu_dev_coredump(vdev);
226232
queue_work(system_percpu_wq, &vdev->context_abort_work);

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,8 +1627,10 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
16271627
drm_client_modeset_probe(&fb_helper->client, width, height);
16281628

16291629
info = drm_fb_helper_alloc_info(fb_helper);
1630-
if (IS_ERR(info))
1630+
if (IS_ERR(info)) {
1631+
mutex_unlock(&fb_helper->lock);
16311632
return PTR_ERR(info);
1633+
}
16321634

16331635
ret = drm_fb_helper_single_fb_probe(fb_helper);
16341636
if (ret < 0) {

drivers/gpu/drm/drm_gem_shmem_helper.c

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,21 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev,
554554
}
555555
EXPORT_SYMBOL_GPL(drm_gem_shmem_dumb_create);
556556

557+
static void drm_gem_shmem_record_mkwrite(struct vm_fault *vmf)
558+
{
559+
struct vm_area_struct *vma = vmf->vma;
560+
struct drm_gem_object *obj = vma->vm_private_data;
561+
struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
562+
loff_t num_pages = obj->size >> PAGE_SHIFT;
563+
pgoff_t page_offset = vmf->pgoff - vma->vm_pgoff; /* page offset within VMA */
564+
565+
if (drm_WARN_ON(obj->dev, !shmem->pages || page_offset >= num_pages))
566+
return;
567+
568+
file_update_time(vma->vm_file);
569+
folio_mark_dirty(page_folio(shmem->pages[page_offset]));
570+
}
571+
557572
static vm_fault_t try_insert_pfn(struct vm_fault *vmf, unsigned int order,
558573
unsigned long pfn)
559574
{
@@ -566,8 +581,23 @@ static vm_fault_t try_insert_pfn(struct vm_fault *vmf, unsigned int order,
566581

567582
if (aligned &&
568583
folio_test_pmd_mappable(page_folio(pfn_to_page(pfn)))) {
584+
vm_fault_t ret;
585+
569586
pfn &= PMD_MASK >> PAGE_SHIFT;
570-
return vmf_insert_pfn_pmd(vmf, pfn, false);
587+
588+
/* Unlike PTEs which are automatically upgraded to
589+
* writeable entries, the PMD upgrades go through
590+
* .huge_fault(). Make sure we pass the "write" info
591+
* along in that case.
592+
* This also means we have to record the write fault
593+
* here, instead of in .pfn_mkwrite().
594+
*/
595+
ret = vmf_insert_pfn_pmd(vmf, pfn,
596+
vmf->flags & FAULT_FLAG_WRITE);
597+
if (ret == VM_FAULT_NOPAGE && (vmf->flags & FAULT_FLAG_WRITE))
598+
drm_gem_shmem_record_mkwrite(vmf);
599+
600+
return ret;
571601
}
572602
#endif
573603
}
@@ -655,19 +685,7 @@ static void drm_gem_shmem_vm_close(struct vm_area_struct *vma)
655685

656686
static vm_fault_t drm_gem_shmem_pfn_mkwrite(struct vm_fault *vmf)
657687
{
658-
struct vm_area_struct *vma = vmf->vma;
659-
struct drm_gem_object *obj = vma->vm_private_data;
660-
struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj);
661-
loff_t num_pages = obj->size >> PAGE_SHIFT;
662-
pgoff_t page_offset = vmf->pgoff - vma->vm_pgoff; /* page offset within VMA */
663-
664-
if (drm_WARN_ON(obj->dev, !shmem->pages || page_offset >= num_pages))
665-
return VM_FAULT_SIGBUS;
666-
667-
file_update_time(vma->vm_file);
668-
669-
folio_mark_dirty(page_folio(shmem->pages[page_offset]));
670-
688+
drm_gem_shmem_record_mkwrite(vmf);
671689
return 0;
672690
}
673691

drivers/gpu/drm/drm_gem_vram_helper.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,12 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs;
4949
* To initialize the VRAM helper library call drmm_vram_helper_init().
5050
* The function allocates and initializes an instance of &struct drm_vram_mm
5151
* in &struct drm_device.vram_mm . Use &DRM_GEM_VRAM_DRIVER to initialize
52-
* &struct drm_driver and &DRM_VRAM_MM_FILE_OPERATIONS to initialize
52+
* &struct drm_driver and &DEFINE_DRM_GEM_FOPS to define
5353
* &struct file_operations; as illustrated below.
5454
*
5555
* .. code-block:: c
5656
*
57-
* struct file_operations fops ={
58-
* .owner = THIS_MODULE,
59-
* DRM_VRAM_MM_FILE_OPERATION
60-
* };
57+
* DEFINE_DRM_GEM_FOPS(fops);
6158
* struct drm_driver drv = {
6259
* .driver_feature = DRM_ ... ,
6360
* .fops = &fops,

include/linux/dma-fence.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ static inline spinlock_t *dma_fence_spinlock(struct dma_fence *fence)
408408
/**
409409
* dma_fence_unlock_irqrestore - unlock the fence and irqrestore
410410
* @fence: the fence to unlock
411-
* @flags the CPU flags to restore
411+
* @flags: the CPU flags to restore
412412
*
413-
* Unlock the fence, allowing it to change it's state to signaled again.
413+
* Unlock the fence, allowing it to change its state to signaled again.
414414
*/
415415
#define dma_fence_unlock_irqrestore(fence, flags) \
416416
spin_unlock_irqrestore(dma_fence_spinlock(fence), flags)

0 commit comments

Comments
 (0)