From: kbuild test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [Intel-gfx] [PATCH 2/9] drm/i915: Update client name on context create
Date: Thu, 16 Apr 2020 14:12:52 +0800 [thread overview]
Message-ID: <202004161432.klfRM0ss%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 11776 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200415101138.26126-3-tvrtko.ursulin@linux.intel.com>
References: <20200415101138.26126-3-tvrtko.ursulin@linux.intel.com>
TO: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
TO: Intel-gfx(a)lists.freedesktop.org
CC: Chris Wilson <chris@chris-wilson.co.uk>
Hi Tvrtko,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on v5.7-rc1 next-20200415]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Tvrtko-Ursulin/Per-client-engine-busyness/20200416-032109
base: git://anongit.freedesktop.org/drm-intel for-linux-next
reproduce:
# apt-get install sparse
# sparse version:
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/i915/i915_drm_client.c:130:23: sparse: warning: incorrect type in argument 1 (different address spaces)
>> drivers/gpu/drm/i915/i915_drm_client.c:130:23: sparse: expected struct pid *pid
>> drivers/gpu/drm/i915/i915_drm_client.c:130:23: sparse: got struct pid [noderef] <asn:4> *pid
drivers/gpu/drm/i915/i915_drm_client.c:131:21: sparse: warning: incorrect type in argument 1 (different address spaces)
>> drivers/gpu/drm/i915/i915_drm_client.c:131:21: sparse: expected void const *
>> drivers/gpu/drm/i915/i915_drm_client.c:131:21: sparse: got char [noderef] <asn:4> *name
drivers/gpu/drm/i915/i915_drm_client.c:232:17: sparse: error: incompatible types in comparison expression (different address spaces):
>> drivers/gpu/drm/i915/i915_drm_client.c:232:17: sparse: struct pid *
>> drivers/gpu/drm/i915/i915_drm_client.c:232:17: sparse: struct pid [noderef] <asn:4> *
# https://github.com/0day-ci/linux/commit/68e51ee0010d0e158add87c4362668f009fc8130
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 68e51ee0010d0e158add87c4362668f009fc8130
vim +130 drivers/gpu/drm/i915/i915_drm_client.c
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 104
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 105 static int
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 106 __i915_drm_client_register(struct i915_drm_client *client,
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 107 struct task_struct *task)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 108 {
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 109 struct i915_drm_clients *clients = client->clients;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 110 char *name;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 111 int ret;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 112
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 113 name = kstrdup(task->comm, GFP_KERNEL);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 114 if (!name)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 115 return -ENOMEM;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 116
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 117 rcu_assign_pointer(client->pid, get_task_pid(task, PIDTYPE_PID));
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 118 rcu_assign_pointer(client->name, name);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 119
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 120 if (!clients->root)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 121 return 0; /* intel_fbdev_init registers a client before sysfs */
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 122
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 123 ret = __client_register_sysfs(client);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 124 if (ret)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 125 goto err_sysfs;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 126
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 127 return 0;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 128
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 129 err_sysfs:
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 @130 put_pid(client->pid);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 @131 kfree(client->name);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 132
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 133 return ret;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 134 }
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 135
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 136 static void
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 137 __i915_drm_client_unregister(struct i915_drm_client *client)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 138 {
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 139 __client_unregister_sysfs(client);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 140
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 141 put_pid(rcu_replace_pointer(client->pid, NULL, true));
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 142 kfree(rcu_replace_pointer(client->name, NULL, true));
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 143 }
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 144
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 145 struct i915_drm_client *
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 146 i915_drm_client_add(struct i915_drm_clients *clients, struct task_struct *task)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 147 {
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 148 struct i915_drm_client *client;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 149 int ret;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 150
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 151 client = kzalloc(sizeof(*client), GFP_KERNEL);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 152 if (!client)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 153 return ERR_PTR(-ENOMEM);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 154
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 155 kref_init(&client->kref);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 156 mutex_init(&client->update_lock);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 157 client->clients = clients;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 158
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 159 ret = xa_alloc_cyclic(&clients->xarray, &client->id, client,
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 160 xa_limit_32b, &clients->next_id, GFP_KERNEL);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 161 if (ret)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 162 goto err_id;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 163
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 164 ret = __i915_drm_client_register(client, task);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 165 if (ret)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 166 goto err_register;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 167
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 168 return client;
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 169
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 170 err_register:
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 171 xa_erase(&clients->xarray, client->id);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 172 err_id:
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 173 kfree(client);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 174
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 175 return ERR_PTR(ret);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 176 }
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 177
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 178 void __i915_drm_client_free(struct kref *kref)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 179 {
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 180 struct i915_drm_client *client =
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 181 container_of(kref, typeof(*client), kref);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 182
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 183 __i915_drm_client_unregister(client);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 184 xa_erase(&client->clients->xarray, client->id);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 185 kfree_rcu(client, rcu);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 186 }
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 187
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 188 void i915_drm_client_close(struct i915_drm_client *client)
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 189 {
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 190 GEM_BUG_ON(READ_ONCE(client->closed));
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 191 WRITE_ONCE(client->closed, true);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 192 i915_drm_client_put(client);
d76ac5524c4129 Tvrtko Ursulin 2020-04-15 193 }
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 194
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 195 struct client_update_free {
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 196 struct rcu_head rcu;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 197 struct pid *pid;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 198 char *name;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 199 };
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 200
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 201 static void __client_update_free(struct rcu_head *rcu)
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 202 {
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 203 struct client_update_free *old = container_of(rcu, typeof(*old), rcu);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 204
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 205 put_pid(old->pid);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 206 kfree(old->name);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 207 kfree(old);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 208 }
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 209
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 210 int
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 211 i915_drm_client_update(struct i915_drm_client *client,
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 212 struct task_struct *task)
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 213 {
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 214 struct drm_i915_private *i915 =
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 215 container_of(client->clients, typeof(*i915), clients);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 216 struct client_update_free *old;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 217 struct pid *pid;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 218 char *name;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 219 int ret;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 220
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 221 old = kmalloc(sizeof(*old), GFP_KERNEL);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 222 if (!old)
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 223 return -ENOMEM;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 224
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 225 ret = mutex_lock_interruptible(&client->update_lock);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 226 if (ret)
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 227 goto out_free;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 228
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 229 pid = get_task_pid(task, PIDTYPE_PID);
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 230 if (!pid)
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 231 goto out_pid;
68e51ee0010d0e Tvrtko Ursulin 2020-04-15 @232 if (pid == client->pid)
:::::: The code at line 130 was first introduced by commit
:::::: d76ac5524c4129b1718d52109a90ec752b1ba2fe drm/i915: Expose list of clients in sysfs
:::::: TO: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
:::::: CC: 0day robot <lkp@intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2020-04-16 6:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 6:12 kbuild test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-14 13:12 [Intel-gfx] [PATCH 0/9] Per client engine busyness Tvrtko Ursulin
2020-09-14 13:12 ` [Intel-gfx] [PATCH 2/9] drm/i915: Update client name on context create Tvrtko Ursulin
2020-09-04 12:59 [Intel-gfx] [PATCH 0/9] Per client engine busyness Tvrtko Ursulin
2020-09-04 12:59 ` [Intel-gfx] [PATCH 2/9] drm/i915: Update client name on context create Tvrtko Ursulin
2020-04-15 10:11 [Intel-gfx] [PATCH 0/9] Per client engine busyness Tvrtko Ursulin
2020-04-15 10:11 ` [Intel-gfx] [PATCH 2/9] drm/i915: Update client name on context create Tvrtko Ursulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202004161432.klfRM0ss%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.