Message ID | 20180815205924.6949-2-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [i-g-t,1/2] igt/pm_rpm: Close local fd before trying to unload module | expand |
On 15/08/18 13:59, Chris Wilson wrote: > Keep the drm_fd owned by pm_rpm as we need to relinquish all ownership > of the device in order to unload the module. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> LGTM. Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com> > --- > tests/pm_rpm.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c > index c0212ed70..f0781617c 100644 > --- a/tests/pm_rpm.c > +++ b/tests/pm_rpm.c > @@ -697,7 +697,10 @@ static bool setup_environment(void) > if (has_runtime_pm) > goto out; > > - drm_fd = drm_open_driver_master(DRIVER_INTEL); > + drm_fd = __drm_open_driver(DRIVER_INTEL); > + igt_require(drm_fd != -1); > + igt_device_set_master(drm_fd); > + > debugfs = igt_debugfs_dir(drm_fd); > igt_require(debugfs != -1); > >
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index c0212ed70..f0781617c 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -697,7 +697,10 @@ static bool setup_environment(void) if (has_runtime_pm) goto out; - drm_fd = drm_open_driver_master(DRIVER_INTEL); + drm_fd = __drm_open_driver(DRIVER_INTEL); + igt_require(drm_fd != -1); + igt_device_set_master(drm_fd); + debugfs = igt_debugfs_dir(drm_fd); igt_require(debugfs != -1);
Keep the drm_fd owned by pm_rpm as we need to relinquish all ownership of the device in order to unload the module. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/pm_rpm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)