From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, "Ahmed S. Darwish" <darwi@linutronix.de>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Ammar Faizi <ammarfaizi2@gnuweeb.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [ammarfaizi2-block:tglx/devel/devmsi 46/86] kernel/irq/msi.c:399 msi_domain_get_virq() warn: inconsistent returns '&dev->msi.data->mutex'.
Date: Mon, 7 Nov 2022 15:39:23 +0300 [thread overview]
Message-ID: <202211070346.0vaondmd-lkp@intel.com> (raw)
Message-ID: <20221107123923.zzAPHAtpeuxYI2cVP7jn-RNjlavWkyLPBvA0_5j8h9E@z> (raw)
tree: https://github.com/ammarfaizi2/linux-block tglx/devel/devmsi
head: ba77f809fa66b636222f6677ec7cf8faa1562fe7
commit: 022573e1aaf0745ab002f898c5d4aa0f0ae5ec09 [46/86] genirq/msi: Make msi_get_virq() device domain aware
config: openrisc-randconfig-m031-20221106
compiler: or1k-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
smatch warnings:
kernel/irq/msi.c:399 msi_domain_get_virq() warn: inconsistent returns '&dev->msi.data->mutex'.
vim +399 kernel/irq/msi.c
022573e1aaf074 Ahmed S. Darwish 2022-11-03 361 unsigned int msi_domain_get_virq(struct device *dev, unsigned int domid, unsigned int index)
cf15f43acaad31 Thomas Gleixner 2021-12-10 362 {
cf15f43acaad31 Thomas Gleixner 2021-12-10 363 struct msi_desc *desc;
495c66aca3da70 Thomas Gleixner 2021-12-06 364 unsigned int ret = 0;
022573e1aaf074 Ahmed S. Darwish 2022-11-03 365 bool pcimsi = false;
022573e1aaf074 Ahmed S. Darwish 2022-11-03 366 int base;
cf15f43acaad31 Thomas Gleixner 2021-12-10 367
cf15f43acaad31 Thomas Gleixner 2021-12-10 368 if (!dev->msi.data)
cf15f43acaad31 Thomas Gleixner 2021-12-10 369 return 0;
cf15f43acaad31 Thomas Gleixner 2021-12-10 370
022573e1aaf074 Ahmed S. Darwish 2022-11-03 371 if (WARN_ON_ONCE(index >= MSI_MAX_INDEX))
022573e1aaf074 Ahmed S. Darwish 2022-11-03 372 return 0;
022573e1aaf074 Ahmed S. Darwish 2022-11-03 373
022573e1aaf074 Ahmed S. Darwish 2022-11-03 374 /* This check is only valid for the PCI default MSI domain */
022573e1aaf074 Ahmed S. Darwish 2022-11-03 375 if (dev_is_pci(dev) && domid == MSI_DEFAULT_DOMAIN)
022573e1aaf074 Ahmed S. Darwish 2022-11-03 376 pcimsi = to_pci_dev(dev)->msi_enabled;
cf15f43acaad31 Thomas Gleixner 2021-12-10 377
495c66aca3da70 Thomas Gleixner 2021-12-06 378 msi_lock_descs(dev);
022573e1aaf074 Ahmed S. Darwish 2022-11-03 379
022573e1aaf074 Ahmed S. Darwish 2022-11-03 380 base = msi_get_domain_base_index(dev, domid);
022573e1aaf074 Ahmed S. Darwish 2022-11-03 381 if (base < 0)
022573e1aaf074 Ahmed S. Darwish 2022-11-03 382 return 0;
msi_unlock_descs();?
022573e1aaf074 Ahmed S. Darwish 2022-11-03 383
022573e1aaf074 Ahmed S. Darwish 2022-11-03 384 desc = xa_load(&dev->msi.data->__store, base + pcimsi ? 0 : index);
cd6cf06590b979 Thomas Gleixner 2021-12-06 385 if (desc && desc->irq) {
cf15f43acaad31 Thomas Gleixner 2021-12-10 386 /*
cd6cf06590b979 Thomas Gleixner 2021-12-06 387 * PCI-MSI has only one descriptor for multiple interrupts.
cf15f43acaad31 Thomas Gleixner 2021-12-10 388 * PCI-MSIX and platform MSI use a descriptor per
cf15f43acaad31 Thomas Gleixner 2021-12-10 389 * interrupt.
cf15f43acaad31 Thomas Gleixner 2021-12-10 390 */
cd6cf06590b979 Thomas Gleixner 2021-12-06 391 if (pcimsi) {
cd6cf06590b979 Thomas Gleixner 2021-12-06 392 if (index < desc->nvec_used)
cd6cf06590b979 Thomas Gleixner 2021-12-06 393 ret = desc->irq + index;
cd6cf06590b979 Thomas Gleixner 2021-12-06 394 } else {
495c66aca3da70 Thomas Gleixner 2021-12-06 395 ret = desc->irq;
cf15f43acaad31 Thomas Gleixner 2021-12-10 396 }
495c66aca3da70 Thomas Gleixner 2021-12-06 397 }
495c66aca3da70 Thomas Gleixner 2021-12-06 398 msi_unlock_descs(dev);
495c66aca3da70 Thomas Gleixner 2021-12-06 @399 return ret;
cf15f43acaad31 Thomas Gleixner 2021-12-10 400 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-11-07 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-06 19:28 kernel test robot [this message]
2022-11-07 12:39 ` [ammarfaizi2-block:tglx/devel/devmsi 46/86] kernel/irq/msi.c:399 msi_domain_get_virq() warn: inconsistent returns '&dev->msi.data->mutex' Dan Carpenter
2022-11-12 17:41 ` Thomas Gleixner
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=202211070346.0vaondmd-lkp@intel.com \
--to=error27@gmail.com \
--cc=ammarfaizi2@gnuweeb.org \
--cc=darwi@linutronix.de \
--cc=gwml@vger.gnuweeb.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).