RE: [PATCH] drm/xe/pm: do not warn about missing runtime PM protection after hot-unplug
"Gote, Nitin R" <[email protected]> Thu, 6 Aug 2026 06:09:50 +0000
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <SA3PR11MB8118FDD028B722BD940FBE85D0D22@SA3PR11MB8118.namprd11.prod.outlook.com> |
> -----Original Message----- > From: Jadav, Raag <[email protected]> > Sent: Thursday, July 30, 2026 6:01 PM > To: Gote, Nitin R <[email protected]> > Cc: [email protected]; Brost, Matthew <[email protected]>; > Auld, Matthew <[email protected]> > Subject: Re: [PATCH] drm/xe/pm: do not warn about missing runtime PM > protection after hot-unplug > > On Thu, Jul 30, 2026 at 05:35:26PM +0530, Gote, Nitin R wrote: > > > From: Jadav, Raag <[email protected]> On Thu, Jul 30, 2026 at > > > 11:06:36AM +0530, Nitin Gote wrote: > > > > After hot-unplug, device_del() disables runtime PM. A deferred fd > > > > close can still run later during process exit and destroy > > > > remaining exec queues, which may call xe_pm_runtime_get_noresume(). > > > > > > This sounds like could cause many other side effects. Why not make > > > sure the exec queues are taken care of as part of hot-unplug path? > > > > > > > Here In igt@core_hotunplug@hotreplug-with-load and > > igt@core_hotunplug@hotunplug-rescan-with-load subtests, the workload > > keeps the DRM fd open while the device is pci hot-unplugged. Later, fd > > close reaches > > guc_exec_queue_destroy() -> guc_exec_queue_add_msg() -> > > xe_pm_runtime_get_noresume(), after pci_remove/device_del() path has > already called pm_runtime_disable() during pci hot-unplug. > > > > So the WARN is a false-positive for the already-unplugged device case. > > I will update the commit message to make this scope clearer. > > I guess my question was, is it safe have the exec queues lying around until fd > close? Wouldn't it be more appropriate to have them cleaned up as part of hot- > unplug itself? > The exec queues are owned by user space through open DRM fds, so they're freed when the fd is closed, not forced at unplug. drm_dev_unplug() marks the device unplugged but keeps the drm_device alive while fds are open, we can't destroy a queue while it's still referenced by an open fd. The hardware side is already cleaned up at unplug; guc_fini_hw() runs in the remove path and sanitizes GuC. So by the time the fd closes, only the software state of the queue is left, and that's what gets freed here. And when it does, the cleanup path checks xe_uc_fw_is_running(), sees GuC is gone, and takes the software only teardown. Nitin > Raag