From patchwork Wed Aug 28 13:09:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Coster X-Patchwork-Id: 13781272 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 613A7C54FAA for ; Wed, 28 Aug 2024 13:17:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB22610E515; Wed, 28 Aug 2024 13:17:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=imgtec.com header.i=@imgtec.com header.b="MQF+pp4L"; dkim=pass (1024-bit key; unprotected) header.d=IMGTecCRM.onmicrosoft.com header.i=@IMGTecCRM.onmicrosoft.com header.b="hHKN7uCA"; 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 AFE5E10E515 for ; Wed, 28 Aug 2024 13:17:32 +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 47S65SJQ027701; Wed, 28 Aug 2024 14:09:17 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imgtec.com; h=cc :content-type:date:from:message-id:mime-version:subject:to; s= dk201812; bh=+zvV9byuqDMnVUBdDzwRq4xcdd0a3cR2UBm1oXNHWhQ=; b=MQF +pp4LCQhznYfZ/OTuhxdXCZ5RE54j9+KTXY8J2ShY3gOtsS9UB3aGMjuScg0mlTx SxWlSp5O+lC3SINTWiu2qXqxsbN6K5wvCVVCayUCwsE/yNJ0H+Zz2756fPBzXIbf 0cwH6ZyNGL9vVc03CQiNNCA1CK7MvRYVWa5gDoAXupqIUxzmuYnMxybt2f6rt1b1 J4D6Ohyhs1E6LJoFuoBQf1TK1qq81drxkxsDxUjm8QxW+KQuFRnNR1SsNx3pNyGK 6lQ2ouEMA2+0RGiG1xuRgAGB7eAMfoTPYjUWxYCsAbkbumRpm2K49Q6SvZnFxLmr hdREjUsqAqDRWWc23AA== Received: from hhmail04.hh.imgtec.org ([217.156.249.195]) by mx08-00376f01.pphosted.com (PPS) with ESMTPS id 4175ss31pm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 28 Aug 2024 14:09:15 +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; Wed, 28 Aug 2024 14:09:14 +0100 Received: from LO2P265CU024.outbound.protection.outlook.com (40.93.67.27) 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; Wed, 28 Aug 2024 14:09:14 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=obbQoJ07ntu1hrNCfFlWwo/CaP8aIzQ7SRcM/1UZohEqWFKmHVilcV1j7Sp+a9k+DvNeVfwVaHAb2pqRrBhgg0fn/6Sjs9dtxb/elUWcyHMI+3+LryQo7iIYsZaeyz9vb68wbyGphnLQlV8KherHW6s5Q16W2b+A/mXJbs9kvwcSaWm5MtrBU8obwEeSC9VdTdDhchwjnjnCOLU91zSizLB7II4Oc6pnJE7EQfJdpQSgcfgFAvfJ4ishUyPqZ7QLzOHuYK1t4xoqYhcNI17Cu4KRwBk0L3FONPJOoERi3O+DTX/WyvhCXkSz+Vp+1V2MAJ8alNZR3qhJN4MyK7ScbQ== 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=+zvV9byuqDMnVUBdDzwRq4xcdd0a3cR2UBm1oXNHWhQ=; b=dH+d2DuJ4xGEvNnEgSMCdkxsqVhjmmekFXta8FzhSFHQMljUGaZhIld1tae0V7AYc/UlDNE3IGwmwP6kJsFKmhLfAWfpr+Ar5J6Oz4XJ2z7ZdQ7KuUGPmLrrdycROJnqRT4h0P09jg4q46iJ1HcqDKB3Iv6kG6YRurNDlT8L5uB7aSa1Uvawi9Z/fzADgEdDiz4tGLrzyYqthQXL+vhZHwOTz4EB3rSkn/qBHtkAI6/Zvq2s6krO7hSXywnFyjCuN2k815CGE8cFfpvPVFv591zQWmk0ar1GrGUpoCn+70HEvcZjefUPJI7EdLG8Cxnyc4GQh0pYoPcAnxSm+j/+3w== 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=+zvV9byuqDMnVUBdDzwRq4xcdd0a3cR2UBm1oXNHWhQ=; b=hHKN7uCA+89NXoj3WJ5+egIoz0MUb5BPM/ysvMb0DWGD9rjKXsDdps1H1BFqn8Agxa26lAf0wNBCxPXG/eWLiaRoycKRItjiV8oss85fFURKzxsrZG4AqR1xiL4UAg5MYQ+TEX+BspnuSYEturxRUfqrRYUWdLKxUkGu5QjTC14= Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:e7::8) by CWLP265MB2642.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Wed, 28 Aug 2024 13:09:13 +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.7897.027; Wed, 28 Aug 2024 13:09:12 +0000 From: Matt Coster To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" CC: Frank Binns Subject: [PATCH] drm/imagination: Use pvr_vm_context_get() Thread-Topic: [PATCH] drm/imagination: Use pvr_vm_context_get() Thread-Index: AQHa+Ut63vojNAp1DkeCGFbhPXW9+w== Date: Wed, 28 Aug 2024 13:09:12 +0000 Message-ID: <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_|CWLP265MB2642:EE_ x-ms-office365-filtering-correlation-id: 04499bb8-5b48-4471-fafc-08dcc7629c9c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?Vcqxy9F5xByqNDhWDsozt739iaNrJij?= =?utf-8?q?XVQsul4HSyy01SgfAYraA8U2KwwfXdOjpUqAupLKOmsr3zuEdkXONbRVjGqot7uVC?= =?utf-8?q?vGLclBLrgPk/UJMwwug9ozpIp4wbos2GefxXAkW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qP?= =?utf-8?q?BwexLB0p50LDbFXeBB+ezpjve+CveFomDkRrpYePcMkYnBOE0N2Rrepa5XoMMup0l?= =?utf-8?q?/UsvMcz5rK+vTEI8v9Dh0IW7ZCvHjLxNRLj246j9ajDbys5nonqI04jqNBOIubdfn?= =?utf-8?q?xqJQlM5W0xt1c/izDkaMNSxuMwpxqBMc5E58k1+ZdtQ+u7kBNFFcKQazg1QiOGGiP?= =?utf-8?q?r5nTzaD0/dI3cWpheh8MeiHiYBwwl90BfjAvgn+vNVQACFSAzoObo3gGmDn8tR2ET?= =?utf-8?q?8X6m7aEsK0kci4Y6vU+qgwsuYzmJFkqFV+uYMm3o092TDaoIwWfj4ZxHcjdx0yhaD?= =?utf-8?q?83f7lg/WalJ4G8Z7ZMBYEBAReIjJAUB1XQ=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)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?wbNVh4sabK4uj/9LDWS9PHmAVzIR?= =?utf-8?q?vUcsq0kPNR7iM7kXgfvOUdGqp7LsVK71YJajwShcIp1LdjqeI+9vrnTRd33ZVeia3?= =?utf-8?q?ktBfbgj8lRSyqXldNte6NE6evCXGRBM5VrnCVk/FTxJXUQMcWmgLH0hiqCREjnrKg?= =?utf-8?q?ePWjJV+Q/7FJ9bJ1pecLnkCsRU1vs3tSc9384wqyq2efRf0hyX+N9JgKudQIh9Uhk?= =?utf-8?q?Qm9jyTFDT70jIkc4JMF6VUd5UkLR6KCwwpoQiPEwTP4M2QX96bG1OKnsxgg1cfa9o?= =?utf-8?q?6Y0wTe0659gzwsFrCR+Q0WdputxsNE3cmrnBwR7GOFm0B+KT4aXfgdi5pl3DuWWXg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W9rQ7BT?= =?utf-8?q?0+XhuD0VoLbOeHjDmDHZ/MMiQiYM4zoK0OYxr2YojN8VEB2FVe1jRdS6k3/0Su8lS?= =?utf-8?q?IqZC6xlDG6V+aaNuv03PSPFhExFbG+9U8n1p1nok4T3rzIxk5eQWotgQHUPoOJRC1?= =?utf-8?q?BIcVEtTBaLy4A2vCJQ2ZSXTdAV/AO0Kph8CZt5qPt0ipt2QdYlks6FYI6XqWopYo8?= =?utf-8?q?n9WHC9qtiNCCmemWX0KV8U8YHSk9JD2/G7yh6IT+avhG7nQE4pgNwYeiEooBszFw4?= =?utf-8?q?nKZNyK7sN243+3Z5OgqEGFAG6vlIiYCrV/kXPTn3JmTj9IydYmvMf7lZwoqmyOzDe?= =?utf-8?q?ujvlC07nsKoAPkZeqvEIrg3yUgqC7ySlqQ=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: 04499bb8-5b48-4471-fafc-08dcc7629c9c X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2024 13:09:12.7956 (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: NQQZ0nYOjFxmYLVoNH8D3BYghaR/FV2t49/bOeicXVa79W2mcVy9P4+Yh+eVjtvKSP6VZiAOL4onoySW7Sk7nA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB2642 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=66cf217c 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=8YfA8XZME4H0u7Jv9v8A:9 a=QEXdDO2ut3YA:10 a=zZCYzV9kfG8A:10 a=uQsQWgxg_WxSIe_9pxsA:9 a=FfaGCDsud1wA:10 a=t8nPyN_e6usw4ciXM-Pk:22 X-Proofpoint-GUID: Bx8YLoHigcNRFIqnzoUipl56urXxVaIC X-Proofpoint-ORIG-GUID: Bx8YLoHigcNRFIqnzoUipl56urXxVaIC 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; -- 2.46.0