Skip to content

Commit befcc89

Browse files
committed
Merge tag 'drm-fixes-2024-10-11' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Weekly fixes haul for drm, lots of small fixes all over, amdgpu, xe lead the way, some minor nouveau and radeon fixes, and then a bunch of misc all over. Nothing too scary or out of the unusual. sched: - Avoid leaking lockdep map fbdev-dma: - Only clean up deferred I/O if instanciated amdgpu: - Fix invalid UBSAN warnings - Fix artifacts in MPO transitions - Hibernation fix amdkfd: - Fix an eviction fence leak radeon: - Add late register for connectors - Always set GEM function pointers i915: - HDCP refcount fix nouveau: - dmem: Fix privileged error in copy engine channel; Fix possible data leak in migrate_to_ram() - gsp: Fix coding style v3d: - Stop active perfmon before destroying it vc4: - Stop active perfmon before destroying it xe: - Drop GuC submit_wq pool - Fix error checking with xa_store() - Fix missing freq restore on GSC load error - Fix wedged_mode file permission - Fix use-after-free in ct communication" * tag 'drm-fixes-2024-10-11' of https://gitlab.freedesktop.org/drm/kernel: drm/fbdev-dma: Only cleanup deferred I/O if necessary drm/xe: Make wedged_mode debugfs writable drm/xe: Restore GT freq on GSC load error drm/xe/guc_submit: fix xa_store() error checking drm/xe/ct: fix xa_store() error checking drm/xe/ct: prevent UAF in send_recv() drm/radeon: always set GEM function pointer nouveau/dmem: Fix vulnerability in migrate_to_ram upon copy error nouveau/dmem: Fix privileged error in copy engine channel drm/amd/display: fix hibernate entry for DCN35+ drm/amd/display: Clear update flags after update has been applied drm/amdgpu: partially revert powerplay `__counted_by` changes drm/radeon: add late_register for connector drm/amdkfd: Fix an eviction fence leak drm/vc4: Stop the active perfmon before being destroyed drm/v3d: Stop the active perfmon before being destroyed drm/i915/hdcp: fix connector refcounting drm/nouveau/gsp: remove extraneous ; after mutex drm/xe: Drop GuC submit_wq pool drm/sched: Use drm sched lockdep map for submit_wq
2 parents 1d227fc + ac44ff7 commit befcc89

File tree

22 files changed

+149
-158
lines changed

22 files changed

+149
-158
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
14391439
list_add_tail(&vm->vm_list_node,
14401440
&(vm->process_info->vm_list_head));
14411441
vm->process_info->n_vms++;
1442-
1443-
*ef = dma_fence_get(&vm->process_info->eviction_fence->base);
1442+
if (ef)
1443+
*ef = dma_fence_get(&vm->process_info->eviction_fence->base);
14441444
mutex_unlock(&vm->process_info->lock);
14451445

14461446
return 0;

drivers/gpu/drm/amd/amdkfd/kfd_process.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,12 +1702,15 @@ int kfd_process_device_init_vm(struct kfd_process_device *pdd,
17021702

17031703
ret = amdgpu_amdkfd_gpuvm_acquire_process_vm(dev->adev, avm,
17041704
&p->kgd_process_info,
1705-
&ef);
1705+
p->ef ? NULL : &ef);
17061706
if (ret) {
17071707
dev_err(dev->adev->dev, "Failed to create process VM object\n");
17081708
return ret;
17091709
}
1710-
RCU_INIT_POINTER(p->ef, ef);
1710+
1711+
if (!p->ef)
1712+
RCU_INIT_POINTER(p->ef, ef);
1713+
17111714
pdd->drm_priv = drm_file->private_data;
17121715

17131716
ret = kfd_process_device_reserve_ib_mem(pdd);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,10 +2972,11 @@ static int dm_suspend(void *handle)
29722972

29732973
hpd_rx_irq_work_suspend(dm);
29742974

2975-
if (adev->dm.dc->caps.ips_support)
2976-
dc_allow_idle_optimizations(adev->dm.dc, true);
2977-
29782975
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
2976+
2977+
if (dm->dc->caps.ips_support && adev->in_s0ix)
2978+
dc_allow_idle_optimizations(dm->dc, true);
2979+
29792980
dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D3);
29802981

29812982
return 0;

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5065,11 +5065,26 @@ static bool update_planes_and_stream_v3(struct dc *dc,
50655065
return true;
50665066
}
50675067

