[Intel-gfx] [PATCH 08/27] drm/i915/pxp: Read register to check hardware session state (fwd)

Julia Lawall julia.lawall at inria.fr
Sat Nov 14 18:03:36 UTC 2020


Hello,

Line 203 is clearly incorrect.  Please check lines 97, 123, and 171 as
well.

julia

---------- Forwarded message ----------
Date: Sun, 15 Nov 2020 01:12:07 +0800
From: kernel test robot <lkp at intel.com>
To: kbuild at lists.01.org
Cc: lkp at intel.com, Julia Lawall <julia.lawall at lip6.fr>
Subject: Re: [Intel-gfx] [PATCH 08/27] drm/i915/pxp: Read register to check
    hardware session state

CC: kbuild-all at lists.01.org
In-Reply-To: <20201114014537.25495-8-sean.z.huang at intel.com>
References: <20201114014537.25495-8-sean.z.huang at intel.com>
TO: Sean Z Huang <sean.z.huang at intel.com>
TO: Intel-gfx at lists.freedesktop.org
CC: "Huang, Sean Z" <sean.z.huang at intel.com>

Hi Sean,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20201113]
[also build test WARNING on v5.10-rc3]
[cannot apply to drm-intel/for-linux-next char-misc/char-misc-testing v5.10-rc3 v5.10-rc2 v5.10-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sean-Z-Huang/drm-i915-pxp-Introduce-Intel-PXP-component/20201114-094926
base:    92edc4aef86780a8ad01b092c6d6630bb3cb423d
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: i386-randconfig-c001-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Julia Lawall <julia.lawall at lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/gpu/drm/i915/pxp/intel_pxp_sm.c:203:17-20: ERROR: i915 is NULL but dereferenced.
   drivers/gpu/drm/i915/pxp/intel_pxp_sm.c:97:17-20: ERROR: i915 is NULL but dereferenced.
   drivers/gpu/drm/i915/pxp/intel_pxp_sm.c:123:17-20: ERROR: i915 is NULL but dereferenced.
   drivers/gpu/drm/i915/pxp/intel_pxp_sm.c:171:17-20: ERROR: i915 is NULL but dereferenced.

vim +203 drivers/gpu/drm/i915/pxp/intel_pxp_sm.c

c0c82470e52f958 Huang, Sean Z 2020-11-13  188
c0c82470e52f958 Huang, Sean Z 2020-11-13  189  /**
c0c82470e52f958 Huang, Sean Z 2020-11-13  190   * check_if_protected_type0_sessions_are_attacked - To check if type0 active sessions are attacked.
c0c82470e52f958 Huang, Sean Z 2020-11-13  191   * @i915: i915 device handle.
c0c82470e52f958 Huang, Sean Z 2020-11-13  192   *
c0c82470e52f958 Huang, Sean Z 2020-11-13  193   * Return: true if HW shows protected sessions are attacked, false otherwise.
c0c82470e52f958 Huang, Sean Z 2020-11-13  194   */
c0c82470e52f958 Huang, Sean Z 2020-11-13  195  static bool check_if_protected_type0_sessions_are_attacked(struct drm_i915_private *i915)
c0c82470e52f958 Huang, Sean Z 2020-11-13  196  {
c0c82470e52f958 Huang, Sean Z 2020-11-13  197  	i915_reg_t kcr_status_reg = KCR_STATUS_1;
c0c82470e52f958 Huang, Sean Z 2020-11-13  198  	u32 reg_value = 0;
c0c82470e52f958 Huang, Sean Z 2020-11-13  199  	u32 mask = 0x80000000;
c0c82470e52f958 Huang, Sean Z 2020-11-13  200  	int ret;
c0c82470e52f958 Huang, Sean Z 2020-11-13  201
c0c82470e52f958 Huang, Sean Z 2020-11-13  202  	if (!i915) {
c0c82470e52f958 Huang, Sean Z 2020-11-13 @203  		drm_dbg(&i915->drm, "Failed to %s, bad params\n", __func__);
c0c82470e52f958 Huang, Sean Z 2020-11-13  204  		goto end;
c0c82470e52f958 Huang, Sean Z 2020-11-13  205  	}
c0c82470e52f958 Huang, Sean Z 2020-11-13  206
c0c82470e52f958 Huang, Sean Z 2020-11-13  207  	if (i915->pxp.r0ctx->global_state_attacked)
c0c82470e52f958 Huang, Sean Z 2020-11-13  208  		return true;
c0c82470e52f958 Huang, Sean Z 2020-11-13  209
c0c82470e52f958 Huang, Sean Z 2020-11-13  210  	ret = pxp_sm_reg_read(i915, kcr_status_reg.reg, &reg_value);
c0c82470e52f958 Huang, Sean Z 2020-11-13  211  	if (ret) {
c0c82470e52f958 Huang, Sean Z 2020-11-13  212  		drm_dbg(&i915->drm, "Failed to pxp_sm_reg_read\n");
c0c82470e52f958 Huang, Sean Z 2020-11-13  213  		goto end;
c0c82470e52f958 Huang, Sean Z 2020-11-13  214  	}
c0c82470e52f958 Huang, Sean Z 2020-11-13  215
c0c82470e52f958 Huang, Sean Z 2020-11-13  216  	if (reg_value & mask)
c0c82470e52f958 Huang, Sean Z 2020-11-13  217  		return true;
c0c82470e52f958 Huang, Sean Z 2020-11-13  218  end:
c0c82470e52f958 Huang, Sean Z 2020-11-13  219  	return false;
c0c82470e52f958 Huang, Sean Z 2020-11-13  220  }
c0c82470e52f958 Huang, Sean Z 2020-11-13  221

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36612 bytes
Desc: 
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20201114/aa091e01/attachment-0001.gz>


More information about the Intel-gfx mailing list