All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/kmod: Recursively unload the modules
@ 2020-11-19 16:21 Chris Wilson
  2020-11-19 17:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
  2020-11-23  7:52 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-11-19 16:21 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

When asked to unload a module, look at all the modules that are
trying to use the module and try to unload those first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kmod.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index e701545d3..5778bf953 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -243,6 +243,25 @@ out:
 	return err < 0 ? err : 0;
 }
 
+static int kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
+{
+	struct kmod_list *holders, *pos;
+	int err = 0;
+
+	holders = kmod_module_get_holders(kmod);
+	kmod_list_foreach(pos, holders) {
+		struct kmod_module *it = kmod_module_get_module(pos);
+		err = kmod_unload_r(it, flags);
+		kmod_module_unref(it);
+		if (err < 0)
+			break;
+	}
+	kmod_module_unref_list(holders);
+	if (err < 0)
+		return err;
+
+	return kmod_module_remove_module(kmod, flags);
+}
 
 /**
  * igt_kmod_unload:
@@ -269,7 +288,7 @@ igt_kmod_unload(const char *mod_name, unsigned int flags)
 		goto out;
 	}
 
-	err = kmod_module_remove_module(kmod, flags);
+	err = kmod_unload_r(kmod, flags);
 	if (err < 0) {
 		igt_debug("Could not remove module %s (%s)\n", mod_name,
 			  strerror(-err));
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for lib/kmod: Recursively unload the modules
  2020-11-19 16:21 [igt-dev] [PATCH i-g-t] lib/kmod: Recursively unload the modules Chris Wilson
@ 2020-11-19 17:22 ` Patchwork
  2020-11-23  7:52 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-11-19 17:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 6362 bytes --]

== Series Details ==

Series: lib/kmod: Recursively unload the modules
URL   : https://patchwork.freedesktop.org/series/84072/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9362 -> IGTPW_5199
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_5199 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_5199, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_5199:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-glk-dsi:         NOTRUN -> [INCOMPLETE][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-glk-dsi/igt@gem_exec_suspend@basic-s0.html

  
Known issues
------------

  Here are the changes found in IGTPW_5199 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload:
    - fi-kbl-soraka:      [PASS][2] -> [DMESG-WARN][3] ([i915#1982])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-kbl-soraka/igt@i915_module_load@reload.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-kbl-soraka/igt@i915_module_load@reload.html
    - fi-icl-y:           [PASS][4] -> [DMESG-WARN][5] ([i915#1982])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-icl-y/igt@i915_module_load@reload.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-icl-y/igt@i915_module_load@reload.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-byt-j1900:       [PASS][6] -> [DMESG-WARN][7] ([i915#1982])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-byt-j1900/igt@i915_pm_rpm@basic-pci-d3-state.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-byt-j1900/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
    - fi-tgl-y:           [PASS][8] -> [DMESG-WARN][9] ([i915#1982])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-tgl-y/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-tgl-y/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html

  * igt@prime_vgem@basic-write:
    - fi-tgl-y:           [PASS][10] -> [DMESG-WARN][11] ([i915#402])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-tgl-y/igt@prime_vgem@basic-write.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-tgl-y/igt@prime_vgem@basic-write.html

  
#### Possible fixes ####

  * igt@core_hotunplug@unbind-rebind:
    - fi-tgl-u2:          [DMESG-WARN][12] ([i915#1982]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-tgl-u2/igt@core_hotunplug@unbind-rebind.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-tgl-u2/igt@core_hotunplug@unbind-rebind.html
    - fi-icl-u2:          [DMESG-WARN][14] ([i915#1982]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-icl-u2/igt@core_hotunplug@unbind-rebind.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-icl-u2/igt@core_hotunplug@unbind-rebind.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-bsw-kefka:       [DMESG-WARN][16] ([i915#1982]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
    - fi-byt-j1900:       [DMESG-WARN][18] ([i915#1982]) -> [PASS][19] +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-byt-j1900/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - {fi-kbl-7560u}:     [DMESG-WARN][20] ([i915#1982]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-kbl-7560u/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-kbl-7560u/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
    - fi-apl-guc:         [DMESG-WARN][22] ([i915#1635] / [i915#1982]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-apl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-apl-guc/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html

  * igt@prime_self_import@basic-with_two_bos:
    - fi-tgl-y:           [DMESG-WARN][24] ([i915#402]) -> [PASS][25] +1 similar issue
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9362/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402


Participating hosts (42 -> 39)
------------------------------

  Additional (2): fi-glk-dsi fi-cfl-guc 
  Missing    (5): fi-ilk-m540 fi-tgl-dsi fi-hsw-4200u fi-bsw-cyan fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_5859 -> IGTPW_5199

  CI-20190529: 20190529
  CI_DRM_9362: 374246282b84ca52149ecb9a83a4ad7a515d01d9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5199: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/index.html
  IGT_5859: 5bc1047cc8f38a9e0c5a914b6511a639b15a740e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5199/index.html

[-- Attachment #1.2: Type: text/html, Size: 7948 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t] lib/kmod: Recursively unload the modules
  2020-11-19 16:21 [igt-dev] [PATCH i-g-t] lib/kmod: Recursively unload the modules Chris Wilson
  2020-11-19 17:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
@ 2020-11-23  7:52 ` Zbigniew Kempczyński
  1 sibling, 0 replies; 3+ messages in thread
From: Zbigniew Kempczyński @ 2020-11-23  7:52 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

On Thu, Nov 19, 2020 at 04:21:12PM +0000, Chris Wilson wrote:
> When asked to unload a module, look at all the modules that are
> trying to use the module and try to unload those first.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_kmod.c | 21 ++++++++++++++++++++-
>  1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index e701545d3..5778bf953 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -243,6 +243,25 @@ out:
>  	return err < 0 ? err : 0;
>  }
>  
> +static int kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
> +{
> +	struct kmod_list *holders, *pos;
> +	int err = 0;
> +
> +	holders = kmod_module_get_holders(kmod);
> +	kmod_list_foreach(pos, holders) {
> +		struct kmod_module *it = kmod_module_get_module(pos);
> +		err = kmod_unload_r(it, flags);
> +		kmod_module_unref(it);
> +		if (err < 0)
> +			break;
> +	}
> +	kmod_module_unref_list(holders);
> +	if (err < 0)
> +		return err;
> +
> +	return kmod_module_remove_module(kmod, flags);
> +}

Code looks ok, I've also I played with it for a while and no issues found.

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
--
Zbigniew

>  
>  /**
>   * igt_kmod_unload:
> @@ -269,7 +288,7 @@ igt_kmod_unload(const char *mod_name, unsigned int flags)
>  		goto out;
>  	}
>  
> -	err = kmod_module_remove_module(kmod, flags);
> +	err = kmod_unload_r(kmod, flags);
>  	if (err < 0) {
>  		igt_debug("Could not remove module %s (%s)\n", mod_name,
>  			  strerror(-err));
> -- 
> 2.29.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-11-23  7:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 16:21 [igt-dev] [PATCH i-g-t] lib/kmod: Recursively unload the modules Chris Wilson
2020-11-19 17:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-11-23  7:52 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.