diff mbox series

[RESEND,1/3] drm/i915/dmc: abstract GPU error state dump

Message ID 20220330124119.224966-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [RESEND,1/3] drm/i915/dmc: abstract GPU error state dump | expand

Commit Message

Jani Nikula March 30, 2022, 12:41 p.m. UTC
Only intel_dmc.c should be accessing dmc details directly.

Need to add an i915_error_printf() stub for
CONFIG_DRM_I915_CAPTURE_ERROR=n.

v2: Add the stub (kernel test robot <lkp@intel.com>)

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> # v1
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 15 +++++++++++++++
 drivers/gpu/drm/i915/display/intel_dmc.h |  3 +++
 drivers/gpu/drm/i915/i915_gpu_error.c    | 10 +---------
 drivers/gpu/drm/i915/i915_gpu_error.h    |  6 ++++++
 4 files changed, 25 insertions(+), 9 deletions(-)

Comments

Jani Nikula March 30, 2022, 3:22 p.m. UTC | #1
On Wed, 30 Mar 2022, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: series starting with [RESEND,1/3] drm/i915/dmc: abstract GPU error state dump
> URL   : https://patchwork.freedesktop.org/series/101957/
> State : failure

I don't get why this doesn't apply.

It applies for me.


BR,
Jani.


>
> == Summary ==
>
> Applying: drm/i915/dmc: abstract GPU error state dump
> Using index info to reconstruct a base tree...
> M	drivers/gpu/drm/i915/display/intel_dmc.c
> M	drivers/gpu/drm/i915/display/intel_dmc.h
> M	drivers/gpu/drm/i915/i915_gpu_error.c
> Falling back to patching base and 3-way merge...
> Auto-merging drivers/gpu/drm/i915/i915_gpu_error.c
> Auto-merging drivers/gpu/drm/i915/display/intel_dmc.h
> CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/display/intel_dmc.h
> Auto-merging drivers/gpu/drm/i915/display/intel_dmc.c
> CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/display/intel_dmc.c
> 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/i915/dmc: abstract GPU error state dump
> 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".
>
>
Sarvela, Tomi P March 31, 2022, 8:28 a.m. UTC | #2
The latest CI_DRM built is 11416; after that, there is build error:
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c: In function 'amdgpu_gtt_mgr_recover':
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c:200:31: error: 'struct ttm_range_mgr_node' has no member named 'tbo'
   amdgpu_ttm_recover_gart(node->tbo);
                               ^~
  CC [M]  drivers/net/ethernet/intel/igb/e1000_mbx.o
scripts/Makefile.build:288: recipe for target 'drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.o' failed

The patch is applied against latest working build commit. Can you try your patch against
 CI_DRM_11416 1dc2c6953e2689a0e5b7cca8450da14059d35f03
and see if you get the same error?

Tomi

> From: Nikula, Jani <jani.nikula@intel.com>
> 
> On Wed, 30 Mar 2022, Patchwork <patchwork@emeril.freedesktop.org>
> wrote:
> > == Series Details ==
> >
> > Series: series starting with [RESEND,1/3] drm/i915/dmc: abstract GPU error
> state dump
> > URL   : https://patchwork.freedesktop.org/series/101957/
> > State : failure
> 
> I don't get why this doesn't apply.
> 
> It applies for me.
> 
> 
> BR,
> Jani.
> 
> 
> >
> > == Summary ==
> >
> > Applying: drm/i915/dmc: abstract GPU error state dump
> > Using index info to reconstruct a base tree...
> > M	drivers/gpu/drm/i915/display/intel_dmc.c
> > M	drivers/gpu/drm/i915/display/intel_dmc.h
> > M	drivers/gpu/drm/i915/i915_gpu_error.c
> > Falling back to patching base and 3-way merge...
> > Auto-merging drivers/gpu/drm/i915/i915_gpu_error.c
> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.h
> > CONFLICT (content): Merge conflict in
> drivers/gpu/drm/i915/display/intel_dmc.h
> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.c
> > CONFLICT (content): Merge conflict in
> drivers/gpu/drm/i915/display/intel_dmc.c
> > 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/i915/dmc: abstract GPU error state dump
> > 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".
> >
> >
> 
> --
> Jani Nikula, Intel Open Source Graphics Center
Lucas De Marchi March 31, 2022, 8:35 a.m. UTC | #3
On Thu, Mar 31, 2022 at 08:28:09AM +0000, Tomi Sarvela wrote:
>The latest CI_DRM built is 11416; after that, there is build error:
>drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c: In function 'amdgpu_gtt_mgr_recover':
>drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c:200:31: error: 'struct ttm_range_mgr_node' has no member named 'tbo'
>   amdgpu_ttm_recover_gart(node->tbo);
>                               ^~
>  CC [M]  drivers/net/ethernet/intel/igb/e1000_mbx.o
>scripts/Makefile.build:288: recipe for target 'drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.o' failed

