Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1802616pxb; Fri, 20 Aug 2021 14:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNfmKrHkwrj5VbSCADP5ejwAHdGFOvGy18BpHU0hIs6KV0mPXVhnLIS9qJW4NCdi1otZoB X-Received: by 2002:a17:906:7f01:: with SMTP id d1mr12713674ejr.318.1629495291667; Fri, 20 Aug 2021 14:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629495291; cv=none; d=google.com; s=arc-20160816; b=KBV9jbwngZH8PyoC/+o1g0dxminvX9IcdQJvJkINK4I4L6KaQaEGABHiz6ijAwEu+m RPC/S2+rn3+9C0bqqdnxU4GNhWsVErV8vLsAgG0FWN6SULw/o8h0kcZUcOxgz2Kx2g++ CHkhPDcQvYJwdNcGd8oDbp74bIsCPyGu/pY1DfJ95cUSjbCdZropQ3F81QLKrIa3et/F ueG6wZOyyBIRUH5b2gQGH1/PjkcqGNwZG1G47OufuY1SzJt70SyKPM3zw86AVe6eWav8 WOlOZDIr1/JHRO0AV6c4OY5u14KmeXtKpmD7H49J4CroVDgkHtaQzmOy7kfPOLmLaPfe xkKw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WHAyDbQyNuFi7nfW9+0a5K0CNgbSgqAU8gDVjfwn6B8=; b=nCaufiocaYmhiHp0LGJh4b0YLC0hmpYqVLGEEP5AoyyrOhixmffHHo7YXNV07e6YUx /Bt2tAgF9MzsQgzpyb1piXeFIRxBTDiB5nF7sTSxXfnaVN78Fek07el/K+qFtk//UqQd YR1qHpcir7tkXpx0Gz2eo0qaqVh+Ejbrh49BKS0L8/d4ksjPNNHLUbGJO/x5NvuqCtwL Tv+ywb/7khbdyM5+mpJ5ztpBR0DtRf+matiNx6zQZnQTvhBzt5gwf3pCttlV8XH3P9UT jFI1tgQgaJIL7E0anomwIwahcpusqEd3HHChXjUQR8z3V5wI+O6/77nbP6xqBtXZq7ax xZ9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si8004379edw.353.2021.08.20.14.34.24; Fri, 20 Aug 2021 14:34:51 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240933AbhHTVcY (ORCPT + 99 others); Fri, 20 Aug 2021 17:32:24 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46144 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240876AbhHTVcV (ORCPT ); Fri, 20 Aug 2021 17:32:21 -0400 Received: from localhost.localdomain (unknown [IPv6:2600:8800:8c06:1000::c8f3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: alyssa) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id D211E1F44A8F; Fri, 20 Aug 2021 22:31:38 +0100 (BST) From: Alyssa Rosenzweig To: dri-devel@lists.freedesktop.org Cc: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Chris Morgan Subject: [PATCH 2/3] drm/panfrost: Use u64 for size in lock_region Date: Fri, 20 Aug 2021 17:31:16 -0400 Message-Id: <20210820213117.13050-3-alyssa.rosenzweig@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210820213117.13050-1-alyssa.rosenzweig@collabora.com> References: <20210820213117.13050-1-alyssa.rosenzweig@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mali virtual addresses are 48-bit. Use a u64 instead of size_t to ensure we can express the "lock everything" condition as ~0ULL without relying on platform-specific behaviour. Signed-off-by: Alyssa Rosenzweig Suggested-by: Rob Herring Tested-by: Chris Morgan --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index f6e02d0392f4..3a795273e505 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -58,7 +58,7 @@ static int write_cmd(struct panfrost_device *pfdev, u32 as_nr, u32 cmd) } static void lock_region(struct panfrost_device *pfdev, u32 as_nr, - u64 iova, size_t size) + u64 iova, u64 size) { u8 region_width; u64 region = iova & PAGE_MASK; @@ -78,7 +78,7 @@ static void lock_region(struct panfrost_device *pfdev, u32 as_nr, static int mmu_hw_do_operation_locked(struct panfrost_device *pfdev, int as_nr, - u64 iova, size_t size, u32 op) + u64 iova, u64 size, u32 op) { if (as_nr < 0) return 0; @@ -95,7 +95,7 @@ static int mmu_hw_do_operation_locked(struct panfrost_device *pfdev, int as_nr, static int mmu_hw_do_operation(struct panfrost_device *pfdev, struct panfrost_mmu *mmu, - u64 iova, size_t size, u32 op) + u64 iova, u64 size, u32 op) { int ret; @@ -112,7 +112,7 @@ static void panfrost_mmu_enable(struct panfrost_device *pfdev, struct panfrost_m u64 transtab = cfg->arm_mali_lpae_cfg.transtab; u64 memattr = cfg->arm_mali_lpae_cfg.memattr; - mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0UL, AS_COMMAND_FLUSH_MEM); + mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0ULL, AS_COMMAND_FLUSH_MEM); mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), transtab & 0xffffffffUL); mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), transtab >> 32); @@ -128,7 +128,7 @@ static void panfrost_mmu_enable(struct panfrost_device *pfdev, struct panfrost_m static void panfrost_mmu_disable(struct panfrost_device *pfdev, u32 as_nr) { - mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0UL, AS_COMMAND_FLUSH_MEM); + mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0ULL, AS_COMMAND_FLUSH_MEM); mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), 0); mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), 0); @@ -242,7 +242,7 @@ static size_t get_pgsize(u64 addr, size_t size) static void panfrost_mmu_flush_range(struct panfrost_device *pfdev, struct panfrost_mmu *mmu, - u64 iova, size_t size) + u64 iova, u64 size) { if (mmu->as < 0) return; -- 2.30.2