Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp932387iog; Thu, 30 Jun 2022 13:09:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uyBw1Z1cBV+UkF+f6vtRZVJCRomWiYyEIWM6lpeKIikqfKE/a+x/s01OTmkDsmCzw7oAZr X-Received: by 2002:a17:906:7742:b0:708:ad9f:8e88 with SMTP id o2-20020a170906774200b00708ad9f8e88mr10460061ejn.735.1656619768523; Thu, 30 Jun 2022 13:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656619768; cv=none; d=google.com; s=arc-20160816; b=M0Y7LRcPYzkppGQctosdJPbV37EdmOvhPo+s3p0yXP7e4aovZ8mlI3dPaUQzUrfirW Ue3/Kl59tNAP61ugkZZ0CeDp0e0byLhhMTzz/qS67e+xyySFfaTUm3TCLxLgHvK3Pewi FDZ2ohJtYz7TodAfxW9U4bHm0fpKcBOUBOQnyAMTKND9aeqxrBR1QF93nsx2d2an3rqk xdVQ0U2p/fFyW7IGuMUI0Fi5bgiboBrOrPb/SM8utILRuwJ1Z2t9qTsNjoJ9lxPI/hX3 8U2PFxBJPY1TsCnJp0SESsscLwC2CMakUcscY4pBdiI/x2SjNw9oj4jI3Ogn0pNvbyR+ PBMw== 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=1mN9G38OZqEQDMOC5LAuX8iJfTHJrxCvSMPFk1gI5AY=; b=n9BrkhIX0zksV0EfX0A67+h8Clq+FbQS1//irsEtPAhsfzy/NDyNQDtxeC9v83vZV3 Bocwb6FniMOW1Y/j1zYMqGyly/8V8SkjfDl7IN44B1cvBItSGBaLJAopGJICanozYdqr rjtWcyYsbzJUD7uNs81p0eqj9pqv8RzMNs6r8UnVQWPpMg5nYOs3othMQwB1PkUvV0n2 w2PA2MeAHwVbs/ba5Xif2o/tQUxr7ql2UOm1p8uXNjzpu8Fg7qoKh//71jwqL5ivVDMN hRBQq7dciSWX46eJDADTTxdaaEnp1lsqHkvaJjUcr0jV4pW44TvLe154EUiFyrStoBp6 jLMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nOtpIMLm; 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 qw15-20020a170906fcaf00b006f3a874f673si9115305ejb.4.2022.06.30.13.09.03; Thu, 30 Jun 2022 13:09:28 -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=nOtpIMLm; 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 S236857AbiF3UGd (ORCPT + 99 others); Thu, 30 Jun 2022 16:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235463AbiF3UGb (ORCPT ); Thu, 30 Jun 2022 16:06:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D663B568 for ; Thu, 30 Jun 2022 13:06:30 -0700 (PDT) Received: from dimapc.. (109-252-118-164.nat.spd-mgts.ru [109.252.118.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id B62C76601970; Thu, 30 Jun 2022 21:06:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656619589; bh=OhSkXrSS3JerWrWYxqJzBuqGxBc+62T8wuwKfrF4ixA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nOtpIMLmVVflkHoW+a4+UtPNT5eRi4ZjuwXVuo85uWmlu096b8gf7QClBheALXclk 9igku/L5dyRPv6NgkbZe72JCcBaacR0XzdiwREG8UDRG5nJzBFtAxfGn2D3BdCBNv6 1ziDPRtsYgJf8mtzm5i8E0cvU09KkoLS5B0yEx1BJNyF3Qouyh+LJZGjJVmUaPz4Tc czL+FuDO6CReouCH8krC4Ak3TTX6ZPh25rYvQ/AAtEwL+CsI0AyLvukOTcr6DfGcm6 CjvhC2S9STTKUthOUm87UH28xpGm/UBV0xifQJbHmz1y3E7w7CM5Kebr0iTfz4qfJN ouSfcwlqUN8rA== From: Dmitry Osipenko To: David Airlie , Daniel Vetter , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Tomeu Vizoso , Rob Clark , Robin Murphy Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Osipenko , kernel@collabora.com Subject: [PATCH v7 1/2] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error Date: Thu, 30 Jun 2022 23:06:00 +0300 Message-Id: <20220630200601.1884120-2-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630200601.1884120-1-dmitry.osipenko@collabora.com> References: <20220630200601.1884120-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_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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.36.1