diff mbox series

[v3] drm/display: use ERR_PTR on DP tunnel manager creation fail

Message ID 7q4fpnmmztmchczjewgm6igy55qt6jsm7tfd4fl4ucfq6yg2oy@q4lxtsu6445c (mailing list archive)
State New
Headers show
Series [v3] drm/display: use ERR_PTR on DP tunnel manager creation fail | expand

Commit Message

Krzysztof Karas Dec. 12, 2024, 11 a.m. UTC
Instead of returning a generic NULL on error from
drm_dp_tunnel_mgr_create(), use error pointers with informative codes
to align the function with stub that is executed when
CONFIG_DRM_DISPLAY_DP_TUNNEL is unset. This will also trigger IS_ERR()
in current caller (intel_dp_tunnerl_mgr_init()) instead of bypassing it
via NULL pointer.

v2: use error codes inside drm_dp_tunnel_mgr_create() instead of handling
 on caller's side (Michal, Imre)

v3: fixup commit message and add "CC"/"Fixes" lines (Andi),
 mention aligning function code with stub
    
Fixes: 91888b5b1ad2 ("drm/i915/dp: Add support for DP tunnel BW allocation")
Cc: Imre Deak <imre.deak@intel.com>
Cc: <stable@vger.kernel.org> # v6.9+
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/display/drm_dp_tunnel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Krzysztof Karas Dec. 12, 2024, 1:36 p.m. UTC | #1
On 2024-12-12 at 11:51:58 +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/display: use ERR_PTR on DP tunnel manager creation fail (rev2)
> URL   : https://patchwork.freedesktop.org/series/142423/
> State : failure
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_15830 -> Patchwork_142423v2
> ====================================================
> 
> Summary
> -------
> 
>   **FAILURE**
> 
>   Serious unknown changes coming with Patchwork_142423v2 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_142423v2, please notify your bug team (I915-ci-infra@lists.freedesktop.org) 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/Patchwork_142423v2/index.html
> 
> Participating hosts (47 -> 45)
> ------------------------------
> 
>   Missing    (2): fi-glk-j4005 fi-snb-2520m 
> 
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in Patchwork_142423v2:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@debugfs_test@sysfs:
>     - bat-arls-5:         [PASS][1] -> [DMESG-WARN][2]
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-arls-5/igt@debugfs_test@sysfs.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-arls-5/igt@debugfs_test@sysfs.html
> 
These failures are related to USB, which is unrelated to the changes
made in this patch. Furthermore, the code did not change from previous
revision of this patch which passed BAT tests. I'm going to re-run the
tests.

Krzysztof Karas
>   
> Known issues
> ------------
> 
>   Here are the changes found in Patchwork_142423v2 that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@i915_module_load@reload:
>     - bat-arls-5:         [PASS][3] -> [DMESG-WARN][4] ([i915#4423])
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-arls-5/igt@i915_module_load@reload.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-arls-5/igt@i915_module_load@reload.html
> 
>   * igt@i915_pm_rpm@module-reload:
>     - bat-dg2-11:         [PASS][5] -> [FAIL][6] ([i915#12903])
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-dg2-11/igt@i915_pm_rpm@module-reload.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-dg2-11/igt@i915_pm_rpm@module-reload.html
>     - bat-adls-6:         [PASS][7] -> [FAIL][8] ([i915#12903])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-adls-6/igt@i915_pm_rpm@module-reload.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-adls-6/igt@i915_pm_rpm@module-reload.html
>     - bat-dg1-7:          [PASS][9] -> [FAIL][10] ([i915#12903])
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-dg1-7/igt@i915_pm_rpm@module-reload.html
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-dg1-7/igt@i915_pm_rpm@module-reload.html
> 
>   * igt@i915_selftest@live:
>     - fi-skl-6600u:       [PASS][11] -> [INCOMPLETE][12] ([i915#13050])
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/fi-skl-6600u/igt@i915_selftest@live.html
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/fi-skl-6600u/igt@i915_selftest@live.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-b-dp-1:
>     - bat-apl-1:          [DMESG-WARN][13] ([i915#12918]) -> [PASS][14] +3 other tests pass
>    [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-apl-1/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-b-dp-1.html
>    [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-apl-1/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-b-dp-1.html
> 
>   * igt@kms_pipe_crc_basic@read-crc-frame-sequence:
>     - bat-apl-1:          [DMESG-WARN][15] ([i915#12921]) -> [PASS][16]
>    [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15830/bat-apl-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence.html
>    [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/bat-apl-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence.html
> 
>   
>   {name}: This element is suppressed. This means it is ignored when computing
>           the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>   [i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
>   [i915#12903]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12903
>   [i915#12918]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12918
>   [i915#12921]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12921
>   [i915#13050]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13050
>   [i915#4423]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4423
> 
> 
> Build changes
> -------------
> 
>   * Linux: CI_DRM_15830 -> Patchwork_142423v2
> 
>   CI-20190529: 20190529
>   CI_DRM_15830: 7b441ab54824526dd570dfbfbef51bcd2ba4c5b5 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_8150: 7812065f4aebab1629b570bd78ef71e09480b359 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
>   Patchwork_142423v2: 7b441ab54824526dd570dfbfbef51bcd2ba4c5b5 @ git://anongit.freedesktop.org/gfx-ci/linux
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_142423v2/index.html
diff mbox series

Patch

diff --git a/drivers/gpu/drm/display/drm_dp_tunnel.c b/drivers/gpu/drm/display/drm_dp_tunnel.c
index 48b2df120086..90fe07a89260 100644
--- a/drivers/gpu/drm/display/drm_dp_tunnel.c
+++ b/drivers/gpu/drm/display/drm_dp_tunnel.c
@@ -1896,8 +1896,8 @@  static void destroy_mgr(struct drm_dp_tunnel_mgr *mgr)
  *
  * Creates a DP tunnel manager for @dev.
  *
- * Returns a pointer to the tunnel manager if created successfully or NULL in
- * case of an error.
+ * Returns a pointer to the tunnel manager if created successfully or error
+ * pointer in case of failure.
  */
 struct drm_dp_tunnel_mgr *
 drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
@@ -1907,7 +1907,7 @@  drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
 
 	mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
 	if (!mgr)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	mgr->dev = dev;
 	init_waitqueue_head(&mgr->bw_req_queue);
@@ -1916,7 +1916,7 @@  drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
 	if (!mgr->groups) {
 		kfree(mgr);
 
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 	}
 
 #ifdef CONFIG_DRM_DISPLAY_DP_TUNNEL_STATE_DEBUG
@@ -1927,7 +1927,7 @@  drm_dp_tunnel_mgr_create(struct drm_device *dev, int max_group_count)
 		if (!init_group(mgr, &mgr->groups[i])) {
 			destroy_mgr(mgr);
 
-			return NULL;
+			return ERR_PTR(-ENOMEM);
 		}
 
 		mgr->group_count++;