Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1726407pxb; Thu, 16 Sep 2021 14:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7jctupAUqAk08bzHF6Lh322Jt1HMjwmVvXeIOwNaZpIbNjSOwKfr6J1ANGW3drNvTlfFN X-Received: by 2002:a05:6e02:1088:: with SMTP id r8mr5331203ilj.46.1631826366234; Thu, 16 Sep 2021 14:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631826366; cv=none; d=google.com; s=arc-20160816; b=B530FsquJ/arwH8djGFBrPXaqa8SFGlyut0J96+HoSti+6kr1k4uJPwpVRmbS9jFIE cLyHUGdJErShF1lXsLBZOxhCLpkdYBrOYNad75+/r4RbMdzoeTyfhaY0UnC0yqaQCYmt Ww2G4eRNMLZemmrAU64rlk7A0VyIu0RsdB9i9MLwoaENNvCBdaVt3pJV3cxBFLxg7IK7 +67jNHAuKwansxFnV1X/pkHEpafQM2oQy9GzeLR7GPSYpT2K9ccCzzqXY5EbV2iN1/9b vd2r9oY2zZmfnBD/MgEO4AAQMKofng4sNS8aP9SeyifQN2c7J1sFIcxweYs47vZL/a6p Tnwg== 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=H1FFDoLOiZITYO5KHjlLI9wspnj+D0f6rewjfVMXu10=; b=t1odAbaoPVUSdTGnw433Wg0KhssZq2+fownLoIrvK0BVFOFybLB0iQhX+9OePxLRmC ST8984gnoSqmZkyoh6scF2tinCEFz2jC8X0amiv7ANLoM0YNkMT+mlFm0GJs8mBECTUX m72K6Ya33ESGXuSg+k4oMx3h3PBej71y1wuduSon5+FRrIESUozxzpmGK3NHhIp5WK27 qhvZ0tIejOZAlvC4xPc1v3/8tMM+wNXbiVblapCtRGVNFIu81oQAXcuEDlWRpbI2ngOL tWU8Fxfq7CE/Yn60U+mMhU6LtJ/G6fWdRGGkE7Gyn+t0iJYWZlnvWmFkOPLwyjFCbN+Q hivw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pWyzSk+u; 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 d186si4744717iog.78.2021.09.16.14.05.42; Thu, 16 Sep 2021 14:06:06 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pWyzSk+u; 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 S243372AbhIPQeD (ORCPT + 99 others); Thu, 16 Sep 2021 12:34:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:38286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241709AbhIPQZt (ORCPT ); Thu, 16 Sep 2021 12:25:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D2A061505; Thu, 16 Sep 2021 16:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809012; bh=LJLgk3YtHGnhIqXPFqy6lL7ykL0hZyTW6uAYpjRp6NI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pWyzSk+uWhnhPcYSnGPw1twvewQ3PJ4J00SH6Gp8ITgqi0oG1Uqq1mR9QRlDKuhy8 aREQq4kyVqALfxUfzgCkk+ma3wtWuz6yibwH00JjjWVX3Fg/6sd+fP3M7sQmdyJy/e xZOInmIr20on0VoI/0tPuzSUaFrtiUgTBQ/vSQ/I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alyssa Rosenzweig , Chris Morgan , Steven Price , Rob Herring Subject: [PATCH 5.10 305/306] drm/panfrost: Clamp lock region to Bifrost minimum Date: Thu, 16 Sep 2021 18:00:50 +0200 Message-Id: <20210916155804.480975528@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Alyssa Rosenzweig commit bd7ffbc3ca12629aeb66fb9e28cf42b7f37e3e3b upstream. When locking a region, we currently clamp to a PAGE_SIZE as the minimum lock region. While this is valid for Midgard, it is invalid for Bifrost, where the minimum locking size is 8x larger than the 4k page size. Add a hardware definition for the minimum lock region size (corresponding to KBASE_LOCK_REGION_MIN_SIZE_LOG2 in kbase) and respect it. Signed-off-by: Alyssa Rosenzweig Tested-by: Chris Morgan Reviewed-by: Steven Price Reviewed-by: Rob Herring Cc: Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210824173028.7528-4-alyssa.rosenzweig@collabora.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/gpu/drm/panfrost/panfrost_regs.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -63,7 +63,7 @@ static void lock_region(struct panfrost_ /* The size is encoded as ceil(log2) minus(1), which may be calculated * with fls. The size must be clamped to hardware bounds. */ - size = max_t(u64, size, PAGE_SIZE); + size = max_t(u64, size, AS_LOCK_REGION_MIN_SIZE); region_width = fls64(size - 1) - 1; region |= region_width; --- a/drivers/gpu/drm/panfrost/panfrost_regs.h +++ b/drivers/gpu/drm/panfrost/panfrost_regs.h @@ -318,6 +318,8 @@ #define AS_FAULTSTATUS_ACCESS_TYPE_READ (0x2 << 8) #define AS_FAULTSTATUS_ACCESS_TYPE_WRITE (0x3 << 8) +#define AS_LOCK_REGION_MIN_SIZE (1ULL << 15) + #define gpu_write(dev, reg, data) writel(data, dev->iomem + reg) #define gpu_read(dev, reg) readl(dev->iomem + reg)