From patchwork Fri Jan 5 10:13:18 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: 13511910 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 27365C4707B for ; Fri, 5 Jan 2024 10:13:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1461610E599; Fri, 5 Jan 2024 10:13:42 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3421610E597; 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=1704449620; x=1735985620; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=jG+UXnu39siiUHFWD+cX+4Xt4Vu6x/mdodFTmIoQACs=; b=WmM+dhAbW5sO4TEswCryo5hR6IVqCgJxreiFIOTTKbhdyxGhHXJIDvnQ Ww38Mc0WyQ9AlxWu6axuV3rb0nNAxcad6S0OoR4sMPtdsLRxaw4w64cng /pdHAKtRrGfnne5tPyGbp++DCfsQ5gwp5BTpsUw6LIdDlclfa/BYBOI+b d95K3Ylge+rm9QujXwPHlJ5v3hPlViWxvUxypfpta5afM7aKoq/XYd2f9 VmwyCMf5u6pr0zMlez8d521zycjU1TRz8wQ6+3jHByehFyw9azEJr1gg/ /AKT1/0DE/227KIsDXDUNTqx0j7fxW2WOgW+i391ME8TMwLk9i0Xn+9PW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="376967336" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="376967336" 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:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="904113834" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="904113834" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 02:13:39 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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 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:38 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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: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:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyp0dkxo8XtB685ERSSraYQuN6t3SGFIKq0KeHGf2yRvUlHywOathWctaAk2IcDDLcPz2GHqRhqBLkoTSu+C81hd4UoQfhXBFPLy4u8CFJ5E8RT4vCv1E7MSvsKjOtMcsTPAO3TniL6Qvdy8bgVYzUL49VoxIBfz6kNcBf2aOal12zU3p84XhnerQ8qQlKFDO5xKj+U++O/SUVnWw1vDQOV1GkayzVNvW53s/X+RDaja5aeK4JyopqY0PR+7XG1lqL0cg+qIlFAYDbmXJKU6mTujMaFaLeywQkyJywiZ01TfpaQ37dnW63qjYzflVkZW0r88nU/uPZYhWuAV5ENgHQ== 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=9LyqUh89AtYOl8u/v5U0Fc2slc/zlHAFLwUHPYIImPE=; b=IpDiuwAew78y4QPjcbG4Yic0tNTzYcm3cdjTw2ND6tvLIyG3GynJCnSP88tqsV4u7ih2RxPZudS9t7IpOAMbaCoSIWyhkvFLraRW+gXaWczlXeWl03/YqYLZdBjn8312+FrOYRJSilE8tGSlSjOVJq1TT75zsknmFzPz3PfFCZ9snLkB1MGZMmjvXY6ryyPHSpmFDpna/WRBD4Axg+mpKio2dKWZNDbS7lFcHlx54WIMLgypfeQAmb5xB+UGFRe1JGas/0Prw2fvIcqj3ogpR2sR+HUY4syN9Whb7JpaaZwl5Ric7CQPEelMky7Y7hqkUpCG8f5sqyAsCmKo8j/7+g== 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:30 +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:30 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v4 0/6] drm/managed: Add drmm_release_action Date: Fri, 5 Jan 2024 11:13:18 +0100 Message-ID: <20240105101324.26811-1-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: FR2P281CA0059.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:93::13) 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: 89f83b4c-f7d4-4474-2e16-08dc0dd6f732 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RN2l+gRXmx90Vqyw5pN7WCFvYlOCurjD0U9qlqdkBLcaTlbwFRwCyCzFj6rAyoK4Nykl1NyPbMtYY+x1fdNC6tzCa7RGwx3wj9aj/hcHtSmAHWZhkg1wnzOBxM+O9fVIJ15JBv56eH5k92NI0UR3QSrWHw69hChD4+XvbZTR1D1sqpyxKGnpJjjJbLd4TM2dyS09gjm06K0UkwYC4QwEic+KxXzfsMzG5h0UL8zqtChDxmL9Romd6MNtZAcvInOa/0nqOVhFCB5cVZYGcF77QzBn3DNU4BgejkZAyuQiGIVg0ah9O0ty8rVstOrk73CNDdlqmjOX6jBUgxRbjqoMjjjyKnvUMNkEZXgXSaZqEQ4Ft117UhjiY43nJoa0DcVWXI3SBxFrahwSYMIYd+dyBgKHcjonrFqnBYF5+CYqOZzTr1TaJ41tuqENKnWyHkCBsHyixDcktdK01Jxq0bRHmZW8kdIjNOUBbDS2Q91c25xum0mlCGXdcq1zLrlK5dBj5Y4Em/xaPaoSnSAfyOK3rNLwpEsHbUDnUItBOpaV5ZJfPOzaUktIh0XMu7rfm8jv 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?PyKi3bKSPpJr2QoQc/rmmMJHzaFv?= =?utf-8?q?1u+5c8Dm0IW3irj07uF5rTIWU46Z+CA5q1Bg4ji4WojPmLx6zCpFf+U7tyiiFjN9e?= =?utf-8?q?Ax2//GVnm4aq8h1jqkGJXhwVJ69LaaXDtj9cXI2O2oMBFohQd+nmjnYDLd8DkG8Uc?= =?utf-8?q?jn0Kmwhlv2eeeFWrtjfWIwD9IKjrcLQFEcODQS9TQSQ4PZEcKOQxrFzwkhd0mB+5I?= =?utf-8?q?lZQjcwk03h5GD0mSbBwbB8xhCfkaA3d+fOCRVwXPQr0C1Mp+qYecDwpN9MPYd5Klu?= =?utf-8?q?jGS4MMWnNmv8GR0kfl1rzQlQuKhP5vKqkqyJTa1A7YOKXWPDNQgCp+dSORHYfPUAc?=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nz?= =?utf-8?q?4zx7rdY4h6auegfW+TyAsPtT/FCOLsJTA76FwmiQzfb0DOO74ibIA7N44RDOWBcEJ?= =?utf-8?q?puWTdF8SsGevCLNyQC1pcK2bAMK8czHwYkf/gOw6hiYgQIUVunpgEMr8+xIji1Gri?= =?utf-8?q?NRkVveIglN27dGYu7IrFfd6642vARNBJjZsQNPV+g709ptXBzOzP9ruEO4cxvGVN0?= =?utf-8?q?ZWnMhV5TS9ege+gxHr0I5UIXHKOOC3ZlJm2AzaEVJv2yFTo0Pogjq/dWLYKoshGOT?= =?utf-8?q?9dNGO8bjLgDAUqlwGn3dIrs34muN/7I1Z8hDK9Wjiv7jhnovpQa5YQ3OWTn2LXuy6?= =?utf-8?q?ScZqv32PPMTu3c87GURoWnurV8QQmg7r6w=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 89f83b4c-f7d4-4474-2e16-08dc0dd6f732 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:30.6090 (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: aP3AgjTCoTULo46WAKjd6EAkGfJXoSlUbpr1jwYxQjfs8qa5r3Np7ftxkBPg1PAa07c+uNNIS3KZep4w6Z+uQ9kKc9j6NLquyxdbTToG+8Q= 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" Upcoming Intel Xe driver will need to have a more fine-grained control over DRM managed actions - namely, the ability to release a given action, triggering it manually at a different point in time than the final drm_dev_put(). This series adds a drmm_release_action function (which is similar to devres devm_release_action) and a simple test that uses it. v1 -> v2: - Split the test changes (Maxime) - Simplify priv lifetime management (Maxime) v2 -> v3: - Order tests alphabetically (Maxime) - Add comments explaining the intention behind the tests and the reason why DRM device can't be embedded inside test priv (Maxime) - Bring back priv lifetime management from v1 to avoid use-after-free v3 -> v4: - Split test changes into smaller patches (Maxime) - Remove the waitqueue usage in tests - Rename the test suite to match other DRM tests MichaƂ Winiarski (6): drm/managed: Add drmm_release_action drm/tests: managed: Rename the suite name to match other DRM tests drm/tests: managed: Remove the waitqueue usage drm/tests: managed: Add comments and expect fail messages drm/tests: managed: Extract device initialization into test init drm/tests: managed: Add a simple test for drmm_managed_release drivers/gpu/drm/drm_managed.c | 39 +++++++++++ drivers/gpu/drm/tests/drm_managed_test.c | 84 +++++++++++++++++------- include/drm/drm_managed.h | 4 ++ 3 files changed, 105 insertions(+), 22 deletions(-)