[Intel-gfx] [PATCH 05/27] drm/i915/pxp: Enable ioctl action to set the ring3 context
kernel test robot
lkp at intel.com
Sat Nov 14 04:23:47 UTC 2020
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
config: i386-randconfig-a012-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/1d109ada10e82c324682792cb0a20deef302336e
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sean-Z-Huang/drm-i915-pxp-Introduce-Intel-PXP-component/20201114-094926
git checkout 1d109ada10e82c324682792cb0a20deef302336e
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/pxp/intel_pxp.c: In function 'i915_pxp_ops_ioctl':
>> drivers/gpu/drm/i915/pxp/intel_pxp.c:26:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
26 | if (copy_from_user(&pxp_info, (void __user *)pxp_ops->pxp_info_ptr, sizeof(pxp_info)) != 0) {
| ^
drivers/gpu/drm/i915/pxp/intel_pxp.c:65:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
65 | if (copy_to_user((void __user *)pxp_ops->pxp_info_ptr, &pxp_info, sizeof(pxp_info)) != 0)
| ^
vim +26 drivers/gpu/drm/i915/pxp/intel_pxp.c
10
11 int i915_pxp_ops_ioctl(struct drm_device *dev, void *data, struct drm_file *drmfile)
12 {
13 int ret;
14 struct pxp_info pxp_info = {0};
15 struct drm_i915_pxp_ops *pxp_ops = data;
16 struct drm_i915_private *i915 = to_i915(dev);
17
18 drm_dbg(&i915->drm, ">>> %s\n", __func__);
19
20 if (!i915 || !drmfile || !pxp_ops || pxp_ops->pxp_info_size != sizeof(pxp_info)) {
21 drm_dbg(&i915->drm, "Failed to %s, invalid params\n", __func__);
22 ret = -EINVAL;
23 goto end;
24 }
25
> 26 if (copy_from_user(&pxp_info, (void __user *)pxp_ops->pxp_info_ptr, sizeof(pxp_info)) != 0) {
27 ret = -EFAULT;
28 goto end;
29 }
30
31 drm_dbg(&i915->drm, "i915 pxp ioctl call with action=[%d]\n", pxp_info.action);
32
33 mutex_lock(&i915->pxp.r0ctx->ctx_mutex);
34
35 if (i915->pxp.r0ctx->global_state_in_suspend) {
36 drm_dbg(&i915->drm, "Return failure due to state in suspend\n");
37 pxp_info.sm_status = PXP_SM_STATUS_SESSION_NOT_AVAILABLE;
38 ret = 0;
39 goto end;
40 }
41
42 if (i915->pxp.r0ctx->global_state_attacked) {
43 drm_dbg(&i915->drm, "Retry required due to state attacked\n");
44 pxp_info.sm_status = PXP_SM_STATUS_RETRY_REQUIRED;
45 ret = 0;
46 goto end;
47 }
48
49 switch (pxp_info.action) {
50 case PXP_ACTION_SET_R3_CONTEXT:
51 {
52 ret = intel_pxp_set_r3ctx(i915, pxp_info.set_r3ctx);
53 break;
54 }
55 default:
56 drm_dbg(&i915->drm, "Failed to %s due to bad params\n", __func__);
57 ret = -EINVAL;
58 goto end;
59 }
60
61 end:
62 mutex_unlock(&i915->pxp.r0ctx->ctx_mutex);
63
64 if (ret == 0)
65 if (copy_to_user((void __user *)pxp_ops->pxp_info_ptr, &pxp_info, sizeof(pxp_info)) != 0)
66 ret = -EFAULT;
67
68 if (ret)
69 dev_err(&dev->pdev->dev, "pid=%d, ret = %d\n", task_pid_nr(current), ret);
70
71 drm_dbg(&i915->drm, "<<< %s\n", __func__);
72 return ret;
73 }
74
---
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: 34381 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20201114/9e615633/attachment-0001.gz>
More information about the Intel-gfx
mailing list