From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [RFC PATCH v2 3/4] cxl/mem: Add CDAT table reading from DOE
Date: Wed, 14 Apr 2021 12:09:30 +0800 [thread overview]
Message-ID: <202104141155.OJa3knmb-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 13339 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210413160159.935663-4-Jonathan.Cameron@huawei.com>
References: <20210413160159.935663-4-Jonathan.Cameron@huawei.com>
TO: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Hi Jonathan,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on pci/next]
[also build test WARNING on linus/master v5.12-rc7]
[cannot apply to next-20210413]
[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/Jonathan-Cameron/PCI-Data-Object-Exchange-support-CXL-CDAT/20210414-000832
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
:::::: branch date: 12 hours ago
:::::: commit date: 12 hours ago
config: x86_64-randconfig-m001-20210413 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/pci/pcie/doe.c:350 doe_statemachine_work() error: uninitialized symbol 'rc'.
vim +/rc +350 drivers/pci/pcie/doe.c
9d119b6670629a Jonathan Cameron 2021-04-14 204
9d119b6670629a Jonathan Cameron 2021-04-14 205 static void doe_statemachine_work(struct work_struct *work)
9d119b6670629a Jonathan Cameron 2021-04-14 206 {
9d119b6670629a Jonathan Cameron 2021-04-14 207 struct delayed_work *w = to_delayed_work(work);
9d119b6670629a Jonathan Cameron 2021-04-14 208 struct pcie_doe *doe = container_of(w, struct pcie_doe, statemachine);
9d119b6670629a Jonathan Cameron 2021-04-14 209 struct pci_dev *pdev = doe->pdev;
9d119b6670629a Jonathan Cameron 2021-04-14 210 struct pcie_doe_task *task;
9d119b6670629a Jonathan Cameron 2021-04-14 211 bool abort;
9d119b6670629a Jonathan Cameron 2021-04-14 212 u32 val;
9d119b6670629a Jonathan Cameron 2021-04-14 213 int rc;
9d119b6670629a Jonathan Cameron 2021-04-14 214
9d119b6670629a Jonathan Cameron 2021-04-14 215 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 216 task = list_first_entry_or_null(&doe->tasks, struct pcie_doe_task, h);
9d119b6670629a Jonathan Cameron 2021-04-14 217 abort = doe->abort;
9d119b6670629a Jonathan Cameron 2021-04-14 218 doe->abort = false;
9d119b6670629a Jonathan Cameron 2021-04-14 219 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 220
9d119b6670629a Jonathan Cameron 2021-04-14 221 if (abort) {
9d119b6670629a Jonathan Cameron 2021-04-14 222 /*
9d119b6670629a Jonathan Cameron 2021-04-14 223 * Currently only used during init - care needed if we want to generally
9d119b6670629a Jonathan Cameron 2021-04-14 224 * expose pcie_doe_abort() as it would impact queries in flight.
9d119b6670629a Jonathan Cameron 2021-04-14 225 */
9d119b6670629a Jonathan Cameron 2021-04-14 226 WARN_ON(task);
9d119b6670629a Jonathan Cameron 2021-04-14 227 doe->state = DOE_WAIT_ABORT;
9d119b6670629a Jonathan Cameron 2021-04-14 228 pcie_doe_abort_start(doe);
9d119b6670629a Jonathan Cameron 2021-04-14 229 return;
9d119b6670629a Jonathan Cameron 2021-04-14 230 }
9d119b6670629a Jonathan Cameron 2021-04-14 231
9d119b6670629a Jonathan Cameron 2021-04-14 232 switch (doe->state) {
9d119b6670629a Jonathan Cameron 2021-04-14 233 case DOE_IDLE:
9d119b6670629a Jonathan Cameron 2021-04-14 234 if (task == NULL)
9d119b6670629a Jonathan Cameron 2021-04-14 235 return;
9d119b6670629a Jonathan Cameron 2021-04-14 236
9d119b6670629a Jonathan Cameron 2021-04-14 237 /* Nothing currently in flight so queue a task */
9d119b6670629a Jonathan Cameron 2021-04-14 238 rc = pcie_doe_send_req(doe, task->ex);
9d119b6670629a Jonathan Cameron 2021-04-14 239 /*
9d119b6670629a Jonathan Cameron 2021-04-14 240 * The specification does not provide any guidance on how long some other
9d119b6670629a Jonathan Cameron 2021-04-14 241 * entity could keep the DOE busy, so try for 1 second then fail.
9d119b6670629a Jonathan Cameron 2021-04-14 242 * Busy handling is best effort only, because there is not way of avoiding
9d119b6670629a Jonathan Cameron 2021-04-14 243 * racing against another user of the DOE.
9d119b6670629a Jonathan Cameron 2021-04-14 244 */
9d119b6670629a Jonathan Cameron 2021-04-14 245 if (rc == -EBUSY) {
9d119b6670629a Jonathan Cameron 2021-04-14 246 doe->busy_retries++;
9d119b6670629a Jonathan Cameron 2021-04-14 247 if (doe->busy_retries == PCI_DOE_BUSY_MAX_RETRIES) {
9d119b6670629a Jonathan Cameron 2021-04-14 248 /* Long enough, fail this request */
9d119b6670629a Jonathan Cameron 2021-04-14 249 doe->busy_retries = 0;
9d119b6670629a Jonathan Cameron 2021-04-14 250 goto busy;
9d119b6670629a Jonathan Cameron 2021-04-14 251 }
9d119b6670629a Jonathan Cameron 2021-04-14 252 schedule_delayed_work(w, HZ / PCI_DOE_BUSY_MAX_RETRIES);
9d119b6670629a Jonathan Cameron 2021-04-14 253 return;
9d119b6670629a Jonathan Cameron 2021-04-14 254 }
9d119b6670629a Jonathan Cameron 2021-04-14 255 if (rc)
9d119b6670629a Jonathan Cameron 2021-04-14 256 goto abort;
9d119b6670629a Jonathan Cameron 2021-04-14 257 doe->busy_retries = 0;
9d119b6670629a Jonathan Cameron 2021-04-14 258
9d119b6670629a Jonathan Cameron 2021-04-14 259 doe->state = DOE_WAIT_RESP;
9d119b6670629a Jonathan Cameron 2021-04-14 260 doe->timeout_jiffies = jiffies + HZ;
9d119b6670629a Jonathan Cameron 2021-04-14 261 /* Now poll or wait for IRQ with timeout */
9d119b6670629a Jonathan Cameron 2021-04-14 262 if (doe->irq > 0)
9d119b6670629a Jonathan Cameron 2021-04-14 263 schedule_delayed_work(w, PCI_DOE_TIMEOUT);
9d119b6670629a Jonathan Cameron 2021-04-14 264 else
9d119b6670629a Jonathan Cameron 2021-04-14 265 schedule_delayed_work(w, PCI_DOE_POLL_INTERVAL);
9d119b6670629a Jonathan Cameron 2021-04-14 266 return;
9d119b6670629a Jonathan Cameron 2021-04-14 267
9d119b6670629a Jonathan Cameron 2021-04-14 268 case DOE_WAIT_RESP:
9d119b6670629a Jonathan Cameron 2021-04-14 269 /* Not possible to get here with NULL task */
9d119b6670629a Jonathan Cameron 2021-04-14 270 pci_read_config_dword(pdev, doe->cap + PCI_DOE_STATUS, &val);
9d119b6670629a Jonathan Cameron 2021-04-14 271 if (FIELD_GET(PCI_DOE_STATUS_ERROR, val)) {
9d119b6670629a Jonathan Cameron 2021-04-14 272 rc = -EIO;
9d119b6670629a Jonathan Cameron 2021-04-14 273 goto abort;
9d119b6670629a Jonathan Cameron 2021-04-14 274 }
9d119b6670629a Jonathan Cameron 2021-04-14 275
9d119b6670629a Jonathan Cameron 2021-04-14 276 if (!FIELD_GET(PCI_DOE_STATUS_DATA_OBJECT_READY, val)) {
9d119b6670629a Jonathan Cameron 2021-04-14 277 /* If not yet at timeout reschedule otherwise abort */
9d119b6670629a Jonathan Cameron 2021-04-14 278 if (time_after(jiffies, doe->timeout_jiffies)) {
9d119b6670629a Jonathan Cameron 2021-04-14 279 rc = -ETIMEDOUT;
9d119b6670629a Jonathan Cameron 2021-04-14 280 goto abort;
9d119b6670629a Jonathan Cameron 2021-04-14 281 }
9d119b6670629a Jonathan Cameron 2021-04-14 282 schedule_delayed_work(w, PCI_DOE_POLL_INTERVAL);
9d119b6670629a Jonathan Cameron 2021-04-14 283 return;
9d119b6670629a Jonathan Cameron 2021-04-14 284 }
9d119b6670629a Jonathan Cameron 2021-04-14 285
9d119b6670629a Jonathan Cameron 2021-04-14 286 rc = pcie_doe_recv_resp(doe, task->ex);
9d119b6670629a Jonathan Cameron 2021-04-14 287 if (rc < 0)
9d119b6670629a Jonathan Cameron 2021-04-14 288 goto abort;
9d119b6670629a Jonathan Cameron 2021-04-14 289
9d119b6670629a Jonathan Cameron 2021-04-14 290 doe->state = DOE_IDLE;
9d119b6670629a Jonathan Cameron 2021-04-14 291
9d119b6670629a Jonathan Cameron 2021-04-14 292 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 293 list_del(&task->h);
9d119b6670629a Jonathan Cameron 2021-04-14 294 if (!list_empty(&doe->tasks))
9d119b6670629a Jonathan Cameron 2021-04-14 295 schedule_delayed_work(w, 0);
9d119b6670629a Jonathan Cameron 2021-04-14 296 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 297
9d119b6670629a Jonathan Cameron 2021-04-14 298 /* Set the return value to the length of received payload */
9d119b6670629a Jonathan Cameron 2021-04-14 299 task->rv = rc;
9d119b6670629a Jonathan Cameron 2021-04-14 300 task->cb(task->private);
9d119b6670629a Jonathan Cameron 2021-04-14 301 return;
9d119b6670629a Jonathan Cameron 2021-04-14 302
9d119b6670629a Jonathan Cameron 2021-04-14 303 case DOE_WAIT_ABORT:
9d119b6670629a Jonathan Cameron 2021-04-14 304 case DOE_WAIT_ABORT_ON_ERR:
9d119b6670629a Jonathan Cameron 2021-04-14 305 pci_read_config_dword(pdev, doe->cap + PCI_DOE_STATUS, &val);
9d119b6670629a Jonathan Cameron 2021-04-14 306
9d119b6670629a Jonathan Cameron 2021-04-14 307 if (!FIELD_GET(PCI_DOE_STATUS_ERROR, val) &&
9d119b6670629a Jonathan Cameron 2021-04-14 308 !FIELD_GET(PCI_DOE_STATUS_BUSY, val)) {
9d119b6670629a Jonathan Cameron 2021-04-14 309 /* Back to normal state - carry on */
9d119b6670629a Jonathan Cameron 2021-04-14 310 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 311 if (!list_empty(&doe->tasks))
9d119b6670629a Jonathan Cameron 2021-04-14 312 schedule_delayed_work(w, 0);
9d119b6670629a Jonathan Cameron 2021-04-14 313 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 314
9d119b6670629a Jonathan Cameron 2021-04-14 315 /* For deliberately triggered abort, someone is waiting */
9d119b6670629a Jonathan Cameron 2021-04-14 316 if (doe->state == DOE_WAIT_ABORT)
9d119b6670629a Jonathan Cameron 2021-04-14 317 complete(&doe->abort_c);
9d119b6670629a Jonathan Cameron 2021-04-14 318 doe->state = DOE_IDLE;
9d119b6670629a Jonathan Cameron 2021-04-14 319
9d119b6670629a Jonathan Cameron 2021-04-14 320 return;
9d119b6670629a Jonathan Cameron 2021-04-14 321 }
9d119b6670629a Jonathan Cameron 2021-04-14 322 if (time_after(jiffies, doe->timeout_jiffies)) {
9d119b6670629a Jonathan Cameron 2021-04-14 323 struct pcie_doe_task *t, *n;
9d119b6670629a Jonathan Cameron 2021-04-14 324
9d119b6670629a Jonathan Cameron 2021-04-14 325 /* We are dead - abort all queued tasks */
9d119b6670629a Jonathan Cameron 2021-04-14 326 dev_err(&pdev->dev, "DOE ABORT timed out\n");
9d119b6670629a Jonathan Cameron 2021-04-14 327 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 328 doe->dead = true;
9d119b6670629a Jonathan Cameron 2021-04-14 329 list_for_each_entry_safe(t, n, &doe->tasks, h) {
9d119b6670629a Jonathan Cameron 2021-04-14 330 t->rv = -EIO;
9d119b6670629a Jonathan Cameron 2021-04-14 331 t->cb(t->private);
9d119b6670629a Jonathan Cameron 2021-04-14 332 list_del(&t->h);
9d119b6670629a Jonathan Cameron 2021-04-14 333 }
9d119b6670629a Jonathan Cameron 2021-04-14 334
9d119b6670629a Jonathan Cameron 2021-04-14 335 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 336 if (doe->state == DOE_WAIT_ABORT)
9d119b6670629a Jonathan Cameron 2021-04-14 337 complete(&doe->abort_c);
9d119b6670629a Jonathan Cameron 2021-04-14 338 }
9d119b6670629a Jonathan Cameron 2021-04-14 339 return;
9d119b6670629a Jonathan Cameron 2021-04-14 340 }
9d119b6670629a Jonathan Cameron 2021-04-14 341
9d119b6670629a Jonathan Cameron 2021-04-14 342 abort:
9d119b6670629a Jonathan Cameron 2021-04-14 343 pcie_doe_abort_start(doe);
9d119b6670629a Jonathan Cameron 2021-04-14 344 doe->state = DOE_WAIT_ABORT_ON_ERR;
9d119b6670629a Jonathan Cameron 2021-04-14 345 busy:
9d119b6670629a Jonathan Cameron 2021-04-14 346 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 347 list_del(&task->h);
9d119b6670629a Jonathan Cameron 2021-04-14 348 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 349
9d119b6670629a Jonathan Cameron 2021-04-14 @350 task->rv = rc;
9d119b6670629a Jonathan Cameron 2021-04-14 351 task->cb(task->private);
9d119b6670629a Jonathan Cameron 2021-04-14 352 /* If we got here via busy, and the queue isn't empty then we need to go again */
9d119b6670629a Jonathan Cameron 2021-04-14 353 if (doe->state == DOE_IDLE) {
9d119b6670629a Jonathan Cameron 2021-04-14 354 mutex_lock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 355 if (!list_empty(&doe->tasks))
9d119b6670629a Jonathan Cameron 2021-04-14 356 schedule_delayed_work(w, 0);
9d119b6670629a Jonathan Cameron 2021-04-14 357 mutex_unlock(&doe->tasks_lock);
9d119b6670629a Jonathan Cameron 2021-04-14 358 }
9d119b6670629a Jonathan Cameron 2021-04-14 359 }
9d119b6670629a Jonathan Cameron 2021-04-14 360
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36422 bytes --]
next reply other threads:[~2021-04-14 4:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 4:09 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-04-13 16:01 [RFC PATCH v2 0/4] PCI Data Object Exchange support + CXL CDAT Jonathan Cameron
2021-04-13 16:01 ` [RFC PATCH v2 3/4] cxl/mem: Add CDAT table reading from DOE Jonathan Cameron
2021-04-13 23:18 ` kernel test robot
2021-04-14 0:30 ` kernel test robot
2021-04-14 18:14 ` Konrad Rzeszutek Wilk
2021-04-14 18:50 ` Ben Widawsky
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=202104141155.OJa3knmb-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.