Skip to content

Commit 5d2fdb2

Browse files
committed
Merge tag 'gvt-next-fixes-2023-02-23' of https://github.com/intel/gvt-linux into drm-intel-next-fixes
gvt-next-fixes-2023-02-23 - use debugfs attribute for gvt debugfs entries (Deepak R Varma) - fix memory leak in vgpu destroy for debugfs_lookup() then remove (Greg KH) - fix DRM_I915_GVT kconfig symbol to unbreak menu presentation (Randy Dunlap) - fix typos (Deepak R Varma, Colin Ian King) Signed-off-by: Jani Nikula <[email protected]> From: Zhenyu Wang <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/Y/co4cy10KM1/2uX@debian-scheme
2 parents 8563616 + 0b93efc commit 5d2fdb2

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

drivers/gpu/drm/i915/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ config DRM_I915_USERPTR
118118

119119
If in doubt, say "Y".
120120

121-
config DRM_I915_GVT
122-
bool
123-
124121
config DRM_I915_GVT_KVMGT
125122
tristate "Enable KVM host support Intel GVT-g graphics virtualization"
126123
depends on DRM_I915
@@ -171,3 +168,6 @@ menu "drm/i915 Unstable Evolution"
171168
depends on DRM_I915
172169
source "drivers/gpu/drm/i915/Kconfig.unstable"
173170
endmenu
171+
172+
config DRM_I915_GVT
173+
bool

drivers/gpu/drm/i915/gvt/debugfs.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ vgpu_scan_nonprivbb_set(void *data, u64 val)
147147
return 0;
148148
}
149149

150-
DEFINE_SIMPLE_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
151-
vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
152-
"0x%llx\n");
150+
DEFINE_DEBUGFS_ATTRIBUTE(vgpu_scan_nonprivbb_fops,
151+
vgpu_scan_nonprivbb_get, vgpu_scan_nonprivbb_set,
152+
"0x%llx\n");
153153

154154
static int vgpu_status_get(void *data, u64 *val)
155155
{
@@ -165,7 +165,7 @@ static int vgpu_status_get(void *data, u64 *val)
165165
return 0;
166166
}
167167

168-
DEFINE_SIMPLE_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
168+
DEFINE_DEBUGFS_ATTRIBUTE(vgpu_status_fops, vgpu_status_get, NULL, "0x%llx\n");
169169

170170
/**
171171
* intel_gvt_debugfs_add_vgpu - register debugfs entries for a vGPU
@@ -180,10 +180,10 @@ void intel_gvt_debugfs_add_vgpu(struct intel_vgpu *vgpu)
180180

181181
debugfs_create_file("mmio_diff", 0444, vgpu->debugfs, vgpu,
182182
&vgpu_mmio_diff_fops);
183-
debugfs_create_file("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
184-
&vgpu_scan_nonprivbb_fops);
185-
debugfs_create_file("status", 0644, vgpu->debugfs, vgpu,
186-
&vgpu_status_fops);
183+
debugfs_create_file_unsafe("scan_nonprivbb", 0644, vgpu->debugfs, vgpu,
184+
&vgpu_scan_nonprivbb_fops);
185+
debugfs_create_file_unsafe("status", 0644, vgpu->debugfs, vgpu,
186+
&vgpu_status_fops);
187187
}
188188

189189
/**

drivers/gpu/drm/i915/gvt/firmware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static int verify_firmware(struct intel_gvt *gvt,
171171
mem = (fw->data + h->cfg_space_offset);
172172

173173
id = *(u16 *)(mem + PCI_VENDOR_ID);
174-
VERIFY("vender id", id, pdev->vendor);
174+
VERIFY("vendor id", id, pdev->vendor);
175175

176176
id = *(u16 *)(mem + PCI_DEVICE_ID);
177177
VERIFY("device id", id, pdev->device);

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev)
699699

700700
clear_bit(INTEL_VGPU_STATUS_ATTACHED, vgpu->status);
701701

702-
debugfs_remove(debugfs_lookup(KVMGT_DEBUGFS_FILENAME, vgpu->debugfs));
702+
debugfs_lookup_and_remove(KVMGT_DEBUGFS_FILENAME, vgpu->debugfs);
703703

704704
kvm_page_track_unregister_notifier(vgpu->vfio_device.kvm,
705705
&vgpu->track_node);

drivers/gpu/drm/i915/gvt/vgpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ int intel_gvt_create_vgpu(struct intel_vgpu *vgpu,
323323
ret = idr_alloc(&gvt->vgpu_idr, vgpu, IDLE_VGPU_IDR + 1, GVT_MAX_VGPU,
324324
GFP_KERNEL);
325325
if (ret < 0)
326-
goto out_unlock;;
326+
goto out_unlock;
327327

328328
vgpu->id = ret;
329329
vgpu->sched_ctl.weight = conf->weight;

0 commit comments

Comments
 (0)