[linux-next:master 405/6048] drivers/gpu/drm/i915/gt/intel_execlists_submission.c:1664 assert_pending_valid() error: uninitialized symbol 'flags'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Chris Wilson <chris(a)chris-wilson.co.uk>
CC: Daniele Ceraolo Spurio <daniele.ceraolospurio(a)intel.com>
CC: Tvrtko Ursulin <tvrtko.ursulin(a)intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 59fa6a163ffabc1bf25c5e0e33899e268a96d3cc
commit: 70a2b431c36483c0c06e589e11c59e438cd0ac06 [405/6048] drm/i915/gt: Rename lrc.c to execlists_submission.c
:::::: branch date: 7 days ago
:::::: commit date: 8 weeks ago
config: x86_64-randconfig-m001-20210201 (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(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gt/intel_execlists_submission.c:1664 assert_pending_valid() error: uninitialized symbol 'flags'.
Old smatch warnings:
drivers/gpu/drm/i915/gt/intel_execlists_submission.c:1117 __unwind_incomplete_requests() error: uninitialized symbol 'pl'.
drivers/gpu/drm/i915/gt/intel_execlists_submission.c:5817 intel_execlists_create_virtual() warn: assigning (-2) to unsigned variable 've->base.instance'
drivers/gpu/drm/i915/gt/intel_execlists_submission.c:5818 intel_execlists_create_virtual() warn: assigning (-2) to unsigned variable 've->base.uabi_instance'
drivers/gpu/drm/i915/gem/i915_gem_context.h:205 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_context.h:207 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gt/selftest_execlists.c:2683 create_gang() warn: missing error code 'err'
drivers/gpu/drm/i915/gem/i915_gem_object.h:127 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 119)
vim +/flags +1664 drivers/gpu/drm/i915/gt/intel_execlists_submission.c
f1042cc8537713 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-01-29 1559
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1560 static __maybe_unused bool
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1561 assert_pending_valid(const struct intel_engine_execlists *execlists,
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1562 const char *msg)
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1563 {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1564 struct intel_engine_cs *engine =
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1565 container_of(execlists, typeof(*engine), execlists);
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1566 struct i915_request * const *port, *rq;
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1567 struct intel_context *ce = NULL;
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1568 bool sentinel = false;
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1569 u32 ccid = -1;
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1570
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1571 trace_ports(execlists, msg, execlists->pending);
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1572
f1042cc8537713 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-01-29 1573 /* We may be messing around with the lists during reset, lalala */
f1042cc8537713 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-01-29 1574 if (reset_in_progress(execlists))
f1042cc8537713 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-01-29 1575 return true;
f1042cc8537713 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-01-29 1576
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1577 if (!execlists->pending[0]) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1578 GEM_TRACE_ERR("%s: Nothing pending for promotion!\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1579 engine->name);
df403069029dc6 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-08-16 1580 return false;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1581 }
df403069029dc6 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-08-16 1582
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1583 if (execlists->pending[execlists_num_ports(execlists)]) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1584 GEM_TRACE_ERR("%s: Excess pending[%d] for promotion!\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1585 engine->name, execlists_num_ports(execlists));
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1586 return false;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1587 }
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1588
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1589 for (port = execlists->pending; (rq = *port); port++) {
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1590 unsigned long flags;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1591 bool ok = true;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1592
80aac91b27e130 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-03 1593 GEM_BUG_ON(!kref_read(&rq->fence.refcount));
80aac91b27e130 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-03 1594 GEM_BUG_ON(!i915_request_is_active(rq));
80aac91b27e130 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-03 1595
9f3ccd40acf4a3 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-20 1596 if (ce == rq->context) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1597 GEM_TRACE_ERR("%s: Dup context:%llx in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1598 engine->name,
38098750719cb5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-01 1599 ce->timeline->fence_context,
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1600 port - execlists->pending);
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1601 return false;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1602 }
9f3ccd40acf4a3 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-20 1603 ce = rq->context;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1604
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1605 if (ccid == ce->lrc.ccid) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1606 GEM_TRACE_ERR("%s: Dup ccid:%x context:%llx in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1607 engine->name,
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1608 ccid, ce->timeline->fence_context,
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1609 port - execlists->pending);
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1610 return false;
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1611 }
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1612 ccid = ce->lrc.ccid;
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1613
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1614 /*
8733a06323d40e drivers/gpu/drm/i915/gt/intel_lrc.c Tvrtko Ursulin 2020-06-07 1615 * Sentinels are supposed to be the last request so they flush
8733a06323d40e drivers/gpu/drm/i915/gt/intel_lrc.c Tvrtko Ursulin 2020-06-07 1616 * the current execution off the HW. Check that they are the only
8733a06323d40e drivers/gpu/drm/i915/gt/intel_lrc.c Tvrtko Ursulin 2020-06-07 1617 * request in the pending submission.
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1618 */
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1619 if (sentinel) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1620 GEM_TRACE_ERR("%s: context:%llx after sentinel in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1621 engine->name,
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1622 ce->timeline->fence_context,
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1623 port - execlists->pending);
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1624 return false;
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1625 }
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1626 sentinel = i915_request_has_sentinel(rq);
15db5fcce9c8e8 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-03-02 1627
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1628 /* Hold tightly onto the lock to prevent concurrent retires! */
49e74c8f9ae635 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-03 1629 if (!spin_trylock_irqsave(&rq->lock, flags))
49e74c8f9ae635 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-03 1630 continue;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1631
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1632 if (i915_request_completed(rq))
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1633 goto unlock;
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1634
e6ba76480299a0 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-21 1635 if (i915_active_is_idle(&ce->active) &&
e6ba76480299a0 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-12-21 1636 !intel_context_is_barrier(ce)) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1637 GEM_TRACE_ERR("%s: Inactive context:%llx in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1638 engine->name,
38098750719cb5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-01 1639 ce->timeline->fence_context,
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1640 port - execlists->pending);
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1641 ok = false;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1642 goto unlock;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1643 }
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1644
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1645 if (!i915_vma_is_pinned(ce->state)) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1646 GEM_TRACE_ERR("%s: Unpinned context:%llx in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1647 engine->name,
38098750719cb5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-01 1648 ce->timeline->fence_context,
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1649 port - execlists->pending);
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1650 ok = false;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1651 goto unlock;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1652 }
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1653
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1654 if (!i915_vma_is_pinned(ce->ring->vma)) {
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1655 GEM_TRACE_ERR("%s: Unpinned ring:%llx in pending[%zd]\n",
f6a7c21c991062 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2020-04-28 1656 engine->name,
38098750719cb5 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-01 1657 ce->timeline->fence_context,
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1658 port - execlists->pending);
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1659 ok = false;
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1660 goto unlock;
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1661 }
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1662
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1663 unlock:
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 @1664 spin_unlock_irqrestore(&rq->lock, flags);
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1665 if (!ok)
c95d31c3df1b9f drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-11-21 1666 return false;
c97fb526ca0666 drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-10-10 1667 }
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1668
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1669 return ce;
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1670 }
22b7a426bbe1eb drivers/gpu/drm/i915/gt/intel_lrc.c Chris Wilson 2019-06-20 1671
:::::: The code at line 1664 was first introduced by commit
:::::: c95d31c3df1b9ff29bcd85c47324e16d430bbd5a drm/i915/execlists: Lock the request while validating it during promotion
:::::: TO: Chris Wilson <chris(a)chris-wilson.co.uk>
:::::: CC: Chris Wilson <chris(a)chris-wilson.co.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
drivers/iommu/intel/irq_remapping.c:455:15: sparse: sparse: memcpy with byte count of 1048576
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Joerg Roedel <jroedel(a)suse.de>
CC: Jerry Snitselaar <jsnitsel(a)redhat.com>
CC: Lu Baolu <baolu.lu(a)linux.intel.com>
Hi Joerg,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6642d600b541b81931fb1ab0c041b0d68f77be7e
commit: 672cf6df9b8a3a6d70a6a5c30397f76fa40d3178 iommu/vt-d: Move Intel IOMMU driver into subdirectory
date: 8 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 8 months ago
config: x86_64-randconfig-s022-20210201 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 672cf6df9b8a3a6d70a6a5c30397f76fa40d3178
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/iommu/intel/irq_remapping.c:455:15: sparse: sparse: memcpy with byte count of 1048576
vim +455 drivers/iommu/intel/irq_remapping.c
f007e99c8e2e32 drivers/pci/intr_remapping.c Weidong Han 2009-05-23 431
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 432 static int iommu_load_old_irte(struct intel_iommu *iommu)
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 433 {
dfddb969edf021 drivers/iommu/intel_irq_remapping.c Dan Williams 2015-10-09 434 struct irte *old_ir_table;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 435 phys_addr_t irt_phys;
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 436 unsigned int i;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 437 size_t size;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 438 u64 irta;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 439
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 440 /* Check whether the old ir-table has the same size as ours */
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 441 irta = dmar_readq(iommu->reg + DMAR_IRTA_REG);
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 442 if ((irta & INTR_REMAP_TABLE_REG_SIZE_MASK)
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 443 != INTR_REMAP_TABLE_REG_SIZE)
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 444 return -EINVAL;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 445
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 446 irt_phys = irta & VTD_PAGE_MASK;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 447 size = INTR_REMAP_TABLE_ENTRIES*sizeof(struct irte);
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 448
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 449 /* Map the old IR table */
dfddb969edf021 drivers/iommu/intel_irq_remapping.c Dan Williams 2015-10-09 450 old_ir_table = memremap(irt_phys, size, MEMREMAP_WB);
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 451 if (!old_ir_table)
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 452 return -ENOMEM;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 453
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 454 /* Copy data over */
dfddb969edf021 drivers/iommu/intel_irq_remapping.c Dan Williams 2015-10-09 @455 memcpy(iommu->ir_table->base, old_ir_table, size);
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 456
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 457 __iommu_flush_cache(iommu, iommu->ir_table->base, size);
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 458
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 459 /*
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 460 * Now check the table for used entries and mark those as
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 461 * allocated in the bitmap
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 462 */
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 463 for (i = 0; i < INTR_REMAP_TABLE_ENTRIES; i++) {
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 464 if (iommu->ir_table->base[i].present)
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 465 bitmap_set(iommu->ir_table->bitmap, i, 1);
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 466 }
7c3c9876d98a76 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 467
dfddb969edf021 drivers/iommu/intel_irq_remapping.c Dan Williams 2015-10-09 468 memunmap(old_ir_table);
50690762cfe32a drivers/iommu/intel_irq_remapping.c Dan Williams 2015-07-30 469
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 470 return 0;
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 471 }
af3b358e481155 drivers/iommu/intel_irq_remapping.c Joerg Roedel 2015-06-12 472
:::::: The code at line 455 was first introduced by commit
:::::: dfddb969edf021f21a45fc6fd019db4f99d12308 iommu/vt-d: Switch from ioremap_cache to memremap
:::::: TO: Dan Williams <dan.j.williams(a)intel.com>
:::::: CC: Joerg Roedel <jroedel(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
drivers/staging/wimax/i2400m/usb-tx.c:205 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Arnd Bergmann <arnd(a)arndb.de>
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0e9bcda5d286f4a26a5407bb38f55c55b453ecfb
commit: f54ec58fee837ec847cb8b50593e81bfaa46107f wimax: move out to staging
date: 3 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-m001-20210131 (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(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/staging/wimax/i2400m/usb-tx.c:205 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
Old smatch warnings:
drivers/staging/wimax/i2400m/usb-tx.c:206 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
drivers/staging/wimax/i2400m/usb-tx.c:208 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
vim +/tx_msg_size +205 drivers/staging/wimax/i2400m/usb-tx.c
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 166
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 167
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 168 /*
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 169 * Get the next TX message in the TX FIFO and send it to the device
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 170 *
25985edcedea63 drivers/net/wimax/i2400m/usb-tx.c Lucas De Marchi 2011-03-30 171 * Note we exit the loop if i2400mu_tx() fails; that function only
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 172 * fails on hard error (failing to tx a buffer not being one of them,
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 173 * see its doc).
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 174 *
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 175 * Return: 0
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 176 */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 177 static
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 178 int i2400mu_txd(void *_i2400mu)
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 179 {
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 180 struct i2400mu *i2400mu = _i2400mu;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 181 struct i2400m *i2400m = &i2400mu->i2400m;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 182 struct device *dev = &i2400mu->usb_iface->dev;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 183 struct i2400m_msg_hdr *tx_msg;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 184 size_t tx_msg_size;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 185 unsigned long flags;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 186
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 187 d_fnstart(4, dev, "(i2400mu %p)\n", i2400mu);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 188
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 189 spin_lock_irqsave(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 190 BUG_ON(i2400mu->tx_kthread != NULL);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 191 i2400mu->tx_kthread = current;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 192 spin_unlock_irqrestore(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 193
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 194 while (1) {
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 195 d_printf(2, dev, "TX: waiting for messages\n");
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 196 tx_msg = NULL;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 197 wait_event_interruptible(
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 198 i2400mu->tx_wq,
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 199 (kthread_should_stop() /* check this first! */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 200 || (tx_msg = i2400m_tx_msg_get(i2400m, &tx_msg_size)))
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 201 );
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 202 if (kthread_should_stop())
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 203 break;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 204 WARN_ON(tx_msg == NULL); /* should not happen...*/
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 @205 d_printf(2, dev, "TX: submitting %zu bytes\n", tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 206 d_dump(5, dev, tx_msg, tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 207 /* Yeah, we ignore errors ... not much we can do */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 208 i2400mu_tx(i2400mu, tx_msg, tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 209 i2400m_tx_msg_sent(i2400m); /* ack it, advance the FIFO */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 210 }
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 211
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 212 spin_lock_irqsave(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 213 i2400mu->tx_kthread = NULL;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 214 spin_unlock_irqrestore(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 215
d1d182e00d7230 drivers/net/wimax/i2400m/usb-tx.c Dan Carpenter 2011-12-16 216 d_fnend(4, dev, "(i2400mu %p)\n", i2400mu);
d1d182e00d7230 drivers/net/wimax/i2400m/usb-tx.c Dan Carpenter 2011-12-16 217 return 0;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 218 }
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 219
:::::: The code at line 205 was first introduced by commit
:::::: a8ebf98f541463107bb9544a1b611981dc2477e7 i2400m/USB: TX and RX path backends
:::::: TO: Inaky Perez-Gonzalez <inaky(a)linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[kdave-btrfs-devel:for-next-20210129 14817/14851] fs/btrfs/tree-log.c:3318:1-7: preceding lock on line 3156
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Naohiro Aota <naohiro.aota(a)wdc.com>
CC: David Sterba <dsterba(a)suse.com>
CC: Josef Bacik <josef(a)toxicpanda.com>
CC: Johannes Thumshirn <johannes.thumshirn(a)wdc.com>
tree: https://github.com/kdave/btrfs-devel.git for-next-20210129
head: 6e043613b2c4377ce095ea826160d42031156d35
commit: 122cfba0d2eb42d0a31161cf2139be0ead18afb7 [14817/14851] btrfs: reorder log node allocation
:::::: branch date: 12 hours ago
:::::: commit date: 12 hours ago
config: powerpc64-randconfig-c003-20210129 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> fs/btrfs/tree-log.c:3318:1-7: preceding lock on line 3156
vim +3318 fs/btrfs/tree-log.c
8b050d350c7846 Miao Xie 2014-02-20 3039
e02119d5a7b439 Chris Mason 2008-09-05 3040 /*
e02119d5a7b439 Chris Mason 2008-09-05 3041 * btrfs_sync_log does sends a given tree log down to the disk and
e02119d5a7b439 Chris Mason 2008-09-05 3042 * updates the super blocks to record it. When this call is done,
12fcfd22fe5bf4 Chris Mason 2009-03-24 3043 * you know that any inodes previously logged are safely on disk only
12fcfd22fe5bf4 Chris Mason 2009-03-24 3044 * if it returns 0.
12fcfd22fe5bf4 Chris Mason 2009-03-24 3045 *
12fcfd22fe5bf4 Chris Mason 2009-03-24 3046 * Any other return value means you need to call btrfs_commit_transaction.
12fcfd22fe5bf4 Chris Mason 2009-03-24 3047 * Some of the edge cases for fsyncing directories that have had unlinks
12fcfd22fe5bf4 Chris Mason 2009-03-24 3048 * or renames done in the past mean that sometimes the only safe
12fcfd22fe5bf4 Chris Mason 2009-03-24 3049 * fsync is to commit the whole FS. When btrfs_sync_log returns -EAGAIN,
12fcfd22fe5bf4 Chris Mason 2009-03-24 3050 * that has happened.
e02119d5a7b439 Chris Mason 2008-09-05 3051 */
e02119d5a7b439 Chris Mason 2008-09-05 3052 int btrfs_sync_log(struct btrfs_trans_handle *trans,
8b050d350c7846 Miao Xie 2014-02-20 3053 struct btrfs_root *root, struct btrfs_log_ctx *ctx)
e02119d5a7b439 Chris Mason 2008-09-05 3054 {
7237f1833601dc Yan Zheng 2009-01-21 3055 int index1;
7237f1833601dc Yan Zheng 2009-01-21 3056 int index2;
8cef4e160d7492 Yan, Zheng 2009-11-12 3057 int mark;
e02119d5a7b439 Chris Mason 2008-09-05 3058 int ret;
0b246afa62b0cf Jeff Mahoney 2016-06-22 3059 struct btrfs_fs_info *fs_info = root->fs_info;
e02119d5a7b439 Chris Mason 2008-09-05 3060 struct btrfs_root *log = root->log_root;
0b246afa62b0cf Jeff Mahoney 2016-06-22 3061 struct btrfs_root *log_root_tree = fs_info->log_root_tree;
4203e968947071 Josef Bacik 2019-09-30 3062 struct btrfs_root_item new_root_item;
bb14a59b619d3a Miao Xie 2014-02-20 3063 int log_transid = 0;
8b050d350c7846 Miao Xie 2014-02-20 3064 struct btrfs_log_ctx root_log_ctx;
c6adc9cc082e3c Miao Xie 2013-05-28 3065 struct blk_plug plug;
47876f7ceffa0e Filipe Manana 2020-11-25 3066 u64 log_root_start;
47876f7ceffa0e Filipe Manana 2020-11-25 3067 u64 log_root_level;
e02119d5a7b439 Chris Mason 2008-09-05 3068
7237f1833601dc Yan Zheng 2009-01-21 3069 mutex_lock(&root->log_mutex);
d1433debe7f434 Miao Xie 2014-02-20 3070 log_transid = ctx->log_transid;
d1433debe7f434 Miao Xie 2014-02-20 3071 if (root->log_transid_committed >= log_transid) {
d1433debe7f434 Miao Xie 2014-02-20 3072 mutex_unlock(&root->log_mutex);
d1433debe7f434 Miao Xie 2014-02-20 3073 return ctx->log_ret;
d1433debe7f434 Miao Xie 2014-02-20 3074 }
d1433debe7f434 Miao Xie 2014-02-20 3075
d1433debe7f434 Miao Xie 2014-02-20 3076 index1 = log_transid % 2;
7237f1833601dc Yan Zheng 2009-01-21 3077 if (atomic_read(&root->log_commit[index1])) {
60d53eb3107c8e Zhaolei 2015-08-17 3078 wait_log_commit(root, log_transid);
7237f1833601dc Yan Zheng 2009-01-21 3079 mutex_unlock(&root->log_mutex);
8b050d350c7846 Miao Xie 2014-02-20 3080 return ctx->log_ret;
e02119d5a7b439 Chris Mason 2008-09-05 3081 }
d1433debe7f434 Miao Xie 2014-02-20 3082 ASSERT(log_transid == root->log_transid);
7237f1833601dc Yan Zheng 2009-01-21 3083 atomic_set(&root->log_commit[index1], 1);
7237f1833601dc Yan Zheng 2009-01-21 3084
7237f1833601dc Yan Zheng 2009-01-21 3085 /* wait for previous tree log sync to complete */
7237f1833601dc Yan Zheng 2009-01-21 3086 if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
60d53eb3107c8e Zhaolei 2015-08-17 3087 wait_log_commit(root, log_transid - 1);
48cab2e0714913 Miao Xie 2014-02-20 3088
86df7eb921a009 Yan, Zheng 2009-10-14 3089 while (1) {
2ecb79239bcd04 Miao Xie 2012-09-06 3090 int batch = atomic_read(&root->log_batch);
cd354ad613a393 Chris Mason 2011-10-20 3091 /* when we're on an ssd, just kick the log commit out */
0b246afa62b0cf Jeff Mahoney 2016-06-22 3092 if (!btrfs_test_opt(fs_info, SSD) &&
27cdeb7096b86f Miao Xie 2014-04-02 3093 test_bit(BTRFS_ROOT_MULTI_LOG_TASKS, &root->state)) {
7237f1833601dc Yan Zheng 2009-01-21 3094 mutex_unlock(&root->log_mutex);
e02119d5a7b439 Chris Mason 2008-09-05 3095 schedule_timeout_uninterruptible(1);
7237f1833601dc Yan Zheng 2009-01-21 3096 mutex_lock(&root->log_mutex);
86df7eb921a009 Yan, Zheng 2009-10-14 3097 }
60d53eb3107c8e Zhaolei 2015-08-17 3098 wait_for_writer(root);
2ecb79239bcd04 Miao Xie 2012-09-06 3099 if (batch == atomic_read(&root->log_batch))
e02119d5a7b439 Chris Mason 2008-09-05 3100 break;
e02119d5a7b439 Chris Mason 2008-09-05 3101 }
e02119d5a7b439 Chris Mason 2008-09-05 3102
12fcfd22fe5bf4 Chris Mason 2009-03-24 3103 /* bail out if we need to do a full commit */
4884b8e8ebf54e David Sterba 2019-03-20 3104 if (btrfs_need_log_full_commit(trans)) {
12fcfd22fe5bf4 Chris Mason 2009-03-24 3105 ret = -EAGAIN;
12fcfd22fe5bf4 Chris Mason 2009-03-24 3106 mutex_unlock(&root->log_mutex);
12fcfd22fe5bf4 Chris Mason 2009-03-24 3107 goto out;
12fcfd22fe5bf4 Chris Mason 2009-03-24 3108 }
12fcfd22fe5bf4 Chris Mason 2009-03-24 3109
8cef4e160d7492 Yan, Zheng 2009-11-12 3110 if (log_transid % 2 == 0)
8cef4e160d7492 Yan, Zheng 2009-11-12 3111 mark = EXTENT_DIRTY;
8cef4e160d7492 Yan, Zheng 2009-11-12 3112 else
8cef4e160d7492 Yan, Zheng 2009-11-12 3113 mark = EXTENT_NEW;
8cef4e160d7492 Yan, Zheng 2009-11-12 3114
690587d109ffe1 Chris Mason 2009-10-13 3115 /* we start IO on all the marked extents here, but we don't actually
690587d109ffe1 Chris Mason 2009-10-13 3116 * wait for them until later.
690587d109ffe1 Chris Mason 2009-10-13 3117 */
c6adc9cc082e3c Miao Xie 2013-05-28 3118 blk_start_plug(&plug);
2ff7e61e0d30ff Jeff Mahoney 2016-06-22 3119 ret = btrfs_write_marked_extents(fs_info, &log->dirty_log_pages, mark);
79787eaab46121 Jeff Mahoney 2012-03-12 3120 if (ret) {
c6adc9cc082e3c Miao Xie 2013-05-28 3121 blk_finish_plug(&plug);
66642832f06a43 Jeff Mahoney 2016-06-10 3122 btrfs_abort_transaction(trans, ret);
907877664e2d85 David Sterba 2019-03-20 3123 btrfs_set_log_full_commit(trans);
79787eaab46121 Jeff Mahoney 2012-03-12 3124 mutex_unlock(&root->log_mutex);
79787eaab46121 Jeff Mahoney 2012-03-12 3125 goto out;
79787eaab46121 Jeff Mahoney 2012-03-12 3126 }
7237f1833601dc Yan Zheng 2009-01-21 3127
4203e968947071 Josef Bacik 2019-09-30 3128 /*
4203e968947071 Josef Bacik 2019-09-30 3129 * We _must_ update under the root->log_mutex in order to make sure we
4203e968947071 Josef Bacik 2019-09-30 3130 * have a consistent view of the log root we are trying to commit at
4203e968947071 Josef Bacik 2019-09-30 3131 * this moment.
4203e968947071 Josef Bacik 2019-09-30 3132 *
4203e968947071 Josef Bacik 2019-09-30 3133 * We _must_ copy this into a local copy, because we are not holding the
4203e968947071 Josef Bacik 2019-09-30 3134 * log_root_tree->log_mutex yet. This is important because when we
4203e968947071 Josef Bacik 2019-09-30 3135 * commit the log_root_tree we must have a consistent view of the
4203e968947071 Josef Bacik 2019-09-30 3136 * log_root_tree when we update the super block to point at the
4203e968947071 Josef Bacik 2019-09-30 3137 * log_root_tree bytenr. If we update the log_root_tree here we'll race
4203e968947071 Josef Bacik 2019-09-30 3138 * with the commit and possibly point at the new block which we may not
4203e968947071 Josef Bacik 2019-09-30 3139 * have written out.
4203e968947071 Josef Bacik 2019-09-30 3140 */
5d4f98a28c7d33 Yan Zheng 2009-06-10 3141 btrfs_set_root_node(&log->root_item, log->node);
4203e968947071 Josef Bacik 2019-09-30 3142 memcpy(&new_root_item, &log->root_item, sizeof(new_root_item));
7237f1833601dc Yan Zheng 2009-01-21 3143
7237f1833601dc Yan Zheng 2009-01-21 3144 root->log_transid++;
7237f1833601dc Yan Zheng 2009-01-21 3145 log->log_transid = root->log_transid;
ff782e0a131c7f Josef Bacik 2009-10-08 3146 root->log_start_pid = 0;
7237f1833601dc Yan Zheng 2009-01-21 3147 /*
8cef4e160d7492 Yan, Zheng 2009-11-12 3148 * IO has been started, blocks of the log tree have WRITTEN flag set
8cef4e160d7492 Yan, Zheng 2009-11-12 3149 * in their headers. new modifications of the log will be written to
8cef4e160d7492 Yan, Zheng 2009-11-12 3150 * new positions. so it's safe to allow log writers to go in.
7237f1833601dc Yan Zheng 2009-01-21 3151 */
7237f1833601dc Yan Zheng 2009-01-21 3152 mutex_unlock(&root->log_mutex);
7237f1833601dc Yan Zheng 2009-01-21 3153
28a235931b56d4 Filipe Manana 2016-08-23 3154 btrfs_init_log_ctx(&root_log_ctx, NULL);
d1433debe7f434 Miao Xie 2014-02-20 3155
7237f1833601dc Yan Zheng 2009-01-21 @3156 mutex_lock(&log_root_tree->log_mutex);
d1433debe7f434 Miao Xie 2014-02-20 3157
d1433debe7f434 Miao Xie 2014-02-20 3158 index2 = log_root_tree->log_transid % 2;
d1433debe7f434 Miao Xie 2014-02-20 3159 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]);
d1433debe7f434 Miao Xie 2014-02-20 3160 root_log_ctx.log_transid = log_root_tree->log_transid;
d1433debe7f434 Miao Xie 2014-02-20 3161
122cfba0d2eb42 Naohiro Aota 2021-01-26 3162 mutex_lock(&fs_info->tree_log_mutex);
122cfba0d2eb42 Naohiro Aota 2021-01-26 3163 if (!log_root_tree->node) {
122cfba0d2eb42 Naohiro Aota 2021-01-26 3164 ret = btrfs_alloc_log_tree_node(trans, log_root_tree);
122cfba0d2eb42 Naohiro Aota 2021-01-26 3165 if (ret) {
122cfba0d2eb42 Naohiro Aota 2021-01-26 3166 mutex_unlock(&fs_info->tree_log_mutex);
122cfba0d2eb42 Naohiro Aota 2021-01-26 3167 goto out;
122cfba0d2eb42 Naohiro Aota 2021-01-26 3168 }
122cfba0d2eb42 Naohiro Aota 2021-01-26 3169 }
122cfba0d2eb42 Naohiro Aota 2021-01-26 3170 mutex_unlock(&fs_info->tree_log_mutex);
122cfba0d2eb42 Naohiro Aota 2021-01-26 3171
4203e968947071 Josef Bacik 2019-09-30 3172 /*
4203e968947071 Josef Bacik 2019-09-30 3173 * Now we are safe to update the log_root_tree because we're under the
4203e968947071 Josef Bacik 2019-09-30 3174 * log_mutex, and we're a current writer so we're holding the commit
4203e968947071 Josef Bacik 2019-09-30 3175 * open until we drop the log_mutex.
4203e968947071 Josef Bacik 2019-09-30 3176 */
4203e968947071 Josef Bacik 2019-09-30 3177 ret = update_log_root(trans, log, &new_root_item);
4a500fd178c89b Yan, Zheng 2010-05-16 3178 if (ret) {
d1433debe7f434 Miao Xie 2014-02-20 3179 if (!list_empty(&root_log_ctx.list))
d1433debe7f434 Miao Xie 2014-02-20 3180 list_del_init(&root_log_ctx.list);
d1433debe7f434 Miao Xie 2014-02-20 3181
c6adc9cc082e3c Miao Xie 2013-05-28 3182 blk_finish_plug(&plug);
907877664e2d85 David Sterba 2019-03-20 3183 btrfs_set_log_full_commit(trans);
995946dd296177 Miao Xie 2014-04-02 3184
79787eaab46121 Jeff Mahoney 2012-03-12 3185 if (ret != -ENOSPC) {
66642832f06a43 Jeff Mahoney 2016-06-10 3186 btrfs_abort_transaction(trans, ret);
79787eaab46121 Jeff Mahoney 2012-03-12 3187 mutex_unlock(&log_root_tree->log_mutex);
79787eaab46121 Jeff Mahoney 2012-03-12 3188 goto out;
79787eaab46121 Jeff Mahoney 2012-03-12 3189 }
bf89d38febaadd Jeff Mahoney 2016-09-09 3190 btrfs_wait_tree_log_extents(log, mark);
4a500fd178c89b Yan, Zheng 2010-05-16 3191 mutex_unlock(&log_root_tree->log_mutex);
4a500fd178c89b Yan, Zheng 2010-05-16 3192 ret = -EAGAIN;
4a500fd178c89b Yan, Zheng 2010-05-16 3193 goto out;
4a500fd178c89b Yan, Zheng 2010-05-16 3194 }
4a500fd178c89b Yan, Zheng 2010-05-16 3195
d1433debe7f434 Miao Xie 2014-02-20 3196 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) {
3da5ab56482f32 Forrest Liu 2015-01-30 3197 blk_finish_plug(&plug);
cbd60aa7cd17d8 Chris Mason 2016-09-06 3198 list_del_init(&root_log_ctx.list);
d1433debe7f434 Miao Xie 2014-02-20 3199 mutex_unlock(&log_root_tree->log_mutex);
d1433debe7f434 Miao Xie 2014-02-20 3200 ret = root_log_ctx.log_ret;
d1433debe7f434 Miao Xie 2014-02-20 3201 goto out;
d1433debe7f434 Miao Xie 2014-02-20 3202 }
8b050d350c7846 Miao Xie 2014-02-20 3203
d1433debe7f434 Miao Xie 2014-02-20 3204 index2 = root_log_ctx.log_transid % 2;
7237f1833601dc Yan Zheng 2009-01-21 3205 if (atomic_read(&log_root_tree->log_commit[index2])) {
c6adc9cc082e3c Miao Xie 2013-05-28 3206 blk_finish_plug(&plug);
bf89d38febaadd Jeff Mahoney 2016-09-09 3207 ret = btrfs_wait_tree_log_extents(log, mark);
60d53eb3107c8e Zhaolei 2015-08-17 3208 wait_log_commit(log_root_tree,
d1433debe7f434 Miao Xie 2014-02-20 3209 root_log_ctx.log_transid);
7237f1833601dc Yan Zheng 2009-01-21 3210 mutex_unlock(&log_root_tree->log_mutex);
5ab5e44a36164f Filipe Manana 2014-11-13 3211 if (!ret)
8b050d350c7846 Miao Xie 2014-02-20 3212 ret = root_log_ctx.log_ret;
7237f1833601dc Yan Zheng 2009-01-21 3213 goto out;
7237f1833601dc Yan Zheng 2009-01-21 3214 }
d1433debe7f434 Miao Xie 2014-02-20 3215 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid);
7237f1833601dc Yan Zheng 2009-01-21 3216 atomic_set(&log_root_tree->log_commit[index2], 1);
7237f1833601dc Yan Zheng 2009-01-21 3217
12fcfd22fe5bf4 Chris Mason 2009-03-24 3218 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) {
60d53eb3107c8e Zhaolei 2015-08-17 3219 wait_log_commit(log_root_tree,
d1433debe7f434 Miao Xie 2014-02-20 3220 root_log_ctx.log_transid - 1);
12fcfd22fe5bf4 Chris Mason 2009-03-24 3221 }
7237f1833601dc Yan Zheng 2009-01-21 3222
12fcfd22fe5bf4 Chris Mason 2009-03-24 3223 /*
12fcfd22fe5bf4 Chris Mason 2009-03-24 3224 * now that we've moved on to the tree of log tree roots,
12fcfd22fe5bf4 Chris Mason 2009-03-24 3225 * check the full commit flag again
12fcfd22fe5bf4 Chris Mason 2009-03-24 3226 */
4884b8e8ebf54e David Sterba 2019-03-20 3227 if (btrfs_need_log_full_commit(trans)) {
c6adc9cc082e3c Miao Xie 2013-05-28 3228 blk_finish_plug(&plug);
bf89d38febaadd Jeff Mahoney 2016-09-09 3229 btrfs_wait_tree_log_extents(log, mark);
12fcfd22fe5bf4 Chris Mason 2009-03-24 3230 mutex_unlock(&log_root_tree->log_mutex);
12fcfd22fe5bf4 Chris Mason 2009-03-24 3231 ret = -EAGAIN;
12fcfd22fe5bf4 Chris Mason 2009-03-24 3232 goto out_wake_log_root;
12fcfd22fe5bf4 Chris Mason 2009-03-24 3233 }
7237f1833601dc Yan Zheng 2009-01-21 3234
2ff7e61e0d30ff Jeff Mahoney 2016-06-22 3235 ret = btrfs_write_marked_extents(fs_info,
8cef4e160d7492 Yan, Zheng 2009-11-12 3236 &log_root_tree->dirty_log_pages,
8cef4e160d7492 Yan, Zheng 2009-11-12 3237 EXTENT_DIRTY | EXTENT_NEW);
c6adc9cc082e3c Miao Xie 2013-05-28 3238 blk_finish_plug(&plug);
79787eaab46121 Jeff Mahoney 2012-03-12 3239 if (ret) {
907877664e2d85 David Sterba 2019-03-20 3240 btrfs_set_log_full_commit(trans);
66642832f06a43 Jeff Mahoney 2016-06-10 3241 btrfs_abort_transaction(trans, ret);
79787eaab46121 Jeff Mahoney 2012-03-12 3242 mutex_unlock(&log_root_tree->log_mutex);
79787eaab46121 Jeff Mahoney 2012-03-12 3243 goto out_wake_log_root;
79787eaab46121 Jeff Mahoney 2012-03-12 3244 }
bf89d38febaadd Jeff Mahoney 2016-09-09 3245 ret = btrfs_wait_tree_log_extents(log, mark);
5ab5e44a36164f Filipe Manana 2014-11-13 3246 if (!ret)
bf89d38febaadd Jeff Mahoney 2016-09-09 3247 ret = btrfs_wait_tree_log_extents(log_root_tree,
c6adc9cc082e3c Miao Xie 2013-05-28 3248 EXTENT_NEW | EXTENT_DIRTY);
5ab5e44a36164f Filipe Manana 2014-11-13 3249 if (ret) {
907877664e2d85 David Sterba 2019-03-20 3250 btrfs_set_log_full_commit(trans);
5ab5e44a36164f Filipe Manana 2014-11-13 3251 mutex_unlock(&log_root_tree->log_mutex);
5ab5e44a36164f Filipe Manana 2014-11-13 3252 goto out_wake_log_root;
5ab5e44a36164f Filipe Manana 2014-11-13 3253 }
e02119d5a7b439 Chris Mason 2008-09-05 3254
47876f7ceffa0e Filipe Manana 2020-11-25 3255 log_root_start = log_root_tree->node->start;
47876f7ceffa0e Filipe Manana 2020-11-25 3256 log_root_level = btrfs_header_level(log_root_tree->node);
7237f1833601dc Yan Zheng 2009-01-21 3257 log_root_tree->log_transid++;
7237f1833601dc Yan Zheng 2009-01-21 3258 mutex_unlock(&log_root_tree->log_mutex);
7237f1833601dc Yan Zheng 2009-01-21 3259
7237f1833601dc Yan Zheng 2009-01-21 3260 /*
47876f7ceffa0e Filipe Manana 2020-11-25 3261 * Here we are guaranteed that nobody is going to write the superblock
47876f7ceffa0e Filipe Manana 2020-11-25 3262 * for the current transaction before us and that neither we do write
47876f7ceffa0e Filipe Manana 2020-11-25 3263 * our superblock before the previous transaction finishes its commit
47876f7ceffa0e Filipe Manana 2020-11-25 3264 * and writes its superblock, because:
47876f7ceffa0e Filipe Manana 2020-11-25 3265 *
47876f7ceffa0e Filipe Manana 2020-11-25 3266 * 1) We are holding a handle on the current transaction, so no body
47876f7ceffa0e Filipe Manana 2020-11-25 3267 * can commit it until we release the handle;
47876f7ceffa0e Filipe Manana 2020-11-25 3268 *
47876f7ceffa0e Filipe Manana 2020-11-25 3269 * 2) Before writing our superblock we acquire the tree_log_mutex, so
47876f7ceffa0e Filipe Manana 2020-11-25 3270 * if the previous transaction is still committing, and hasn't yet
47876f7ceffa0e Filipe Manana 2020-11-25 3271 * written its superblock, we wait for it to do it, because a
47876f7ceffa0e Filipe Manana 2020-11-25 3272 * transaction commit acquires the tree_log_mutex when the commit
47876f7ceffa0e Filipe Manana 2020-11-25 3273 * begins and releases it only after writing its superblock.
7237f1833601dc Yan Zheng 2009-01-21 3274 */
47876f7ceffa0e Filipe Manana 2020-11-25 3275 mutex_lock(&fs_info->tree_log_mutex);
47876f7ceffa0e Filipe Manana 2020-11-25 3276 btrfs_set_super_log_root(fs_info->super_for_commit, log_root_start);
47876f7ceffa0e Filipe Manana 2020-11-25 3277 btrfs_set_super_log_root_level(fs_info->super_for_commit, log_root_level);
eece6a9cf69140 David Sterba 2017-02-10 3278 ret = write_all_supers(fs_info, 1);
47876f7ceffa0e Filipe Manana 2020-11-25 3279 mutex_unlock(&fs_info->tree_log_mutex);
5af3e8cce8b7ba Stefan Behrens 2012-08-01 3280 if (ret) {
907877664e2d85 David Sterba 2019-03-20 3281 btrfs_set_log_full_commit(trans);
66642832f06a43 Jeff Mahoney 2016-06-10 3282 btrfs_abort_transaction(trans, ret);
5af3e8cce8b7ba Stefan Behrens 2012-08-01 3283 goto out_wake_log_root;
5af3e8cce8b7ba Stefan Behrens 2012-08-01 3284 }
7237f1833601dc Yan Zheng 2009-01-21 3285
257c62e1bce03e Chris Mason 2009-10-13 3286 mutex_lock(&root->log_mutex);
257c62e1bce03e Chris Mason 2009-10-13 3287 if (root->last_log_commit < log_transid)
257c62e1bce03e Chris Mason 2009-10-13 3288 root->last_log_commit = log_transid;
257c62e1bce03e Chris Mason 2009-10-13 3289 mutex_unlock(&root->log_mutex);
257c62e1bce03e Chris Mason 2009-10-13 3290
12fcfd22fe5bf4 Chris Mason 2009-03-24 3291 out_wake_log_root:
570dd45042a7c8 Chris Mason 2016-10-27 3292 mutex_lock(&log_root_tree->log_mutex);
8b050d350c7846 Miao Xie 2014-02-20 3293 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret);
8b050d350c7846 Miao Xie 2014-02-20 3294
d1433debe7f434 Miao Xie 2014-02-20 3295 log_root_tree->log_transid_committed++;
7237f1833601dc Yan Zheng 2009-01-21 3296 atomic_set(&log_root_tree->log_commit[index2], 0);
d1433debe7f434 Miao Xie 2014-02-20 3297 mutex_unlock(&log_root_tree->log_mutex);
d1433debe7f434 Miao Xie 2014-02-20 3298
33a9eca7e4a4c2 David Sterba 2015-10-10 3299 /*
093258e6ebaf17 David Sterba 2018-02-26 3300 * The barrier before waitqueue_active (in cond_wake_up) is needed so
093258e6ebaf17 David Sterba 2018-02-26 3301 * all the updates above are seen by the woken threads. It might not be
093258e6ebaf17 David Sterba 2018-02-26 3302 * necessary, but proving that seems to be hard.
33a9eca7e4a4c2 David Sterba 2015-10-10 3303 */
093258e6ebaf17 David Sterba 2018-02-26 3304 cond_wake_up(&log_root_tree->log_commit_wait[index2]);
e02119d5a7b439 Chris Mason 2008-09-05 3305 out:
d1433debe7f434 Miao Xie 2014-02-20 3306 mutex_lock(&root->log_mutex);
570dd45042a7c8 Chris Mason 2016-10-27 3307 btrfs_remove_all_log_ctxs(root, index1, ret);
d1433debe7f434 Miao Xie 2014-02-20 3308 root->log_transid_committed++;
7237f1833601dc Yan Zheng 2009-01-21 3309 atomic_set(&root->log_commit[index1], 0);
d1433debe7f434 Miao Xie 2014-02-20 3310 mutex_unlock(&root->log_mutex);
8b050d350c7846 Miao Xie 2014-02-20 3311
33a9eca7e4a4c2 David Sterba 2015-10-10 3312 /*
093258e6ebaf17 David Sterba 2018-02-26 3313 * The barrier before waitqueue_active (in cond_wake_up) is needed so
093258e6ebaf17 David Sterba 2018-02-26 3314 * all the updates above are seen by the woken threads. It might not be
093258e6ebaf17 David Sterba 2018-02-26 3315 * necessary, but proving that seems to be hard.
33a9eca7e4a4c2 David Sterba 2015-10-10 3316 */
093258e6ebaf17 David Sterba 2018-02-26 3317 cond_wake_up(&root->log_commit_wait[index1]);
b31eabd86eb68d Chris Mason 2011-01-31 @3318 return ret;
e02119d5a7b439 Chris Mason 2008-09-05 3319 }
e02119d5a7b439 Chris Mason 2008-09-05 3320
:::::: The code at line 3318 was first introduced by commit
:::::: b31eabd86eb68d3c217e6821078249bc045e698a Btrfs: catch errors from btrfs_sync_log
:::::: TO: Chris Mason <chris.mason(a)oracle.com>
:::::: CC: Chris Mason <chris.mason(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[qais-yousef:pelt-halflife-sysctl 12/12] kernel/sched/pelt.h:180 update_idle_rq_clock_pelt() error: uninitialized symbol 'divider'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Qais Yousef <qyousef(a)layalina.io>
tree: https://github.com/qais-yousef/linux pelt-halflife-sysctl
head: c35bd693d02f8a88f3ea301c880a70361dd6d15f
commit: c35bd693d02f8a88f3ea301c880a70361dd6d15f [12/12] sched/pelt: use static keys to avoid extra accesses
:::::: branch date: 3 hours ago
:::::: commit date: 3 hours ago
config: x86_64-randconfig-m001-20210130 (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(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/sched/pelt.h:180 update_idle_rq_clock_pelt() error: uninitialized symbol 'divider'.
kernel/sched/pelt.c:150 __accumulate_pelt_segments() error: uninitialized symbol 'c2'.
vim +/divider +180 kernel/sched/pelt.h
23127296889fe8 Vincent Guittot 2019-01-23 146
23127296889fe8 Vincent Guittot 2019-01-23 147 /*
23127296889fe8 Vincent Guittot 2019-01-23 148 * When rq becomes idle, we have to check if it has lost idle time
23127296889fe8 Vincent Guittot 2019-01-23 149 * because it was fully busy. A rq is fully used when the /Sum util_sum
23127296889fe8 Vincent Guittot 2019-01-23 150 * is greater or equal to:
23127296889fe8 Vincent Guittot 2019-01-23 151 * (LOAD_AVG_MAX - 1024 + rq->cfs.avg.period_contrib) << SCHED_CAPACITY_SHIFT;
23127296889fe8 Vincent Guittot 2019-01-23 152 * For optimization and computing rounding purpose, we don't take into account
23127296889fe8 Vincent Guittot 2019-01-23 153 * the position in the current window (period_contrib) and we use the higher
23127296889fe8 Vincent Guittot 2019-01-23 154 * bound of util_sum to decide.
23127296889fe8 Vincent Guittot 2019-01-23 155 */
23127296889fe8 Vincent Guittot 2019-01-23 156 static inline void update_idle_rq_clock_pelt(struct rq *rq)
23127296889fe8 Vincent Guittot 2019-01-23 157 {
c35bd693d02f8a Qais Yousef 2021-01-29 158 u32 divider, util_sum;
c35bd693d02f8a Qais Yousef 2021-01-29 159
c35bd693d02f8a Qais Yousef 2021-01-29 160 util_sum = rq->cfs.avg.util_sum;
23127296889fe8 Vincent Guittot 2019-01-23 161 util_sum += rq->avg_rt.util_sum;
23127296889fe8 Vincent Guittot 2019-01-23 162 util_sum += rq->avg_dl.util_sum;
23127296889fe8 Vincent Guittot 2019-01-23 163
c35bd693d02f8a Qais Yousef 2021-01-29 164 if (static_branch_likely(&pelt_halflife_32))
c35bd693d02f8a Qais Yousef 2021-01-29 165 divider = ((LOAD_AVG_MAX_32 - 1024) << SCHED_CAPACITY_SHIFT) - LOAD_AVG_MAX_32;
c35bd693d02f8a Qais Yousef 2021-01-29 166 if (static_branch_likely(&pelt_halflife_16))
c35bd693d02f8a Qais Yousef 2021-01-29 167 divider = ((LOAD_AVG_MAX_16 - 1024) << SCHED_CAPACITY_SHIFT) - LOAD_AVG_MAX_16;
c35bd693d02f8a Qais Yousef 2021-01-29 168 if (static_branch_likely(&pelt_halflife_8))
c35bd693d02f8a Qais Yousef 2021-01-29 169 divider = ((LOAD_AVG_MAX_8 - 1024) << SCHED_CAPACITY_SHIFT) - LOAD_AVG_MAX_8;
c35bd693d02f8a Qais Yousef 2021-01-29 170
23127296889fe8 Vincent Guittot 2019-01-23 171 /*
23127296889fe8 Vincent Guittot 2019-01-23 172 * Reflecting stolen time makes sense only if the idle
23127296889fe8 Vincent Guittot 2019-01-23 173 * phase would be present at max capacity. As soon as the
23127296889fe8 Vincent Guittot 2019-01-23 174 * utilization of a rq has reached the maximum value, it is
23127296889fe8 Vincent Guittot 2019-01-23 175 * considered as an always runnig rq without idle time to
23127296889fe8 Vincent Guittot 2019-01-23 176 * steal. This potential idle time is considered as lost in
23127296889fe8 Vincent Guittot 2019-01-23 177 * this case. We keep track of this lost idle time compare to
23127296889fe8 Vincent Guittot 2019-01-23 178 * rq's clock_task.
23127296889fe8 Vincent Guittot 2019-01-23 179 */
23127296889fe8 Vincent Guittot 2019-01-23 @180 if (util_sum >= divider)
23127296889fe8 Vincent Guittot 2019-01-23 181 rq->lost_idle_time += rq_clock_task(rq) - rq->clock_pelt;
23127296889fe8 Vincent Guittot 2019-01-23 182 }
23127296889fe8 Vincent Guittot 2019-01-23 183
:::::: The code at line 180 was first introduced by commit
:::::: 23127296889fe84b0762b191b5d041e8ba6f2599 sched/fair: Update scale invariance of PELT
:::::: TO: Vincent Guittot <vincent.guittot(a)linaro.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[kdave-btrfs-devel:for-next-20210129 14783/14851] fs/btrfs/zoned.c:428:7-12: ERROR: reference preceded by free on line 394
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Johannes Thumshirn <johannes.thumshirn(a)wdc.com>
CC: David Sterba <dsterba(a)suse.com>
CC: Naohiro Aota <naohiro.aota(a)wdc.com>
CC: Josef Bacik <josef(a)toxicpanda.com>
tree: https://github.com/kdave/btrfs-devel.git for-next-20210129
head: 6e043613b2c4377ce095ea826160d42031156d35
commit: 9e802babe3299843f991f1fd40212cde940115ba [14783/14851] btrfs: allow zoned mode on non-zoned block devices
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: powerpc64-randconfig-c003-20210129 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> fs/btrfs/zoned.c:428:7-12: ERROR: reference preceded by free on line 394
vim +428 fs/btrfs/zoned.c
ea7403f51b3ebc7 Naohiro Aota 2021-01-26 250
5b316468983dfa9 Naohiro Aota 2020-11-10 251 int btrfs_get_dev_zone_info(struct btrfs_device *device)
5b316468983dfa9 Naohiro Aota 2020-11-10 252 {
9e802babe329984 Johannes Thumshirn 2021-01-26 253 struct btrfs_fs_info *fs_info = device->fs_info;
5b316468983dfa9 Naohiro Aota 2020-11-10 254 struct btrfs_zoned_device_info *zone_info = NULL;
5b316468983dfa9 Naohiro Aota 2020-11-10 255 struct block_device *bdev = device->bdev;
862931c76327e54 Naohiro Aota 2020-11-10 256 struct request_queue *queue = bdev_get_queue(bdev);
5b316468983dfa9 Naohiro Aota 2020-11-10 257 sector_t nr_sectors;
5b316468983dfa9 Naohiro Aota 2020-11-10 258 sector_t sector = 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 259 struct blk_zone *zones = NULL;
5b316468983dfa9 Naohiro Aota 2020-11-10 260 unsigned int i, nreported = 0, nr_zones;
5b316468983dfa9 Naohiro Aota 2020-11-10 261 unsigned int zone_sectors;
9e802babe329984 Johannes Thumshirn 2021-01-26 262 char *model, *emulated;
5b316468983dfa9 Naohiro Aota 2020-11-10 263 int ret;
5b316468983dfa9 Naohiro Aota 2020-11-10 264
9e802babe329984 Johannes Thumshirn 2021-01-26 265 /*
9e802babe329984 Johannes Thumshirn 2021-01-26 266 * Cannot use btrfs_is_zoned here, since fs_info->zone_size might
9e802babe329984 Johannes Thumshirn 2021-01-26 267 * not be set yet.
9e802babe329984 Johannes Thumshirn 2021-01-26 268 */
9e802babe329984 Johannes Thumshirn 2021-01-26 269 if (!btrfs_fs_incompat(fs_info, ZONED))
5b316468983dfa9 Naohiro Aota 2020-11-10 270 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 271
5b316468983dfa9 Naohiro Aota 2020-11-10 272 if (device->zone_info)
5b316468983dfa9 Naohiro Aota 2020-11-10 273 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 274
5b316468983dfa9 Naohiro Aota 2020-11-10 275 zone_info = kzalloc(sizeof(*zone_info), GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 276 if (!zone_info)
5b316468983dfa9 Naohiro Aota 2020-11-10 277 return -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 278
9e802babe329984 Johannes Thumshirn 2021-01-26 279 if (!bdev_is_zoned(bdev)) {
9e802babe329984 Johannes Thumshirn 2021-01-26 280 if (!fs_info->zone_size) {
9e802babe329984 Johannes Thumshirn 2021-01-26 281 ret = calculate_emulated_zone_size(fs_info);
9e802babe329984 Johannes Thumshirn 2021-01-26 282 if (ret)
9e802babe329984 Johannes Thumshirn 2021-01-26 283 goto out;
9e802babe329984 Johannes Thumshirn 2021-01-26 284 }
9e802babe329984 Johannes Thumshirn 2021-01-26 285
9e802babe329984 Johannes Thumshirn 2021-01-26 286 ASSERT(fs_info->zone_size);
9e802babe329984 Johannes Thumshirn 2021-01-26 287 zone_sectors = fs_info->zone_size >> SECTOR_SHIFT;
9e802babe329984 Johannes Thumshirn 2021-01-26 288 } else {
5b316468983dfa9 Naohiro Aota 2020-11-10 289 zone_sectors = bdev_zone_sectors(bdev);
9e802babe329984 Johannes Thumshirn 2021-01-26 290 }
9e802babe329984 Johannes Thumshirn 2021-01-26 291
9e802babe329984 Johannes Thumshirn 2021-01-26 292 nr_sectors = bdev_nr_sectors(bdev);
5b316468983dfa9 Naohiro Aota 2020-11-10 293 /* Check if it's power of 2 (see is_power_of_2) */
5b316468983dfa9 Naohiro Aota 2020-11-10 294 ASSERT(zone_sectors != 0 && (zone_sectors & (zone_sectors - 1)) == 0);
5b316468983dfa9 Naohiro Aota 2020-11-10 295 zone_info->zone_size = zone_sectors << SECTOR_SHIFT;
5b316468983dfa9 Naohiro Aota 2020-11-10 296 zone_info->zone_size_shift = ilog2(zone_info->zone_size);
862931c76327e54 Naohiro Aota 2020-11-10 297 zone_info->max_zone_append_size =
862931c76327e54 Naohiro Aota 2020-11-10 298 (u64)queue_max_zone_append_sectors(queue) << SECTOR_SHIFT;
5b316468983dfa9 Naohiro Aota 2020-11-10 299 zone_info->nr_zones = nr_sectors >> ilog2(zone_sectors);
5b316468983dfa9 Naohiro Aota 2020-11-10 300 if (!IS_ALIGNED(nr_sectors, zone_sectors))
5b316468983dfa9 Naohiro Aota 2020-11-10 301 zone_info->nr_zones++;
5b316468983dfa9 Naohiro Aota 2020-11-10 302
5b316468983dfa9 Naohiro Aota 2020-11-10 303 zone_info->seq_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 304 if (!zone_info->seq_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 305 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 306 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 307 }
5b316468983dfa9 Naohiro Aota 2020-11-10 308
5b316468983dfa9 Naohiro Aota 2020-11-10 309 zone_info->empty_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 310 if (!zone_info->empty_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 311 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 312 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 313 }
5b316468983dfa9 Naohiro Aota 2020-11-10 314
5b316468983dfa9 Naohiro Aota 2020-11-10 315 zones = kcalloc(BTRFS_REPORT_NR_ZONES, sizeof(struct blk_zone), GFP_KERNEL);
5b316468983dfa9 Naohiro Aota 2020-11-10 316 if (!zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 317 ret = -ENOMEM;
5b316468983dfa9 Naohiro Aota 2020-11-10 318 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 319 }
5b316468983dfa9 Naohiro Aota 2020-11-10 320
5b316468983dfa9 Naohiro Aota 2020-11-10 321 /* Get zones type */
5b316468983dfa9 Naohiro Aota 2020-11-10 322 while (sector < nr_sectors) {
5b316468983dfa9 Naohiro Aota 2020-11-10 323 nr_zones = BTRFS_REPORT_NR_ZONES;
5b316468983dfa9 Naohiro Aota 2020-11-10 324 ret = btrfs_get_dev_zones(device, sector << SECTOR_SHIFT, zones,
5b316468983dfa9 Naohiro Aota 2020-11-10 325 &nr_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 326 if (ret)
5b316468983dfa9 Naohiro Aota 2020-11-10 327 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 328
5b316468983dfa9 Naohiro Aota 2020-11-10 329 for (i = 0; i < nr_zones; i++) {
5b316468983dfa9 Naohiro Aota 2020-11-10 330 if (zones[i].type == BLK_ZONE_TYPE_SEQWRITE_REQ)
5b316468983dfa9 Naohiro Aota 2020-11-10 331 __set_bit(nreported, zone_info->seq_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 332 if (zones[i].cond == BLK_ZONE_COND_EMPTY)
5b316468983dfa9 Naohiro Aota 2020-11-10 333 __set_bit(nreported, zone_info->empty_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 334 nreported++;
5b316468983dfa9 Naohiro Aota 2020-11-10 335 }
5b316468983dfa9 Naohiro Aota 2020-11-10 336 sector = zones[nr_zones - 1].start + zones[nr_zones - 1].len;
5b316468983dfa9 Naohiro Aota 2020-11-10 337 }
5b316468983dfa9 Naohiro Aota 2020-11-10 338
5b316468983dfa9 Naohiro Aota 2020-11-10 339 if (nreported != zone_info->nr_zones) {
5b316468983dfa9 Naohiro Aota 2020-11-10 340 btrfs_err_in_rcu(device->fs_info,
5b316468983dfa9 Naohiro Aota 2020-11-10 341 "inconsistent number of zones on %s (%u/%u)",
5b316468983dfa9 Naohiro Aota 2020-11-10 342 rcu_str_deref(device->name), nreported,
5b316468983dfa9 Naohiro Aota 2020-11-10 343 zone_info->nr_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 344 ret = -EIO;
5b316468983dfa9 Naohiro Aota 2020-11-10 345 goto out;
5b316468983dfa9 Naohiro Aota 2020-11-10 346 }
5b316468983dfa9 Naohiro Aota 2020-11-10 347
12659251ca5df05 Naohiro Aota 2020-11-10 348 /* Validate superblock log */
12659251ca5df05 Naohiro Aota 2020-11-10 349 nr_zones = BTRFS_NR_SB_LOG_ZONES;
12659251ca5df05 Naohiro Aota 2020-11-10 350 for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
12659251ca5df05 Naohiro Aota 2020-11-10 351 u32 sb_zone;
12659251ca5df05 Naohiro Aota 2020-11-10 352 u64 sb_wp;
12659251ca5df05 Naohiro Aota 2020-11-10 353 int sb_pos = BTRFS_NR_SB_LOG_ZONES * i;
12659251ca5df05 Naohiro Aota 2020-11-10 354
12659251ca5df05 Naohiro Aota 2020-11-10 355 sb_zone = sb_zone_number(zone_info->zone_size_shift, i);
12659251ca5df05 Naohiro Aota 2020-11-10 356 if (sb_zone + 1 >= zone_info->nr_zones)
12659251ca5df05 Naohiro Aota 2020-11-10 357 continue;
12659251ca5df05 Naohiro Aota 2020-11-10 358
12659251ca5df05 Naohiro Aota 2020-11-10 359 sector = sb_zone << (zone_info->zone_size_shift - SECTOR_SHIFT);
12659251ca5df05 Naohiro Aota 2020-11-10 360 ret = btrfs_get_dev_zones(device, sector << SECTOR_SHIFT,
12659251ca5df05 Naohiro Aota 2020-11-10 361 &zone_info->sb_zones[sb_pos],
12659251ca5df05 Naohiro Aota 2020-11-10 362 &nr_zones);
12659251ca5df05 Naohiro Aota 2020-11-10 363 if (ret)
12659251ca5df05 Naohiro Aota 2020-11-10 364 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 365
12659251ca5df05 Naohiro Aota 2020-11-10 366 if (nr_zones != BTRFS_NR_SB_LOG_ZONES) {
12659251ca5df05 Naohiro Aota 2020-11-10 367 btrfs_err_in_rcu(device->fs_info,
12659251ca5df05 Naohiro Aota 2020-11-10 368 "zoned: failed to read super block log zone info at devid %llu zone %u",
12659251ca5df05 Naohiro Aota 2020-11-10 369 device->devid, sb_zone);
12659251ca5df05 Naohiro Aota 2020-11-10 370 ret = -EUCLEAN;
12659251ca5df05 Naohiro Aota 2020-11-10 371 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 372 }
12659251ca5df05 Naohiro Aota 2020-11-10 373
12659251ca5df05 Naohiro Aota 2020-11-10 374 /*
12659251ca5df05 Naohiro Aota 2020-11-10 375 * If zones[0] is conventional, always use the beggining of the
12659251ca5df05 Naohiro Aota 2020-11-10 376 * zone to record superblock. No need to validate in that case.
12659251ca5df05 Naohiro Aota 2020-11-10 377 */
12659251ca5df05 Naohiro Aota 2020-11-10 378 if (zone_info->sb_zones[BTRFS_NR_SB_LOG_ZONES * i].type ==
12659251ca5df05 Naohiro Aota 2020-11-10 379 BLK_ZONE_TYPE_CONVENTIONAL)
12659251ca5df05 Naohiro Aota 2020-11-10 380 continue;
12659251ca5df05 Naohiro Aota 2020-11-10 381
12659251ca5df05 Naohiro Aota 2020-11-10 382 ret = sb_write_pointer(device->bdev,
12659251ca5df05 Naohiro Aota 2020-11-10 383 &zone_info->sb_zones[sb_pos], &sb_wp);
12659251ca5df05 Naohiro Aota 2020-11-10 384 if (ret != -ENOENT && ret) {
12659251ca5df05 Naohiro Aota 2020-11-10 385 btrfs_err_in_rcu(device->fs_info,
12659251ca5df05 Naohiro Aota 2020-11-10 386 "zoned: super block log zone corrupted devid %llu zone %u",
12659251ca5df05 Naohiro Aota 2020-11-10 387 device->devid, sb_zone);
12659251ca5df05 Naohiro Aota 2020-11-10 388 ret = -EUCLEAN;
12659251ca5df05 Naohiro Aota 2020-11-10 389 goto out;
12659251ca5df05 Naohiro Aota 2020-11-10 390 }
12659251ca5df05 Naohiro Aota 2020-11-10 391 }
12659251ca5df05 Naohiro Aota 2020-11-10 392
12659251ca5df05 Naohiro Aota 2020-11-10 393
5b316468983dfa9 Naohiro Aota 2020-11-10 @394 kfree(zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 395
5b316468983dfa9 Naohiro Aota 2020-11-10 396 device->zone_info = zone_info;
5b316468983dfa9 Naohiro Aota 2020-11-10 397
9e802babe329984 Johannes Thumshirn 2021-01-26 398 switch (bdev_zoned_model(bdev)) {
9e802babe329984 Johannes Thumshirn 2021-01-26 399 case BLK_ZONED_HM:
9e802babe329984 Johannes Thumshirn 2021-01-26 400 model = "host-managed zoned";
9e802babe329984 Johannes Thumshirn 2021-01-26 401 emulated = "";
9e802babe329984 Johannes Thumshirn 2021-01-26 402 break;
9e802babe329984 Johannes Thumshirn 2021-01-26 403 case BLK_ZONED_HA:
9e802babe329984 Johannes Thumshirn 2021-01-26 404 model = "host-aware zoned";
9e802babe329984 Johannes Thumshirn 2021-01-26 405 emulated = "";
9e802babe329984 Johannes Thumshirn 2021-01-26 406 break;
9e802babe329984 Johannes Thumshirn 2021-01-26 407 case BLK_ZONED_NONE:
9e802babe329984 Johannes Thumshirn 2021-01-26 408 model = "regular";
9e802babe329984 Johannes Thumshirn 2021-01-26 409 emulated = "emulated ";
9e802babe329984 Johannes Thumshirn 2021-01-26 410 break;
9e802babe329984 Johannes Thumshirn 2021-01-26 411 default:
9e802babe329984 Johannes Thumshirn 2021-01-26 412 /* Just in case */
9e802babe329984 Johannes Thumshirn 2021-01-26 413 btrfs_err_in_rcu(fs_info, "Unsupported zoned model %d on %s",
9e802babe329984 Johannes Thumshirn 2021-01-26 414 bdev_zoned_model(bdev),
9e802babe329984 Johannes Thumshirn 2021-01-26 415 rcu_str_deref(device->name));
9e802babe329984 Johannes Thumshirn 2021-01-26 416 ret = -EOPNOTSUPP;
9e802babe329984 Johannes Thumshirn 2021-01-26 417 goto out;
9e802babe329984 Johannes Thumshirn 2021-01-26 418 }
9e802babe329984 Johannes Thumshirn 2021-01-26 419
9e802babe329984 Johannes Thumshirn 2021-01-26 420 btrfs_info_in_rcu(fs_info,
9e802babe329984 Johannes Thumshirn 2021-01-26 421 "%s block device %s, %u %szones of %llu bytes",
9e802babe329984 Johannes Thumshirn 2021-01-26 422 model, rcu_str_deref(device->name), zone_info->nr_zones,
9e802babe329984 Johannes Thumshirn 2021-01-26 423 emulated, zone_info->zone_size);
5b316468983dfa9 Naohiro Aota 2020-11-10 424
5b316468983dfa9 Naohiro Aota 2020-11-10 425 return 0;
5b316468983dfa9 Naohiro Aota 2020-11-10 426
5b316468983dfa9 Naohiro Aota 2020-11-10 427 out:
5b316468983dfa9 Naohiro Aota 2020-11-10 @428 kfree(zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 429 bitmap_free(zone_info->empty_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 430 bitmap_free(zone_info->seq_zones);
5b316468983dfa9 Naohiro Aota 2020-11-10 431 kfree(zone_info);
5b316468983dfa9 Naohiro Aota 2020-11-10 432
5b316468983dfa9 Naohiro Aota 2020-11-10 433 return ret;
5b316468983dfa9 Naohiro Aota 2020-11-10 434 }
5b316468983dfa9 Naohiro Aota 2020-11-10 435
:::::: The code at line 428 was first introduced by commit
:::::: 5b316468983dfa9473ff0f1c42e4e30b4c267141 btrfs: get zone information of zoned block devices
:::::: TO: Naohiro Aota <naohiro.aota(a)wdc.com>
:::::: CC: David Sterba <dsterba(a)suse.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[chrome-os:chromeos-5.4 74/85] fs/io-wq.c:656:2-6: ERROR: invalid reference to the index variable of the iterator on line 646
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
TO: Guenter Roeck <groeck(a)google.com>
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 56f704f1ca6f7dcdae5e9b7e2f1b4c2695e7fa94
commit: b75748e5171e8f9f741eb5018dfb479da9f3f834 [74/85] BACKPORT: io_uring: replace workqueue usage with io-wq
:::::: branch date:
:::::: commit date: 4 hours ago
config: m68k-randconfig-c003-20210129 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> fs/io-wq.c:656:2-6: ERROR: invalid reference to the index variable of the iterator on line 646
vim +656 fs/io-wq.c
d9415202b39091 Jens Axboe 2019-10-22 631
d9415202b39091 Jens Axboe 2019-10-22 632 static enum io_wq_cancel io_wqe_cancel_work(struct io_wqe *wqe,
d9415202b39091 Jens Axboe 2019-10-22 633 struct io_wq_work *cwork)
d9415202b39091 Jens Axboe 2019-10-22 634 {
d9415202b39091 Jens Axboe 2019-10-22 635 struct io_wq_work *work;
d9415202b39091 Jens Axboe 2019-10-22 636 bool found = false;
d9415202b39091 Jens Axboe 2019-10-22 637
d9415202b39091 Jens Axboe 2019-10-22 638 cwork->flags |= IO_WQ_WORK_CANCEL;
d9415202b39091 Jens Axboe 2019-10-22 639
d9415202b39091 Jens Axboe 2019-10-22 640 /*
d9415202b39091 Jens Axboe 2019-10-22 641 * First check pending list, if we're lucky we can just remove it
d9415202b39091 Jens Axboe 2019-10-22 642 * from there. CANCEL_OK means that the work is returned as-new,
d9415202b39091 Jens Axboe 2019-10-22 643 * no completion will be posted for it.
d9415202b39091 Jens Axboe 2019-10-22 644 */
d9415202b39091 Jens Axboe 2019-10-22 645 spin_lock_irq(&wqe->lock);
d9415202b39091 Jens Axboe 2019-10-22 @646 list_for_each_entry(work, &wqe->work_list, list) {
d9415202b39091 Jens Axboe 2019-10-22 647 if (work == cwork) {
d9415202b39091 Jens Axboe 2019-10-22 648 list_del(&work->list);
d9415202b39091 Jens Axboe 2019-10-22 649 found = true;
d9415202b39091 Jens Axboe 2019-10-22 650 break;
d9415202b39091 Jens Axboe 2019-10-22 651 }
d9415202b39091 Jens Axboe 2019-10-22 652 }
d9415202b39091 Jens Axboe 2019-10-22 653 spin_unlock_irq(&wqe->lock);
d9415202b39091 Jens Axboe 2019-10-22 654
d9415202b39091 Jens Axboe 2019-10-22 655 if (found) {
d9415202b39091 Jens Axboe 2019-10-22 @656 work->flags |= IO_WQ_WORK_CANCEL;
d9415202b39091 Jens Axboe 2019-10-22 657 work->func(&work);
d9415202b39091 Jens Axboe 2019-10-22 658 return IO_WQ_CANCEL_OK;
d9415202b39091 Jens Axboe 2019-10-22 659 }
d9415202b39091 Jens Axboe 2019-10-22 660
d9415202b39091 Jens Axboe 2019-10-22 661 /*
d9415202b39091 Jens Axboe 2019-10-22 662 * Now check if a free (going busy) or busy worker has the work
d9415202b39091 Jens Axboe 2019-10-22 663 * currently running. If we find it there, we'll return CANCEL_RUNNING
d9415202b39091 Jens Axboe 2019-10-22 664 * as an indication that we attempte to signal cancellation. The
d9415202b39091 Jens Axboe 2019-10-22 665 * completion will run normally in this case.
d9415202b39091 Jens Axboe 2019-10-22 666 */
d9415202b39091 Jens Axboe 2019-10-22 667 rcu_read_lock();
d9415202b39091 Jens Axboe 2019-10-22 668 found = io_wq_for_each_worker(wqe, &wqe->free_list, io_wq_worker_cancel,
d9415202b39091 Jens Axboe 2019-10-22 669 cwork);
d9415202b39091 Jens Axboe 2019-10-22 670 if (found)
d9415202b39091 Jens Axboe 2019-10-22 671 goto done;
d9415202b39091 Jens Axboe 2019-10-22 672
d9415202b39091 Jens Axboe 2019-10-22 673 found = io_wq_for_each_worker(wqe, &wqe->busy_list, io_wq_worker_cancel,
d9415202b39091 Jens Axboe 2019-10-22 674 cwork);
d9415202b39091 Jens Axboe 2019-10-22 675 done:
d9415202b39091 Jens Axboe 2019-10-22 676 rcu_read_unlock();
d9415202b39091 Jens Axboe 2019-10-22 677 return found ? IO_WQ_CANCEL_RUNNING : IO_WQ_CANCEL_NOTFOUND;
d9415202b39091 Jens Axboe 2019-10-22 678 }
d9415202b39091 Jens Axboe 2019-10-22 679
:::::: The code at line 656 was first introduced by commit
:::::: d9415202b39091a078aeca3c9a3b60436dd1cc1d UPSTREAM: io-wq: small threadpool implementation for io_uring
:::::: TO: Jens Axboe <axboe(a)kernel.dk>
:::::: CC: Commit Bot <commit-bot(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[xlnx:master 59/60] drivers/mtd/spi-nor/spi-nor.c:5455:22: warning: Unused variable: np_spi
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Vishal Sagar <vishal.sagar(a)xilinx.com>
CC: Michal Simek <monstr(a)monstr.eu>
CC: Hyun Kwon <hyun.kwon(a)xilinx.com>
tree: https://github.com/Xilinx/linux-xlnx master
head: 043f8a226a752a1dd11f7ff64cee6dbe7334d394
commit: c0b33b8ccd38096c815f2dd39746044d0aa079d3 [59/60] staging: xlnxsync: Fix the uapi header license
:::::: branch date: 9 months ago
:::::: commit date: 9 months ago
compiler: nios2-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
drivers/mtd/spi-nor/spi-nor.c:4170:24: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
map_id = map_id << 1 | !!(*buf & read_data_mask);
^
>> drivers/mtd/spi-nor/spi-nor.c:5455:22: warning: Unused variable: np_spi [unusedVariable]
struct device_node *np_spi;
^
drivers/mtd/spi-nor/spi-nor.c:5456:6: warning: Unused variable: is_dual [unusedVariable]
u32 is_dual;
^
vim +5455 drivers/mtd/spi-nor/spi-nor.c
620df2497415a9 Tudor Ambarus 2019-08-24 5444
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5445 int spi_nor_scan(struct spi_nor *nor, const char *name,
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5446 const struct spi_nor_hwcaps *hwcaps)
b199489d37b21c Huang Shijie 2014-02-24 5447 {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5448 struct flash_info *info = NULL;
b199489d37b21c Huang Shijie 2014-02-24 5449 struct device *dev = nor->dev;
1976367173a47f Brian Norris 2015-08-13 5450 struct mtd_info *mtd = &nor->mtd;
9c7d787508be6d Brian Norris 2015-10-30 5451 struct device_node *np = spi_nor_get_flash_node(nor);
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5452 struct spi_nor_flash_parameter *params = &nor->params;
b199489d37b21c Huang Shijie 2014-02-24 5453 int ret;
b199489d37b21c Huang Shijie 2014-02-24 5454 int i;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 @5455 struct device_node *np_spi;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5456 u32 is_dual;
b199489d37b21c Huang Shijie 2014-02-24 5457
b199489d37b21c Huang Shijie 2014-02-24 5458 ret = spi_nor_check(nor);
b199489d37b21c Huang Shijie 2014-02-24 5459 if (ret)
b199489d37b21c Huang Shijie 2014-02-24 5460 return ret;
b199489d37b21c Huang Shijie 2014-02-24 5461
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5462 /* Reset SPI protocol for all commands. */
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5463 nor->reg_proto = SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5464 nor->read_proto = SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5465 nor->write_proto = SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5466
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5467 /*
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5468 * We need the bounce buffer early to read/write registers when going
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5469 * through the spi-mem layer (buffers have to be DMA-able).
b35b9a10362d20 Boris Brezillon 2019-08-06 5470 * For spi-mem drivers, we'll reallocate a new buffer if
b35b9a10362d20 Boris Brezillon 2019-08-06 5471 * nor->page_size turns out to be greater than PAGE_SIZE (which
b35b9a10362d20 Boris Brezillon 2019-08-06 5472 * shouldn't happen before long since NOR pages are usually less
b35b9a10362d20 Boris Brezillon 2019-08-06 5473 * than 1KB) after spi_nor_scan() returns.
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5474 */
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5475 nor->bouncebuf_size = PAGE_SIZE;
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5476 nor->bouncebuf = devm_kmalloc(dev, nor->bouncebuf_size,
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5477 GFP_KERNEL);
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5478 if (!nor->bouncebuf)
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5479 return -ENOMEM;
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5480
620df2497415a9 Tudor Ambarus 2019-08-24 5481 info = spi_nor_get_flash_info(nor, name);
620df2497415a9 Tudor Ambarus 2019-08-24 5482 if (IS_ERR(info))
620df2497415a9 Tudor Ambarus 2019-08-24 5483 return PTR_ERR(info);
b199489d37b21c Huang Shijie 2014-02-24 5484
b296379fef7ce9 Boris Brezillon 2018-12-06 5485 nor->info = info;
b296379fef7ce9 Boris Brezillon 2018-12-06 5486
dcc935b06f1f29 Zhuohao Lee 2019-08-28 5487 spi_nor_debugfs_init(nor, info);
dcc935b06f1f29 Zhuohao Lee 2019-08-28 5488
b199489d37b21c Huang Shijie 2014-02-24 5489 mutex_init(&nor->lock);
b199489d37b21c Huang Shijie 2014-02-24 5490
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5491 /*
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5492 * Make sure the XSR_RDY flag is set before calling
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5493 * spi_nor_wait_till_ready(). Xilinx S3AN share MFR
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5494 * with Atmel spi-nor
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5495 */
ad3bba06b63697 Boris Brezillon 2019-07-30 5496 if (info->flags & SPI_NOR_XSR_RDY)
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5497 nor->flags |= SNOR_F_READY_XSR_RDY;
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5498
dff972458acb05 Boris Brezillon 2019-08-24 5499 if (info->flags & SPI_NOR_HAS_LOCK)
dff972458acb05 Boris Brezillon 2019-08-24 5500 nor->flags |= SNOR_F_HAS_LOCK;
dff972458acb05 Boris Brezillon 2019-08-24 5501
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5502 if ((u16)JEDEC_MFR(nor->info) != SNOR_MFR_MICRON)
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5503 nor->flags |= SNOR_F_BROKEN_OCTAL_DDR;
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5504
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5505 /*
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5506 * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5507 * with the software protection bits set.
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5508 */
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5509 if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5510 JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5511 JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5512 nor->info->flags & SPI_NOR_HAS_LOCK) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5513 write_enable(nor);
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5514 write_sr(nor, 0);
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5515 if (info->flags & SST_GLOBAL_PROT_UNLK) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5516 write_enable(nor);
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5517 if (nor->spimem) {
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5518 struct spi_mem_op op =
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5519 SPI_MEM_OP(SPI_MEM_OP_CMD(GLOBAL_BLKPROT_UNLK, 1),
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5520 SPI_MEM_OP_NO_ADDR,
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5521 SPI_MEM_OP_NO_DUMMY,
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5522 SPI_MEM_OP_NO_DATA);
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5523
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5524 spi_mem_exec_op(nor->spimem, &op);
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5525 } else {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5526 /* Unlock global write protection bits */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5527 nor->write_reg(nor, GLOBAL_BLKPROT_UNLK, NULL, 0);
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5528 }
abd3edf0a1c724 Amit Kumar Mahapatra 2020-02-17 5529 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5530 spi_nor_wait_till_ready(nor);
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5531 }
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5532
1c1d8d98e1c706 Tudor Ambarus 2019-08-24 5533 /* Init flash parameters based on flash_info struct and SFDP */
1c1d8d98e1c706 Tudor Ambarus 2019-08-24 5534 spi_nor_init_params(nor);
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5535
32f1b7c8352fd3 Rafał Miłecki 2014-09-28 5536 if (!mtd->name)
b199489d37b21c Huang Shijie 2014-02-24 5537 mtd->name = dev_name(dev);
c9ec3900abf279 Brian Norris 2015-08-13 5538 mtd->priv = nor;
b199489d37b21c Huang Shijie 2014-02-24 5539 mtd->type = MTD_NORFLASH;
b199489d37b21c Huang Shijie 2014-02-24 5540 mtd->writesize = 1;
b199489d37b21c Huang Shijie 2014-02-24 5541 mtd->flags = MTD_CAP_NORFLASH;
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5542 mtd->size = params->size;
b199489d37b21c Huang Shijie 2014-02-24 5543 mtd->_erase = spi_nor_erase;
b199489d37b21c Huang Shijie 2014-02-24 5544 mtd->_read = spi_nor_read;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5545 nor->page_size = params->page_size;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5546 #ifdef CONFIG_OF
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5547 np_spi = of_get_next_parent(np);
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5548 if (((of_property_match_string(np_spi, "compatible",
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5549 "xlnx,zynq-qspi-1.0") >= 0) ||
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5550 (of_property_match_string(np_spi, "compatible",
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5551 "xlnx,zynqmp-qspi-1.0") >= 0)) ||
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5552 (of_property_match_string(np_spi, "compatible",
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5553 "xlnx,versal-qspi-1.0") >= 0)) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5554 if (of_property_read_u32(np_spi, "is-dual",
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5555 &is_dual) < 0) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5556 /* Default to single if prop not defined */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5557 nor->shift = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5558 nor->isstacked = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5559 nor->isparallel = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5560 } else {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5561 if (is_dual == 1) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5562 /* dual parallel */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5563 nor->shift = 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5564 info->sector_size <<= nor->shift;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5565 info->page_size <<= nor->shift;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5566 mtd->size <<= nor->shift;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5567 nor->isparallel = 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5568 nor->isstacked = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5569 nor->spi->master->flags |=
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5570 (SPI_MASTER_DATA_STRIPE
e48e22ba9df304 Amit Kumar Mahapatra 2020-01-19 5571 | SPI_MASTER_BOTH_CS);
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5572 } else {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5573 #ifdef CONFIG_SPI_ZYNQ_QSPI_DUAL_STACKED
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5574 /* dual stacked */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5575 nor->shift = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5576 mtd->size <<= 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5577 info->n_sectors <<= 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5578 nor->isstacked = 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5579 nor->isparallel = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5580 #else
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5581 u32 is_stacked;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5582
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5583 if (of_property_read_u32(np_spi,
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5584 "is-stacked",
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5585 &is_stacked) < 0) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5586 is_stacked = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5587 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5588 if (is_stacked) {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5589 /* dual stacked */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5590 nor->shift = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5591 mtd->size <<= 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5592 info->n_sectors <<= 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5593 nor->isstacked = 1;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5594 nor->isparallel = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5595 } else {
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5596 /* single */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5597 nor->shift = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5598 nor->isstacked = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5599 nor->isparallel = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5600 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5601 #endif
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5602 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5603 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5604 }
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5605 #else
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5606 /* Default to single */
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5607 nor->shift = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5608 nor->isstacked = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5609 nor->isparallel = 0;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5610 #endif
d6084fc83c8249 Kamal Dasu 2017-08-22 5611 mtd->_resume = spi_nor_resume;
b199489d37b21c Huang Shijie 2014-02-24 5612
dff972458acb05 Boris Brezillon 2019-08-24 5613 if (nor->params.locking_ops) {
b199489d37b21c Huang Shijie 2014-02-24 5614 mtd->_lock = spi_nor_lock;
b199489d37b21c Huang Shijie 2014-02-24 5615 mtd->_unlock = spi_nor_unlock;
5bf0e69b67a560 Brian Norris 2015-09-01 5616 mtd->_is_locked = spi_nor_is_locked;
b199489d37b21c Huang Shijie 2014-02-24 5617 }
b199489d37b21c Huang Shijie 2014-02-24 5618
b199489d37b21c Huang Shijie 2014-02-24 5619 /* sst nor chips use AAI word program */
b199489d37b21c Huang Shijie 2014-02-24 5620 if (info->flags & SST_WRITE)
b199489d37b21c Huang Shijie 2014-02-24 5621 mtd->_write = sst_write;
b199489d37b21c Huang Shijie 2014-02-24 5622 else
b199489d37b21c Huang Shijie 2014-02-24 5623 mtd->_write = spi_nor_write;
b199489d37b21c Huang Shijie 2014-02-24 5624
51983b7dcf3a50 Brian Norris 2014-09-10 5625 if (info->flags & USE_FSR)
51983b7dcf3a50 Brian Norris 2014-09-10 5626 nor->flags |= SNOR_F_USE_FSR;
3dd8012a8eeb37 Brian Norris 2016-01-29 5627 if (info->flags & SPI_NOR_HAS_TB)
3dd8012a8eeb37 Brian Norris 2016-01-29 5628 nor->flags |= SNOR_F_HAS_SR_TB;
2f5ad7f0f3e167 mar.krzeminski 2017-01-06 5629 if (info->flags & NO_CHIP_ERASE)
2f5ad7f0f3e167 mar.krzeminski 2017-01-06 5630 nor->flags |= SNOR_F_NO_OP_CHIP_ERASE;
c4b3eacc1dfef5 Alexander Sverdlin 2017-07-17 5631 if (info->flags & USE_CLSR)
c4b3eacc1dfef5 Alexander Sverdlin 2017-07-17 5632 nor->flags |= SNOR_F_USE_CLSR;
c14deddec1fbd8 grmoore(a)altera.com 2014-04-29 5633
b199489d37b21c Huang Shijie 2014-02-24 5634 if (info->flags & SPI_NOR_NO_ERASE)
b199489d37b21c Huang Shijie 2014-02-24 5635 mtd->flags |= MTD_NO_ERASE;
b199489d37b21c Huang Shijie 2014-02-24 5636
b199489d37b21c Huang Shijie 2014-02-24 5637 mtd->dev.parent = dev;
4a15e396e500a0 Amit Kumar Mahapatra 2020-01-19 5638 nor->jedec_id = info->id[0];
b199489d37b21c Huang Shijie 2014-02-24 5639 mtd->writebufsize = nor->page_size;
b199489d37b21c Huang Shijie 2014-02-24 5640
bb276262e88dae Brian Norris 2018-07-27 5641 if (of_property_read_bool(np, "broken-flash-reset"))
bb276262e88dae Brian Norris 2018-07-27 5642 nor->flags |= SNOR_F_BROKEN_RESET;
bb276262e88dae Brian Norris 2018-07-27 5643
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5644 /*
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5645 * Configure the SPI memory:
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5646 * - select op codes for (Fast) Read, Page Program and Sector Erase.
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5647 * - set the number of dummy cycles (mode cycles + wait states).
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5648 * - set the SPI protocols for register and memory accesses.
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5649 */
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5650 ret = spi_nor_setup(nor, hwcaps);
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5651 if (ret)
b199489d37b21c Huang Shijie 2014-02-24 5652 return ret;
b199489d37b21c Huang Shijie 2014-02-24 5653
92094ebc385ef5 Boris Brezillon 2019-08-24 5654 if (info->flags & SPI_NOR_4B_OPCODES)
548ed6847f5303 Boris Brezillon 2018-12-06 5655 nor->flags |= SNOR_F_4B_OPCODES;
548ed6847f5303 Boris Brezillon 2018-12-06 5656
696ce50f4e9377 Tudor Ambarus 2019-08-24 5657 ret = spi_nor_set_addr_width(nor);
696ce50f4e9377 Tudor Ambarus 2019-08-24 5658 if (ret)
696ce50f4e9377 Tudor Ambarus 2019-08-24 5659 return ret;
c67cbb839da9cc Brian Norris 2015-11-10 5660
46dde01f6bab35 Kamal Dasu 2017-08-22 5661 /* Send all the required SPI flash commands to initialize device */
46dde01f6bab35 Kamal Dasu 2017-08-22 5662 ret = spi_nor_init(nor);
46dde01f6bab35 Kamal Dasu 2017-08-22 5663 if (ret)
46dde01f6bab35 Kamal Dasu 2017-08-22 5664 return ret;
46dde01f6bab35 Kamal Dasu 2017-08-22 5665
06bb6f5a69dfc5 Rafał Miłecki 2015-08-10 5666 dev_info(dev, "%s (%lld Kbytes)\n", info->name,
b199489d37b21c Huang Shijie 2014-02-24 5667 (long long)mtd->size >> 10);
b199489d37b21c Huang Shijie 2014-02-24 5668
b199489d37b21c Huang Shijie 2014-02-24 5669 dev_dbg(dev,
b199489d37b21c Huang Shijie 2014-02-24 5670 "mtd .name = %s, .size = 0x%llx (%lldMiB), "
b199489d37b21c Huang Shijie 2014-02-24 5671 ".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
b199489d37b21c Huang Shijie 2014-02-24 5672 mtd->name, (long long)mtd->size, (long long)(mtd->size >> 20),
b199489d37b21c Huang Shijie 2014-02-24 5673 mtd->erasesize, mtd->erasesize / 1024, mtd->numeraseregions);
b199489d37b21c Huang Shijie 2014-02-24 5674
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5675 if (hwcaps->mask & (SNOR_HWCAPS_READ_8_8_8 | SNOR_HWCAPS_PP_8_8_8)) {
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5676 if (!(nor->flags & SNOR_F_BROKEN_OCTAL_DDR)) {
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5677 ret = spi_nor_switch_micron_octal_ddr(nor);
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5678 if (ret)
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5679 return ret;
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5680 }
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5681 }
bc9834d82ffb13 Sai Krishna Potthuri 2019-12-26 5682
b199489d37b21c Huang Shijie 2014-02-24 5683 if (mtd->numeraseregions)
b199489d37b21c Huang Shijie 2014-02-24 5684 for (i = 0; i < mtd->numeraseregions; i++)
b199489d37b21c Huang Shijie 2014-02-24 5685 dev_dbg(dev,
b199489d37b21c Huang Shijie 2014-02-24 5686 "mtd.eraseregions[%d] = { .offset = 0x%llx, "
b199489d37b21c Huang Shijie 2014-02-24 5687 ".erasesize = 0x%.8x (%uKiB), "
b199489d37b21c Huang Shijie 2014-02-24 5688 ".numblocks = %d }\n",
b199489d37b21c Huang Shijie 2014-02-24 5689 i, (long long)mtd->eraseregions[i].offset,
b199489d37b21c Huang Shijie 2014-02-24 5690 mtd->eraseregions[i].erasesize,
b199489d37b21c Huang Shijie 2014-02-24 5691 mtd->eraseregions[i].erasesize / 1024,
b199489d37b21c Huang Shijie 2014-02-24 5692 mtd->eraseregions[i].numblocks);
b199489d37b21c Huang Shijie 2014-02-24 5693 return 0;
b199489d37b21c Huang Shijie 2014-02-24 5694 }
b61834b0d0ed50 Brian Norris 2014-04-08 5695 EXPORT_SYMBOL_GPL(spi_nor_scan);
b199489d37b21c Huang Shijie 2014-02-24 5696
:::::: The code at line 5455 was first introduced by commit
:::::: 4a15e396e500a03a854a3a7de0b8df38af2dcf9d mtd: spi-nor: Add dual parallel and stacked support for Zynq QSPI controller
:::::: TO: Amit Kumar Mahapatra <amit.kumar-mahapatra(a)xilinx.com>
:::::: CC: Michal Simek <michal.simek(a)xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
[hch-block:bio_alloc 4/12] fs/f2fs/data.c:389:7: warning: Possible null pointer dereference: sector
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Christoph Hellwig <hch(a)lst.de>
tree: git://git.infradead.org/users/hch/block.git bio_alloc
head: 6fd853692c2ff61b179fd7b8bcc098c8ade12915
commit: c5178eb0f208fb3db41ee40735d67de16dbe22d5 [4/12] f2fs: refactor f2fs_target_device
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> fs/ocfs2/cluster/heartbeat.c:1618:9: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
return sprintf(page, "%dn", to_o2hb_region(item)->hr_blocks);
^
fs/f2fs/data.c:1827:11: warning: Redundant condition: If 'err == 1', the comparison 'err' is always true. [redundantCondition]
if (err || err == 1)
^
>> fs/f2fs/data.c:389:7: warning: Possible null pointer dereference: sector [nullPointer]
if (*sector)
^
fs/f2fs/data.c:716:62: note: Calling function 'f2fs_target_device', 3rd argument 'NULL' value is 0
return bio->bi_bdev == f2fs_target_device(sbi, cur_blkaddr, NULL);
^
fs/f2fs/data.c:389:7: note: Null pointer dereference
if (*sector)
^
fs/f2fs/f2fs.h:2221:15: warning: Local variable valid_node_count shadows outer function [shadowFunction]
unsigned int valid_node_count, user_block_count;
^
fs/f2fs/f2fs.h:2317:28: note: Shadowed declaration
static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
^
fs/f2fs/f2fs.h:2221:15: note: Shadow variable
unsigned int valid_node_count, user_block_count;
^
vim +389 fs/f2fs/data.c
93dfe2ac516250 Jaegeuk Kim 2013-11-30 372
3c62be17d4f562 Jaegeuk Kim 2016-10-06 373 struct block_device *f2fs_target_device(struct f2fs_sb_info *sbi,
c5178eb0f208fb Christoph Hellwig 2021-01-25 374 block_t blk_addr, sector_t *sector)
3c62be17d4f562 Jaegeuk Kim 2016-10-06 375 {
3c62be17d4f562 Jaegeuk Kim 2016-10-06 376 struct block_device *bdev = sbi->sb->s_bdev;
3c62be17d4f562 Jaegeuk Kim 2016-10-06 377 int i;
3c62be17d4f562 Jaegeuk Kim 2016-10-06 378
0916878da35565 Damien Le Moal 2019-03-16 379 if (f2fs_is_multi_device(sbi)) {
3c62be17d4f562 Jaegeuk Kim 2016-10-06 380 for (i = 0; i < sbi->s_ndevs; i++) {
3c62be17d4f562 Jaegeuk Kim 2016-10-06 381 if (FDEV(i).start_blk <= blk_addr &&
3c62be17d4f562 Jaegeuk Kim 2016-10-06 382 FDEV(i).end_blk >= blk_addr) {
3c62be17d4f562 Jaegeuk Kim 2016-10-06 383 blk_addr -= FDEV(i).start_blk;
3c62be17d4f562 Jaegeuk Kim 2016-10-06 384 break;
3c62be17d4f562 Jaegeuk Kim 2016-10-06 385 }
3c62be17d4f562 Jaegeuk Kim 2016-10-06 386 }
0916878da35565 Damien Le Moal 2019-03-16 387 }
c5178eb0f208fb Christoph Hellwig 2021-01-25 388
c5178eb0f208fb Christoph Hellwig 2021-01-25 @389 if (*sector)
c5178eb0f208fb Christoph Hellwig 2021-01-25 390 *sector = SECTOR_FROM_BLOCK(blk_addr);
3c62be17d4f562 Jaegeuk Kim 2016-10-06 391 return bdev;
3c62be17d4f562 Jaegeuk Kim 2016-10-06 392 }
3c62be17d4f562 Jaegeuk Kim 2016-10-06 393
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Kees Cook <keescook(a)chromium.org>
CC: Chao Yu <yuchao0(a)huawei.com>, Chao Yu <chao(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: bec4c2968fce2f44ce62d05288a633cd99a722eb
commit: 3f649ab728cda8038259d8f14492fe400fbab911 treewide: Remove uninitialized_var() usage
date: 7 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 7 months ago
config: x86_64-randconfig-m001-20210129 (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(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:642 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:644 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
Old smatch warnings:
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:649 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuehi'.
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:650 _rtl92cu_init_chipn_two_out_ep_priority() error: uninitialized symbol 'valuelow'.
vim +/valuelow +642 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 615
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 616 static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 617 bool wmm_enable,
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 618 u8 queue_sel)
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 619 {
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 620 u16 beq, bkq, viq, voq, mgtq, hiq;
3f649ab728cda8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Kees Cook 2020-06-03 621 u16 valuehi;
3f649ab728cda8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Kees Cook 2020-06-03 622 u16 valuelow;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 623
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 624 switch (queue_sel) {
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 625 case (TX_SELE_HQ | TX_SELE_LQ):
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 626 valuehi = QUEUE_HIGH;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 627 valuelow = QUEUE_LOW;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 628 break;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 629 case (TX_SELE_NQ | TX_SELE_LQ):
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 630 valuehi = QUEUE_NORMAL;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 631 valuelow = QUEUE_LOW;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 632 break;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 633 case (TX_SELE_HQ | TX_SELE_NQ):
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 634 valuehi = QUEUE_HIGH;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 635 valuelow = QUEUE_NORMAL;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 636 break;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 637 default:
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 638 WARN_ON(1);
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 639 break;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 640 }
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 641 if (!wmm_enable) {
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 @642 beq = valuelow;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 643 bkq = valuelow;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 @644 viq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 645 voq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 646 mgtq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 647 hiq = valuehi;
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 648 } else {/* for WMM ,CONFIG_OUT_EP_WIFI_MODE */
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 649 beq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 650 bkq = valuelow;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 651 viq = valuelow;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 652 voq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 653 mgtq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 654 hiq = valuehi;
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 655 }
ff9704538e6dd8 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c Larry Finger 2019-02-14 656 _rtl92c_init_chipn_reg_priority(hw, beq, bkq, viq, voq, mgtq, hiq);
292b11926fec13 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c Joe Perches 2011-07-20 657 pr_info("Tx queue select: 0x%02x\n", queue_sel);
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 658 }
dc0313f4666419 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c George 2011-02-19 659
:::::: The code at line 642 was first introduced by commit
:::::: ff9704538e6dd8d652e98317ab3dc06c7a017e58 rtlwifi: rtl8192{c,u}: Remove CamelCase variables
:::::: TO: Larry Finger <Larry.Finger(a)lwfinger.net>
:::::: CC: Kalle Valo <kvalo(a)codeaurora.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 month