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

Configure Feed

Select the types of activity you want to include in your feed.

fbdev: hgafb: Request memory region before ioremap

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 <hardik.phalet@pm.me>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Hardik Phalet and committed by
Helge Deller
448aaf54 a40c0e81

+7 -2
+7 -2
drivers/video/fbdev/hgafb.c
··· 276 276 spin_unlock_irqrestore(&hga_reg_lock, flags); 277 277 } 278 278 279 - static int hga_card_detect(void) 279 + static int hga_card_detect(struct platform_device *pdev) 280 280 { 281 281 int count = 0; 282 282 void __iomem *p, *q; 283 283 unsigned short p_save, q_save; 284 284 285 285 hga_vram_len = 0x08000; 286 + 287 + if (!devm_request_mem_region(&pdev->dev, 0xb0000, hga_vram_len, "hgafb")) { 288 + dev_err(&pdev->dev, "cannot reserve video memory at 0xb0000\n"); 289 + return -EBUSY; 290 + } 286 291 287 292 hga_vram = ioremap(0xb0000, hga_vram_len); 288 293 if (!hga_vram) ··· 573 568 struct fb_info *info; 574 569 int ret; 575 570 576 - ret = hga_card_detect(); 571 + ret = hga_card_detect(pdev); 577 572 if (ret) 578 573 return ret; 579 574