just fixed that

>
>The patch is applied against latest working build commit. Can you try your patch against
> CI_DRM_11416 1dc2c6953e2689a0e5b7cca8450da14059d35f03
>and see if you get the same error?

so maybe just a re-trigger should work?

Lucas De Marchi

>
>Tomi
>
>> From: Nikula, Jani <jani.nikula@intel.com>
>>
>> On Wed, 30 Mar 2022, Patchwork <patchwork@emeril.freedesktop.org>
>> wrote:
>> > == Series Details ==
>> >
>> > Series: series starting with [RESEND,1/3] drm/i915/dmc: abstract GPU error
>> state dump
>> > URL   : https://patchwork.freedesktop.org/series/101957/
>> > State : failure
>>
>> I don't get why this doesn't apply.
>>
>> It applies for me.
>>
>>
>> BR,
>> Jani.
>>
>>
>> >
>> > == Summary ==
>> >
>> > Applying: drm/i915/dmc: abstract GPU error state dump
>> > Using index info to reconstruct a base tree...
>> > M	drivers/gpu/drm/i915/display/intel_dmc.c
>> > M	drivers/gpu/drm/i915/display/intel_dmc.h
>> > M	drivers/gpu/drm/i915/i915_gpu_error.c
>> > Falling back to patching base and 3-way merge...
>> > Auto-merging drivers/gpu/drm/i915/i915_gpu_error.c
>> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.h
>> > CONFLICT (content): Merge conflict in
>> drivers/gpu/drm/i915/display/intel_dmc.h
>> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.c
>> > CONFLICT (content): Merge conflict in
>> drivers/gpu/drm/i915/display/intel_dmc.c
>> > 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/i915/dmc: abstract GPU error state dump
>> > 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".
>> >
>> >
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
Sarvela, Tomi P March 31, 2022, 8:41 a.m. UTC | #4
After the latest CI_DRM has been build, re-test should be enough.

Tomi

> From: De Marchi, Lucas <lucas.demarchi@intel.com>
> On Thu, Mar 31, 2022 at 08:28:09AM +0000, Tomi Sarvela wrote:
> >The latest CI_DRM built is 11416; after that, there is build error:
> >drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c: In function
> 'amdgpu_gtt_mgr_recover':
> >drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c:200:31: error: 'struct
> ttm_range_mgr_node' has no member named 'tbo'
> >   amdgpu_ttm_recover_gart(node->tbo);
> >                               ^~
> >  CC [M]  drivers/net/ethernet/intel/igb/e1000_mbx.o
> >scripts/Makefile.build:288: recipe for target
> 'drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.o' failed
> 
> just fixed that
> 
> >
> >The patch is applied against latest working build commit. Can you try your
> patch against
> > CI_DRM_11416 1dc2c6953e2689a0e5b7cca8450da14059d35f03
> >and see if you get the same error?
> 
> so maybe just a re-trigger should work?
> 
> Lucas De Marchi
> 
> >
> >Tomi
> >
> >> From: Nikula, Jani <jani.nikula@intel.com>
> >>
> >> On Wed, 30 Mar 2022, Patchwork <patchwork@emeril.freedesktop.org>
> >> wrote:
> >> > == Series Details ==
> >> >
> >> > Series: series starting with [RESEND,1/3] drm/i915/dmc: abstract GPU
> error
> >> state dump
> >> > URL   : https://patchwork.freedesktop.org/series/101957/
> >> > State : failure
> >>
> >> I don't get why this doesn't apply.
> >>
> >> It applies for me.
> >>
> >>
> >> BR,
> >> Jani.
> >>
> >>
> >> >
> >> > == Summary ==
> >> >
> >> > Applying: drm/i915/dmc: abstract GPU error state dump
> >> > Using index info to reconstruct a base tree...
> >> > M	drivers/gpu/drm/i915/display/intel_dmc.c
> >> > M	drivers/gpu/drm/i915/display/intel_dmc.h
> >> > M	drivers/gpu/drm/i915/i915_gpu_error.c
> >> > Falling back to patching base and 3-way merge...
> >> > Auto-merging drivers/gpu/drm/i915/i915_gpu_error.c
> >> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.h
> >> > CONFLICT (content): Merge conflict in
> >> drivers/gpu/drm/i915/display/intel_dmc.h
> >> > Auto-merging drivers/gpu/drm/i915/display/intel_dmc.c
> >> > CONFLICT (content): Merge conflict in
> >> drivers/gpu/drm/i915/display/intel_dmc.c
> >> > 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/i915/dmc: abstract GPU error state dump
> >> > 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".
> >> >
> >> >
> >>
> >> --
> >> Jani Nikula, Intel Open Source Graphics Center
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 5de13f978e57..f0eb3de8de60 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -811,6 +811,21 @@  void intel_dmc_ucode_fini(struct drm_i915_private *dev_priv)
 		kfree(dev_priv->dmc.dmc_info[id].payload);
 }
 
