Skip to content

Commit 423e504

Browse files
author
Iouri Tarassov
committed
drivers: hv: dxgkrnl: Do not print error messages when virtual GPU is not present
Dxgkrnl prints the error message "Failed to acquire global channel lock" when a process tries to open the /dev/dxg device and there is no virtual GPU. This message should not be printed in this scenario. Signed-off-by: Iouri Tarassov <[email protected]>
1 parent 429134d commit 423e504

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/hv/dxgkrnl/dxgadapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ void dxgadapter_start(struct dxgadapter *adapter)
7878

7979
/* The global channel is initialized when the first adapter starts */
8080
if (!dxgglobal->global_channel_initialized) {
81+
dxgglobal->global_channel_initialized = true;
8182
ret = dxgglobal_init_global_channel();
8283
if (ret) {
8384
dxgglobal_destroy_global_channel();
8485
return;
8586
}
86-
dxgglobal->global_channel_initialized = true;
8787
}
8888

8989
/* Initialize vGPU vm bus channel */

drivers/hv/dxgkrnl/dxgmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ int dxgglobal_acquire_channel_lock(void)
4646
{
4747
struct dxgglobal *dxgglobal = dxggbl();
4848

49+
if (!dxgglobal->global_channel_initialized)
50+
return -ENODEV;
51+
4952
down_read(&dxgglobal->channel_lock);
5053
if (dxgglobal->channel.channel == NULL) {
5154
DXG_ERR("Failed to acquire global channel lock");
55+
up_read(&dxgglobal->channel_lock);
5256
return -ENODEV;
5357
} else {
5458
return 0;

0 commit comments

Comments
 (0)