From patchwork Fri Nov 29 13:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 11267151 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 588CE930 for ; Fri, 29 Nov 2019 13:59:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40B462176D for ; Fri, 29 Nov 2019 13:59:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40B462176D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB2A56E90A; Fri, 29 Nov 2019 13:59:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E0B56E908 for ; Fri, 29 Nov 2019 13:59:13 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 2BD7929256A; Fri, 29 Nov 2019 13:59:12 +0000 (GMT) From: Boris Brezillon To: Rob Herring , Tomeu Vizoso , Alyssa Rosenzweig , Steven Price Subject: [PATCH 0/8] panfrost: Fixes for 5.4 Date: Fri, 29 Nov 2019 14:59:00 +0100 Message-Id: <20191129135908.2439529-1-boris.brezillon@collabora.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello, I've recently come to test a 5.4 kernel on a rk3288 platform (T760), and, as reported by many people on #panfrost, I've hit a page-fault storm when running various GL apps. This series tries to address the problems I could spot during my debug session, with patch 7 being the most invasive change. I wish I could find an easier way to fix the "BO mapping teared down while GPU jobs referencing it are in-flight" problem, as I don't like tagging complex changes for stable, but this is the best I could come up with. Let me know if you have better ideas. Regards, Boris Boris Brezillon (8): drm/panfrost: Make panfrost_job_run() return an ERR_PTR() instead of NULL drm/panfrost: Fix a race in panfrost_ioctl_madvise() drm/panfrost: Fix a BO leak in panfrost_ioctl_mmap_bo() drm/panfrost: Fix a race in panfrost_gem_free_object() drm/panfrost: Open/close the perfcnt BO drm/panfrost: Make sure imported/exported BOs are never purged drm/panfrost: Add the panfrost_gem_mapping concept drm/panfrost: Make sure the shrinker does not reclaim referenced BOs drivers/gpu/drm/panfrost/panfrost_drv.c | 132 +++++++++++-- drivers/gpu/drm/panfrost/panfrost_gem.c | 184 +++++++++++++++--- drivers/gpu/drm/panfrost/panfrost_gem.h | 51 ++++- .../gpu/drm/panfrost/panfrost_gem_shrinker.c | 6 +- drivers/gpu/drm/panfrost/panfrost_job.c | 22 ++- drivers/gpu/drm/panfrost/panfrost_job.h | 1 + drivers/gpu/drm/panfrost/panfrost_mmu.c | 61 +++--- drivers/gpu/drm/panfrost/panfrost_mmu.h | 6 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 49 +++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.h | 2 +- 10 files changed, 416 insertions(+), 98 deletions(-)