Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp862320pxb; Tue, 1 Feb 2022 12:00:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJw776OCRKQXhXx2wIg82FwBkptL8wC/LCbBiksvOJdfmei8RwWBEf6fojEwwdLbPUkx2xRE X-Received: by 2002:a05:6402:1252:: with SMTP id l18mr27214022edw.234.1643745630881; Tue, 01 Feb 2022 12:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745630; cv=none; d=google.com; s=arc-20160816; b=UqqLpg0n6tc0uXO5JPX0o7q62olW5IsLOHtL0qYxvCdmc7TKToRpyDm5XqUACjXODY Q8S7RiagkCkykfpYhLKMEag1+7Kclhem+BOKOzaa46jbElsHYNAFGdMdj/BYbADLdM7E 1gBrPMPAXYi97H1lQvFHcCkXxS5yfHP/FzMO1yjDAG6IY9CPc/UPuqecwFDq2ZPBqVWG 9sdCG6yMXMbToap5heIldE3UCwR1Tpebuzj2ZUS7XIwa49rcpIuqMZF+TDlD0ubNyOxC E1fvzAx7UZL3EBBtvC7d6XUJ4H06EpYV91zAZz29Ubw+DGglO1BwkjYy3XgkmOFfpcj+ hlFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9hsDWnen5MB0XTF/xHOy9wFfJQZLqUBnJOPGR5A1aK4=; b=a8lTFqgSyj0f4Wx2NgOsFvexi5lkXnkK1qpQimowOL7k2dMWtnva5ECl/GbOHo/2sl uzVV4TkQcJTQPr1XuRMCnJcYT1nX6zh0N80YVzNICb+8Dgz7mO0VKHn5aOOfR2ZG+zuc MCQVLqa5muSsbAPcaBsuL0/9JZuIkQNgP0S5EZlaT63UzFdhQLy+e8vp13aNwnl512Fv AVBFId3l030xfHlSonI7lg/0JXiEw5kW552W0aiyBbWsvt9DVTBnFxidFSi5zUVx0IRD No+FFTlCkRxyWaqV3h9j0M61XoudBcElpCP6q083OJT0+5Qd1gKI0JxGXDfNxQBgkVnY g6vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="hv//6qXq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si10858667edx.440.2022.02.01.12.00.05; Tue, 01 Feb 2022 12:00:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="hv//6qXq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359821AbiAaLH7 (ORCPT + 99 others); Mon, 31 Jan 2022 06:07:59 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52292 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359110AbiAaLEW (ORCPT ); Mon, 31 Jan 2022 06:04:22 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CCE4FB82A6C; Mon, 31 Jan 2022 11:04:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC32C340EE; Mon, 31 Jan 2022 11:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627060; bh=13so7g2ezdIKuT/cNeRJNDoFrTi74+ykDnHXiaUHom8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hv//6qXq7jkpMArjB4ndN+LurbB7yexshcR3abMz9Ye/6RfHqpedKBcVdaVeT21sF rPIfrobqQkn4Vfpc0T97N8AqpJypmbhnVBvTLx2VTCAC+IZrTYACGSVswkDDYFWjFy kpeyslu9hA/3lFCMVi4IAawaTte0EBUhOTXSJygc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xianting Tian , Dmitry Baryshkov , Sasha Levin Subject: [PATCH 5.10 062/100] drm/msm: Fix wrong size calculation Date: Mon, 31 Jan 2022 11:56:23 +0100 Message-Id: <20220131105222.522549814@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xianting Tian commit 0a727b459ee39bd4c5ced19d6024258ac87b6b2e upstream. 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 Fixes: 072f1f9168ed ("drm/msm: add support for "stolen" mem") Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220112123334.749776-1-xianting.tian@linux.alibaba.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -350,7 +350,7 @@ static int msm_init_vram(struct drm_devi 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.