Skip to content

Commit 750b958

Browse files
committed
Merge tag 'drm-fixes-2023-10-27' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This is the final set of fixes for 6.6, just misc bits mainly in amdgpu and i915, nothing too noteworthy. amdgpu: - ignore duplicated BOs in CS parser - remove redundant call to amdgpu_ctx_priority_is_valid() - Extend VI APSM quirks to more platforms 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 i915: - Determine context valid in OA reports - Hold GT forcewake during steering operations - Check if PMU is closed before stopping event" * tag 'drm-fixes-2023-10-27' of git://anongit.freedesktop.org/drm/drm: accel/ivpu/37xx: Fix missing VPUIP interrupts drm/amd: Disable ASPM for VI w/ all Intel systems drm/i915/pmu: Check if pmu is closed before stopping event drm/i915/mcr: Hold GT forcewake during steering operations drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO drm/i915/perf: Determine context valid in OA reports drm/amdkfd: reserve a fence slot while locking the BO drm/amdgpu: Remove redundant call to priority_is_valid() drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() drm/amdgpu: ignore duplicate BOs again
2 parents 3a568e3 + 4411782 commit 750b958

File tree

10 files changed

+55
-23
lines changed

10 files changed

+55
-23
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/amd/amdgpu/vi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ static void vi_program_aspm(struct amdgpu_device *adev)
11241124
bool bL1SS = false;
11251125
bool bClkReqSupport = true;
11261126

1127-
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
1127+
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_pcie_dynamic_switching_supported())
11281128
return;
11291129

11301130
if (adev->flags & AMD_IS_APU ||

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/i915/gt/intel_gt_mcr.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,26 @@ void intel_gt_mcr_lock(struct intel_gt *gt, unsigned long *flags)
376376
* driver threads, but also with hardware/firmware agents. A dedicated
377377
* locking register is used.
378378
*/
379-
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70))
379+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) {
380+
/*
381+
* The steering control and semaphore registers are inside an
382+
* "always on" power domain with respect to RC6. However there
383+
* are some issues if higher-level platform sleep states are
384+
* entering/exiting at the same time these registers are
385+
* accessed. Grabbing GT forcewake and holding it over the
386+
* entire lock/steer/unlock cycle ensures that those sleep
387+
* states have been fully exited before we access these
388+
* registers. This wakeref will be released in the unlock
389+
* routine.
390+
*
391+
* This is expected to become a formally documented/numbered
392+
* workaround soon.
393+
*/
394+
intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_GT);
395+
380396
err = wait_for(intel_uncore_read_fw(gt->uncore,
381397
MTL_STEER_SEMAPHORE) == 0x1, 100);
398+
}
382399

383400
/*
384401
* Even on platforms with a hardware lock, we'll continue to grab
@@ -415,8 +432,11 @@ void intel_gt_mcr_unlock(struct intel_gt *gt, unsigned long flags)
415432
{
416433
spin_unlock_irqrestore(&gt->mcr_lock, flags);
417434

418-
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70))
435+
if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) {
419436
intel_uncore_write_fw(gt->uncore, MTL_STEER_SEMAPHORE, 0x1);
437+
438+
intel_uncore_forcewake_put(gt->uncore, FORCEWAKE_GT);
439+
}
420440
}
421441

422442
/**

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ static void oa_report_id_clear(struct i915_perf_stream *stream, u32 *report)
482482
static bool oa_report_ctx_invalid(struct i915_perf_stream *stream, void *report)
483483
{
484484
return !(oa_report_id(stream, report) &
485-
stream->perf->gen8_valid_ctx_bit) &&
486-
GRAPHICS_VER(stream->perf->i915) <= 11;
485+
stream->perf->gen8_valid_ctx_bit);
487486
}
488487

489488
static u64 oa_timestamp(struct i915_perf_stream *stream, void *report)
@@ -5106,6 +5105,7 @@ static void i915_perf_init_info(struct drm_i915_private *i915)
51065105
perf->gen8_valid_ctx_bit = BIT(16);
51075106
break;
51085107
case 12:
5108+
perf->gen8_valid_ctx_bit = BIT(16);
51095109
/*
51105110
* Calculate offset at runtime in oa_pin_context for gen12 and
51115111
* cache the value in perf->ctx_oactxctrl_offset.

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,18 @@ static void i915_pmu_event_start(struct perf_event *event, int flags)
832832

833833
static void i915_pmu_event_stop(struct perf_event *event, int flags)
834834
{
835+
struct drm_i915_private *i915 =
836+
container_of(event->pmu, typeof(*i915), pmu.base);
837+
struct i915_pmu *pmu = &i915->pmu;
838+
839+
if (pmu->closed)
840+
goto out;
841+
835842
if (flags & PERF_EF_UPDATE)
836843
i915_pmu_event_read(event);
837844
i915_pmu_disable(event);
845+
846+
out:
838847
event->hw.state = PERF_HES_STOPPED;
839848
}
840849

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)