[PATCH] drm/vmwgfx: Fix some scheduling in atomic bugs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The vmw_gmrid_man_get_node() function calls vmw_host_printf() while
holding a spinlock so these functions need to be atomic.  Generally,
no one expects printf() functions to sleep.

Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index ed9c7b3a1e08..16be71c4c679 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -506,14 +506,14 @@ int vmw_host_printf(const char *fmt, ...)
 		return ret;
 
 	va_start(ap, fmt);
-	log = kvasprintf(GFP_KERNEL, fmt, ap);
+	log = kvasprintf(GFP_ATOMIC, fmt, ap);
 	va_end(ap);
 	if (!log) {
 		DRM_ERROR("Cannot allocate memory for the log message.\n");
 		return -ENOMEM;
 	}
 
-	msg = kasprintf(GFP_KERNEL, "log %s", log);
+	msg = kasprintf(GFP_ATOMIC, "log %s", log);
 	if (!msg) {
 		DRM_ERROR("Cannot allocate memory for host log message.\n");
 		kfree(log);
-- 
2.20.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux