Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp617165iob; Thu, 28 Apr 2022 08:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeBaP3PHmWu/lmBt1Brv6u2XZlF4zuWWejQY68fwGdBxEuaQZQw0VwsKAWSy53aO/Jyf9r X-Received: by 2002:a05:6512:3b9b:b0:472:124a:ce37 with SMTP id g27-20020a0565123b9b00b00472124ace37mr11839339lfv.151.1651160598252; Thu, 28 Apr 2022 08:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651160598; cv=none; d=google.com; s=arc-20160816; b=Y1JFFxnbWv/zAxOD8rsJDXS3DB8SSvU3n+U67Y7TmjlqFJ6Z+1Ilw1Q1XEtHUH8jZV rrqmZslsTrc3RV7s4/oc6UesgfZ0OB6bPthirBx9D6FtOyoowgFP4xMozN+sSy76cW/R +T/8AAei885JqmPox9omJy9LIty04onRnjt3lgvHtuzzNaHIFV+7Z5eymrPaAv1Or//a DFaFHnESEeGuUpzj9iCsEgTGkOfnh3g0oV5YggwdaUS8ZenVOYqxBRQ+ooUjr5gWZk6s aGJtnl9k5wbVHlTrC8YudD0/syTJYt/nmXeBLO3/lYzmMD0PKHtWSTyYvFxwGkDZHxBp IaXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=K5Ma2h0Yto/xmSP0t5XS9V28WwPpbE6K9pcnzaHXIRg=; b=M4VTutr4F1J9xxZ4TVFv/vRaQM/cWZKUAjDYkE18hOx4ODqofjkgkmhTxOUVeoGvSQ vUTJNtfrZ6ezyyrV06ZeCbBBArXCeVmWVmUOvLrsiuDqB4hpX20JVh2gVLP3Bj57U6rX EQCg2+ZhHzP9G9el0sUcJ4c+ZYfuj4jW1Ij/XK4KvC5L4h0kOSb4/8pYBkv5xK/l8A5m lmlmoyMj1WshjVOovlIeWwpBtWG0hoi4WlBrPOkFxbDU2fi+Dmc99E6kbhq98hBxAjCz fNdGrL0Oc0rqPN8BKS7ZzyuUUGg8xVrSZAh5tE0Y/tTquVIa/+v11yzcsuMWVMF6EOvD roxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020ac24e08000000b0046bc1ad719csi5701486lfr.95.2022.04.28.08.42.50; Thu, 28 Apr 2022 08:43:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235396AbiD1NWm (ORCPT + 99 others); Thu, 28 Apr 2022 09:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347125AbiD1NW1 (ORCPT ); Thu, 28 Apr 2022 09:22:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 455419681E for ; Thu, 28 Apr 2022 06:19:08 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF6831477; Thu, 28 Apr 2022 06:19:07 -0700 (PDT) Received: from [10.1.31.24] (e122027.cambridge.arm.com [10.1.31.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D568D3F73B; Thu, 28 Apr 2022 06:19:02 -0700 (PDT) Message-ID: <37dae9fa-dadf-4b80-fbea-689472fd7dce@arm.com> Date: Thu, 28 Apr 2022 14:19:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v5 01/17] drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error Content-Language: en-GB To: Dmitry Osipenko , 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 , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?Q?Christian_K=c3=b6nig?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko References: <20220424190424.540501-1-dmitry.osipenko@collabora.com> <20220424190424.540501-2-dmitry.osipenko@collabora.com> From: Steven Price In-Reply-To: <20220424190424.540501-2-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 On 24/04/2022 20:04, Dmitry Osipenko wrote: > When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be > unreferenced and not the shmem object that backs that mapping. > > Cc: stable@vger.kernel.org > Signed-off-by: Dmitry Osipenko Fixes: bdefca2d8dc0 ("drm/panfrost: Add the panfrost_gem_mapping concept") Reviewed-by: Steven Price Thanks, Steve > --- > 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; > } >