[PATCH] drm/i915/gvt: Fix PTE write flush for taking runtime pm properly
Zhenyu Wang
zhenyuw at linux.intel.com
Wed Apr 12 06:22:35 UTC 2017
Make sure to take runtime pm when write PTE flush which ensure to
write to hw properly. This fixes warning during mdev/vgpu creation
which will do ggtt reset.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 9375 at drivers/gpu/drm/i915/intel_drv.h:1748 fwtable_write32+0x1c2/0x1e0 [i915]
RPM wakelock ref not held during HW access
Modules linked in: binfmt_misc(E) snd_hda_codec_hdmi(E) snd_hda_codec_realtek(E) snd_hda_codec_generic(E) kvmgt(E) vfio_mdev(E) mdev(E) vfio_iommu_type1(E) vfio(E) x86_pkg_temp_thermal(E) intel_powerclamp(E) coretemp(E) i915(E) kvm_intel(E) kvm(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) iwlwifi(E) ghash_clmulni_intel(E) pcbc(E) aesni_intel(E) aes_x86_64(E) crypto_simd(E) snd_hda_intel(E) glue_helper(E) cfg80211(E) snd_hda_codec(E) cryptd(E) prime_numbers(E) snd_hwdep(E) snd_hda_core(E) intel_cstate(E) drm_kms_helper(E) snd_pcm(E) drm(E) idma64(E) snd_timer(E) virt_dma(E) snd(E) intel_uncore(E) mei_me(E) joydev(E) iTCO_wdt(E) evdev(E) intel_rapl_perf(E) pcspkr(E) soundcore(E) iTCO_vendor_support(E) shpchp(E) sg(E) i2c_algo_bit(E) mei(E) intel_lpss_pci(E) intel_pch_thermal(E) battery(E)
video(E) intel_lpss_acpi(E) intel_lpss(E) mfd_core(E) tpm_tis(E) tpm_tis_core(E) acpi_pad(E) tpm(E) button(E) ip_tables(E) x_tables(E) autofs4(E) ext4(E) crc16(E) jbd2(E) fscrypto(E) mbcache(E) hid_generic(E) sd_mod(E) hid_logitech_hidpp(E) hid_logitech_dj(E) usbhid(E) crc32c_intel(E) sdhci_pci(E) ahci(E) libahci(E) sdhci(E) mmc_core(E) e1000e(E) ptp(E) pps_core(E) xhci_pci(E) xhci_hcd(E) libata(E) i2c_i801(E) scsi_mod(E) usbcore(E) fan(E) thermal(E) i2c_hid(E) hid(E)
CPU: 1 PID: 9375 Comm: uuid Tainted: G E 4.11.0-rc5-gvt-staging-0405+ #23
Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0039.2016.0316.1747 03/16/2016
Call Trace:
? dump_stack+0x5c/0x81
? __warn+0xbe/0xe0
? warn_slowpath_fmt+0x5a/0x80
? wake_up_klogd+0x37/0x40
? vprintk_emit+0x2ef/0x370
? fwtable_write32+0x1c2/0x1e0 [i915]
? gtt_set_entry64+0xbb/0xd0 [i915]
? intel_vgpu_reset_ggtt+0x88/0xf0 [i915]
? intel_vgpu_init_gtt+0xa5/0x4f0 [i915]
? intel_gvt_create_vgpu+0x1b5/0x250 [i915]
? kobject_put+0x1b/0x50
? intel_vgpu_create+0x4e/0x130 [kvmgt]
? mdev_device_create+0x186/0x2a0 [mdev]
? create_store+0xba/0xe0 [mdev]
? create_store+0xba/0xe0 [mdev]
? kernfs_fop_write+0x109/0x1a0
? kernfs_fop_write+0x109/0x1a0
? __vfs_write+0x33/0x160
? __fput+0x161/0x1d0
? vfs_write+0xb0/0x190
? SyS_write+0x52/0xc0
? exit_to_usermode_loop+0x7a/0xa0
? entry_SYSCALL_64_fastpath+0x1e/0xad
Fixes: d650ac060237 ("drm/i915/gvt: reset the GGTT entry when vGPU created")
Cc: Ping Gao <ping.a.gao at intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
---
drivers/gpu/drm/i915/gvt/gtt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
index 6da4e444e572..38316efb5fed 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.c
+++ b/drivers/gpu/drm/i915/gvt/gtt.c
@@ -249,10 +249,14 @@ static void write_pte64(struct drm_i915_private *dev_priv,
{
void __iomem *addr = (gen8_pte_t __iomem *)dev_priv->ggtt.gsm + index;
+ intel_runtime_pm_get(dev_priv);
+
writeq(pte, addr);
I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
POSTING_READ(GFX_FLSH_CNTL_GEN6);
+
+ intel_runtime_pm_put(dev_priv);
}
static inline struct intel_gvt_gtt_entry *gtt_get_entry64(void *pt,
--
2.11.0
More information about the intel-gvt-dev
mailing list