Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1991140pxb; Thu, 16 Sep 2021 22:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcNwtstj7Ja1Srl8RsV09QJiSEFWiaPnKpM0Vrc4hFTnrg58c27usfJIBLj0dPbxT8OYll X-Received: by 2002:aa7:cd41:: with SMTP id v1mr10552792edw.393.1631857257613; Thu, 16 Sep 2021 22:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631857257; cv=none; d=google.com; s=arc-20160816; b=RFu1U/PKK5v/2LVNYdKop802EVzZgAcsQGxeQYUagDeYbLAWZLTG19SmuTKYOZ2mJ2 dcwCrSFCyWdgkg+PYNTt/GrDZ33ucaLED9avUov141eNvhhtaTm/isbpjONtxehIQ4wQ t+G1wAB0RFvRysaQPeT10anC+mJJFpkzoyO15gkUaBCmHVut2nydB83EGDhEVBpnbdzn pswg1zCo+f+kH51rgFgp++f3g3dDCev8RaJtDzHUH0uH0Tiw7i2YhBiAo3aQk5DNlNdG 2Sexw6ok0DZ1J+yXmWl6KgRuKYQS39AJucq17klHDSaQ077zrktZtGwKNt98V+8mRn0v GdcA== 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=zfKlwcOFVauEXlFtfYzBfWGkXmgQUUQhbytwgsbFdUo=; b=tv0/nDpaxR+U9jsQxjHTXWfPcgAGA2aH4IW5MVsEwm3/gCwiTjfX+NH3NwnvfKmDe3 vNgYkfBV75GXqXpQz7DOebgNyCyZVY0DGxNij1dQ1SQbnpvtBBiOFw7+YtdlNuIvIECk xfm3e6HWSp+pb9RK5elb3gbRCh2cif2RxF6YEl0CN3iaCBcTexLKS5lipJEy5GGC3oxN S6MN9lteJ7VVlwtTya6neZ8HspKzfB0PdZ02qhTFbAR1BeWcndaZzp+LAuTCI2nlhrsg 9l+uDt32btJ7YTsLfzC99oGhtRwG0WQTmgqqdjL753Wn0/pIGJ0gGkEnP/P9YvUXvcZW Vbpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LfbstJZY; 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 ca5si5550429edb.284.2021.09.16.22.40.15; Thu, 16 Sep 2021 22:40:57 -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=LfbstJZY; 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 S1357573AbhIPRwB (ORCPT + 99 others); Thu, 16 Sep 2021 13:52:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:55272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355659AbhIPRl4 (ORCPT ); Thu, 16 Sep 2021 13:41:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3762B63295; Thu, 16 Sep 2021 16:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631811233; bh=K+S7vrtV7L3w5D1KrANIWDKZmxsDT2+8SBdFnzpWBGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfbstJZYHzja6qh5cw/m9AxdL5dLu1I3KgROsnsu1PyZn04tIpeWzjEKtq46cEO1z 8IwOy6iR373PSe6VHTLbUyr5/j6u1f+a+NqcTNi+ChDA/wuS8lMrU9DVYLMDynAE/P H922Ez5ZQNVvxzyjAB/XxRfqSeiT4gqPQR2eSNxs= 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.14 431/432] drm/panfrost: Clamp lock region to Bifrost minimum Date: Thu, 16 Sep 2021 18:03:00 +0200 Message-Id: <20210916155825.451198622@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@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 @@ -319,6 +319,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)