Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/hyperv: Don't overwrite dirt_needed value set by host

Existing code is causing a race condition where dirt_needed value is
already set by the host and gets overwritten with default value. Remove
this default setting of dirt_needed, to avoid overwriting the value
received in the channel callback set by vmbus_open. Removing this
setting also means the default value for dirt_needed is changed to false
as it's allocated by kzalloc which is similar to legacy hyperv_fb driver.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1662996766-19304-1-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Saurabh Sengar and committed by
Wei Liu
19b5e665 78c65f0f

-2
-2
drivers/gpu/drm/hyperv/hyperv_drm_drv.c
··· 142 142 if (ret) 143 143 drm_warn(dev, "Failed to update vram location.\n"); 144 144 145 - hv->dirt_needed = true; 146 - 147 145 ret = hyperv_mode_config_init(hv); 148 146 if (ret) 149 147 goto err_free_mmio;