Skip to content

Commit

Permalink
video: fbdev: starfive: Fix frame buffer reserved memory resource con…
Browse files Browse the repository at this point in the history
…flict

    starfive,vpp-lcdc 12000000.sfivefb: can't request region for resource [mem 0xfb000000-0xfcffffff]
    starfive,vpp-lcdc 12000000.sfivefb: Fail to allocate video RAM
    starfive,vpp-lcdc 12000000.sfivefb: starfive fb init fail
    starfive,vpp-lcdc 12000000.sfivefb: fb info init FAIL
    starfive,vpp-lcdc: probe of 12000000.sfivefb failed with error -16

devm_ioremap_resource() calls devm_request_mem_region(), which fails as
the reserved memory for the frame buffer is already present in the
resource list, cfr. /proc/iomem:

    fb000000-fcffffff : Reserved

Fix this by mapping the frame buffer memory using devm_ioremap().

Signed-off-by: Geert Uytterhoeven <[email protected]>
  • Loading branch information
geertu committed May 18, 2021
1 parent b582a44 commit feadd18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/fbdev/starfive/starfive_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ static int sf_fb_map_video_memory(struct sf_fb_data *sf_dev)
sf_dev->fb.screen_size = resource_size(&res_mem);
sf_dev->fb.fix.smem_start = res_mem.start;

sf_dev->fb.screen_base = devm_ioremap_resource(sf_dev->dev, &res_mem);
sf_dev->fb.screen_base = devm_ioremap(sf_dev->dev, res_mem.start,
resource_size(&res_mem));
if (IS_ERR(sf_dev->fb.screen_base))
return PTR_ERR(sf_dev->fb.screen_base);

Expand Down

0 comments on commit feadd18

Please sign in to comment.