Patch "drm/msm: Fix wrong size calculation" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/msm: Fix wrong size calculation

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-msm-fix-wrong-size-calculation.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f61db1d219e63b29edb9a28beb8781f70ed4eb63
Author: Xianting Tian <xianting.tian@xxxxxxxxxxxxxxxxx>
Date:   Wed Jan 12 20:33:34 2022 +0800

    drm/msm: Fix wrong size calculation
    
    [ Upstream commit 0a727b459ee39bd4c5ced19d6024258ac87b6b2e ]
    
    For example, memory-region in .dts as below,
            reg = <0x0 0x50000000 0x0 0x20000000>
    
    We can get below values,
    struct resource r;
    r.start = 0x50000000;
    r.end   = 0x6fffffff;
    
    So the size should be:
    size = r.end - r.start + 1 = 0x20000000
    
    Signed-off-by: Xianting Tian <xianting.tian@xxxxxxxxxxxxxxxxx>
    Fixes: 072f1f9168ed ("drm/msm: add support for "stolen" mem")
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220112123334.749776-1-xianting.tian@xxxxxxxxxxxxxxxxx
    Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 3dad4687d3ddc..7951f57f92027 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -321,7 +321,7 @@ static int msm_init_vram(struct drm_device *dev)
 		of_node_put(node);
 		if (ret)
 			return ret;
-		size = r.end - r.start;
+		size = r.end - r.start + 1;
 		DRM_INFO("using VRAM carveout: %lx@%pa\n", size, &r.start);
 
 		/* if we have no IOMMU, then we need to use carveout allocator.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux