From: Dan Carpenter <dan.carpenter@oracle.com>
To: VMware Graphics <linux-graphics-maintainer@vmware.com>,
Zack Rusin <zackr@vmware.com>, Sinclair Yeh <syeh@vmware.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Martin Krastev <krastevm@vmware.com>,
dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] drm/vmwgfx: Fix some scheduling in atomic bugs
Date: Thu, 12 Aug 2021 10:00:44 +0300 [thread overview]
Message-ID: <20210812070044.GD31863@kili> (raw)
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
reply other threads:[~2021-08-12 7:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210812070044.GD31863@kili \
--to=dan.carpenter@oracle.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=krastevm@vmware.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=syeh@vmware.com \
--cc=zackr@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox