drm/i915/gvt: fix high-order allocation failure on late load
diff mbox series

Message ID 1579723824-25711-1-git-send-email-igor.druzhinin@citrix.com
State New
Headers show
  • drm/i915/gvt: fix high-order allocation failure on late load
Related show

Commit Message

Igor Druzhinin Jan. 22, 2020, 8:10 p.m. UTC
If the module happens to be loaded later at runtime there is a chance
memory is already fragmented enough to fail allocation of firmware
blob storage and consequently GVT init. Since it doesn't seem to be
necessary to have the blob contiguous, use vmalloc() instead to avoid
the issue.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
 drivers/gpu/drm/i915/gvt/firmware.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff mbox series

diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
index 049775e..b0c1fda 100644
--- a/drivers/gpu/drm/i915/gvt/firmware.c
+++ b/drivers/gpu/drm/i915/gvt/firmware.c
@@ -146,7 +146,7 @@  void intel_gvt_free_firmware(struct intel_gvt *gvt)
-	kfree(gvt->firmware.mmio);
+	vfree(gvt->firmware.mmio);
 static int verify_firmware(struct intel_gvt *gvt,
@@ -229,7 +229,7 @@  int intel_gvt_load_firmware(struct intel_gvt *gvt)
 	firmware->cfg_space = mem;
-	mem = kmalloc(info->mmio_size, GFP_KERNEL);
+	mem = vmalloc(info->mmio_size);
 	if (!mem) {