CC: [email protected] CC: [email protected] CC: [email protected] TO: Jani Nikula <[email protected]> CC: "Ville Syrjälä" <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b5013d084e03e82ceeab4db8ae8ceeaebe76b0eb commit: 3c6a4a02c92af14a0325ede88bdbccc0ccd19241 drm/i915/panel: move intel_panel_use_ssc() out of headers date: 3 months ago :::::: branch date: 9 hours ago :::::: commit date: 3 months ago config: i386-randconfig-c001-20210927 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3c6a4a02c92af14a0325ede88bdbccc0ccd19241 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 3c6a4a02c92af14a0325ede88bdbccc0ccd19241 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ drivers/gpu/drm/i915/i915_drv.h:1380:2: note: Returning value, which participates in a condition later return info->platform_mask[pi] & BIT(pb); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:605:6: note: Returning from 'IS_PLATFORM' if (IS_CHERRYVIEW(to_i915(dev))) { ^ drivers/gpu/drm/i915/i915_drv.h:1427:33: note: expanded from macro 'IS_CHERRYVIEW' #define IS_CHERRYVIEW(dev_priv) IS_PLATFORM(dev_priv, INTEL_CHERRYVIEW) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:605:6: note: Assuming the condition is false if (IS_CHERRYVIEW(to_i915(dev))) { ^ drivers/gpu/drm/i915/i915_drv.h:1427:33: note: expanded from macro 'IS_CHERRYVIEW' #define IS_CHERRYVIEW(dev_priv) IS_PLATFORM(dev_priv, INTEL_CHERRYVIEW) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:605:2: note: Taking false branch if (IS_CHERRYVIEW(to_i915(dev))) { ^ drivers/gpu/drm/i915/display/intel_dpll.c:611:28: note: Assuming 'target_freq' is not equal to 0 if (drm_WARN_ON_ONCE(dev, !target_freq)) ^ include/drm/drm_print.h:567:24: note: expanded from macro 'drm_WARN_ON_ONCE' drm_WARN_ONCE((drm), (x), "%s", \ ^ include/drm/drm_print.h:558:12: note: expanded from macro 'drm_WARN_ONCE' WARN_ONCE(condition, "%s %s: " format, \ ^~~~~~~~~ include/asm-generic/bug.h:150:18: note: expanded from macro 'WARN_ONCE' DO_ONCE_LITE_IF(condition, WARN, 1, format) ^~~~~~~~~ include/linux/once_lite.h:15:27: note: expanded from macro 'DO_ONCE_LITE_IF' bool __ret_do_once = !!(condition); \ ^~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:611:6: note: '__ret_do_once' is false if (drm_WARN_ON_ONCE(dev, !target_freq)) ^ include/drm/drm_print.h:567:2: note: expanded from macro 'drm_WARN_ON_ONCE' drm_WARN_ONCE((drm), (x), "%s", \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/drm/drm_print.h:558:2: note: expanded from macro 'drm_WARN_ONCE' WARN_ONCE(condition, "%s %s: " format, \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/bug.h:150:2: note: expanded from macro 'WARN_ONCE' DO_ONCE_LITE_IF(condition, WARN, 1, format) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/once_lite.h:17:16: note: expanded from macro 'DO_ONCE_LITE_IF' if (unlikely(__ret_do_once && !__already_done)) { \ ^~~~~~~~~~~~~ include/linux/compiler.h:78:42: note: expanded from macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ drivers/gpu/drm/i915/display/intel_dpll.c:611:6: note: Left side of '&&' is false if (drm_WARN_ON_ONCE(dev, !target_freq)) ^ include/drm/drm_print.h:567:2: note: expanded from macro 'drm_WARN_ON_ONCE' drm_WARN_ONCE((drm), (x), "%s", \ ^ include/drm/drm_print.h:558:2: note: expanded from macro 'drm_WARN_ONCE' WARN_ONCE(condition, "%s %s: " format, \ ^ include/asm-generic/bug.h:150:2: note: expanded from macro 'WARN_ONCE' DO_ONCE_LITE_IF(condition, WARN, 1, format) ^ include/linux/once_lite.h:17:30: note: expanded from macro 'DO_ONCE_LITE_IF' if (unlikely(__ret_do_once && !__already_done)) { \ ^ drivers/gpu/drm/i915/display/intel_dpll.c:611:6: note: Taking false branch if (drm_WARN_ON_ONCE(dev, !target_freq)) ^ include/drm/drm_print.h:567:2: note: expanded from macro 'drm_WARN_ON_ONCE' drm_WARN_ONCE((drm), (x), "%s", \ ^ include/drm/drm_print.h:558:2: note: expanded from macro 'drm_WARN_ONCE' WARN_ONCE(condition, "%s %s: " format, \ ^ include/asm-generic/bug.h:150:2: note: expanded from macro 'WARN_ONCE' DO_ONCE_LITE_IF(condition, WARN, 1, format) ^ include/linux/once_lite.h:17:3: note: expanded from macro 'DO_ONCE_LITE_IF' if (unlikely(__ret_do_once && !__already_done)) { \ ^ drivers/gpu/drm/i915/display/intel_dpll.c:611:2: note: Taking false branch if (drm_WARN_ON_ONCE(dev, !target_freq)) ^ drivers/gpu/drm/i915/display/intel_dpll.c:615:21: note: The right operand of '-' is a garbage value abs(target_freq - calculated_clock->dot), ^ include/linux/math.h:133:21: note: expanded from macro 'abs' __abs_choose_expr(x, int, \ ^ include/linux/math.h:144:24: note: expanded from macro '__abs_choose_expr' ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other) ^ include/linux/math.h:144:54: note: expanded from macro '__abs_choose_expr' ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other) ^~~~~ include/linux/math.h:144:54: note: expanded from macro '__abs_choose_expr' ({ signed type __x = (x); __x < 0 ? -__x : __x; }), other) ^~~~~ >> drivers/gpu/drm/i915/display/intel_dpll.c:1073:9: warning: Dereference of >> null pointer [clang-analyzer-core.NullDereference] dev_priv->vbt.lvds_ssc_freq); ^ include/drm/drm_print.h:450:60: note: expanded from macro 'drm_dbg_kms' drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) ^~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:1056:38: note: Calling 'to_i915' struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/i915_drv.h:1238:9: note: Left side of '&&' is false return container_of(dev, struct drm_i915_private, drm); ^ include/linux/kernel.h:495:61: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ drivers/gpu/drm/i915/i915_drv.h:1238:9: note: Taking false branch return container_of(dev, struct drm_i915_private, drm); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ drivers/gpu/drm/i915/i915_drv.h:1238:9: note: Loop condition is false. Exiting loop return container_of(dev, struct drm_i915_private, drm); ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert' do { \ ^ drivers/gpu/drm/i915/i915_drv.h:1238:2: note: Returning pointer return container_of(dev, struct drm_i915_private, drm); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:1056:38: note: Returning from 'to_i915' struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); ^~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:1056:2: note: 'dev_priv' initialized here struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/display/intel_dpll.c:1058:3: note: Left side of '&&' is false to_intel_atomic_state(crtc_state->uapi.state); ^ drivers/gpu/drm/i915/display/intel_display_types.h:1397:34: note: expanded from macro 'to_intel_atomic_state' #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base) ^ include/linux/kernel.h:495:61: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ drivers/gpu/drm/i915/display/intel_dpll.c:1058:3: note: Taking false branch to_intel_atomic_state(crtc_state->uapi.state); ^ drivers/gpu/drm/i915/display/intel_display_types.h:1397:34: note: expanded from macro 'to_intel_atomic_state' #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base) ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^ include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ drivers/gpu/drm/i915/display/intel_dpll.c:1058:3: note: Loop condition is false. Exiting loop to_intel_atomic_state(crtc_state->uapi.state); ^ drivers/gpu/drm/i915/display/intel_display_types.h:1397:34: note: expanded from macro 'to_intel_atomic_state' #define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base) ^ include/linux/kernel.h:495:2: note: expanded from macro 'container_of' BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) vim +1073 drivers/gpu/drm/i915/display/intel_dpll.c 8cf41f316e6497 Dave Airlie 2021-01-14 1052 8cf41f316e6497 Dave Airlie 2021-01-14 1053 static int ilk_crtc_compute_clock(struct intel_crtc *crtc, 8cf41f316e6497 Dave Airlie 2021-01-14 1054 struct intel_crtc_state *crtc_state) 8cf41f316e6497 Dave Airlie 2021-01-14 1055 { 8cf41f316e6497 Dave Airlie 2021-01-14 1056 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 8cf41f316e6497 Dave Airlie 2021-01-14 1057 struct intel_atomic_state *state = 8cf41f316e6497 Dave Airlie 2021-01-14 1058 to_intel_atomic_state(crtc_state->uapi.state); 8cf41f316e6497 Dave Airlie 2021-01-14 1059 const struct intel_limit *limit; 8cf41f316e6497 Dave Airlie 2021-01-14 1060 int refclk = 120000; 8cf41f316e6497 Dave Airlie 2021-01-14 1061 8cf41f316e6497 Dave Airlie 2021-01-14 1062 memset(&crtc_state->dpll_hw_state, 0, 8cf41f316e6497 Dave Airlie 2021-01-14 1063 sizeof(crtc_state->dpll_hw_state)); 8cf41f316e6497 Dave Airlie 2021-01-14 1064 8cf41f316e6497 Dave Airlie 2021-01-14 1065 /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */ 8cf41f316e6497 Dave Airlie 2021-01-14 1066 if (!crtc_state->has_pch_encoder) 8cf41f316e6497 Dave Airlie 2021-01-14 1067 return 0; 8cf41f316e6497 Dave Airlie 2021-01-14 1068 8cf41f316e6497 Dave Airlie 2021-01-14 1069 if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) { 8cf41f316e6497 Dave Airlie 2021-01-14 1070 if (intel_panel_use_ssc(dev_priv)) { 8cf41f316e6497 Dave Airlie 2021-01-14 1071 drm_dbg_kms(&dev_priv->drm, 8cf41f316e6497 Dave Airlie 2021-01-14 1072 "using SSC reference clock of %d kHz\n", 8cf41f316e6497 Dave Airlie 2021-01-14 @1073 dev_priv->vbt.lvds_ssc_freq); 8cf41f316e6497 Dave Airlie 2021-01-14 1074 refclk = dev_priv->vbt.lvds_ssc_freq; 8cf41f316e6497 Dave Airlie 2021-01-14 1075 } 8cf41f316e6497 Dave Airlie 2021-01-14 1076 8cf41f316e6497 Dave Airlie 2021-01-14 1077 if (intel_is_dual_link_lvds(dev_priv)) { 8cf41f316e6497 Dave Airlie 2021-01-14 1078 if (refclk == 100000) 8cf41f316e6497 Dave Airlie 2021-01-14 1079 limit = &ilk_limits_dual_lvds_100m; 8cf41f316e6497 Dave Airlie 2021-01-14 1080 else 8cf41f316e6497 Dave Airlie 2021-01-14 1081 limit = &ilk_limits_dual_lvds; 8cf41f316e6497 Dave Airlie 2021-01-14 1082 } else { 8cf41f316e6497 Dave Airlie 2021-01-14 1083 if (refclk == 100000) 8cf41f316e6497 Dave Airlie 2021-01-14 1084 limit = &ilk_limits_single_lvds_100m; 8cf41f316e6497 Dave Airlie 2021-01-14 1085 else 8cf41f316e6497 Dave Airlie 2021-01-14 1086 limit = &ilk_limits_single_lvds; 8cf41f316e6497 Dave Airlie 2021-01-14 1087 } 8cf41f316e6497 Dave Airlie 2021-01-14 1088 } else { 8cf41f316e6497 Dave Airlie 2021-01-14 1089 limit = &ilk_limits_dac; 8cf41f316e6497 Dave Airlie 2021-01-14 1090 } 8cf41f316e6497 Dave Airlie 2021-01-14 1091 8cf41f316e6497 Dave Airlie 2021-01-14 1092 if (!crtc_state->clock_set && 8cf41f316e6497 Dave Airlie 2021-01-14 1093 !g4x_find_best_dpll(limit, crtc_state, crtc_state->port_clock, 8cf41f316e6497 Dave Airlie 2021-01-14 1094 refclk, NULL, &crtc_state->dpll)) { 8cf41f316e6497 Dave Airlie 2021-01-14 1095 drm_err(&dev_priv->drm, 8cf41f316e6497 Dave Airlie 2021-01-14 1096 "Couldn't find PLL settings for mode!\n"); 8cf41f316e6497 Dave Airlie 2021-01-14 1097 return -EINVAL; 8cf41f316e6497 Dave Airlie 2021-01-14 1098 } 8cf41f316e6497 Dave Airlie 2021-01-14 1099 8cf41f316e6497 Dave Airlie 2021-01-14 1100 ilk_compute_dpll(crtc, crtc_state, NULL); 8cf41f316e6497 Dave Airlie 2021-01-14 1101 8cf41f316e6497 Dave Airlie 2021-01-14 1102 if (!intel_reserve_shared_dplls(state, crtc, NULL)) { 8cf41f316e6497 Dave Airlie 2021-01-14 1103 drm_dbg_kms(&dev_priv->drm, 8cf41f316e6497 Dave Airlie 2021-01-14 1104 "failed to find PLL for pipe %c\n", 8cf41f316e6497 Dave Airlie 2021-01-14 1105 pipe_name(crtc->pipe)); 8cf41f316e6497 Dave Airlie 2021-01-14 1106 return -EINVAL; 8cf41f316e6497 Dave Airlie 2021-01-14 1107 } 8cf41f316e6497 Dave Airlie 2021-01-14 1108 8cf41f316e6497 Dave Airlie 2021-01-14 1109 return 0; 8cf41f316e6497 Dave Airlie 2021-01-14 1110 } 8cf41f316e6497 Dave Airlie 2021-01-14 1111 :::::: The code at line 1073 was first introduced by commit :::::: 8cf41f316e6497c043c161606959d39dcba265e6 drm/i915: refactor pll code out into intel_dpll.c :::::: TO: Dave Airlie <[email protected]> :::::: CC: Jani Nikula <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
