public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: Fix some scheduling in atomic bugs
@ 2021-08-12  7:00 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-08-12  7:00 UTC (permalink / raw)
  To: VMware Graphics, Zack Rusin, Sinclair Yeh
  Cc: David Airlie, Daniel Vetter, Martin Krastev, dri-devel,
	kernel-janitors

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@oracle.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-12  7:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12  7:00 [PATCH] drm/vmwgfx: Fix some scheduling in atomic bugs Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox