From: Zack Rusin <zackr@vmware.com>
To: <dri-devel@lists.freedesktop.org>
Cc: Martin Krastev <krastevm@vmware.com>
Subject: [PATCH v2 3/6] drm/vmwgfx: Fail to initialize on broken configs
Date: Fri, 5 Nov 2021 15:38:44 -0400 [thread overview]
Message-ID: <20211105193845.258816-4-zackr@vmware.com> (raw)
In-Reply-To: <20211105193845.258816-1-zackr@vmware.com>
Some of our hosts have a bug where rescaning a pci bus results in stale
fifo memory being mapped on the host. This makes any fifo communication
impossible resulting in various kernel crashes.
Instead of unexpectedly crashing, predictably fail to load the driver
which will preserve the system.
Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU")
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
index 67db472d3493..a3bfbb6c3e14 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
@@ -145,6 +145,13 @@ struct vmw_fifo_state *vmw_fifo_create(struct vmw_private *dev_priv)
(unsigned int) max,
(unsigned int) min,
(unsigned int) fifo->capabilities);
+
+ if (unlikely(min >= max)) {
+ drm_warn(&dev_priv->drm,
+ "FIFO memory is not usable. Driver failed to initialize.");
+ return ERR_PTR(-ENXIO);
+ }
+
return fifo;
}
--
2.32.0
next prev parent reply other threads:[~2021-11-05 19:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 19:38 [PATCH v2 0/6] Support module unload and hotunplug Zack Rusin
2021-11-05 19:38 ` [PATCH v2 1/6] drm/vmwgfx: Remove the deprecated lower mem limit Zack Rusin
2021-11-05 19:38 ` [PATCH v2 2/6] drm/vmwgfx: Release ttm memory if probe fails Zack Rusin
2021-11-05 19:38 ` Zack Rusin [this message]
2021-11-05 19:38 ` [PATCH v2 4/6] drm/vmwgfx: Introduce a new placement for MOB page tables Zack Rusin
2021-11-05 19:38 ` [PATCH v2 5/6] drm/vmwgfx: Switch the internal BO's to ttm_bo_type_kernel Zack Rusin
2021-11-05 19:38 ` [PATCH v2 6/6] drm/ttm: Clarify that the TTM_PL_SYSTEM buffers need to stay idle Zack Rusin
2021-11-08 11:07 ` Christian König
2021-11-08 15:42 ` [PATCH v3] " Zack Rusin
2021-11-10 14:50 ` [PATCH v4] drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control Zack Rusin
2021-11-11 16:44 ` Zack Rusin
2021-11-13 11:26 ` Thomas Hellström
2021-11-16 7:19 ` Christian König
2021-11-16 7:43 ` Thomas Hellström
2021-11-16 8:20 ` Christian König
2021-11-16 8:33 ` Thomas Hellström
2021-11-16 8:54 ` Christian König
2021-11-16 9:00 ` Thomas Hellström
2021-11-16 9:09 ` Christian König
2021-11-16 15:49 ` Daniel Vetter
2021-11-16 15:53 ` Zack Rusin
2021-11-22 14:15 ` Christian König
2021-11-22 15:05 ` Zack Rusin
2021-11-24 8:22 ` Christian König
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=20211105193845.258816-4-zackr@vmware.com \
--to=zackr@vmware.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=krastevm@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