Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1930986ioo; Fri, 27 May 2022 23:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOCQnl3GtTxzEC/n3qVO8u/4S4ADorNGnrZMEL4CcpjaBn8jNRoQYYVlcR6ePJ/mmoNIGP X-Received: by 2002:a05:6402:1150:b0:42a:9dbf:8860 with SMTP id g16-20020a056402115000b0042a9dbf8860mr48289890edw.350.1653719527924; Fri, 27 May 2022 23:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653719527; cv=none; d=google.com; s=arc-20160816; b=AYWmfQc8ru4Ux15hnKgPhG4p97n+aofhZsodm00BYMUAScAqPgyxBAk9uzk6157QUI aDzrLTaK2FfuxXsY560Ldwv9pU+bNtRRczrSwCcQC5O7cR12ge4kj18DPiVcSNs97Rux P6EbyNYQXjw5yjLZT+n3nYe/hlnFDnhIj7MR0k2c/R4c3ZN8TYqbCAX2/OvsDvsJRaVD 1UX3HZuxwtbXbS0LXtUKqr7aizFrrxpcTgqr7rAos2sXyzv770X31NNo+8FuGhY/v7GQ hzXTN3P7n06VprXppzwRiNo6kCrZz9niPkQtvqRP6gHHyAzXfTov2AJXeBOfemQOGndx iYRg== 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 :dkim-signature; bh=dYDoTOBOgliFjjVom8iUQ6u7jPfojEvTePmzQy4rAHc=; b=vrOqkhED499aDrYK/ZMBdArj+MVgkBScz540sTHMHrg213YchoApPT70m1/XYS0DWV MHNiFELY9c0flbIeHkctQd1kmY+0gcSYU/pC7t7UTMEIlnNgtI3tYRwcEdCBw1DEasLF s1jfX3K9SV3DC1de5HM2SEtfNuBaqM0SJdnexiO8KQCnjqxWnhGjCWhYmbrHpyKDaIRV Yglz+ZhRLQPRfrYaVEfl+dwoHk3ranfVHKcfjFYr0gGi7Jeld3CPjrhy9DpdroXSLZCi qHEBAhaehLbvtOo15y/Kn/XhSe6TFd5+VsrI/80TUL8c9pPMbPA7x/7etcUM8rPN7alN P/Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GCNfDyHw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn8-20020a1709070d0800b006fef85cfcd4si5601864ejc.384.2022.05.27.23.31.42; Fri, 27 May 2022 23:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GCNfDyHw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349544AbiEZXye (ORCPT + 99 others); Thu, 26 May 2022 19:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349532AbiEZXyW (ORCPT ); Thu, 26 May 2022 19:54:22 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D0B9B82CC; Thu, 26 May 2022 16:54:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 7343C1F4088D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653609258; bh=5Mavp4oALIXdPN+ziHKcCdoikrrk4yQKrexW04s8O+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GCNfDyHwva3jnk23dJ6QCm8KOFAi1gjRCYP9xvOs94W2p7deUvj44P68aLsjE/7u4 yfwcfvNQr4nmbq52kvoniOE8I9kqYDxW3E/zJsq0wztbyxUJoWfBM+sGz5sj1vP3H1 2vGOjrTvEf1oTtWzvBJYCeI30H+IFh8vs5cf8GYlVPtAuYsIX/4NOWwLNjQpHii/el xpF91QL9vdycQFlnx5rTQyBbB8eKCgGWzed9YAwG2heRHBLbIhmlReZDCc5gSLh54+ qewVvEolbc/vSS/eRiv+h9jFugsNQsuaCSWUqlG3uE3J5QZULCTn9GPAlkp9ZR9mS8 1NxdCkIbiyuoQ== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , Thierry Reding , Tomasz Figa , Marek Szyprowski , Mauro Carvalho Chehab , Alex Deucher , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko , linux-tegra@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH v6 03/22] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error Date: Fri, 27 May 2022 02:50:21 +0300 Message-Id: <20220526235040.678984-4-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220526235040.678984-1-dmitry.osipenko@collabora.com> References: <20220526235040.678984-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be unreferenced and not the shmem object which backs the mapping. Cc: stable@vger.kernel.org Fixes: bdefca2d8dc0 ("drm/panfrost: Add the panfrost_gem_mapping concept") Reviewed-by: Steven Price Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index d3f82b26a631..b285a8001b1d 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -518,7 +518,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, err_pages: drm_gem_shmem_put_pages(&bo->base); err_bo: - drm_gem_object_put(&bo->base.base); + panfrost_gem_mapping_put(bomapping); return ret; } -- 2.35.3