Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp657333rdb; Mon, 15 Jan 2024 09:12:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxTgPrS7zOLHQAbZxzarcK4oTWSq9BMn6Kni8ksl7at6WV4rEbIXkgQcRlfpxDUUDJyBSg X-Received: by 2002:a05:6402:3d2:b0:558:ac44:78ad with SMTP id t18-20020a05640203d200b00558ac4478admr2694007edw.66.1705338738036; Mon, 15 Jan 2024 09:12:18 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u16-20020a50a410000000b00558e5625c3csi2816146edb.156.2024.01.15.09.12.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 09:12:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PW44al+O; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-26299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26299-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9BD321F22661 for ; Mon, 15 Jan 2024 17:12:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4518317C91; Mon, 15 Jan 2024 17:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PW44al+O" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 2FC5417C6E for ; Mon, 15 Jan 2024 17:12:07 +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=1705338729; x=1736874729; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=xGXnKYlI3DgCW9p0Sisslodda0oX+3NotOC7TkoaiwM=; b=PW44al+OIlMl4l4PFh65Zj+ai9/gEeXMJam/Nn9UlgglBYTm4x3K2PNy lwjpBePv/3keD9ZRCClP04CCxj+WBV2g5dwONcqzQvnyvAIhzecJTVJIo g4I4zvVeh+C/CtJTfmPbgcz5q02jNNL4fk6PnERyiKiSCU6TvtI5hCumj adrzL1EXi+tamNczBvI3QZ93sFw7/qBLoocYtv2o6dm4GZWrOk0HEJHLf 8b44Hip7V/cHDipjIDXJ5IGmiRBFg/9KUJCChqVA5DarD6Y4FJVTPCIyv 7U/oWgA1bKm1BrOHcepkgvZG+rmgY8DoFhIJx8dAHSnycuCx5xqc6F5BN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="13014889" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="13014889" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:12:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="787148441" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="787148441" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:12:06 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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; Mon, 15 Jan 2024 09:12:04 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Mon, 15 Jan 2024 09:12:03 -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; Mon, 15 Jan 2024 09:12:03 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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; Mon, 15 Jan 2024 09:12:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kBLBb0u3XrQX3Se4KwZbYXIV/cKIRUTrMv7TyLFdzG4YXEWVERPGkKHAWFBYJw9DutMpi76p7RfCBt3G9PpOdJq3G+6OYUhES4ZyuL+J0Ag+WH26t+2LNNhpK+yGOGSviHWyz2+T9m/9/56cDqAlzrQuVZ6j6GMu5ao9WbZOZJ33jF2g3DEwH761hRSlxgbyLvB4RBHvsGQivbqRhQwvcGW8Obv01RyHFHlhk3s7U0fZrTP1tG1cO2KzZvHZAYJUDIUEPGY5xTDURXIZsEeTlWhGIj6sm9bA/BoPSRWmv90ckhSoc70k4lJieAi19mTVYCnt1dGngwIyest12GmzQQ== 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=37B95n5ElusS98gg+lT9xxjeOhJ8t/HubRSITPhEffA=; b=S54narPAOi7+51Z5RSrYPlVYrxLIN7uKhBo2qk8Z37bYPP7DVONeHI0kuBRtW9ltV8TZeSK99Ao6gFnQse+ZDMIFHt+D21I2qnLJqcnenqKjZbnmaEDcUd7AewnGc39SzttemYre49J70WqEwD/0ZZZc/mDHNzMNtf8CUmwxEIHBuyXzPIsnkza1efFfSYI6oTjWF0d374c41klP+dtTI8G/g1NFxuVlEq5jSH+9gaqjraST1/K0hzQEf4zA+yNMflnZbCrB2Cs5qS3qZVa1j2aj3zUzMScTmlyepWMJ4S4USedx5o3r9bqE4Wyj3U0CTXAZb+p6+DwBMYgy0ZCcpg== 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 SA2PR11MB5178.namprd11.prod.outlook.com (2603:10b6:806:fa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19; Mon, 15 Jan 2024 17:12:01 +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.7181.020; Mon, 15 Jan 2024 17:12:01 +0000 Date: Mon, 15 Jan 2024 18:11:57 +0100 From: =?utf-8?Q?Micha=C5=82?= Winiarski To: Maxime Ripard CC: , , , Rodrigo Vivi , Michal Wajdeczko , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , "Javier Martinez Canillas" , =?utf-8?B?TWHDrXJh?= Canal Subject: Re: Re: [PATCH v4 6/6] drm/tests: managed: Add a simple test for drmm_managed_release Message-ID: References: <20240105101324.26811-1-michal.winiarski@intel.com> <20240105101324.26811-7-michal.winiarski@intel.com> <2mgrb5lrm5oskkcauhdbegdb5jwhqx6unzlaltz6e2bzaqrzyr@dnkbsr3ykj7k> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2mgrb5lrm5oskkcauhdbegdb5jwhqx6unzlaltz6e2bzaqrzyr@dnkbsr3ykj7k> X-ClientProxiedBy: FR0P281CA0014.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::19) 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_|SA2PR11MB5178:EE_ X-MS-Office365-Filtering-Correlation-Id: aeee82f4-7f7e-44cb-cbee-08dc15ed16c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F3U0996Mx40Cl1viYQLWyM5Idf0JlM0/gFpC/7N6wL227eU1WZSn5DhG3F/Uk8O7qahFvtD6ALOn+o96aS9fuZ6dXL5gH0PBQSpoo2Brk9n5922o82JHLcDe6x7FAxPvMQQcw6cov5GYiss6yFHMHIdK/ojkN+rs+HuOriJDCaOairGQkuhAy6fOSN96f9ZTg80Y+bnq03kboUrntd+tdrW5KtqZr//ZYZcK2MeBh1EoiMaIcEG6d3BNOu1DTLfcroHThJTSLjZ4FXkzZ2STsP3jKMmUx52wL6xjvJ+dfL5fvuY9erRzeMlIXI4lZQDP+uVUIGN4vtCOmJ8ki+EDN2Z558XtHMsGHFPGutiY9Z4CNSuZGtzmJgPjqeK7ZFB0f8nHfXPj3O0UxoNfnEaOp1E/rF5CiKsqLrf2XmLzXZlQAFaqcX9sr2InrPs1mH9cp+2+7cwShZD/WJ788LL7GKPlNdytbD0oY9PrJXoh8Gwv8tAmsE3rgPg1mtHIMmW+IjjxJhABW5XeSv1PqnuWwkh9aO7Vd4iIDjf2AkQB8T0= 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)(7916004)(136003)(396003)(366004)(376002)(346002)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(6486002)(6506007)(6512007)(6666004)(26005)(9686003)(83380400001)(33716001)(82960400001)(38100700002)(86362001)(41300700001)(478600001)(8676002)(4326008)(8936002)(5660300002)(66946007)(66476007)(66556008)(6916009)(2906002)(316002)(54906003)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VWhMVW1vYWljT2s3cFZsTGx1bHdIOGs4QmhPZmhaQmR2VlorS2dLNUhJTzJ2?= =?utf-8?B?OW00V3lCZy9iSGpBMEY2YjNCRko2dnovR1h4Wm1HZDRMdXlrUFhUbnErMUd5?= =?utf-8?B?dXBHMHN4TGJUaEoyVktTYjdmRm1hcjIyWUtVYkNYNmlWaFRsWDNaMXlnVlpi?= =?utf-8?B?dDZ2Zy9FYVlCR2lXb2lHMkxvaVdic0pmVGRWdHRROExmakdFK1dXd1Nta2NW?= =?utf-8?B?a09HQTVKYkxUMzkvWWY5UVdmbEc2MHlhUVFkcmF2M0ZYWF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U2bVo5Z1hZOWV2dW53aGpUQ25yT01EWmNZR3JaMTNT?= =?utf-8?B?UXM0aEd0VmN3K0VHU2tYbkdNbklrZFdHbjFTdSttL0Y3eXM0R2REbXRvLzE0?= =?utf-8?B?QXc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: aeee82f4-7f7e-44cb-cbee-08dc15ed16c0 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:12:01.5128 (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: lQ30jyfiyG4mLQP5jpV1bvCt7pEyrwauor9xMaYNRUSgWTbIZW30nLzMT5zEsDA0Lqo7dYoLNjBBqbKmXvQfYH0V1rWGK7f0mbgJookxU30= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5178 X-OriginatorOrg: intel.com On Wed, Jan 10, 2024 at 04:56:27PM +0100, Maxime Ripard wrote: > On Fri, Jan 05, 2024 at 11:13:24AM +0100, Michał Winiarski wrote: > > 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"); > > +} > > + > > I guess we can have something simpler if we switch action_done to a > counter and just check that the counter didn't increase. > > And I think the custom messages should be removed there too. > > Maxime I'll drop the custom messages here and in the previous patch. I'll also simplify this test in the way you suggested in previous revision, to not check for release action call on cleanup. Thanks, -Michał