Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2350665pxb; Mon, 20 Sep 2021 19:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHShgsrWra7Rs0LiBwkSf/cwMH30M4YTcZKFum7AWF/SjwmOJWWgfGi0Rb/4MLKaGu6DC0 X-Received: by 2002:a17:906:700f:: with SMTP id n15mr31388301ejj.319.1632192358531; Mon, 20 Sep 2021 19:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192358; cv=none; d=google.com; s=arc-20160816; b=gq0sh3/axu87NKfagLWXid6OZhxNK5jEJKZUl9KgsR0jqPZjYZjE1+7G9k+QHVD44/ IsV5tcFYksWKlmfZdrkwZrHi8SvEcMWlervUaok3zYexzwx8h20TMvYwKiqd5ZPdK08g 9AoBFgrqykEI4QIb5sOrvejTi1fmfj9+VtOJFB9c+LgqsSrt15Dj2K0nzIaJ5GMuDg3e VkUXTGbqPzHtq4Ppk/E7ODTjIpcPvHVZEIwwLGuzP2VuwQHn4WQN4OBJwYBUkMKflCpP Zui+Vumsgs2MoZDUZbMJBRTVrgXxtbXjAjao3Q5opM+jbzuLEs2xtxNwIfxJTiXPT4bK OnBQ== 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=LJM6NP0EeQVGjoCWXnnr4b0iZ1y/5nMEOteWMsOSmoE=; b=v84YR12mDM2xsHa5Bt8RsKasuEXEbYGMCGZvIXgd/uj2Z5nYKA3FWsfcN4QE4HBUCW p71qfyBAfE3V/SajTIDaeJrgMOKRJLeLZpFCjrymAznP33Sn3tiqBhwVPvRgGR4NKCjY i8DitKxE4iySeKDRQoKAGaYvbUkElKFAry1NS6kGHPNBxJbLXzxujn20uQDTTDwlRZ7s AHs5gGwoUZtObgczFnna5sFjw/FYwCRcWHYJJD6067gpudQ40Ch4R3ITDtOT3AHyPtgZ EN/6Wnmze/uzVZLi44nlYPNJeRB/y0wMcI+xm8DiFKw8Lqd0JOOD5BD614tSWqPHBuXx 3yJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qwr1m4vV; 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 5si20324344ejj.698.2021.09.20.19.45.33; Mon, 20 Sep 2021 19:45:58 -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=qwr1m4vV; 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 S1378698AbhITSZs (ORCPT + 99 others); Mon, 20 Sep 2021 14:25:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351304AbhITSS5 (ORCPT ); Mon, 20 Sep 2021 14:18:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F1BBF61A7B; Mon, 20 Sep 2021 17:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158584; bh=ezMrkwQK4gVmfO+w0CokXNJv9DTEQspGvofP2N70dFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwr1m4vV+b53G6x3oEKcSWs+Mrd4weKxvSI02o72oOZV/ASM13CjyroSynZWtlkdY lDrVYYTHKaL5R9/oiFiI97piRDfxrts6nKc6pZlhWJwcqY0UuyYBo/JEM/8p4F6wZH Xyha2j7rUBbXJiQezhY4cv8TEP+9ti2UxeXAOdEg= 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.4 191/260] drm/panfrost: Clamp lock region to Bifrost minimum Date: Mon, 20 Sep 2021 18:43:29 +0200 Message-Id: <20210920163937.606242841@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 @@ -60,7 +60,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)