Thread (7 messages) 7 messages, 6 authors, 2024-03-01

RE: [PATCH 1/1] fbdev/hyperv_fb: Fix logic error for Gen2 VMs in hvfb_getmem()

flat view

From: Michael Kelley <hidden>
Date: 2024-02-09 15:23:37
Also in: dri-devel, linux-hyperv, lkml

From: Thomas Zimmermann <tzimmermann@suse.de> Sent: Thursday, February 1, 2024 12:17 AM
Hi

Am 01.02.24 um 07:00 schrieb mhkelley58@gmail.com:
quoted
From: Michael Kelley <redacted>

A recent commit removing the use of screen_info introduced a logic
error. The error causes hvfb_getmem() to always return -ENOMEM
for Generation 2 VMs. As a result, the Hyper-V frame buffer
device fails to initialize. The error was introduced by removing
an "else if" clause, leaving Gen2 VMs to always take the -ENOMEM
error path.

Fix the problem by removing the error path "else" clause. Gen 2
VMs now always proceed through the MMIO memory allocation code,
but with "base" and "size" defaulting to 0.
Indeed, that's how it was supposed to work. IDK how I didn't notice this
bug. Thanks a lot for the fix.
quoted
Fixes: 0aa0838c84da ("fbdev/hyperv_fb: Remove firmware framebufferswith aperture helpers")
Signed-off-by: Michael Kelley <redacted>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Wei Liu and Helge Deller --

Should this fix go through the Hyper-V tree or the fbdev tree?   I'm not
aware of a reason that it really matters, but it needs to be one or the
other, and sooner rather than later, because the Hyper-V driver is broken
starting in 6.8-rc1.

Michael
quoted
---
  drivers/video/fbdev/hyperv_fb.c | 2 --
  1 file changed, 2 deletions(-)
diff --git a/drivers/video/fbdev/hyperv_fb.c
b/drivers/video/fbdev/hyperv_fb.c
quoted
index c26ee6fd73c9..8fdccf033b2d 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -1010,8 +1010,6 @@ static int hvfb_getmem(struct hv_device *hdev,
struct fb_info *info)
quoted
  			goto getmem_done;
  		}
  		pr_info("Unable to allocate enough contiguous physical memory on Gen 1 VM. Using MMIO instead.\n");
-	} else {
-		goto err1;
  	}

  	/*
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help