Skip to contentSkip to conversation

drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

PATCH In review Nathan Chancellor 4 participants 6 messages Jul 16, 2020 – Jul 28, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

Clang warns:

drivers/gpu/drm/i915/display/intel_combo_phy.c:268:3: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]

                ret &= check_phy_reg(dev_priv, phy, ICL_PORT_TX_DW8_LN0(phy),
                ^~~
drivers/gpu/drm/i915/display/intel_combo_phy.c:261:10: note: initialize
the variable 'ret' to silence this warning
        bool ret;
                ^
                 = 0

1 warning generated.

In practice, the bug this warning appears to be concerned with would not actually matter because ret gets initialized to the return value of cnl_verify_procmon_ref_values. However, that does appear to be a bug since it means the first hunk of the patch this fixes won't actually do anything (since the values of check_phy_reg won't factor into the final ret value). Initialize ret to true then make all of the assignments a bitwise AND with itself so that the function always does what it should do.

Fixes 239bef676d8e ("drm/i915/display: Implement new combo phy initialization step")
---
 drivers/gpu/drm/i915/display/intel_combo_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_combo_phy.c +2 -2
index eccaa79cb4a9..a4b8aa6d0a9e 100644
@@ -258,7 +258,7 @@ static bool phy_is_master(struct drm_i915_private *dev_priv, enum phy phy)
 static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv,
 				       enum phy phy)
 {
-	bool ret;
+	bool ret = true;
 	u32 expected_val = 0;
 
 	if (!icl_combo_phy_enabled(dev_priv, phy))
@@ -276,7 +276,7 @@ static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv,
 				     DCC_MODE_SELECT_CONTINUOSLY);
 	}
 
