* [PATCH] drm/sched: Add warning for removing hack in drm_sched_fini()
@ 2025-10-09 12:59 Philipp Stanner
2025-10-11 2:15 ` kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: Philipp Stanner @ 2025-10-09 12:59 UTC (permalink / raw)
To: Matthew Brost, Danilo Krummrich, Philipp Stanner,
Christian König, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: dri-devel, linux-kernel
The assembled developers agreed at the X.Org Developers Conference that
the hack added for amdgpu in drm_sched_fini() shall be removed. It
shouldn't be needed by amdgpu anymore.
As it's unclear whether all drivers really follow the life time rule of
entities having to be torn down before their scheduler, it is reasonable
to warn for a while before removing the hack.
Add a warning in drm_sched_fini() that fires if an entity is still
active.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
drivers/gpu/drm/scheduler/sched_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 46119aacb809..e69917120870 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -1441,6 +1441,8 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched)
* drivers that keep entities alive for longer than
* the scheduler.
*/
+ if (!s_entity->stopped)
+ dev_warn(sched->dev, "Tearing down scheduler with active entities!\n");
s_entity->stopped = true;
spin_unlock(&rq->lock);
kfree(sched->sched_rq[i]);
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/sched: Add warning for removing hack in drm_sched_fini()
2025-10-09 12:59 [PATCH] drm/sched: Add warning for removing hack in drm_sched_fini() Philipp Stanner
@ 2025-10-11 2:15 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-10-11 2:15 UTC (permalink / raw)
To: Philipp Stanner, Matthew Brost, Danilo Krummrich,
Christian König, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: oe-kbuild-all, dri-devel, linux-kernel
Hi Philipp,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v6.17 next-20251010]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Philipp-Stanner/drm-sched-Add-warning-for-removing-hack-in-drm_sched_fini/20251010-120556
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20251009125928.250652-2-phasta%40kernel.org
patch subject: [PATCH] drm/sched: Add warning for removing hack in drm_sched_fini()
config: parisc-randconfig-r072-20251011 (https://download.01.org/0day-ci/archive/20251011/202510110929.AxIiHbe0-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251011/202510110929.AxIiHbe0-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510110929.AxIiHbe0-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/linux/wait.h:7,
from drivers/gpu/drm/scheduler/sched_main.c:70:
drivers/gpu/drm/scheduler/sched_main.c: In function 'drm_sched_fini':
>> include/linux/list.h:784:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for (pos = list_first_entry(head, typeof(*pos), member); \
^~~
drivers/gpu/drm/scheduler/sched_main.c:1422:3: note: in expansion of macro 'list_for_each_entry'
list_for_each_entry(s_entity, &rq->entities, list)
^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/scheduler/sched_main.c:1446:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
s_entity->stopped = true;
^~~~~~~~
vim +/for +784 include/linux/list.h
4d70c74659d9746 Andy Shevchenko 2022-11-30 767
e130816164e244b Andy Shevchenko 2020-10-15 768 /**
e130816164e244b Andy Shevchenko 2020-10-15 769 * list_entry_is_head - test if the entry points to the head of the list
e130816164e244b Andy Shevchenko 2020-10-15 770 * @pos: the type * to cursor
e130816164e244b Andy Shevchenko 2020-10-15 771 * @head: the head for your list.
e130816164e244b Andy Shevchenko 2020-10-15 772 * @member: the name of the list_head within the struct.
e130816164e244b Andy Shevchenko 2020-10-15 773 */
e130816164e244b Andy Shevchenko 2020-10-15 774 #define list_entry_is_head(pos, head, member) \
2932fb0a927d306 Wei Yang 2024-02-08 775 list_is_head(&pos->member, (head))
e130816164e244b Andy Shevchenko 2020-10-15 776
^1da177e4c3f415 Linus Torvalds 2005-04-16 777 /**
^1da177e4c3f415 Linus Torvalds 2005-04-16 778 * list_for_each_entry - iterate over list of given type
8e3a67a99231f9f Randy Dunlap 2006-06-25 779 * @pos: the type * to use as a loop cursor.
^1da177e4c3f415 Linus Torvalds 2005-04-16 780 * @head: the head for your list.
3943f42c11896ce Andrey Utkin 2014-11-14 781 * @member: the name of the list_head within the struct.
^1da177e4c3f415 Linus Torvalds 2005-04-16 782 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 783 #define list_for_each_entry(pos, head, member) \
93be3c2eb3371f0 Oleg Nesterov 2013-11-12 @784 for (pos = list_first_entry(head, typeof(*pos), member); \
e130816164e244b Andy Shevchenko 2020-10-15 785 !list_entry_is_head(pos, head, member); \
8120e2e5141a420 Oleg Nesterov 2013-11-12 786 pos = list_next_entry(pos, member))
^1da177e4c3f415 Linus Torvalds 2005-04-16 787
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-11 2:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 12:59 [PATCH] drm/sched: Add warning for removing hack in drm_sched_fini() Philipp Stanner
2025-10-11 2:15 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).