From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC9B7FD0650 for ; Wed, 11 Mar 2026 08:05:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07CB110E806; Wed, 11 Mar 2026 08:04:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=pm.me header.i=@pm.me header.b="opJSFmdF"; dkim-atps=neutral Received: from mail-106110.protonmail.ch (mail-106110.protonmail.ch [79.135.106.110]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4588B10E71B for ; Tue, 10 Mar 2026 12:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1773145830; x=1773405030; bh=70qYgbuSjChtaC/Be+ZW82CQnptfCc3jGidv51tEe7w=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=opJSFmdFfOSQHxw1F6eoKz0R14nyZbkQZjs6DliIUApwaf5j1qEsjvczagE1ft1E/ xMnci9i3DQe2CndssWqRWiqnYCXCp0P5icjK6ckQ0qcPsHD+RLWKNvZuelOeOqyLW9 H76yjoFSjqiqptLERebctmzHQGkrU9nwhBNdTL/kt4Hgj4TKIPXkScTGXJEUFqlI2f 6WhJN0SBAmvGgMF9REliytyYdSv5oQtNrC3Hw9C0QUgTzRbY1xdd1txhQ10XQ2vEYp 6cix3rZCTStolijLZO4oLTrdmjfXzjiUS4JEx+DqzexqcmtuRUZ0i+REkVKPZMC8Jq DY6r9ygjuRgJg== Date: Tue, 10 Mar 2026 12:30:27 +0000 To: Ferenc Bakonyi , Helge Deller From: Hardik Phalet Cc: Shuah Khan , Brigham Campbell , Thomas Zimmermann , linux-nvidia@lists.surfsouth.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Hardik Phalet Subject: [PATCH v3] fbdev/hga: Request memory region before ioremap Message-ID: <20260310123004.888132-1-hardik.phalet@pm.me> Feedback-ID: 166659585:user:proton X-Pm-Message-ID: 1e6537c57d7eaa74a5eb9d60b28cae32c0f30467 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Wed, 11 Mar 2026 08:04:38 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The driver calls ioremap() on the HGA video memory at 0xb0000 without first reserving the physical address range. This leaves the kernel resource tree incomplete and can cause silent conflicts with other drivers claiming the same range. Add a devm_request_mem_region() call before ioremap() in hga_card_detect() to reserve the memory region. Signed-off-by: Hardik Phalet --- Changes in v3: - Used dev_err() to log memory region request, based on another review comment by Thomas [2]. Changes in v2: - Used devm_request_mem_region instead of request_mem_region, based on a =09review comment by Thomas [1]. v1: https://lore.kernel.org/all/20260310064124.602848-1-hardik.phalet@pm.me= / v2: https://lore.kernel.org/all/20260310113810.789575-1-hardik.phalet@pm.me= / [1]: https://lore.kernel.org/all/5f9749ba-18a8-4b6b-a6e7-a011a3871bfb@suse.= de/ [2]: https://lore.kernel.org/all/ec635591-c861-4aa8-a259-718690ddaa4e@suse.= de/ drivers/video/fbdev/hgafb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c index 14418aa3791a..d32fd1c5217c 100644 --- a/drivers/video/fbdev/hgafb.c +++ b/drivers/video/fbdev/hgafb.c @@ -276,7 +276,7 @@ static void hga_blank(int blank_mode) =09spin_unlock_irqrestore(&hga_reg_lock, flags); } =20 -static int hga_card_detect(void) +static int hga_card_detect(struct platform_device *pdev) { =09int count =3D 0; =09void __iomem *p, *q; @@ -284,6 +284,11 @@ static int hga_card_detect(void) =20 =09hga_vram_len =3D 0x08000; =20 +=09if (!devm_request_mem_region(&pdev->dev, 0xb0000, hga_vram_len, "hgafb"= )) { +=09=09dev_err(&pdev->dev, "cannot reserve video memory at 0xb0000\n"); +=09=09return -EBUSY; +=09} + =09hga_vram =3D ioremap(0xb0000, hga_vram_len); =09if (!hga_vram) =09=09return -ENOMEM; @@ -568,7 +573,7 @@ static int hgafb_probe(struct platform_device *pdev) =09struct fb_info *info; =09int ret; =20 -=09ret =3D hga_card_detect(); +=09ret =3D hga_card_detect(pdev); =09if (ret) =09=09return ret; =20 --=20 2.53.0