From patchwork Mon Jan 22 18:04:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10178997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D756A601D5 for ; Mon, 22 Jan 2018 18:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6F927FA1 for ; Mon, 22 Jan 2018 18:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34A8283C5; Mon, 22 Jan 2018 18:04:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8626E27FA1 for ; Mon, 22 Jan 2018 18:04:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A53AD6E29A; Mon, 22 Jan 2018 18:04:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FF2B6E28A; Mon, 22 Jan 2018 18:04:22 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E86E56090E; Mon, 22 Jan 2018 18:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516644261; bh=5NzMuQ3FQJmlQDJrE7ZG1jts6iG4yGk+HkR0oH0p+m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mI5N4djwEw2r4oO7EXmaatN15EqkD3M83PE4Wx0MJjDjECji1vbqrnSrkHcGc5b0g 44chMtmxyS26sKiMjpQYHOV5u8U7HFGTRP2R4rO2arnyCE3QQUggRU21DE4A/beeM1 dlN5vOtMsKu88rxoLTqGJn6vhRjBvUTTimE00Fqc= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id EF91A60A61; Mon, 22 Jan 2018 18:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516644261; bh=5NzMuQ3FQJmlQDJrE7ZG1jts6iG4yGk+HkR0oH0p+m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mI5N4djwEw2r4oO7EXmaatN15EqkD3M83PE4Wx0MJjDjECji1vbqrnSrkHcGc5b0g 44chMtmxyS26sKiMjpQYHOV5u8U7HFGTRP2R4rO2arnyCE3QQUggRU21DE4A/beeM1 dlN5vOtMsKu88rxoLTqGJn6vhRjBvUTTimE00Fqc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EF91A60A61 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/msm: Pass the correct aperture end to drm_mm_init Date: Mon, 22 Jan 2018 11:04:12 -0700 Message-Id: <1516644253-31546-5-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516644253-31546-1-git-send-email-jcrouse@codeaurora.org> References: <1516644253-31546-1-git-send-email-jcrouse@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP drm_mm_init() takes the start and length of the intended virtual memory address region but the msm code is passing the end of the region instead. That would work out if the region started at 0 but it doesn't so the top of the region sneaks above the 32 bit boundary which won't work because the driver doesn't support 64 bit addresses for the GPU yet. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_gem_vma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index d34e331..ffbec22 100644 --- a/drivers/gpu/drm/msm/msm_gem_vma.c +++ b/drivers/gpu/drm/msm/msm_gem_vma.c @@ -96,6 +96,8 @@ struct msm_gem_address_space * const char *name) { struct msm_gem_address_space *aspace; + u64 size = domain->geometry.aperture_end - + domain->geometry.aperture_start; aspace = kzalloc(sizeof(*aspace), GFP_KERNEL); if (!aspace) @@ -106,7 +108,7 @@ struct msm_gem_address_space * aspace->mmu = msm_iommu_new(dev, domain); drm_mm_init(&aspace->mm, (domain->geometry.aperture_start >> PAGE_SHIFT), - (domain->geometry.aperture_end >> PAGE_SHIFT) - 1); + size >> PAGE_SHIFT); kref_init(&aspace->kref);