Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp48767rdb; Fri, 5 Jan 2024 02:14:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKGWlf7z285c5UaL5lzNnAVSzA+tlC1UZk8i0WD4+knDhRBrDbo4kSs4WKmw6TT4MFhuOv X-Received: by 2002:a17:903:11c4:b0:1d4:ca2e:2bfb with SMTP id q4-20020a17090311c400b001d4ca2e2bfbmr1684480plh.42.1704449654099; Fri, 05 Jan 2024 02:14:14 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jd2-20020a170903260200b001d4af764023si957981plb.368.2024.01.05.02.14.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 02:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17719-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WmM+dhAb; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-17719-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17719-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D0A12B21F7D for ; Fri, 5 Jan 2024 10:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D6932D05E; Fri, 5 Jan 2024 10:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WmM+dhAb" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 641392D04A for ; Fri, 5 Jan 2024 10:13:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com 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="376967330" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="376967330" 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=20Winiarski?= To: , , CC: Rodrigo Vivi , Michal Wajdeczko , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Javier Martinez Canillas , =?UTF-8?q?Ma=C3=ADra=20Canal?= , =?UTF-8?q?Micha=C5=82=20Winiarski?= 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0059.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:93::13) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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?B?UHlLaTNiS1NQcEpyMlFvUWMvcm1tTUpIemFGdjF1KzVjOERtMElXM2lyajA3?= =?utf-8?B?dUY1clRJV1U0NlorQ0E1cTFCZzRqaTRXb2pQbUx4NnpDcEZmK1U3dHlpaUZq?= =?utf-8?B?TjllQXgyLy9HVm5tNGFxOGgxanFrR0pYaHdWSjY5TGFhWER0ajljWEkyTzJv?= =?utf-8?B?TUJGb2hRZCtubWpuWURMZDhEa0c4VWNqbjBLbXdobHYyZWVlRldydGpmV0l3?= =?utf-8?B?RDlJS2pyY0xRRkVjT0RRUzlUUVNRNFBaRWNLT1F4ckZ6d2toZDBtQis1SWxa?= =?utf-8?B?UWpjd2swM2g1R0QwbVNiQndiQjh4aENma2FBM2QrZk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-8?B?WVEzT1dUbjJMWHV5NlNjWnF2MzJQUE1UdTNjODdHVVJvV251clY4UVFtZzdy?= =?utf-8?B?Nnc9PQ==?= 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 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(-) -- 2.43.0