Skip to content

Commit 6366ffa

Browse files
committed
Merge tag 'drm-misc-fixes-2023-10-26' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull: amdgpu: - ignore duplicated BOs in CS parser - remove redundant call to amdgpu_ctx_priority_is_valid() amdkfd: - reserve fence slot while locking BO dp_mst: - Fix NULL deref in get_mst_branch_device_by_guid_helper() logicvc: - Kconfig: Select REGMAP and REGMAP_MMIO ivpu: - Fix missing VPUIP interrupts Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 05d3ef8 + b132ac5 commit 6366ffa

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

drivers/accel/ivpu/ivpu_hw_37xx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,6 @@ static u32 ivpu_hw_37xx_irqb_handler(struct ivpu_device *vdev, int irq)
940940
if (status == 0)
941941
return 0;
942942

943-
/* Disable global interrupt before handling local buttress interrupts */
944-
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
945-
946943
if (REG_TEST_FLD(VPU_37XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
947944
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq: %08x",
948945
REGB_RD32(VPU_37XX_BUTTRESS_CURRENT_PLL));
@@ -974,9 +971,6 @@ static u32 ivpu_hw_37xx_irqb_handler(struct ivpu_device *vdev, int irq)
974971
else
975972
REGB_WR32(VPU_37XX_BUTTRESS_INTERRUPT_STAT, status);
976973

977-
/* Re-enable global interrupt */
978-
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
979-
980974
if (schedule_recovery)
981975
ivpu_pm_schedule_recovery(vdev);
982976

@@ -988,9 +982,14 @@ static irqreturn_t ivpu_hw_37xx_irq_handler(int irq, void *ptr)
988982
struct ivpu_device *vdev = ptr;
989983
u32 ret_irqv, ret_irqb;
990984

985+
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
986+
991987
ret_irqv = ivpu_hw_37xx_irqv_handler(vdev, irq);
992988
ret_irqb = ivpu_hw_37xx_irqb_handler(vdev, irq);
993989

990+
/* Re-enable global interrupts to re-trigger MSI for pending interrupts */
991+
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
992+
994993
return IRQ_RETVAL(ret_irqb | ret_irqv);
995994
}
996995

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static int reserve_bo_and_vm(struct kgd_mem *mem,
11031103
if (unlikely(ret))
11041104
goto error;
11051105

1106-
ret = drm_exec_lock_obj(&ctx->exec, &bo->tbo.base);
1106+
ret = drm_exec_prepare_obj(&ctx->exec, &bo->tbo.base, 1);
11071107
drm_exec_retry_on_contention(&ctx->exec);
11081108
if (unlikely(ret))
11091109
goto error;

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p,
6565
}
6666

6767
amdgpu_sync_create(&p->sync);
68-
drm_exec_init(&p->exec, DRM_EXEC_INTERRUPTIBLE_WAIT);
68+
drm_exec_init(&p->exec, DRM_EXEC_INTERRUPTIBLE_WAIT |
69+
DRM_EXEC_IGNORE_DUPLICATES);
6970
return 0;
7071
}
7172

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ bool amdgpu_ctx_priority_is_valid(int32_t ctx_prio)
5555
return true;
5656
default:
5757
case AMDGPU_CTX_PRIORITY_UNSET:
58+
/* UNSET priority is not valid and we don't carry that
59+
* around, but set it to NORMAL in the only place this
60+
* function is called, amdgpu_ctx_ioctl().
61+
*/
5862
return false;
5963
}
6064
}
@@ -95,9 +99,6 @@ amdgpu_ctx_to_drm_sched_prio(int32_t ctx_prio)
9599
static int amdgpu_ctx_priority_permit(struct drm_file *filp,
96100
int32_t priority)
97101
{
98-
if (!amdgpu_ctx_priority_is_valid(priority))
99-
return -EINVAL;
100-
101102
/* NORMAL and below are accessible by everyone */
102103
if (priority <= AMDGPU_CTX_PRIORITY_NORMAL)
103104
return 0;
@@ -632,8 +633,6 @@ static int amdgpu_ctx_query2(struct amdgpu_device *adev,
632633
return 0;
633634
}
634635

635-
636-
637636
static int amdgpu_ctx_stable_pstate(struct amdgpu_device *adev,
638637
struct amdgpu_fpriv *fpriv, uint32_t id,
639638
bool set, u32 *stable_pstate)
@@ -676,8 +675,10 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
676675
id = args->in.ctx_id;
677676
priority = args->in.priority;
678677

679-
/* For backwards compatibility reasons, we need to accept
680-
* ioctls with garbage in the priority field */
678+
/* For backwards compatibility, we need to accept ioctls with garbage
679+
* in the priority field. Garbage values in the priority field, result
680+
* in the priority being set to NORMAL.
681+
*/
681682
if (!amdgpu_ctx_priority_is_valid(priority))
682683
priority = AMDGPU_CTX_PRIORITY_NORMAL;
683684

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,14 +2574,14 @@ static struct drm_dp_mst_branch *get_mst_branch_device_by_guid_helper(
25742574
struct drm_dp_mst_branch *found_mstb;
25752575
struct drm_dp_mst_port *port;
25762576

2577+
if (!mstb)
2578+
return NULL;
2579+
25772580
if (memcmp(mstb->guid, guid, 16) == 0)
25782581
return mstb;
25792582

25802583

25812584
list_for_each_entry(port, &mstb->ports, next) {
2582-
if (!port->mstb)
2583-
continue;
2584-
25852585
found_mstb = get_mst_branch_device_by_guid_helper(port->mstb, guid);
25862586

25872587
if (found_mstb)

drivers/gpu/drm/logicvc/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ config DRM_LOGICVC
55
select DRM_KMS_HELPER
66
select DRM_KMS_DMA_HELPER
77
select DRM_GEM_DMA_HELPER
8+
select REGMAP
9+
select REGMAP_MMIO
810
help
911
DRM display driver for the logiCVC programmable logic block from Xylon

0 commit comments

Comments
 (0)