5068+
static void clear_update_flags(struct dc_surface_update *srf_updates,
5069+
int surface_count, struct dc_stream_state *stream)
5070+
{
5071+
int i;
5072+
5073+
if (stream)
5074+
stream->update_flags.raw = 0;
5075+
5076+
for (i = 0; i < surface_count; i++)
5077+
if (srf_updates[i].surface)
5078+
srf_updates[i].surface->update_flags.raw = 0;
5079+
}
5080+
50685081
bool dc_update_planes_and_stream(struct dc *dc,
50695082
struct dc_surface_update *srf_updates, int surface_count,
50705083
struct dc_stream_state *stream,
50715084
struct dc_stream_update *stream_update)
50725085
{
5086+
bool ret = false;
5087+
50735088
dc_exit_ips_for_hw_access(dc);
50745089
/*
50755090
* update planes and stream version 3 separates FULL and FAST updates
@@ -5086,10 +5101,16 @@ bool dc_update_planes_and_stream(struct dc *dc,
50865101
* features as they are now transparent to the new sequence.
50875102
*/
50885103
if (dc->ctx->dce_version >= DCN_VERSION_4_01)
5089-
return update_planes_and_stream_v3(dc, srf_updates,
5104+
ret = update_planes_and_stream_v3(dc, srf_updates,
50905105
surface_count, stream, stream_update);
5091-
return update_planes_and_stream_v2(dc, srf_updates,
5106+
else
5107+
ret = update_planes_and_stream_v2(dc, srf_updates,
50925108
surface_count, stream, stream_update);
5109+
5110+
if (ret)
5111+
clear_update_flags(srf_updates, surface_count, stream);
5112+
5113+
return ret;
50935114
}
50945115

50955116
void dc_commit_updates_for_stream(struct dc *dc,
@@ -5099,24 +5120,26 @@ void dc_commit_updates_for_stream(struct dc *dc,
50995120
struct dc_stream_update *stream_update,
51005121
struct dc_state *state)
51015122
{
5123+
bool ret = false;
5124+
51025125
dc_exit_ips_for_hw_access(dc);
51035126
/* TODO: Since change commit sequence can have a huge impact,
51045127
* we decided to only enable it for DCN3x. However, as soon as
51055128
* we get more confident about this change we'll need to enable
51065129
* the new sequence for all ASICs.
51075130
*/
51085131
if (dc->ctx->dce_version >= DCN_VERSION_4_01) {
5109-
update_planes_and_stream_v3(dc, srf_updates, surface_count,
5132+
ret = update_planes_and_stream_v3(dc, srf_updates, surface_count,
51105133
stream, stream_update);
5111-
return;
5112-
}
5113-
if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
5114-
update_planes_and_stream_v2(dc, srf_updates, surface_count,
5134+
} else if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
5135+
ret = update_planes_and_stream_v2(dc, srf_updates, surface_count,
51155136
stream, stream_update);
5116-
return;
5117-
}
5118-
update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
5119-
stream_update, state);
5137+
} else
5138+
ret = update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
5139+
stream_update, state);
5140+
5141+
if (ret)
5142+
clear_update_flags(srf_updates, surface_count, stream);
51205143
}
51215144

51225145
uint8_t dc_get_current_stream_count(struct dc *dc)

drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct vi_dpm_level {
6060

6161
struct vi_dpm_table {
6262
uint32_t count;
63-
struct vi_dpm_level dpm_level[] __counted_by(count);
63+
struct vi_dpm_level dpm_level[];
6464
};
6565

6666
#define PCIE_PERF_REQ_REMOVE_REGISTRY 0
@@ -91,7 +91,7 @@ struct phm_set_power_state_input {
9191

9292
struct phm_clock_array {
9393
uint32_t count;
94-
uint32_t values[] __counted_by(count);
94+
uint32_t values[];
9595
};
9696

9797
struct phm_clock_voltage_dependency_record {
@@ -123,7 +123,7 @@ struct phm_acpclock_voltage_dependency_record {
123123

124124
struct phm_clock_voltage_dependency_table {
125125
uint32_t count;
126-
struct phm_clock_voltage_dependency_record entries[] __counted_by(count);
126+
struct phm_clock_voltage_dependency_record entries[];
127127
};
128128

129129
struct phm_phase_shedding_limits_record {
@@ -140,7 +140,7 @@ struct phm_uvd_clock_voltage_dependency_record {
140140

141141
struct phm_uvd_clock_voltage_dependency_table {
142142
uint8_t count;
143-
struct phm_uvd_clock_voltage_dependency_record entries[] __counted_by(count);
143+
struct phm_uvd_clock_voltage_dependency_record entries[];
144144
};
145145

146146
struct phm_acp_clock_voltage_dependency_record {
@@ -150,7 +150,7 @@ struct phm_acp_clock_voltage_dependency_record {
150150

151151
struct phm_acp_clock_voltage_dependency_table {
152152
uint32_t count;
153-
struct phm_acp_clock_voltage_dependency_record entries[] __counted_by(count);
153+
struct phm_acp_clock_voltage_dependency_record entries[];
154154
};
155155

156156
struct phm_vce_clock_voltage_dependency_record {
@@ -161,32 +161,32 @@ struct phm_vce_clock_voltage_dependency_record {
161161

162162
struct phm_phase_shedding_limits_table {
163163
uint32_t count;
164-
struct phm_phase_shedding_limits_record entries[] __counted_by(count);
164+
struct phm_phase_shedding_limits_record entries[];
165165
};
166166

167167
struct phm_vceclock_voltage_dependency_table {
168168
uint8_t count;
169-
struct phm_vceclock_voltage_dependency_record entries[] __counted_by(count);
169+
struct phm_vceclock_voltage_dependency_record entries[];
170170
};
171171

172172
struct phm_uvdclock_voltage_dependency_table {
173173
uint8_t count;
174-
struct phm_uvdclock_voltage_dependency_record entries[] __counted_by(count);
174+
struct phm_uvdclock_voltage_dependency_record entries[];
175175
};
176176

177177
struct phm_samuclock_voltage_dependency_table {
178178
uint8_t count;
179-
struct phm_samuclock_voltage_dependency_record entries[] __counted_by(count);
179+
struct phm_samuclock_voltage_dependency_record entries[];
180180
};
181181

182182
struct phm_acpclock_voltage_dependency_table {
183183
uint32_t count;
184-
struct phm_acpclock_voltage_dependency_record entries[] __counted_by(count);
184+
struct phm_acpclock_voltage_dependency_record entries[];
185185
};
186186

187187
struct phm_vce_clock_voltage_dependency_table {
188188
uint8_t count;
189-
struct phm_vce_clock_voltage_dependency_record entries[] __counted_by(count);
189+
struct phm_vce_clock_voltage_dependency_record entries[];
190190
};
191191

192192

@@ -393,7 +393,7 @@ union phm_cac_leakage_record {
393393

394394
struct phm_cac_leakage_table {
395395
uint32_t count;
396-
union phm_cac_leakage_record entries[] __counted_by(count);
396+
union phm_cac_leakage_record entries[];
397397
};
398398

399399
struct phm_samu_clock_voltage_dependency_record {
@@ -404,7 +404,7 @@ struct phm_samu_clock_voltage_dependency_record {
404404

405405
struct phm_samu_clock_voltage_dependency_table {
406406
uint8_t count;
407-
struct phm_samu_clock_voltage_dependency_record entries[] __counted_by(count);
407+
struct phm_samu_clock_voltage_dependency_record entries[];
408408
};
409409

410410
struct phm_cac_tdp_table {

drivers/gpu/drm/drm_fbdev_dma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static void drm_fbdev_dma_fb_destroy(struct fb_info *info)
5050
if (!fb_helper->dev)
5151
return;
5252

53-
fb_deferred_io_cleanup(info);
53+
if (info->fbdefio)
54+
fb_deferred_io_cleanup(info);
5455
drm_fb_helper_fini(fb_helper);
5556

5657
drm_client_buffer_vunmap(fb_helper->buffer);

drivers/gpu/drm/i915/display/intel_hdcp.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,8 @@ static void intel_hdcp_update_value(struct intel_connector *connector,
10941094
hdcp->value = value;
10951095
if (update_property) {
10961096
drm_connector_get(&connector->base);
1097-
queue_work(i915->unordered_wq, &hdcp->prop_work);
1097+
if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
1098+
drm_connector_put(&connector->base);
10981099
}
10991100
}
11001101

@@ -2524,7 +2525,8 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
25242525
mutex_lock(&hdcp->mutex);
25252526
hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
25262527
drm_connector_get(&connector->base);
2527-
queue_work(i915->unordered_wq, &hdcp->prop_work);
2528+
if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
2529+
drm_connector_put(&connector->base);
25282530
mutex_unlock(&hdcp->mutex);
25292531
}
25302532

@@ -2541,7 +2543,9 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
25412543
*/
25422544
if (!desired_and_not_enabled && !content_protection_type_changed) {
25432545
drm_connector_get(&connector->base);
2544-
queue_work(i915->unordered_wq, &hdcp->prop_work);
2546+
if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
2547+
drm_connector_put(&connector->base);
2548+
25452549
}
25462550
}
25472551

drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct nvkm_gsp {
210210
} *rm;
211211

212212
struct {
213-
struct mutex mutex;;
213+
struct mutex mutex;
214214
struct idr idr;
215215
} client_id;
216216

drivers/gpu/drm/nouveau/nouveau_dmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf)
193193
if (!spage || !(src & MIGRATE_PFN_MIGRATE))
194194
goto done;
195195

196-
dpage = alloc_page_vma(GFP_HIGHUSER, vmf->vma, vmf->address);
196+
dpage = alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vmf->vma, vmf->address);
197197
if (!dpage)
198198
goto done;
199199

drivers/gpu/drm/nouveau/nouveau_drm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ nouveau_accel_ce_init(struct nouveau_drm *drm)
331331
return;
332332
}
333333

334-
ret = nouveau_channel_new(&drm->client, false, runm, NvDmaFB, NvDmaTT, &drm->cechan);
334+
ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
335335
if (ret)
336336
NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
337337
}

0 commit comments

Comments
 (0)