-	ret = cnl_verify_procmon_ref_values(dev_priv, phy);
+	ret &= cnl_verify_procmon_ref_values(dev_priv, phy);
 
 	if (phy_is_master(dev_priv, phy)) {
 		ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW8(phy),

base-commit: ca0e494af5edb59002665bf12871e94b4163a257

Signature · 1 line
2.28.0.rc0
#1 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

== Series Details ==

== Series Details ==

Series: drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state
URL : https://patchwork.freedesktop.org/series/79536/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
b0efac00fd8c drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state
-:11: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#11: 
                ret &= check_phy_reg(dev_priv, phy, ICL_PORT_TX_DW8_LN0(phy),

total: 0 errors, 1 warnings, 0 checks, 16 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

In reply to Nathan Chancellor
== Series Details ==

== Series Details ==

Series: drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state
URL : https://patchwork.freedesktop.org/series/79536/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8753 -> Patchwork_18185
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_18185 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_18185, 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/Patchwork_18185/index.html

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_pm_rpm@module-reload:
- fi-tgl-y: [PASS][1] -> [DMESG-WARN][2] +4 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-y/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-y/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_pm_rpm@basic-pci-d3-state:
- {fi-tgl-dsi}: [DMESG-WARN][3] ([i915#1982]) -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-dsi/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- {fi-tgl-dsi}: [PASS][5] -> [DMESG-WARN][6] +4 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-dsi/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-dsi/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s0:
- fi-tgl-u2: [PASS][7] -> [FAIL][8] ([i915#1888])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-u2/igt@[email protected]

* igt@kms_addfb_basic@bo-too-small:
- fi-tgl-y: [PASS][9] -> [DMESG-WARN][10] ([i915#402]) +1 similar issue
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-y/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-y/igt@[email protected]

#### Possible fixes ####

* igt@debugfs_test@read_all_entries:
- fi-bsw-nick: [INCOMPLETE][11] ([i915#1250] / [i915#1436]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-bsw-nick/igt@debugfs_test@read_all_entries.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-bsw-nick/igt@debugfs_test@read_all_entries.html

* igt@gem_exec_store@basic:
- fi-tgl-y: [DMESG-WARN][13] ([i915#402]) -> [PASS][14] +2 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-y/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-y/igt@[email protected]

* igt@i915_module_load@reload:
- fi-byt-j1900: [DMESG-WARN][15] ([i915#1982]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-byt-j1900/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-byt-j1900/igt@[email protected]
- fi-kbl-x1275: [DMESG-WARN][17] ([i915#62] / [i915#92]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-kbl-x1275/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-kbl-x1275/igt@[email protected]

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [DMESG-WARN][19] ([i915#1982]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-bsw-kefka/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-bsw-kefka/igt@[email protected]

* igt@i915_selftest@live@execlists:
- fi-kbl-r: [INCOMPLETE][21] ([i915#794]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-kbl-r/igt@i915_selftest@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-kbl-r/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@gt_lrc:
- fi-tgl-u2: [DMESG-FAIL][23] ([i915#1233]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-u2/igt@i915_selftest@live@gt_lrc.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-u2/igt@i915_selftest@live@gt_lrc.html

* igt@kms_flip@basic-flip-vs-modeset@a-dsi1:
- {fi-tgl-dsi}: [DMESG-WARN][25] ([i915#1982]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-dsi/igt@kms_flip@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-dsi/igt@kms_flip@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-tgl-u2: [DMESG-WARN][27] ([i915#402]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-tgl-u2/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-tgl-u2/igt@[email protected]

#### Warnings ####

* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][29] ([i915#62] / [i915#92]) -> [DMESG-WARN][30] ([i915#1982] / [i915#62] / [i915#92] / [i915#95])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-kbl-x1275/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-kbl-x1275/igt@[email protected]

* igt@kms_flip@basic-flip-vs-dpms@a-dp1:
- fi-kbl-x1275: [DMESG-WARN][31] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][32] ([i915#62] / [i915#92])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-kbl-x1275/igt@kms_flip@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-kbl-x1275/igt@kms_flip@[email protected]

* igt@kms_force_connector_basic@force-edid:
- fi-kbl-x1275: [DMESG-WARN][33] ([i915#62] / [i915#92]) -> [DMESG-WARN][34] ([i915#62] / [i915#92] / [i915#95]) +4 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8753/fi-kbl-x1275/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/fi-kbl-x1275/igt@[email protected]

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

[i915#1233]: https://gitlab.freedesktop.org/drm/intel/issues/1233
[i915#1250]: https://gitlab.freedesktop.org/drm/intel/issues/1250
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#794]: https://gitlab.freedesktop.org/drm/intel/issues/794
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (46 -> 40)
------------------------------

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus

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

* Linux: CI_DRM_8753 -> Patchwork_18185

CI-20190529: 20190529
CI_DRM_8753: 62f01b776240c4586b3cbbdbe6065d4473d45429 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5737: c18a9c1083ce9344ff71ae405b9f2deaa82b6702 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18185: b0efac00fd8cdd3d7a3cc3140ba0df8bda56ebf3 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

b0efac00fd8c drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

== Logs ==

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

Hi Nathan

Are you planning to check this regressions and send another version with the fix?Or can I do it on top of your patch?

Quoted 99 lines · Patchwork

Patch Details
Series: drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state
URL: https://patchwork.freedesktop.org/series/79536/
State: failure
Details: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/index.html
CI Bug Log - changes from CI_DRM_8753 -> Patchwork_18185 Summary
FAILURE

Serious unknown changes coming with Patchwork_18185 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_18185, 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/Patchwork_18185/index.html

Possible new issues
Here are the unknown changes that may have been introduced in Patchwork_18185:

IGT changes
Possible regressions
igt@i915_pm_rpm@module-reload:
fi-tgl-y: PASS -> DMESG-WARN +4 similar issues
Suppressed
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

igt@i915_pm_rpm@basic-pci-d3-state:

{fi-tgl-dsi}: DMESG-WARN (i915#1982) -> DMESG-WARN igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:

{fi-tgl-dsi}: PASS -> DMESG-WARN +4 similar issues
Known issues
Here are the changes found in Patchwork_18185 that come from known issues:

IGT changes
Issues hit
igt@gem_exec_suspend@basic-s0:

fi-tgl-u2: PASS -> FAIL (i915#1888)
igt@kms_addfb_basic@bo-too-small:

fi-tgl-y: PASS -> DMESG-WARN (i915#402) +1 similar issue Possible fixes igt@debugfs_test@read_all_entries:

fi-bsw-nick: INCOMPLETE (i915#1250 / i915#1436) -> PASS igt@gem_exec_store@basic:

fi-tgl-y: DMESG-WARN (i915#402) -> PASS +2 similar issues igt@i915_module_load@reload:

fi-byt-j1900: DMESG-WARN (i915#1982) -> PASS

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> PASS

igt@i915_pm_rpm@basic-pci-d3-state:

fi-bsw-kefka: DMESG-WARN (i915#1982) -> PASS
igt@i915_selftest@live@execlists:

fi-kbl-r: INCOMPLETE (i915#794) -> PASS
igt@i915_selftest@live@gt_lrc:

fi-tgl-u2: DMESG-FAIL (i915#1233) -> PASS
igt@kms_flip@basic-flip-vs-modeset@a-dsi1:

{fi-tgl-dsi}: DMESG-WARN (i915#1982) -> PASS igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:

fi-tgl-u2: DMESG-WARN (i915#402) -> PASS
Warnings
igt@gem_exec_suspend@basic-s0:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> DMESG-WARN (i915#1982 / i915#62 / i915#92 / i915#95) igt@kms_flip@basic-flip-vs-dpms@a-dp1:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92 / i915#95) -> DMESG-WARN (i915#62 / i915#92) igt@kms_force_connector_basic@force-edid:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> DMESG-WARN (i915#62 / i915#92 / i915#95) +4 similar issues {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

Participating hosts (46 -> 40)
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus

Build changes
Linux: CI_DRM_8753 -> Patchwork_18185
CI-20190529: 20190529
CI_DRM_8753: 62f01b776240c4586b3cbbdbe6065d4473d45429 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5737: c18a9c1083ce9344ff71ae405b9f2deaa82b6702 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18185: b0efac00fd8cdd3d7a3cc3140ba0df8bda56ebf3 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

Quoted 9 lines

b0efac00fd8c drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

_______________________________________________
Intel-gfx mailing list
[email protected]

https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Re: [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

Hi Jose,

Quoted 3 lines · Jose

Hi Nathan

Are you planning to check this regressions and send another version with the fix?Or can I do it on top of your patch?

Unfortunately, I have had little time for kernel work (full time retail worker in the middle of a pandemic plus full time student is a real fun combination...). I would definitely appreciate a follow up fix if you can provide one, since I would imagine it would be a pre-existing issue since all my patch does is make the check in the icl_combo_phy_enabled if block work as expected (when it does not appear to be working before).

Cheers,
Nathan

Quoted 102 lines · Patchwork
Quoted 101 lines

Patch Details
Series: drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state
URL: https://patchwork.freedesktop.org/series/79536/
State: failure
Details: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18185/index.html
CI Bug Log - changes from CI_DRM_8753 -> Patchwork_18185 Summary
FAILURE

Serious unknown changes coming with Patchwork_18185 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_18185, 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/Patchwork_18185/index.html

Possible new issues
Here are the unknown changes that may have been introduced in Patchwork_18185:

IGT changes
Possible regressions
igt@i915_pm_rpm@module-reload:
fi-tgl-y: PASS -> DMESG-WARN +4 similar issues
Suppressed
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

igt@i915_pm_rpm@basic-pci-d3-state:

{fi-tgl-dsi}: DMESG-WARN (i915#1982) -> DMESG-WARN igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:

{fi-tgl-dsi}: PASS -> DMESG-WARN +4 similar issues
Known issues
Here are the changes found in Patchwork_18185 that come from known issues:

IGT changes
Issues hit
igt@gem_exec_suspend@basic-s0:

fi-tgl-u2: PASS -> FAIL (i915#1888)
igt@kms_addfb_basic@bo-too-small:

fi-tgl-y: PASS -> DMESG-WARN (i915#402) +1 similar issue Possible fixes igt@debugfs_test@read_all_entries:

fi-bsw-nick: INCOMPLETE (i915#1250 / i915#1436) -> PASS igt@gem_exec_store@basic:

fi-tgl-y: DMESG-WARN (i915#402) -> PASS +2 similar issues igt@i915_module_load@reload:

fi-byt-j1900: DMESG-WARN (i915#1982) -> PASS

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> PASS

igt@i915_pm_rpm@basic-pci-d3-state:

fi-bsw-kefka: DMESG-WARN (i915#1982) -> PASS
igt@i915_selftest@live@execlists:

fi-kbl-r: INCOMPLETE (i915#794) -> PASS
igt@i915_selftest@live@gt_lrc:

fi-tgl-u2: DMESG-FAIL (i915#1233) -> PASS
igt@kms_flip@basic-flip-vs-modeset@a-dsi1:

{fi-tgl-dsi}: DMESG-WARN (i915#1982) -> PASS igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:

fi-tgl-u2: DMESG-WARN (i915#402) -> PASS
Warnings
igt@gem_exec_suspend@basic-s0:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> DMESG-WARN (i915#1982 / i915#62 / i915#92 / i915#95) igt@kms_flip@basic-flip-vs-dpms@a-dp1:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92 / i915#95) -> DMESG-WARN (i915#62 / i915#92) igt@kms_force_connector_basic@force-edid:

fi-kbl-x1275: DMESG-WARN (i915#62 / i915#92) -> DMESG-WARN (i915#62 / i915#92 / i915#95) +4 similar issues {name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

Participating hosts (46 -> 40)
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus

Build changes
Linux: CI_DRM_8753 -> Patchwork_18185
CI-20190529: 20190529
CI_DRM_8753: 62f01b776240c4586b3cbbdbe6065d4473d45429 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5737: c18a9c1083ce9344ff71ae405b9f2deaa82b6702 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18185: b0efac00fd8cdd3d7a3cc3140ba0df8bda56ebf3 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

b0efac00fd8c drm/i915/display: Ensure that ret is always initialized in icl_combo_phy_verify_state

Quoted 7 lines
Quoted 7 lines

_______________________________________________
Intel-gfx mailing list
[email protected]

https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#5 lore raw
In reply to Nathan Chancellor
Quoted 22 lines · Nathan Chancellor

Clang warns:

drivers/gpu/drm/i915/display/intel_combo_phy.c:268:3: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]

                ret &= check_phy_reg(dev_priv, phy, ICL_PORT_TX_DW8_LN0(phy),
                ^~~
drivers/gpu/drm/i915/display/intel_combo_phy.c:261:10: note: initialize
the variable 'ret' to silence this warning
        bool ret;
                ^
                 = 0

1 warning generated.

In practice, the bug this warning appears to be concerned with would not actually matter because ret gets initialized to the return value of cnl_verify_procmon_ref_values. However, that does appear to be a bug since it means the first hunk of the patch this fixes won't actually do anything (since the values of check_phy_reg won't factor into the final ret value). Initialize ret to true then make all of the assignments a bitwise AND with itself so that the function always does what it should do.

Quoted 3 lines
Fixes 239bef676d8e ("drm/i915/display: Implement new combo phy initialization step")
Quoted 31 lines
---
 drivers/gpu/drm/i915/display/intel_combo_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_combo_phy.c +2 -2
index eccaa79cb4a9..a4b8aa6d0a9e 100644
@@ -258,7 +258,7 @@ static bool phy_is_master(struct drm_i915_private *dev_priv, enum phy phy)
 static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv,
 				       enum phy phy)
 {
-	bool ret;
+	bool ret = true;
 	u32 expected_val = 0;
 
 	if (!icl_combo_phy_enabled(dev_priv, phy))
@@ -276,7 +276,7 @@ static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv,
 				     DCC_MODE_SELECT_CONTINUOSLY);
 	}
 
-	ret = cnl_verify_procmon_ref_values(dev_priv, phy);
+	ret &= cnl_verify_procmon_ref_values(dev_priv, phy);
 
 	if (phy_is_master(dev_priv, phy)) {
 		ret &= check_phy_reg(dev_priv, phy, ICL_PORT_COMP_DW8(phy),

base-commit: ca0e494af5edb59002665bf12871e94b4163a257

Signature · 1 line
2.28.0.rc0
Signature · 9 lines
Matt Roper
Graphics Software Engineer
VTT-OSGC Platform Enablement
Intel Corporation
(916) 356-2795
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx