From nobody Wed Apr 15 02:31:19 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF4DDC00140 for ; Sun, 31 Jul 2022 19:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237832AbiGaT6G (ORCPT ); Sun, 31 Jul 2022 15:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbiGaT6D (ORCPT ); Sun, 31 Jul 2022 15:58:03 -0400 Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5C8DF8A for ; Sun, 31 Jul 2022 12:58:01 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id IF4YopDbmkootIF4Zoa9NM; Sun, 31 Jul 2022 21:58:00 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 31 Jul 2022 21:58:00 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Deepak Rawat , David Airlie , Daniel Vetter , Thomas Zimmermann Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH] hyperv_setup_vram() calls vmbus_allocate_mmio(). This must be undone in the error handling path of the probe, as already done in the remove function. Date: Sun, 31 Jul 2022 21:57:57 +0200 Message-Id: <1781855facffbdba640ce2da3649cac424e76fed.1659297462.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch depends on commit a0ab5abced55 ("drm/hyperv : Removing the restruction of VRAM allocation with PCI bar size"). Without it, something like what is done in commit e048834c209a ("drm/hyperv: Fix device removal on Gen1 VMs") should be done. Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video= device") Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hype= rv/hyperv_drm_drv.c index 6d11e7938c83..fc8b4e045f5d 100644 --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c @@ -133,7 +133,6 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, } =20 ret =3D hyperv_setup_vram(hv, hdev); - if (ret) goto err_vmbus_close; =20 @@ -150,18 +149,20 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, =20 ret =3D hyperv_mode_config_init(hv); if (ret) - goto err_vmbus_close; + goto err_free_mmio; =20 ret =3D drm_dev_register(dev, 0); if (ret) { drm_err(dev, "Failed to register drm driver.\n"); - goto err_vmbus_close; + goto err_free_mmio; } =20 drm_fbdev_generic_setup(dev, 0); =20 return 0; =20 +err_free_mmio: + vmbus_free_mmio(hv->mem->start, hv->fb_size); err_vmbus_close: vmbus_close(hdev->channel); err_hv_set_drv_data: --=20 2.34.1