From patchwork Fri Jan 5 10:13:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511911 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 2D86BC4707B for ; Fri, 5 Jan 2024 10:13:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C6B810E5A2; Fri, 5 Jan 2024 10:13:43 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0675810E597; Fri, 5 Jan 2024 10:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449621; x=1735985621; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=yRMxCdjoqIkD75SEuJzObVSQ7nqozqsXnQwiAAoCr5k=; b=gu0gTVYDADCL03lhtYyDYLIXWXM4TwL1aPBxLmJBVN1r53lHApgwIJcF Bwo5YwTA/pAv7c7LBloIPr+Tgb0JMCvbzphMLvn6Mz8VWpwdQF1vpGhVG QcuukhqTTAI896f86KKVf3lEzlL7G593W43kmo4RcJncQT+yYC0Si9cCz 2M/G9lZbqRWf24FIa+y0XCd0MvP1DXvXPebiUarqiwtbOCl9UWPhGFtZz x7aXBf/dGS8CmxBH5Zy0d5kEYYXXc50HJAthoEvk7sEKMRT7sR2uVmQxh nt6EV0CKAde4iUiy+dC8qBVJ83QKQWyyTWj1BGL1rVMUiR8yTO4dkrzwN g==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="376967342" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="376967342" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:13:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="904113836" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="904113836" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:39 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:38 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:13:38 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LvOPT4fPPq4IvgtnJAWCPlhBTBnSh8obh5loCp0z24UTCb+5/zc/ICv62MTmNt0Glr3pYLKVjDTv9rGCiIFTTrQ/iw8Lq+GlhyB/QXFpwgFWhX0MGtJHZf9nudYwdJ61yX3LBPv9DYtgr/i/5S4+/CkmZ34P2Z/BDu5Jketb3/b4Pz4SlW+4JTOHu0z5xU+E/w1Z47h86lJfHLwJwLP37kSNlYRuUCGzyWrUUPG9kViuScfwlEJuOoZ0gBu3gKa6kBjrTVyv9Q7TmtENgK0WPUYkC3MzkGxPcsNCgxTb37VbujhRZqheVEqQoaAhqLwSmAD4FHm3H+zsSoUVCDNYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=dkhLHh0crXwXx0APrqjN+/BQ8dQyd7xvanE/ap6H1sA=; b=R0YFAOPmoB8HM1dirpre1UbtWA91sWhFsIaEyFP13O2mVQJTtfY7Pp0Hp8ekNS7JCKxrIPgOMjeErk8NUul/BiEv+FQNVJu5neFSn7YTYliB/CGGO5PlUPpPkl0ZKwFcs9R9eFZ/c/9/CZrO5dGd4ygGykZ1rRH4B6SC8ICKqojXtX6B1GEr93AtvKQtO2ElzSxT3ymeWkkJpsnMyDLAP/1BFQrUqzsP7l4sz4rnspQeCSW/qJwZVkcWU52A36eiTF/RXcKzMpSe0Gs5foofWiOEwM6U75MZEuy1IGiw5ci/51p9k516E2NeIvtx0NAidveHflbq5jj6hReX0fOwnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by LV3PR11MB8483.namprd11.prod.outlook.com (2603:10b6:408:1b0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14; Fri, 5 Jan 2024 10:13:35 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:35 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 1/6] drm/managed: Add drmm_release_action Date: Fri, 5 Jan 2024 11:13:19 +0100 Message-ID: <20240105101324.26811-2-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR0902CA0047.eurprd09.prod.outlook.com (2603:10a6:802:1::36) To BL1PR11MB5365.namprd11.prod.outlook.com (2603:10b6:208:308::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|LV3PR11MB8483:EE_ X-MS-Office365-Filtering-Correlation-Id: ddd326fb-7d65-4026-4d0a-08dc0dd6f982 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a+7VUiaacYQS8/rz5N7EEP79Gn2D+/7DBCs1yiXbwA4vxpDinexuBLOWvrU3xJF+F5lLz3EIbRaMCGGC3HsY+7aDerU9UIQEYFLl/jySdagkww/akcK4t3t3yAWf7qc+G8jSHhp2Woeoc9CufZ3YITSd22N1yulcNGf2ygidhy0L4YMYWqIZl8v27+tbFXjXw6Xi3xcmrpN/o9q8EWcTnb0dxBFUtpUplCkO0Z4pHLFxsehc38fw9ASCnIglOACWSXgtHlAlKQBFxIJduKdWaQUYabtSovQHObA2t4X+yiorwhp4glBmReVIY70IbxY33CTg56vmxoq3xJ4Xqxqp68ouBnbcQJivMJ1anriJ1QQyhqpH4LN4D1+pQ9YgrQAAAWtlwsC8uO1IG9kZmb2+HTflxbDKFTCtf4G4tKyWa+mL8065HhmTz/7Xzg10ChuyIglkT7f6ZUKG2qD5wvoHr0YidTaoHgCK+iTuLMYKceeG9W01/em6cqOYaI7LPfAolVzbV1GSa0JvknXA3WinA+Onem/7t3rKoOAjKCFPH07/M7Ufo/MSiv1GW1bZ/DXW X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(396003)(366004)(346002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(6512007)(6666004)(66476007)(478600001)(66556008)(66946007)(8676002)(8936002)(316002)(54906003)(2906002)(6486002)(26005)(1076003)(83380400001)(2616005)(41300700001)(5660300002)(7416002)(4326008)(36756003)(38100700002)(82960400001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Wdsx1+u+YGTbNp332k/GlKepIBCQ?= =?utf-8?q?ZnPO9ET1L5PQ8KScCte15kYo1tzv50wHjxhvK0SAFQK/O5tZEgJTzN8rme7Z5019t?= =?utf-8?q?o254LPeox2vrNY8+YZd50AZHKPhju9J2OVs97ikv51NcVsBoiObVKT9WQ7yxQ5Asz?= =?utf-8?q?Jsg8VY/0Y/pxY5W3N3KOJIowkh3rJhQTpziHVCvZkhm76bA3l9/ZZmgMH3Ij/nIkf?= =?utf-8?q?ZODj6+qcpDpltU4sytaD2ZhJ/kffoQ3P8EvDq/qGFHO+/72k122w+UxmcL50iCgrQ?= =?utf-8?q?mlu0yLfGMaWlE5s5yPLKNhZ2hX8bOma6WDEL8SCLICfGGk8HQZxZ2fOrbj+m9YsEi?= =?utf-8?q?gpeTGg1pv3pyn1P10pbAdzrW7IXGA3V1sWihx1X50KIFCvEJVQdLvO9aPiGgneech?= =?utf-8?q?Fvw0GlzC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F4wc93keXwVExM27KvXt0bb8a70UQ5hLzV56qRo?= =?utf-8?q?V2e0vdqRP1DWuNr59/LVAgJCqMAJDfjjRRkl7esk8c+pxDuMx6g6HZj+CCWLpKxLJ?= =?utf-8?q?eI/n6wCFL+VydwjMldxlx3N5DUJo5lmulx8EolDVYBbEmbhjQdqctW5cYFmV4f1Rf?= =?utf-8?q?CdFnWfFLKjJROMIdng55JUE9Wp2T4oIN4kVMlcbx/HbTGxP3CORkHQhPWBQ7SZV6G?= =?utf-8?q?Z0h6k8wpPm84THq2dU4hn95SnwAplf1CCA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ddd326fb-7d65-4026-4d0a-08dc0dd6f982 X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5365.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:34.8979 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DRt69f/Lv302zLnuNenu2hiZ2//4pg6QrNB7QT2gaO2sJSQeYv5MJVO6U+MLxWWBJNnkjljdX7DQl9cEY3IsEM2VwPBDOar0VDl/LAG6/Cc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR11MB8483 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Similar to devres equivalent, it allows to call the "release" action directly and remove the resource from the managed resources list. Signed-off-by: Michał Winiarski Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_managed.c | 39 +++++++++++++++++++++++++++++++++++ include/drm/drm_managed.h | 4 ++++ 2 files changed, 43 insertions(+) diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index bcd111404b128..7646f67bda4e4 100644 --- a/drivers/gpu/drm/drm_managed.c +++ b/drivers/gpu/drm/drm_managed.c @@ -176,6 +176,45 @@ int __drmm_add_action_or_reset(struct drm_device *dev, } EXPORT_SYMBOL(__drmm_add_action_or_reset); +/** + * drmm_release_action - release a managed action from a &drm_device + * @dev: DRM device + * @action: function which would be called when @dev is released + * @data: opaque pointer, passed to @action + * + * This function calls the @action previously added by drmm_add_action() + * immediately. + * The @action is removed from the list of cleanup actions for @dev, + * which means that it won't be called in the final drm_dev_put(). + */ +void drmm_release_action(struct drm_device *dev, + drmres_release_t action, + void *data) +{ + struct drmres *dr_match = NULL, *dr; + unsigned long flags; + + spin_lock_irqsave(&dev->managed.lock, flags); + list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) { + if (dr->node.release == action) { + if (!data || (data && *(void **)dr->data == data)) { + dr_match = dr; + del_dr(dev, dr_match); + break; + } + } + } + spin_unlock_irqrestore(&dev->managed.lock, flags); + + if (WARN_ON(!dr_match)) + return; + + action(dev, data); + + free_dr(dr_match); +} +EXPORT_SYMBOL(drmm_release_action); + /** * drmm_kmalloc - &drm_device managed kmalloc() * @dev: DRM device diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h index ad08f834af408..f547b09ca0239 100644 --- a/include/drm/drm_managed.h +++ b/include/drm/drm_managed.h @@ -45,6 +45,10 @@ int __must_check __drmm_add_action_or_reset(struct drm_device *dev, drmres_release_t action, void *data, const char *name); +void drmm_release_action(struct drm_device *dev, + drmres_release_t action, + void *data); + void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp) __malloc; /** From patchwork Fri Jan 5 10:13:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511912 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 206CCC3DA6E for ; Fri, 5 Jan 2024 10:13:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D24A610E5C3; Fri, 5 Jan 2024 10:13:45 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3628310E5AF; Fri, 5 Jan 2024 10:13:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449623; x=1735985623; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=st5f0YlL88bWvM/DTkJaGPbw7YBOquFZiHWTV3Fc0yo=; b=CPBTtTTQa8tTzurLkFc2aL7lMkPYr/I/Dg9AT5gGTz6Zw+bAdjdaqwy4 JVpNrnwwR64wmhlHb+5sE9gbVT9m5VSIG2oztisGghHerE5TvWEZS+T+d vM987lvuOdoD6UtOyoSGZEoG5bDNi6D91n0LdZfM8VF/4enirXr1a4bca OKY6aEdIu3JofxLmydjjgAETEK81ac8+n1Z3u60MkJr5ImWJGuGh2AN09 MHao4Zbi/UqbUJXzA7BF3e/9iACdSeEEVgQfhlwUYuGwvSG1Jxjj/h7SL hkFDG6OBEQ06OBn7QSUeLKXJqyUl93ALV6hOgZgSb7AvEo50bnQHZemn7 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="376967367" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="376967367" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:13:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="904113841" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="904113841" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:42 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:41 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:41 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:13:41 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kaBnn510mFZDB2AD6vDS87D2hS3x3XvWD00mIDneBlRbi0/2F14O4+SVUekhbOV136HcqsUhLL4NK0W663XYqoPkKFhJt3yDod/ZTwaBHGLM4In8wv3XFfhyVUBcnO7w97bWiLqvA0Z+joPVDmEBdEO9eq1coGoaVDhWZkTr0aQMRsYxnAKnXV4K+/20s95AIVeYRNAAmWQOx9A+CDNw0mUQ4sYeX/Tgc6umqrJC/n5kxSs9JqwzFGEwVGLweYbyQhF8YGaBA6V3wihn7nevCTtCcGSs8f8iTpnAzK3SXbfNTPfJX1oZFQQk4zwasp+xHOC+Mtz0HG7g7WfjGRyL+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=OrNEy63RS/s+NA+SUvDkd4opujoahiFy5yQbnP+yksk=; b=Wbc2PcOcTrzJTgiQbanhYVQKK5VCD7WLuIn29XLk7ejWwoHryXKFNyEeSf85Y/gyXvExMXvcjapecxe0cW9y65c48BZsHNLdyb1VzAdmsbYlES8jZ97tIqV2UCQ/3eH6i9kYoEaLJUmNPn2e9E8DXLeNOqoCeqxo/XlmHWS+FtsvuaXwzsriUP4em5DTFG+NNqNkAEAhn4IYspc1XFoOY9bF3YuVoG/2MGI8QUTLUJ8YXN2C3I3Skyj1ipNI0EJsfvulrN5wdgq4Ivo4GrkC4GmISFICCagCKTMZqQfAVDbcNm52myijLD0nLBtbVlvImApIvFmIigY8YdlU7eilSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by LV3PR11MB8483.namprd11.prod.outlook.com (2603:10b6:408:1b0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14; Fri, 5 Jan 2024 10:13:38 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:38 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 2/6] drm/tests: managed: Rename the suite name to match other DRM tests Date: Fri, 5 Jan 2024 11:13:20 +0100 Message-ID: <20240105101324.26811-3-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR09CA0110.eurprd09.prod.outlook.com (2603:10a6:803:78::33) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|LV3PR11MB8483:EE_ X-MS-Office365-Filtering-Correlation-Id: d763c947-e00f-4c58-aa07-08dc0dd6fc58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Va3YUQtwnIUFjW8wlWEf2REUh1QZxpOdyeJoJDo5yOukxdU0dDoBClg06OmF0mf3EP89acc+3ljK11s2biNoOfzwWJs7zWJoSCwuWoAE9yFD1snSxQe2GI3J+k0XPuOtegmOKjgVvmOqVQvDnGnAltnaZu5zq8MXCY1q/ql9vDwaA6WJ9iFHi/Rjk12uTugG661ZtkoV/+Kbj7Oag9LFPFsHfOkVkiiIXvUAchGFMzZxKMD2Sk0yj+TRRdo2LKwrxgIvMN7ypHgreSRmpUpJhUQpkDTVTo6nMe1pwG3+gYGE95CcaSlR7zk6LxxWqqr+T0B5IZzDC1NtTpog7D7huacmuap8HhTszjL9YTaJqxBKoQJR2xNNEOpvKbVQA1J3lMYZL2DuD9jPQ+TReDEQOPSax8flLPYp7mkZe0yG7Xdt11enitpumLYEkPjjKHSMxOEgHPpZPPfH2ZeKKCt6zdRhRvl8Pg/hsnPvGW658P6frS3RsZltdrPV0FI5wJTIXGzLqhuUnQ74hn/aWw+qvAirD/PJpK/bvCGVUlbfu0CBKLf+aTROj4Qiuzgjp5jB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(396003)(366004)(346002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(6512007)(6666004)(66476007)(478600001)(66556008)(66946007)(8676002)(8936002)(316002)(54906003)(2906002)(6486002)(26005)(1076003)(83380400001)(2616005)(41300700001)(5660300002)(7416002)(4744005)(4326008)(36756003)(38100700002)(82960400001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?S4W1pROmnK5NoAS+Qjunhn5/4hk5?= =?utf-8?q?Lq7cJwozbKS4AVL5jdI+3JONdYxZpa1jzTE3uzTF5O0PsI4IlOqN/yTH4NrKW4rvi?= =?utf-8?q?c/z//VkEKJ8eNfQRlT7XXWVt7vP6ToRE3pUwp5i/RRNQqIm+pZOdbr1Og2YLlLfZG?= =?utf-8?q?BZpVpiDI13DiVQ7ELqkinAsMdbNH73vHi+xlblR0mcR5b9jm1ID7BWX8666lvOoxm?= =?utf-8?q?Hy+mHoHWTa6YXU2D6kIs+yK44md8+/OL59wG9dbHF0BKchB/Jdrwn72W++l2TJseb?= =?ut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HatVG7y98Mr/7wvmUUWn2QOZ/zOHJWxAJcXGZDI9kiZilYqJO0r/lTLFAc3ib?= =?utf-8?q?AJcRFIO2gZ/Xz0rOgcJYHIP264Ew4atDyFn2t8DjBktsFuYW7RIaNzPIgsiP5bN2D?= =?utf-8?q?kmGlEh7Wax3ZMzXugC1168TwpcvMRWE2s72TxL6zp3U0bGKe2bedwaws1FOwEcIPj?= =?utf-8?q?GALYc/fOxhVvBJo82hRZUIn/XKCTOMHUFgGqRvpoAkrQ3s8kBoteCV5ZYQZSvni1M?= =?utf-8?q?4HBNc1ySPDBcLSQBX54mXSC1KAqqAXTg5ijZIJpC/m+CSrZ5j6LzJ5qm3jKqjikrb?= =?utf-8?q?NYbAj060KTZxb+p97zkYziv3vY8K6VhussD4l/fC+qznqyREJwxgYmH5jqu/4sAuP?= =?utf-8?q?GpEUrIdOWsNs1VAo/TZeSAhLvT8ANLK/Uw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d763c947-e00f-4c58-aa07-08dc0dd6fc58 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:38.8870 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mC5eGwEeMrDQrZtptERj83B1kxpJ8z3hnEg52jiMcbJG3lUZmJkl+Q3mKdx6tR8cEk1T+QemnA+boQnIJU7M7DgaTireywgSsFBNFDIvnSA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR11MB8483 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DRM tests use "_" rather than "-" as word separator. Rename the test suite to match other tests. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 1652dca11d30c..659af5abb8014 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -61,7 +61,7 @@ static struct kunit_case drm_managed_tests[] = { }; static struct kunit_suite drm_managed_test_suite = { - .name = "drm-test-managed", + .name = "drm_test_managed", .test_cases = drm_managed_tests }; From patchwork Fri Jan 5 10:13:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511913 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 EA30FC3DA6E for ; Fri, 5 Jan 2024 10:13:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2114510E5CA; Fri, 5 Jan 2024 10:13:53 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7049D10E5CA; Fri, 5 Jan 2024 10:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449631; x=1735985631; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=+g82cLTvUsGz2O7XsukpBKdt2b9RHeeaq9tCoTcWAok=; b=dyz2OkiQfZIb6Ywmf+Lps/+3fGbtzqLMOzUaipzPRLoIff6kOQwJB+Xb yomdcXYZkdaJZgK2Ej0fiU3b7AGORZNmx2Lo8vioajPOh+LiI8dfTZQS/ 6+8XJg4w/IYiAyizeaNdKyNmEcPpY9+Bt+WQz5XyvQ34YeFXcClSV676d jCOsD4JnscZR+J87UArXTU+mvO8GGgB1mZHI2FJDOoahLTwlHRi62z2Tp q2+5h8dgnzngayesyXrNf67esl1OshLiOitfFRHAL6MsrNjdllODFD+W6 t0kv540rrY7GHOGuYkxU3ujqaAOdtnRmppRGz83X/LqyUMv1FZyHRqLHO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="483651616" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="483651616" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:13:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="730435432" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="730435432" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:50 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:50 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:13:50 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJDRpd1t7VCg17o5kARFJJzchI9C6DW5dtApBh7kmBjSGolWD926qXDm03SIk0HgBjieIJeZ/TLpAUCYRDsAayA5owJmYTFz9s/2wrDf1aM3L6bc1NMjmU89HG/jB4PPA4ktcP/lt1ZLdw3NtAMldRuDPsHWAQ0bJ15oZCB+fTLxZRnfR7PMZGTSHbI4cfdT0ODO/u/JQDAh6YQc64DvoHtFXZ+MCQbUlqLy/sghfu3Mubk2e9fepVDZNURR1qxzzloFVw7gn+gGuwRxqE2DKesi6KPGs00NKtoznbMoUpD404RfgftjJRKDeDbJ+GegK2zbCpIjWKr7gCGG5GUlBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=M6GlbfUjH/bsmaWYDJhAQjSWjM3UvIDXd4Dwp770O5A=; b=RXBeqvCUkY0/kJ11y2/f2uS8GamM/Sh4xMMADFBjQxIC9SeBn1hGFdLd5DDDdNYIK4eSdQgbVbjk4qVbB6VlEcLJCZ1toChggIAF0cg2AvIxT4v1BHFWbM7pZzK4ZISOqpVxKgOViigKO+PhBhEMMeAGCvEqnF77qox6JohdLMVSVFMRuo2kYZp7pJN+DfNedBZEAjimHYRFE2MIl1Kw2j7dSelVi4M7CAtlozRS5i0KAc87VnRFFUQsP41tFjJZYXpoILDGQckl8YSQtdoL/KEJEkFiZcYNTUNfSNz84k9aEb1C77ScGc6AtljIYEsL432m2rlTJAwujOwQz9Dq+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by LV3PR11MB8483.namprd11.prod.outlook.com (2603:10b6:408:1b0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14; Fri, 5 Jan 2024 10:13:43 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:43 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 3/6] drm/tests: managed: Remove the waitqueue usage Date: Fri, 5 Jan 2024 11:13:21 +0100 Message-ID: <20240105101324.26811-4-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR0P281CA0103.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::16) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|LV3PR11MB8483:EE_ X-MS-Office365-Filtering-Correlation-Id: 0896ec80-533b-401d-b573-08dc0dd6fecb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: orZQMHt4uMgHSG8qg1u35snUFrWwkAd+T97A3XDZrpOi0z+wavD/4LRAbs0EjaF9gZu4KqzOPT3VeKNxyJPm8GcoPD8+yt2ygFxUPkA0qEqQpFY3d478aXE12ugs9okIzxUHmq+edCYqGPLlgzL8Kskhtq7h3OxIya4kY1S5LY9hnPQCeqr0e1YmJCLIhsF0BBwC0MBgXSnNpaEwZhkCAVMV4ueKJmnFF34ogCJsjgI6vkmukoT5xwPq13HnVNwT/Nk3gomiCEQC0mcjaP6Gz01oxIFG/l4kIAZwCLBlMETAZFH68ezHA5ugqZod6BlbgvxfC47uC5nlmvBxmJTntquQF9lcx5Cj0Pg29HV1a39Ss2wjk6AtBAJhZqh4/W53xqtrWI5vVnoJXGRXoH+f3gnUFiUrgf9nBkELyvSgI0Ha+pp0bCXaNrL+7r5cvBXVqnQaj2JVC0gSfnORdOEgvm2DA0k1B8J5EjRiJEfdEfkL4FE2plpKHYxjvjB8YpbDdrkKtrTs8whZBnk1Ffu5PWAvyZpnXspjKU1MhmNJGnKUUzHf641oUNS1S0VVj+1A X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(396003)(366004)(346002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(6512007)(6666004)(66476007)(478600001)(66556008)(66946007)(8676002)(8936002)(316002)(54906003)(2906002)(6486002)(26005)(1076003)(83380400001)(2616005)(41300700001)(5660300002)(7416002)(4326008)(36756003)(38100700002)(82960400001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiS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aJ+CCNGJwfUSd/mjBwwsV5hqOBiVb8W0TVnLIwhQxzJG4B?= =?utf-8?q?u1s8r2LkEInWa+dELikxtlrAnaN93+rEZmlqBBFGT4XCU9ss4s7jjghTHzB2GchQB?= =?utf-8?q?ZOF+nu0jXB2tKzNKBLMvclsXQeYn0pthL6K+cDoPlAJHJNb0M7y8ermTNawl8F7jC?= =?utf-8?q?gyBqmWkOj1kxnHlyh4575SENE9rr4OW8Exb2iPJXfdts8V9022Vwv3RZqR1zAcBWn?= =?utf-8?q?5xmIZDQEuXaZ6Xm2f6Yh9dglHB+LJGDgTiCOwoDpm48QK1B3Zyb630T9kUjMlW+r1?= =?utf-8?q?Wi9NtJa1aJFxodxwauPgGEW0fShNZwCKGaGVD2pi8ZtrQjsnwCVHOosus7NPXgJq5?= =?utf-8?q?qAcI2CaIvAuDXMQinyjE4lzGNKFRPxnzPb5jAvyMqrEfUmHX8FnkXZ4G/ihy647pi?= =?utf-8?q?HdDOL5F0XWNG52zHRtNRtiAZZRolM2mdUsGefBVNr832OOrv40aYftN8lrUPiQ4aq?= =?utf-8?q?C+z1pk5B+OraLmtVU4msN7Uf1fmoUG3V2MvpvM7cQmEGZc0HoRBChKbiFR9YF3pP6?= =?utf-8?q?9HW84xLIME0Hj5V7wSsm5J33vGoOYgDMeXVOpugc2OUbJspdfMkWNxYYyAQF8AEaG?= =?utf-8?q?qVzoM1G2fXSLpQ8FXDl5yaRSBm+3hgKlZkIL1CPFUPtheBSAbJ5D+akDir7Z4lT1d?= =?utf-8?q?5w6qKfgyFM1VOPzuL63AiY5taYsBvtjaLw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0896ec80-533b-401d-b573-08dc0dd6fecb X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:43.0143 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ayNhrgxH4BaZUeaSsFXfdJ04DiCoQDiwYbMFuarJXzR3PAvPOCZpCBaT7XDfL20Um9Kaq5uOjS7sKki4ZvWutlKFcBPbAmolujzXiL5/+EM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR11MB8483 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DRM managed release (drm_managed_release) is called as part of devres release (devres_release_all), which is not async. The release action should have already been executed once drm_kunit_helper_free_device exits, meaning that there's no need to use a waitqueue - we can just inspect the "action_done" state directly. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 659af5abb8014..e4790ae838ba7 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -8,12 +8,8 @@ #include -/* Ought to be enough for anybody */ -#define TEST_TIMEOUT_MS 100 - struct managed_test_priv { bool action_done; - wait_queue_head_t action_wq; }; static void drm_action(struct drm_device *drm, void *ptr) @@ -21,7 +17,6 @@ static void drm_action(struct drm_device *drm, void *ptr) struct managed_test_priv *priv = ptr; priv->action_done = true; - wake_up_interruptible(&priv->action_wq); } static void drm_test_managed_run_action(struct kunit *test) @@ -33,7 +28,6 @@ static void drm_test_managed_run_action(struct kunit *test) priv = kunit_kzalloc(test, sizeof(*priv), GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); - init_waitqueue_head(&priv->action_wq); dev = drm_kunit_helper_alloc_device(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev); @@ -50,9 +44,7 @@ static void drm_test_managed_run_action(struct kunit *test) drm_dev_unregister(drm); drm_kunit_helper_free_device(test, dev); - ret = wait_event_interruptible_timeout(priv->action_wq, priv->action_done, - msecs_to_jiffies(TEST_TIMEOUT_MS)); - KUNIT_EXPECT_GT(test, ret, 0); + KUNIT_EXPECT_TRUE(test, priv->action_done); } static struct kunit_case drm_managed_tests[] = { From patchwork Fri Jan 5 10:13:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511914 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 1DED8C47079 for ; Fri, 5 Jan 2024 10:13:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3071510E5CC; Fri, 5 Jan 2024 10:13:57 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BFAC10E5CC; Fri, 5 Jan 2024 10:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449636; x=1735985636; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=yngqZG8Spc06NTUdaXFEbO5cTO9IfPcH40tZek15x7A=; b=bEcfQJktuS7mLupe6kbxNc3r0LI79YmUWpLBk6qEdIiOq7tT/G/IQKH8 1cvyQZxBohNgZnMcBexZvQ+gnmTIg0txbkocH9TimI92aFFU22i39K8dC IRfLtX8/DG2n2ow6yzXr/y3Lt7JGj0QcO/S7yJZVd9UZfLZpsACulafo7 WPFMxU7Cqbz5MiAVUM2W+kFvEd5ztB0kGswzLKF5j29KdwgcJneFI3guo asrKT5Ul7qi235PlqmF6dzciQWS78mK4YJuG5lXqORpLW9NInAiVRgmQY HaPFKe7NmEtpwNo/sjl4AKFG0qFuJtmfzDUvupB/zFbbZR9kfXzYXrDSz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="483651634" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="483651634" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:13:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="730435473" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="730435473" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:55 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:55 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:13:55 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpR5RtF1eUQtOFq1o/wlSlGClbX/rgRqjQbEqis713MFwJ/DJOvt5+IAbcXQFQTnTC6JJ93JzTiO/aVUR5cC16uYa8uL9ASxkZ5OWdTKpeuXrF/GllcvLsatEew7MluPNj4iunKKHwJ+asBV4+HAUQpZA6Mlh18PDxvESf74sAAXqO67YNiqJZkPmJ04+1IZnEk+IdyNf3rMbqg2FhxD2IH8ZptbcmIrxRl1zbyypUDzaBc6j6dNJAI5t6+BmShHirf2CJLGqmVRYGq21WLCxdxeMI3CToO2xyazeNsRPI2+rOpmom2XORx05hzzrA2W2pU1jDJVCI72Kl1FqcpNMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=36WGdOADJ6H/0w6QoNAwTeI1Doo4V2GznzvvWmIxLvs=; b=cF+hDv7YhvTwQg4BoDsMriUzkqYt+RHt37/ljx2A5c9DdOcy+95FyXuEfYOos20OlaR27SX10gL96DXE5IVbeHqTP5h4gUEH/dU8u5ZHoyEigPkm+dejfV1pJuf/ePohmRf+FPmHlv3xYdph0rzf3ZD+v1ii7BYk4ePOdM6J/NRpka6yBtXnvGDu7NC5/0dppsj1mZG4/xt6086XXu2WY8nqD62DuyWpCaJ/8WJbGlbt0wLK1LV7IysTMuUP4Mu30464KGTD8MDrAi7AkpoEu1z8gosbXaqPF60AtobnGRfhSpP46hoOWJsfRohuoCb8K7XawDezxucJSakH/vvzJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by PH0PR11MB4823.namprd11.prod.outlook.com (2603:10b6:510:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 10:13:47 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:46 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 4/6] drm/tests: managed: Add comments and expect fail messages Date: Fri, 5 Jan 2024 11:13:22 +0100 Message-ID: <20240105101324.26811-5-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR0502CA0007.eurprd05.prod.outlook.com (2603:10a6:803:1::20) To BL1PR11MB5365.namprd11.prod.outlook.com (2603:10b6:208:308::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|PH0PR11MB4823:EE_ X-MS-Office365-Filtering-Correlation-Id: d960fb1a-3988-44e4-87d6-08dc0dd700bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4DqXvZf7zn2juiK45TfYS6bAOq4clc8FnN8tOHK50lyFlqOi5TIjHvHsiwdJQBGppwvuxr6CudcLKDgWJM4kYwOx9mlvNeYegF5VNRyzrVV4X/yF13o2bveBYEonEBoeNzDPqPITX5dvItnhf7+Wx2p1lHYYUrdWY3ilc5MUyDUu2ufK5vP3KjS2Cmy/9Z0JMIFQMIsxooqm24tlusIQZ+EWYrGcn8QvEZ+74JnJwHmmbr2K5Q8PllZfq5HeoYrWtdL/4X9a76Hl076/I8kg01qTzrXG5E6jaTGnks2jtN2cCts3wTA4pwG8NZXZbI74yG/nD2lkQA3RjATkJEugZBk20w54Uw5J9RxJS9h0mU0ymt+WKNXmc6dJDouL+dkKPVCkuHBwC5Avo0c0tiFyCPGvlc5bZhjBVrilWZ0BpFnTLB5I271qEj4iWJL+1I+hGaKYt+zwL37kP9bi4SXRmddMkRWmLDMP+fJoMHLfvOVmNX4F1XApEvjxJYiL72xf96h5whXHR+zT2oUlB4plS1vmKhR7Q8JY4waXl30jZz/ngC7hafZEEwKXdAzqGpUO X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(2616005)(26005)(1076003)(6666004)(6506007)(6512007)(86362001)(83380400001)(4326008)(8676002)(8936002)(316002)(54906003)(7416002)(36756003)(2906002)(5660300002)(6486002)(478600001)(66946007)(66476007)(66556008)(38100700002)(82960400001)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Px3gXKRcJUfyHDqpyEp44t0wTWaz?= =?utf-8?q?dnMFLzd9mp/I5FMVtSLnQ0r1WLm3Hnxs4iyT5T1NOCT/Y41kTkpEAM/PCsvVZ5hwl?= =?utf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1q6brXYBqjGliP0X7Yl6KJlTnA5NCcyjK4IFXUzNPrNQ+xwVptP6P?= =?utf-8?q?1J/KmPJgBacGvLzsd8d2UwyBrywACD44WLKh+5YVcYVlNJ6NoW/FcHACZbrK6bHtu?= =?utf-8?q?r2Opxjoy6uInag+BbkeF1Cn/7it88t1tfCuCBS0bF/HKM48ZeI0t5mw8KByWS8+ak?= =?utf-8?q?7NcmNn9Y+EoPborFtKqkM5csTYrQl3pPsZyif3JAxIeH03WBqORwsER/IxODSk6AA?= =?utf-8?q?jJ+eTBfI9YgZuEf6uxgaRGPEuzbilrqZ19x0zJ2m1dqZ1ErOsf7blf9ndZoG7V7zO?= =?utf-8?q?e/pjHuXYOIZuwvVE71W6nnQDyH+MUDGm6Gwaju7PHLi8JHUuqfrSbk9qF3gIOtW2K?= =?utf-8?q?OB6ONiw4fnWR2tnS98t8AiXpE2BMK4LS6fhzRckyFxKkGb2zmj3UH4mdlQf39S1Q9?= =?utf-8?q?NAzHm0SiJwr3HuxS/CiEjA6NKffr6PaodKwtXcmo3so84uiV1XDrlIKYAbiCBlAMX?= =?utf-8?q?BN/T1d06bc78mtn09PcZCNAlwmLunFHp1Zpf4MheK+2ZNMCgKe0R59uElz5EV7GUC?= =?utf-8?q?RpE1aQVRMBgay9Jbd/Kmtj8KBJIOyqlHiQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: d960fb1a-3988-44e4-87d6-08dc0dd700bc X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5365.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:46.6390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wnBS3Xq0KhmIAbrqLEYcMVDLROpXSuYfz8ax9F94iaGEqq0Ue+yRBIWv1MzvSMnUDgT8eAklSpjX6TvHWoz6ObugDd9nGd08Pk+0N00mPXw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4823 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index e4790ae838ba7..986a38c9144a5 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -19,6 +19,10 @@ static void drm_action(struct drm_device *drm, void *ptr) priv->action_done = true; } +/* + * The test verifies that the release action is called automatically when the + * device is released. + */ static void drm_test_managed_run_action(struct kunit *test) { struct managed_test_priv *priv; @@ -32,6 +36,11 @@ static void drm_test_managed_run_action(struct kunit *test) dev = drm_kunit_helper_alloc_device(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev); + /* + * DRM device can't be embedded in priv, since priv->action_done needs + * to remain allocated beyond both parent device and drm_device + * lifetime. + */ drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*drm), 0, DRIVER_MODESET); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm); @@ -44,7 +53,7 @@ static void drm_test_managed_run_action(struct kunit *test) drm_dev_unregister(drm); drm_kunit_helper_free_device(test, dev); - KUNIT_EXPECT_TRUE(test, priv->action_done); + KUNIT_EXPECT_TRUE_MSG(test, priv->action_done, "Release action was not called"); } static struct kunit_case drm_managed_tests[] = { From patchwork Fri Jan 5 10:13:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511915 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 83A31C4707B for ; Fri, 5 Jan 2024 10:13:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92A8C10E5CE; Fri, 5 Jan 2024 10:13:58 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9666910E5CE; Fri, 5 Jan 2024 10:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449637; x=1735985637; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=kBoUF9HYOTFjNe2KivFWvaOTPojfkpwp8QWHNhicEKk=; b=HcUqTmDQq3Mo8kIaX9FAD2l0+hhW8FtkTHn0IU+DvH+b4ZpOG5Y5ZzxZ JNpGI22v+EXYBe+oz+BfPkx+0c524jqExxOxFRLbcrYE/3eWlmKHhxlND YExwsL6so1h3dLA21n/bCgf+TzU+hBVfFZXZceHUK03gPRxdHcfv7oO+X l7VG2NqIBdyDJOi2JVSdYRlPJvMsUgnUOev5MMGUBvhC8gAsJ5PFGs9cA /A2mQiRx3U4FagtXZ63oKQyP1ki9sdrxmPnYQ3qmvmsxGvNEjpaqTpvcJ /gS3AynDBhWJOLqo2Lp72ee+Jx1mbL4w/Ganf27GdMhig9RDBgPaKw6lB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="483651641" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="483651641" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:13:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="730435477" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="730435477" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:57 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:56 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:56 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:13:56 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cckap2kZKrRR74mmqOwAg3vJ3ocTDoZUAohhjt1xCGv2kZE5m1cuCpOVf1wxvDYxcTOTGiCxh96lfPDa5O3grOJtg5zBqgzsmej7yNHkdyygyj9+Z48tYgP5lLkE/up25I6jwhSrI6HjyOPy5tafIgBOFPAtC7wQ8gWnM9sPa1+fbwXjI7JLET6VDpPoDStZMPS4kLFCt0rxvudhUskFK7u1bMI+RkuFl/+g7Y+Xy3l5AnhtGm5yAgNKDrG0OLk1UkgOs+5eP2upnzHZBjSpGQB+AtsTwSE+6BhfqHbTmq1OtvfDsPXYURMUZUuhppGCJMMxpoOpcjm4WoOJlZZeoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VyCAC7LWE14HvBFc2H+TqGWJ5O9b40rs5udZJZAwzPw=; b=a5bWX1etx8YXElWd/x7br+YKfb+BLMP+myFYcNBiTfINVq+JrLFUc0Zv4Hyko1cNDimBESJKvv66Nf1bNs9eNmg+KT7bg7PyY8SplfjWB0X0uA1+tn0rFOBZeIboSjeyDVs1TYcYP1R7e0xceGn7mlhNK/D/YdeXcdfAYz5Y6eLIiLyc1hthj7rKK/kxkoxRm/rgz7qk+GKSFKkpKyzrOJHG9U00sWjLDN4a9N+MbME63nsTi3eLOm6NWUDW7cNHsUwTLRiyvqM42xvoxAqg6NxvMspOfJPy1zgfqeqJwn/ZpDMMYTxkavfrdi+RBaHbL9h2d5XLaqgmeFlDBMKKjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by PH0PR11MB4823.namprd11.prod.outlook.com (2603:10b6:510:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 10:13:51 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:51 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 5/6] drm/tests: managed: Extract device initialization into test init Date: Fri, 5 Jan 2024 11:13:23 +0100 Message-ID: <20240105101324.26811-6-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR03CA0044.eurprd03.prod.outlook.com (2603:10a6:803:50::15) To BL1PR11MB5365.namprd11.prod.outlook.com (2603:10b6:208:308::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|PH0PR11MB4823:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a2eb0d0-c9ad-4c31-a41e-08dc0dd703dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DTF7t0WS3M4UsvM9kA9ynwXKRrG0SipTGfDaHmaEDSPzoWuH8PhHj9GVpogBebo7eCM2UATjeRaSoY4MBSjdd62M/HawHbGhSchEsQ22Lh1ADoWZ4ige4aj2/xy7TUVy6baE2HQ04JNqhKl6JU2MxZnFT3qpkRrm+hRfLdTV8aPDsCGFhGEPuVgjony3yRTBCexA7wwyarIgddsdxlaZSiOVXsLyAriDRJHUuTU4qGT12UZgpOr6xIKPvPHtE/mNIt6LVIIF3MuBWpTiVAMQIGaQEMZ3QLIkxIgARZAE3hEYbH+4jGwlxL6ld+6197A3BkGm0MlP+hMX9YpVT+s5U+dlqdriCvR0VQy+nk6vQeM313zMEXJ57UrsWe4h659XSIRKmc0g/V1Z+mteEL1r7fD/cCf5UgGUxXKb4yic1QF9Fe0BnJ2hC0TUkGPHmjm5Kn67xSVurpYcfuq63Kwu3DAaAGxLDbm5zIYl43wF7F7IYb18ml3g/NKo+BvQSQu4FAnh7m1TV349u91ti1j2SnTLaSrkiX13ciRUH6HzGcqQGhBPh+jPuh4P+fyJeArZ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(2616005)(26005)(1076003)(6666004)(6506007)(6512007)(86362001)(83380400001)(4326008)(8676002)(8936002)(316002)(54906003)(7416002)(36756003)(2906002)(5660300002)(6486002)(478600001)(66946007)(66476007)(66556008)(38100700002)(82960400001)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KF8dvB36SOI8TS447KQfq3vKEA0j?= =?utf-8?q?V1WG8MLNCN2hstwUlp6uOKsCBI3sZ+M/IgZyPVSa/AELbIsNXW81TkscxGBRzUww8?= =?utf-8?q?XpWqZyVvptW+INnVUAoOfIcBrELuzeZFvdK5i5oTTBRH7l9NkIUFC9/oRQNk4inio?= =?utf-8?q?/N4KWvj7zvoKkBZO7+IZ4JQS+VJI7eoFFek1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eMBxZolZlFE3Wrb5fJCNUJBciAMXJmZlb?= =?utf-8?q?Eefvd8jIZo26/SdE6WlJ5TWfTPoG+4TRLySo7scrDDV7Pw7mEhzdgMcj2JZJL5V1h?= =?utf-8?q?ZS0i274NDtk+MIhWAjj7qzNwLn85leWMFOvLmszG5RR5agcz30YnqsKcMl6hubk03?= =?utf-8?q?m5PIXbn5k9qAi4UKP9ggSYm+j4xrvOFJa+o39jcn4iB6EeXfD4jDUq42ymbwslEd7?= =?utf-8?q?eJbN4DkGcjDFsy52HpKwa9qB3jNh8GO+Q5WSDyctxq02mRE4K67kSkr6oXzm4Syzo?= =?utf-8?q?cLCQIQHpHGdcJeryw2pHPBzD4kGCTnI4fZsq9d3cBcUV2+U+PgJrf3NAhr+JaAuAo?= =?utf-8?q?isZhRmn/58bw1RLWJ8mK2K+o6E6wj0YJgQOg88XUITjlSf5g+ybt/T5DmRyBmWYx0?= =?utf-8?q?rEtX4PmQsykW7WoJMcTHEi+TUU2k9aEvIfyUGaSkZl786BuH+tKiEBYhHEC/Xlaou?= =?utf-8?q?0lEDLR1xqowacm/eCzbxC6RE+LL9KSZv1w=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 3a2eb0d0-c9ad-4c31-a41e-08dc0dd703dd X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5365.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:51.8484 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9fNj23lPpkWrPKipt7YoRe+OZF7iE7yhp9XDN2EfgsDisDzlGqv3jg5jqm5ClP1xa9Xw1KlH+r0QQkqaSpUDZ27a2vxc9ukB9amoGTA9o+c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4823 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski Acked-by: Maxime Ripard --- drivers/gpu/drm/tests/drm_managed_test.c | 37 +++++++++++++++--------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 986a38c9144a5..c1fc1f0aac9b2 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -9,6 +9,7 @@ #include struct managed_test_priv { + struct drm_device *drm; bool action_done; }; @@ -24,11 +25,26 @@ static void drm_action(struct drm_device *drm, void *ptr) * device is released. */ static void drm_test_managed_run_action(struct kunit *test) +{ + struct managed_test_priv *priv = test->priv; + int ret; + + ret = drmm_add_action_or_reset(priv->drm, drm_action, priv); + KUNIT_EXPECT_EQ(test, ret, 0); + + ret = drm_dev_register(priv->drm, 0); + KUNIT_ASSERT_EQ(test, ret, 0); + + drm_dev_unregister(priv->drm); + drm_kunit_helper_free_device(test, priv->drm->dev); + + KUNIT_EXPECT_TRUE_MSG(test, priv->action_done, "Release action was not called"); +} + +static int drm_managed_test_init(struct kunit *test) { struct managed_test_priv *priv; - struct drm_device *drm; struct device *dev; - int ret; priv = kunit_kzalloc(test, sizeof(*priv), GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); @@ -41,19 +57,13 @@ static void drm_test_managed_run_action(struct kunit *test) * to remain allocated beyond both parent device and drm_device * lifetime. */ - drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*drm), 0, DRIVER_MODESET); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm); + priv->drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*priv->drm), 0, + DRIVER_MODESET); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->drm); - ret = drmm_add_action_or_reset(drm, drm_action, priv); - KUNIT_EXPECT_EQ(test, ret, 0); + test->priv = priv; - ret = drm_dev_register(drm, 0); - KUNIT_ASSERT_EQ(test, ret, 0); - - drm_dev_unregister(drm); - drm_kunit_helper_free_device(test, dev); - - KUNIT_EXPECT_TRUE_MSG(test, priv->action_done, "Release action was not called"); + return 0; } static struct kunit_case drm_managed_tests[] = { @@ -63,6 +73,7 @@ static struct kunit_case drm_managed_tests[] = { static struct kunit_suite drm_managed_test_suite = { .name = "drm_test_managed", + .init = drm_managed_test_init, .test_cases = drm_managed_tests }; From patchwork Fri Jan 5 10:13:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13511916 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 56F3FC4707B for ; Fri, 5 Jan 2024 10:14:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73B9A10E5D3; Fri, 5 Jan 2024 10:14:05 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B9C010E5D3; Fri, 5 Jan 2024 10:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704449644; x=1735985644; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=CV9CQhOlT0/5VGvMDC7Hks2hAE59AabLvH3u/gvoTpY=; b=dlsQpkTuXMyEf3OZSqjGObXqBBTLxJ3Atd/2pyW1ev1R2PtAUEjbR33S M6yQ8FlHNSy9nA4VajBEEbzoQyLYOQ+nj8y8wgWHZV/1cfCyaCb5b+dWO 6ytQauI149n600u5PsJ/LlJB510MrA57H4Zysrzxjz8I2iTbaWhsWpd5L adhmFgrBsTN/TfrkaxGVB2E4BCDGiStJQ9MBwNEL/RfrK3i5RFnNdJNBE 712JtWnZey/Jel/5PoGfZ/xBXNhy58+dWumjEDXB8xoHXM1HGGByvkFT8 xSdEw0daVqgucEFfv3gnLkZ/664/hl7mJ/MWcNnU8BnYVcKjhIcQw65H9 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="483651665" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="483651665" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 02:14:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="730435491" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="730435491" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:14:03 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 02:14:03 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 02:14:03 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 02:13:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlyfoMTLKUMDl1wTc7YAG6WwjhxZ8Uuhgbu8h+Y1ovfemOSatzph2wlPccmphclXTSkgQD2fXW1BCz2HPs3M5bmw261h+ouO3anIa4jkXYAiKS20W9Bu1qDk2oTDY2clN2Rjx7huZzEZaxyI5vaK+bfQHQwei74+XllmLMv387XX+Lb9wEZ4QqAsPrhNawoLkAzYjLixN/c9e5cietKMCpPq02SKL67tq+OnJ4+Su2V5C8mn2347mkgm+vPa/+ZGvN0nmpTzFmfidjoYwKsDamqKagYANYrAvtCdUd7yZSLt8gdccDjN2/x/v9V784loq9THDCt3c56N+HQjr0rZtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=D3oaXJhkeI+gqFKTkMLFxSpRvgAZzvlkvC4yrcHGNik=; b=MtlqLjCk/uxliHdfqRrdPYjq7fYy9lPeP8wfPn5utSgkv4/Ef6SAPFgC4KD1DDyCxOhLy+jnWHm32A/+21jsJvzuN8XTf6B4CNZSEvhjWQNF6wvHgHp55Z7AD2lTlIXcYEU7mQC3Jf2H7jJXhg/s7/EktE+0qmXHVc950ePD8qVJP6w7RcPI4d8KIPUNm0vYPDxlNgcNSuDBtxjORMNSmWqrZC4lqgcAv3W2fOpI9rVlQ1v7v54yUtRSm9k9V6/I0jD/IhOQJtoh1/9pQUfkztU+owA61TLNSOUgefsgG14U2gAliZbU6trujgBns5OJUBq6aXSeCK0Z6/Ds2eGeqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by PH0PR11MB4823.namprd11.prod.outlook.com (2603:10b6:510:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 10:13:57 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 10:13:56 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 6/6] drm/tests: managed: Add a simple test for drmm_managed_release Date: Fri, 5 Jan 2024 11:13:24 +0100 Message-ID: <20240105101324.26811-7-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105101324.26811-1-michal.winiarski@intel.com> References: <20240105101324.26811-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1PR10CA0092.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:28::21) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|PH0PR11MB4823:EE_ X-MS-Office365-Filtering-Correlation-Id: 66606960-96ed-4533-711f-08dc0dd706fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZblOjlWvychQRsrbO5HkSPIQwJJeuwp3WSwSmWnSzLRj70jF9DR4ex9A09vCDvGNPaR6oATRQy9Wf8exu4SDVWZrJ8m+M//cZ7nyjiGlb6LHnBsAf8bpc4mlsxjKK0VDMET2B9v5/d/Z00oWoZHZQAzyGL7FoESBwV1RnX4+RfsT2bx0xGKEzOMqo1/4zda5eKDo0IWaIY97nHRNPNZQjTUZWePO1xJyBsgn9KRyP31y3LwrnesZjIOEI5O/PDzZIjGfWFXVk26vtkTZ6AiLLK1NSuV1c7nUH1IGnfhUC8zV/CJvTwa9WQ412zoQ52GQGEBNB1BzkI6BMNURE9HJz1Rc1QXUO+cdvV+sRaMOYLh6GYnWGPCFdfgLThVr1qIrg4D+iYdD6HYyl+1Utf/OJXwHM/u+uBTuGKlNoy3oCY3rqv8ATDqVqgDNxm6SAEPe/8qzQdW0rVYGudWFq8dmKNr86u0Co1IrwSKOUzbNP+73bPsTX/TlNGUMZYm5lAeVpjBc/KR67HXbm6jd8pTLofjRTiEFVSg0mRq7P3Xb789Gj922h3L20YLS6v6jHWqM X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(2616005)(26005)(1076003)(6666004)(6506007)(6512007)(86362001)(83380400001)(4326008)(8676002)(8936002)(316002)(54906003)(7416002)(36756003)(2906002)(5660300002)(6486002)(478600001)(66946007)(66476007)(66556008)(38100700002)(82960400001)(41300700001); DIR:OUT; SFP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ikKIIrQCQgiuAhACMNXtm1?= =?utf-8?q?GJz5jqPNBMO9W0STQ5MDprQ9wvqU5P7LO+Fo5oy7/ETt3ZciCf/pN1KWYbdgwJydJ?= =?utf-8?q?qzjVcoe22uJ3FFzIWerND4Wsmt2Yno3I7KG6diuRIO2oE8UkWzhBbJFhSLAnfoXfC?= =?utf-8?q?htnL8/oOg9OhNTokpkmg2uNeq/8SWNcEc87ad18X+bZi4KAKpvndO5TZeaIykyFCu?= =?utf-8?q?vAGXSzq30Nhdvc/fwBG+YMIq4iSbvYBRnq7gqVEZ1iiVR9NVyS6XCSC8Hm/qatl30?= =?utf-8?q?YganingQAMYu+7XYbHZvn0/UvMJmtvsLlwV9WdEDEgTh/lEq9hMOb4sh+3ubceBgl?= =?utf-8?q?etRAzHU6RuX5Bzm4OSmWYOeuQjVLqFNXWFEeJgYZv6MIGXupXMwVCTMfZqvCo+6cQ?= =?utf-8?q?VjcdDTJwNh3azwp5nb02xMm6wWgMyTnlzvm3AXsrzo5Fhd0kFGYo6hNV9I0bfheea?= =?utf-8?q?d678MAZ5G7nxaTV36kHxpOH9cBmOGYbjFbHudz8ytIP+wAtVs6OmRA/UW93efK2pj?= =?utf-8?q?YiKuvjAANObKRkk46lEouqaqeATp6QwYTfQrD3FanX2O98LQGHpWMODdy5Ph4/o4B?= =?utf-8?q?IE99rsz80OeFErGZCymscpNVppyIyEytaLvqyZCbCeu+2QAwW+KB8heb8YFNcktJC?= =?utf-8?q?3wsKdSIENuEOUx7cKMaB+lbFhm2vpT3dN7VD+KvbPwepLCQ6ki0ExFlA2OspllMfy?= =?utf-8?q?bxPzkOSrT2fiUx3DJsHzU7JLV+yFU6pB/g=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 66606960-96ed-4533-711f-08dc0dd706fb X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 10:13:56.8875 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IfX6EsbBimyYe6l5VmwTT7barni7XdGsxChFBYX5Ck41qUf/BeI5zyMu9w0XCpXTjiQNd8HJ2F/fqS/d9FVoYbc2R2IUF50kwEMBIq2YdNI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4823 X-OriginatorOrg: intel.com 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: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a simple test that checks whether the action is indeed called right away and that it is not called on the final drm_dev_put(). Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index c1fc1f0aac9b2..91863642efc13 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -41,6 +41,33 @@ static void drm_test_managed_run_action(struct kunit *test) KUNIT_EXPECT_TRUE_MSG(test, priv->action_done, "Release action was not called"); } +/* + * The test verifies that the release action is called immediately when + * drmm_release_action is called and that it is not called for a second time + * when the device is released. + */ +static void drm_test_managed_release_action(struct kunit *test) +{ + struct managed_test_priv *priv = test->priv; + int ret; + + ret = drmm_add_action_or_reset(priv->drm, drm_action, priv); + KUNIT_EXPECT_EQ(test, ret, 0); + + ret = drm_dev_register(priv->drm, 0); + KUNIT_ASSERT_EQ(test, ret, 0); + + drmm_release_action(priv->drm, drm_action, priv); + KUNIT_EXPECT_TRUE_MSG(test, priv->action_done, "Release action was not called"); + priv->action_done = false; + + drm_dev_unregister(priv->drm); + drm_kunit_helper_free_device(test, priv->drm->dev); + + KUNIT_EXPECT_FALSE_MSG(test, priv->action_done, + "Unexpected release action call during cleanup"); +} + static int drm_managed_test_init(struct kunit *test) { struct managed_test_priv *priv; @@ -67,6 +94,7 @@ static int drm_managed_test_init(struct kunit *test) } static struct kunit_case drm_managed_tests[] = { + KUNIT_CASE(drm_test_managed_release_action), KUNIT_CASE(drm_test_managed_run_action), {} };