Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 0/2] DRM - avoid regression in -rc, fix comment
@ 2022-12-05 16:10 Jim Cromie
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now Jim Cromie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jim Cromie @ 2022-12-05 16:10 UTC (permalink / raw)
  To: linux-kernel, dri-devel, amd-gfx, intel-gvt-dev, intel-gfx
  Cc: jani.nikula, daniel.vetter, Jim Cromie, seanpaul

hi DRM-folks,

DRM_USE_DYNAMIC_DEBUG has regression, mark as BROKEN for now.
Also correct a comment.

Jim Cromie (2):
  drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now
  drm_print: fix stale macro-name in comment

 drivers/gpu/drm/Kconfig | 3 ++-
 include/drm/drm_print.h | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Intel-gfx] [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now
  2022-12-05 16:10 [Intel-gfx] [PATCH 0/2] DRM - avoid regression in -rc, fix comment Jim Cromie
@ 2022-12-05 16:10 ` Jim Cromie
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment Jim Cromie
  2022-12-05 16:18 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment Patchwork
  2 siblings, 0 replies; 7+ messages in thread
From: Jim Cromie @ 2022-12-05 16:10 UTC (permalink / raw)
  To: linux-kernel, dri-devel, amd-gfx, intel-gvt-dev, intel-gfx
  Cc: jani.nikula, daniel.vetter, Jim Cromie, seanpaul

CONFIG_DRM_USE_DYNAMIC_DEBUG=y has a regression, due to a chicken-egg
initialization problem:

1- modprobe i915
   i915 needs drm.ko, which is loaded 1st

2- "modprobe drm drm.debug=0x1ff" (virtual/implied)
   drm.debug is set post-initialization, from boot-args etc

3- `modprobe i915` finishes

W/O drm.debug-on-dyndbg that just works, because drm_dbg* does
drm_debug_enabled() to check __drm_debug & DRM_UT_<CAT> before
printing.

But the whole point of CONFIG_DRM_USE_DYNAMIC_DEBUG is to avoid that
runtime test, by enabling (at end/after module_init) a static-key at
selected callsites in the just-loaded module.

And since drm.ko is loaded before all dependent modules, no other
modules are "just-loaded", and their drm.debug callsites are not
present yet, just those in drm.ko itself.

CC: <ville.syrjala@linux.intel.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
.v2 - default=N, cuz CI tests BROKEN stuff too. @ville.syrjala
---
 drivers/gpu/drm/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 34f5a092c99e..5adc8d5b6a40 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -53,7 +53,8 @@ config DRM_DEBUG_MM
 
 config DRM_USE_DYNAMIC_DEBUG
 	bool "use dynamic debug to implement drm.debug"
-	default y
+	default n
+	depends on BROKEN	# chicken-egg initial enable problem
 	depends on DRM
 	depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE
 	depends on JUMP_LABEL
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment
  2022-12-05 16:10 [Intel-gfx] [PATCH 0/2] DRM - avoid regression in -rc, fix comment Jim Cromie
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now Jim Cromie
@ 2022-12-05 16:10 ` Jim Cromie
  2023-01-05 12:46   ` Daniel Vetter
  2022-12-05 16:18 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment Patchwork
  2 siblings, 1 reply; 7+ messages in thread
From: Jim Cromie @ 2022-12-05 16:10 UTC (permalink / raw)
  To: linux-kernel, dri-devel, amd-gfx, intel-gvt-dev, intel-gfx
  Cc: jani.nikula, daniel.vetter, Jim Cromie, seanpaul

Cited commit uses stale macro name, fix this, and explain better.

When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_*
onto BITs in drm.debug.  This still uses enum drm_debug_category, but
it is somewhat indirect, with the ordered set of DRM_UT_* enum-vals.
This requires that the macro args: DRM_UT_* list must be kept in sync
and in order.

Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.")
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
. emphasize ABI non-change despite enum val change - Jani Nikula
. reorder to back of patchset to follow API name changes.
---
 include/drm/drm_print.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index a44fb7ef257f..e4c0c7e6d49d 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -276,7 +276,10 @@ static inline struct drm_printer drm_err_printer(const char *prefix)
  *
  */
 enum drm_debug_category {
-	/* These names must match those in DYNAMIC_DEBUG_CLASSBITS */
+	/*
+	 * Keep DYNDBG_CLASSMAP_DEFINE args in sync with changes here,
+	 * the enum-values define BIT()s in drm.debug, so are ABI.
+	 */
 	/**
 	 * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c,
 	 * drm_memory.c, ...
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment
  2022-12-05 16:10 [Intel-gfx] [PATCH 0/2] DRM - avoid regression in -rc, fix comment Jim Cromie
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now Jim Cromie
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment Jim Cromie
@ 2022-12-05 16:18 ` Patchwork
  2022-12-06  0:11   ` jim.cromie
  2 siblings, 1 reply; 7+ messages in thread
From: Patchwork @ 2022-12-05 16:18 UTC (permalink / raw)
  To: Jim Cromie; +Cc: intel-gfx

== Series Details ==

Series: DRM - avoid regression in -rc, fix comment
URL   : https://patchwork.freedesktop.org/series/111631/
State : failure

== Summary ==

Error: patch https://patchwork.freedesktop.org/api/1.0/series/111631/revisions/1/mbox/ not applied
Applying: drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/Kconfig
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/Kconfig
CONFLICT (content): Merge conflict in drivers/gpu/drm/Kconfig
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx]  ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment
  2022-12-05 16:18 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment Patchwork
@ 2022-12-06  0:11   ` jim.cromie
  0 siblings, 0 replies; 7+ messages in thread
From: jim.cromie @ 2022-12-06  0:11 UTC (permalink / raw)
  To: intel-gfx

On Mon, Dec 5, 2022 at 9:18 AM Patchwork
<patchwork@emeril.freedesktop.org> wrote:
>
> == Series Details ==
>
> Series: DRM - avoid regression in -rc, fix comment
> URL   : https://patchwork.freedesktop.org/series/111631/
> State : failure
>
> == Summary ==
>
> Error: patch https://patchwork.freedesktop.org/api/1.0/series/111631/revisions/1/mbox/ not applied

whats the right upstream to avoid  misapplies ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment
  2022-12-05 16:10 ` [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment Jim Cromie
@ 2023-01-05 12:46   ` Daniel Vetter
  2023-01-09 22:17     ` jim.cromie
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2023-01-05 12:46 UTC (permalink / raw)
  To: Jim Cromie
  Cc: jani.nikula, daniel.vetter, intel-gfx, linux-kernel, amd-gfx,
	seanpaul, dri-devel, intel-gvt-dev

On Mon, Dec 05, 2022 at 09:10:05AM -0700, Jim Cromie wrote:
> Cited commit uses stale macro name, fix this, and explain better.
> 
> When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_*
> onto BITs in drm.debug.  This still uses enum drm_debug_category, but
> it is somewhat indirect, with the ordered set of DRM_UT_* enum-vals.
> This requires that the macro args: DRM_UT_* list must be kept in sync
> and in order.
> 
> Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.")
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>

What's the status of this series?

Greg, you landed the original entire pile that wasn't quite ready yet? Or
should I apply these two?
-Daniel

> ---
> . emphasize ABI non-change despite enum val change - Jani Nikula
> . reorder to back of patchset to follow API name changes.
> ---
>  include/drm/drm_print.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index a44fb7ef257f..e4c0c7e6d49d 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -276,7 +276,10 @@ static inline struct drm_printer drm_err_printer(const char *prefix)
>   *
>   */
>  enum drm_debug_category {
> -	/* These names must match those in DYNAMIC_DEBUG_CLASSBITS */
> +	/*
> +	 * Keep DYNDBG_CLASSMAP_DEFINE args in sync with changes here,
> +	 * the enum-values define BIT()s in drm.debug, so are ABI.
> +	 */
>  	/**
>  	 * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c,
>  	 * drm_memory.c, ...
> -- 
> 2.38.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment
  2023-01-05 12:46   ` Daniel Vetter
@ 2023-01-09 22:17     ` jim.cromie
  0 siblings, 0 replies; 7+ messages in thread
From: jim.cromie @ 2023-01-09 22:17 UTC (permalink / raw)
  To: Jim Cromie, linux-kernel, dri-devel, amd-gfx, intel-gvt-dev,
	intel-gfx, jani.nikula, ville.syrjala, seanpaul, robdclark
  Cc: daniel.vetter

On Thu, Jan 5, 2023 at 5:46 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Mon, Dec 05, 2022 at 09:10:05AM -0700, Jim Cromie wrote:
> > Cited commit uses stale macro name, fix this, and explain better.
> >
> > When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_*
> > onto BITs in drm.debug.  This still uses enum drm_debug_category, but
> > it is somewhat indirect, with the ordered set of DRM_UT_* enum-vals.
> > This requires that the macro args: DRM_UT_* list must be kept in sync
> > and in order.
> >
> > Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.")
> > Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
>
> What's the status of this series?
>

dead - superseded by
https://patchwork.freedesktop.org/series/111652/
which is still WIP, but improved since that post.
I'll resubmit soon, with same title so patchwork calls it rev 2

> Greg, you landed the original entire pile that wasn't quite ready yet? Or
> should I apply these two?
> -Daniel
>
> > ---
> > . emphasize ABI non-change despite enum val change - Jani Nikula
> > . reorder to back of patchset to follow API name changes.
> > ---
> >  include/drm/drm_print.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> > index a44fb7ef257f..e4c0c7e6d49d 100644
> > --- a/include/drm/drm_print.h
> > +++ b/include/drm/drm_print.h
> > @@ -276,7 +276,10 @@ static inline struct drm_printer drm_err_printer(const char *prefix)
> >   *
> >   */
> >  enum drm_debug_category {
> > -     /* These names must match those in DYNAMIC_DEBUG_CLASSBITS */
> > +     /*
> > +      * Keep DYNDBG_CLASSMAP_DEFINE args in sync with changes here,
> > +      * the enum-values define BIT()s in drm.debug, so are ABI.
> > +      */
> >       /**
> >        * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c,
> >        * drm_memory.c, ...
> > --
> > 2.38.1
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-09 22:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05 16:10 [Intel-gfx] [PATCH 0/2] DRM - avoid regression in -rc, fix comment Jim Cromie
2022-12-05 16:10 ` [Intel-gfx] [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now Jim Cromie
2022-12-05 16:10 ` [Intel-gfx] [PATCH 2/2] drm_print: fix stale macro-name in comment Jim Cromie
2023-01-05 12:46   ` Daniel Vetter
2023-01-09 22:17     ` jim.cromie
2022-12-05 16:18 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for DRM - avoid regression in -rc, fix comment Patchwork
2022-12-06  0:11   ` jim.cromie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox