Skip to content

Commit 42e0a87

Browse files
committed
Merge tag 'drm-intel-fixes-2022-07-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix a possible refcount leak in DP MST connector (Hangyu) - Fix on loading guc on ADL-N (Daniele) - Fix vm use-after-free in vma destruction (Thomas) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 7de9636 + 1205807 commit 42e0a87

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
839839
ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
840840
DRM_MODE_CONNECTOR_DisplayPort);
841841
if (ret) {
842+
drm_dp_mst_put_port_malloc(port);
842843
intel_connector_free(intel_connector);
843844
return NULL;
844845
}

drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ __uc_fw_auto_select(struct drm_i915_private *i915, struct intel_uc_fw *uc_fw)
162162
u8 rev = INTEL_REVID(i915);
163163
int i;
164164

165+
/*
166+
* The only difference between the ADL GuC FWs is the HWConfig support.
167+
* ADL-N does not support HWConfig, so we should use the same binary as
168+
* ADL-S, otherwise the GuC might attempt to fetch a config table that
169+
* does not exist.
170+
*/
171+
if (IS_ADLP_N(i915))
172+
p = INTEL_ALDERLAKE_S;
173+
165174
GEM_BUG_ON(uc_fw->type >= ARRAY_SIZE(blobs_all));
166175
fw_blobs = blobs_all[uc_fw->type].blobs;
167176
fw_count = blobs_all[uc_fw->type].count;

drivers/gpu/drm/i915/i915_vma.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,10 +1637,10 @@ static void force_unbind(struct i915_vma *vma)
16371637
GEM_BUG_ON(drm_mm_node_allocated(&vma->node));
16381638
}
16391639

1640-
static void release_references(struct i915_vma *vma, bool vm_ddestroy)
1640+
static void release_references(struct i915_vma *vma, struct intel_gt *gt,
1641+
bool vm_ddestroy)
16411642
{
16421643
struct drm_i915_gem_object *obj = vma->obj;
1643-
struct intel_gt *gt = vma->vm->gt;
16441644

16451645
GEM_BUG_ON(i915_vma_is_active(vma));
16461646

@@ -1695,20 +1695,24 @@ void i915_vma_destroy_locked(struct i915_vma *vma)
16951695

16961696
force_unbind(vma);
16971697
list_del_init(&vma->vm_link);
1698-
release_references(vma, false);
1698+
release_references(vma, vma->vm->gt, false);
16991699
}
17001700

17011701
void i915_vma_destroy(struct i915_vma *vma)
17021702
{
1703+
struct intel_gt *gt;
17031704
bool vm_ddestroy;
17041705

17051706
mutex_lock(&vma->vm->mutex);
17061707
force_unbind(vma);
17071708
list_del_init(&vma->vm_link);
17081709
vm_ddestroy = vma->vm_ddestroy;
17091710
vma->vm_ddestroy = false;
1711+
1712+
/* vma->vm may be freed when releasing vma->vm->mutex. */
1713+
gt = vma->vm->gt;
17101714
mutex_unlock(&vma->vm->mutex);
1711-
release_references(vma, vm_ddestroy);
1715+
release_references(vma, gt, vm_ddestroy);
17121716
}
17131717

17141718
void i915_vma_parked(struct intel_gt *gt)

0 commit comments

Comments
 (0)