+void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m,
+				 struct drm_i915_private *i915)
+{
+	struct intel_dmc *dmc = &i915->dmc;
+
+	if (!HAS_DMC(i915))
+		return;
+
+	i915_error_printf(m, "DMC loaded: %s\n",
+			  str_yes_no(intel_dmc_has_payload(i915)));
+	i915_error_printf(m, "DMC fw version: %d.%d\n",
+			  DMC_VERSION_MAJOR(dmc->version),
+			  DMC_VERSION_MINOR(dmc->version));
+}
+
 static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
 {
 	struct drm_i915_private *i915 = m->private;
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.h b/drivers/gpu/drm/i915/display/intel_dmc.h
index b9f608057700..dd8880d2cbed 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.h
+++ b/drivers/gpu/drm/i915/display/intel_dmc.h
@@ -10,6 +10,7 @@ 
 #include "intel_wakeref.h"
 #include <linux/workqueue.h>
 
+struct drm_i915_error_state_buf;
 struct drm_i915_private;
 
 #define DMC_VERSION(major, minor)	((major) << 16 | (minor))
@@ -55,6 +56,8 @@  void intel_dmc_ucode_suspend(struct drm_i915_private *i915);
 void intel_dmc_ucode_resume(struct drm_i915_private *i915);
 bool intel_dmc_has_payload(struct drm_i915_private *i915);
 void intel_dmc_debugfs_register(struct drm_i915_private *i915);
+void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m,
+				 struct drm_i915_private *i915);
 
 void assert_dmc_loaded(struct drm_i915_private *i915);
 
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 5478b1dd26bd..fa14314e7d70 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -849,15 +849,7 @@  static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
 
 	err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
 
-	if (HAS_DMC(m->i915)) {
-		struct intel_dmc *dmc = &m->i915->dmc;
-
-		err_printf(m, "DMC loaded: %s\n",
-			   str_yes_no(intel_dmc_has_payload(m->i915) != 0));
-		err_printf(m, "DMC fw version: %d.%d\n",
-			   DMC_VERSION_MAJOR(dmc->version),
-			   DMC_VERSION_MINOR(dmc->version));
-	}
+	intel_dmc_print_error_state(m, m->i915);
 
 	err_printf(m, "RPM wakelock: %s\n", str_yes_no(error->wakelock));
 	err_printf(m, "PM suspended: %s\n", str_yes_no(error->suspended));
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h b/drivers/gpu/drm/i915/i915_gpu_error.h
index 09159ff01411..7977a01a708f 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.h
+++ b/drivers/gpu/drm/i915/i915_gpu_error.h
@@ -298,6 +298,12 @@  void i915_disable_error_state(struct drm_i915_private *i915, int err);
 
 #else
 
+__printf(2, 3)
+static inline void
+i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
+{
+}
+
 static inline void
 i915_capture_error_state(struct intel_gt *gt, intel_engine_mask_t engine_mask, u32 dump_flags)
 {