From patchwork Fri Aug 30 15:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Coster X-Patchwork-Id: 13785234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 025A2CA0FFE for ; Fri, 30 Aug 2024 15:06:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7052110E0BE; Fri, 30 Aug 2024 15:06:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=imgtec.com header.i=@imgtec.com header.b="fbs0tE9o"; dkim=pass (1024-bit key; unprotected) header.d=IMGTecCRM.onmicrosoft.com header.i=@IMGTecCRM.onmicrosoft.com header.b="m+xc8Vrv"; dkim-atps=neutral Received: from mx08-00376f01.pphosted.com (mx08-00376f01.pphosted.com [91.207.212.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F15410E0BE for ; Fri, 30 Aug 2024 15:06:18 +0000 (UTC) Received: from pps.filterd (m0168888.ppops.net [127.0.0.1]) by mx08-00376f01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47UCpeOd025514; Fri, 30 Aug 2024 16:06:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imgtec.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=dk201812; bh=zqjGe6azUDp/oDJEhF+InAf/n TZ+rnGt0DmhaALEuMo=; b=fbs0tE9odmplhUD4flGb9WYnTWMKwCUl/nhUWasl1 WdmNOKZP5Ydy2HCqSZAhz3YgbcaZl8bNQEy3yP/fyTdUa3ROZivi9fwzuHCNV5BD Bm5+34y06LxXqhWoA/2dP3FQ41qYcRpdq/mCdlG8LQ/cPVPAois8eXmdcbWfEFdW 60FqEku64WnE2aW/oSA73pzM6n4mav5xYfjS/N1EzE2g8zB3NtbkzD8hXUhV5lAH SnIW9Tn8qeQm+qSR2S8n15jMyvwubcEzabdmTTsB+l91lB+r9FQaNwJt6FGWj4pS zTRAUAZESUHx4QMa1Tsz03truHKjMbRWeLGHqyJibj8vQ== Received: from hhmail04.hh.imgtec.org ([217.156.249.195]) by mx08-00376f01.pphosted.com (PPS) with ESMTPS id 4175ss4qgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 30 Aug 2024 16:06:03 +0100 (BST) Received: from HHMAIL05.hh.imgtec.org (10.100.10.120) by HHMAIL04.hh.imgtec.org (10.100.10.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Fri, 30 Aug 2024 16:06:03 +0100 Received: from CWXP265CU008.outbound.protection.outlook.com (40.93.68.3) by email.imgtec.com (10.100.10.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37 via Frontend Transport; Fri, 30 Aug 2024 16:06:03 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YGAYvhJjbsVyl1DGLiw/ddwwb+DvcozsOyaz/g/MmBBj3Azc/r0Y/lAB8yahn0iv77WxRcGLeIo9eV4DaiBjOMWMxKGtvsOePQqCmS+036QIgIV7+443DDv18NSQO5iPyJeyN1WHtUJelwjShpAmo9Y97jMyKXTFhMKjKHcE2DFpFFbMp0t4GHSuXxP9H2FpqeZBe7fOH1x027cjWtWnzIHN4ZAFOrWHBOC1m/cT1+89qWmM0kI0S5KZvizcOZDqYDfI10REUxgh49asPEZchr6J4QEckH+hvfmaCRB+InQj7RNjlsFqqVQpZJMhPJK6BdGTKlfxOX0fNdxXi2SyeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zqjGe6azUDp/oDJEhF+InAf/nTZ+rnGt0DmhaALEuMo=; b=k7Qa1fcwus3nySZmeq7ygdiLVAizrf84CJSwWNBqkf/4swUTEKrh2Zs6ElscoNbA052u++pJbn0ahxCJv/N4AH3uzxIPldz17ey2buWxzacsIwOUqjrzlUpXUPEBJBgxidP6A/BSL7lvTLRQN4qXSugSPNFDxGvCxlOFZ+u5ouGSXuFJ2+9Ree1oauVv5VUz3X6RXmFnJkdCPxT5DmX7kwkExkPgPJeIwHh0uANqGUHKPt83uym7F+czJshVMpMviPM511qOgBZHOJJaWdXzUrtp6AcfA4mZvYm29PX2LHJpA8ld7dYty4YjOL8bTBFnRaaPxv+xEfVctNJBa1A58A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=imgtec.com; dmarc=pass action=none header.from=imgtec.com; dkim=pass header.d=imgtec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=IMGTecCRM.onmicrosoft.com; s=selector2-IMGTecCRM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zqjGe6azUDp/oDJEhF+InAf/nTZ+rnGt0DmhaALEuMo=; b=m+xc8VrvYPDdBPe3ztWyIvxs3opviMdYeJNJR4rLb4Jm3ZzzdFLpQYzi+V0Vkzu2t1AF2L5dJV74JOeVBPxgLvqgPSiHpbjFrn2BqkiHO1WJumjeC1NGGlT+dfDJN9TBYgjW4P2OFNkb1NoxCJtMVRbqefnBYek8wMCeWV4TBmQ= Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:e7::8) by LO7P265MB7800.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:413::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 15:06:01 +0000 Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15]) by CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15%5]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 15:06:01 +0000 From: Matt Coster To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Frank Binns , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH RESEND] drm/imagination: Use pvr_vm_context_get() Thread-Topic: [PATCH RESEND] drm/imagination: Use pvr_vm_context_get() Thread-Index: AQHa+u4gZ2H0mIcdFk+0LcWjG55H4w== Date: Fri, 30 Aug 2024 15:06:01 +0000 Message-ID: <8616641d-6005-4b25-bc0a-0b53985a0e08@imgtec.com> References: <72fa30a5-ddbf-4957-ad5c-5c941747be5c@imgtec.com> In-Reply-To: <72fa30a5-ddbf-4957-ad5c-5c941747be5c@imgtec.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CWXP265MB3397:EE_|LO7P265MB7800:EE_ x-ms-office365-filtering-correlation-id: 58e46240-37e6-40b1-0a50-08dcc90542e7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?wpYI0x5spJnWk0OeTAT+PIsfVx0k80S?= =?utf-8?q?HdQZTz3JGDqlyjGfvA8g2Y+dKO9dH13jGqQf+5M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XzWUINOTiEINOlWXktXyQSWRNssGWSF1?= =?utf-8?q?CGdVcpCnTrenj2XwuMWXGFuTp/zjVryyMsOTskBSgoBQzOGHZjTklH8BfQVCoAiX3?= =?utf-8?q?LXRO1e+t3vWJ6wvogHDWRHdHr7GgIyyAl0lF2+xhdtmGHnOS3eoZAr0DkWgNLm+5L?= =?utf-8?q?lcFSQx9YFEy5W0GaXBrT1L+bSPUap+LLfmYxZSwwRJ7AP1SJL+07qWaiRETTCjQmh?= =?utf-8?q?M6PFfgACWvDqCkWh4MGLwpHU/Br4iwoOCsFAG6gYZpiQvj2gH1sSgmnQbdMES9+kE?= =?utf-8?q?kHz1MFDeMm8FYpkKoN7V6z3lmjAwJakQDgghL/lbqBaUhWAkvD1Mx/K396cbfA3dn?= =?utf-8?q?EiCPMZDcABWkWmCMAzj+N7aO+83BaKQcMYOkTgZQ3/Xkq/Sfs9vacBz770q8JHi5b?= =?utf-8?q?rAUqs7qH2yVjiuh/T8Eip7CXjedutTL6IA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?gZDNO3x6t8KypvrPFw2o4VIC4q1Y?= =?utf-8?q?npvkh8QO0spf96lQDd02GcdGuGN1/RZwO3iE1NWf2l7PCa4eFlRBhmtLrBsd+Vdrg?= =?utf-8?q?DSkUQP3iewrrbNc41ru1d0jq7Ykcc57MjbExmZ9GAYbxrLrsJEutOJjCahENCzyVB?= =?utf-8?q?fyE/6sTylFScxm3QvqXchRF8LuIH/FZjZRsrDUAMQhJleOfgcoNW6h0MTVjds3smq?= =?utf-8?q?Gl9AyDEyB9BPrRmdZEvIf/IM4EtgfB/H9Tc7P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sRQ4EvJz8yoOtVea7KHXDpACibkeR5JxIen?= =?utf-8?q?BvsMvgU0JUGmS/EuK5OCec05aAyX/4xM3dk4/GIqwJHTwk6sAe/ta1CEqvV0gk7z/?= =?utf-8?q?XX0OhYZTQEiTmrFUjsIxrFfqhahU3jq3nUr5N/JdpaF9UDPc386MY27wG5MzZz88/?= =?utf-8?q?KhllA8V3hIQ35MjSqPcihH45naI3KhCCDCYO3MW6SZWzm4h4KkE6f7xwGDpR1VVie?= =?utf-8?q?vY6EJAgpeAIV9vuiHRRQpIyvhCEruEghH6vjsI4eIYwGKnxKfn4hHp+8CoCTF2FnS?= =?utf-8?q?n5JaNylvrCMmQca9HisKmzFG6nm053KeDFQ3VXSwProwxLcUSx67PMKMJi1A2ygwK?= =?utf-8?q?w9fHWEI1sa3pHGBVFiatVdGDYrgYEiqDkpfYj2xbFe2zX39UuAh/bCpDCqeXscTi3?= =?utf-8?q?HJssiw3cWRToM/U5LmsrH/9kM0Ogwai7CA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 58e46240-37e6-40b1-0a50-08dcc90542e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2024 15:06:01.3762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0d5fd8bb-e8c2-4e0a-8dd5-2c264f7140fe X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yh90MRASMWlSgXrMfL5fyBtlxVv0ZrmWB/V+M7EeMQNavJ1hhVURXdobP7zPpOG4vYRgehrxzJzvfMLN8r5RRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO7P265MB7800 X-OriginatorOrg: imgtec.com X-EXCLAIMER-MD-CONFIG: 15a78312-3e47-46eb-9010-2e54d84a9631 X-Authority-Analysis: v=2.4 cv=MeE+uI/f c=1 sm=1 tr=0 ts=66d1dfdd cx=c_pps a=6IdplsTJodF3+aqeaEJcqA==:117 a=6IdplsTJodF3+aqeaEJcqA==:17 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=yoJbH4e0A30A:10 a=WnR_qW7rlZcA:10 a=NgoYpvdbvlAA:10 a=r_1tXGB3AAAA:8 a=1YwCQWLIvWRl5UmCe10A:9 a=QEXdDO2ut3YA:10 a=zZCYzV9kfG8A:10 a=lWDfc6OkCw0CPreCeiEA:9 a=FfaGCDsud1wA:10 a=t8nPyN_e6usw4ciXM-Pk:22 X-Proofpoint-GUID: 0fPqxUqWGGLjWkvvPSQQ_7lwe2nrK-2- X-Proofpoint-ORIG-GUID: 0fPqxUqWGGLjWkvvPSQQ_7lwe2nrK-2- X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I missed this open-coded kref_get() while trying to debug a refcount bug, so let's use the helper function here to avoid that waste of time again in the future. Signed-off-by: Matt Coster Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code") Reviewed-by: Frank Binns --- drivers/gpu/drm/imagination/pvr_vm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_vm.c b/drivers/gpu/drm/imagination/pvr_vm.c index e59517ba039e..ffd466509d0b 100644 --- a/drivers/gpu/drm/imagination/pvr_vm.c +++ b/drivers/gpu/drm/imagination/pvr_vm.c @@ -636,9 +636,7 @@ pvr_vm_context_lookup(struct pvr_file *pvr_file, u32 handle) xa_lock(&pvr_file->vm_ctx_handles); vm_ctx = xa_load(&pvr_file->vm_ctx_handles, handle); - if (vm_ctx) - kref_get(&vm_ctx->ref_count); - + pvr_vm_context_get(vm_ctx); xa_unlock(&pvr_file->vm_ctx_handles); return vm_ctx;