block/bfq-cgroup.c:670:6: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
by kernel test robot
::::::
:::::: Manual check reason: "low confidence static check warning: block/bfq-cgroup.c:670:6: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]"
::::::
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Paolo Valente <paolo.valente(a)linaro.org>
CC: Jens Axboe <axboe(a)kernel.dk>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1a0e93df1e107dc766fdf86ae88076efd9f376e6
commit: d29bd41428cfff9b582c248db14a47e2be8457a8 block, bfq: reset last_bfqq_created on group change
date: 9 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 9 months ago
config: arm-randconfig-c002-20220625 (https://download.01.org/0day-ci/archive/20220701/202207010623.OxutEnVC-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 42a7ddb428c999229491b0effbb1a4059149fba8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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 d29bd41428cfff9b582c248db14a47e2be8457a8
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
fs/hfs/bnode.c:381:6: note: Assuming the condition is false
if (off != sizeof(struct hfs_bnode_desc))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:381:2: note: Taking false branch
if (off != sizeof(struct hfs_bnode_desc))
^
fs/hfs/bnode.c:383:14: note: Assuming 'i' is <= field 'num_recs'
for (i = 1; i <= node->num_recs; off = next_off, i++) {
^~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:383:2: note: Loop condition is true. Entering loop body
for (i = 1; i <= node->num_recs; off = next_off, i++) {
^
fs/hfs/bnode.c:386:7: note: Assuming 'next_off' is > 'off'
if (next_off <= off ||
^~~~~~~~~~~~~~~
fs/hfs/bnode.c:386:7: note: Left side of '||' is false
fs/hfs/bnode.c:387:7: note: Assuming 'next_off' is <= field 'node_size'
next_off > tree->node_size ||
^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:386:7: note: Left side of '||' is false
if (next_off <= off ||
^
fs/hfs/bnode.c:388:7: note: Assuming the condition is false
next_off & 1)
^~~~~~~~~~~~
fs/hfs/bnode.c:386:3: note: Taking false branch
if (next_off <= off ||
^
fs/hfs/bnode.c:391:13: note: Field 'type' is equal to HFS_NODE_INDEX
if (node->type != HFS_NODE_INDEX &&
^
fs/hfs/bnode.c:391:36: note: Left side of '&&' is false
if (node->type != HFS_NODE_INDEX &&
^
fs/hfs/bnode.c:394:14: note: Calling 'hfs_bnode_read_u8'
key_size = hfs_bnode_read_u8(node, off) + 1;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:55:2: note: 'data' declared without an initial value
u8 data;
^~~~~~~
fs/hfs/bnode.c:57:2: note: Calling 'hfs_bnode_read'
hfs_bnode_read(node, &data, off, 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:30:2: note: Loop condition is true. Entering loop body
for (bytes_read = 0; bytes_read < len; bytes_read += bytes_to_read) {
^
fs/hfs/bnode.c:31:7: note: Assuming 'pagenum' is >= field 'pages_per_bnode'
if (pagenum >= node->tree->pages_per_bnode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:31:3: note: Taking true branch
if (pagenum >= node->tree->pages_per_bnode)
^
fs/hfs/bnode.c:32:4: note: Execution continues on line 31
break;
^
fs/hfs/bnode.c:43:1: note: Returning without writing to '*buf'
}
^
fs/hfs/bnode.c:57:2: note: Returning from 'hfs_bnode_read'
hfs_bnode_read(node, &data, off, 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:58:2: note: Undefined or garbage value returned to caller
return data;
^ ~~~~
fs/hfs/bnode.c:179:4: warning: Value stored to 'tmp' is never read [clang-analyzer-deadcode.DeadStores]
tmp = hfs_bnode_read_u8(node, key_off);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/hfs/bnode.c:179:4: note: Value stored to 'tmp' is never read
tmp = hfs_bnode_read_u8(node, key_off);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 7 warnings (7 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
block/bfq-wf2q.c:263:7: warning: Access to field 'my_sched_data' results in a dereference of a null pointer (loaded from variable 'entity') [clang-analyzer-core.NullDereference]
if (!entity->my_sched_data)
^
block/bfq-wf2q.c:1508:2: note: 'entity' initialized to a null pointer value
struct bfq_entity *entity = NULL;
^~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-wf2q.c:1512:6: note: Assuming the condition is false
if (bfq_tot_busy_queues(bfqd) == 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-wf2q.c:1512:2: note: Taking false branch
if (bfq_tot_busy_queues(bfqd) == 0)
^
block/bfq-wf2q.c:1521:2: note: Loop condition is false. Execution continues on line 1582
for (; sd ; sd = entity->my_sched_data) {
^
block/bfq-wf2q.c:1582:28: note: Passing null pointer value via 1st parameter 'entity'
bfqq = bfq_entity_to_bfqq(entity);
^~~~~~
block/bfq-wf2q.c:1582:9: note: Calling 'bfq_entity_to_bfqq'
bfqq = bfq_entity_to_bfqq(entity);
^~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-wf2q.c:263:7: note: Access to field 'my_sched_data' results in a dereference of a null pointer (loaded from variable 'entity')
if (!entity->my_sched_data)
^~~~~~
Suppressed 8 warnings (8 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
>> block/bfq-cgroup.c:670:6: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
entity->parent->last_bfqq_created == bfqq)
^
block/bfq-cgroup.c:892:2: note: Loop condition is false. Exiting loop
spin_lock_irqsave(&bfqd->lock, flags);
^
include/linux/spinlock.h:393:2: note: expanded from macro 'spin_lock_irqsave'
raw_spin_lock_irqsave(spinlock_check(lock), flags); \
^
include/linux/spinlock.h:254:2: note: expanded from macro 'raw_spin_lock_irqsave'
do { \
^
block/bfq-cgroup.c:892:2: note: Loop condition is false. Exiting loop
spin_lock_irqsave(&bfqd->lock, flags);
^
include/linux/spinlock.h:391:43: note: expanded from macro 'spin_lock_irqsave'
#define spin_lock_irqsave(lock, flags) \
^
block/bfq-cgroup.c:894:6: note: Assuming 'entity' is non-null
if (!entity) /* root group */
^~~~~~~
block/bfq-cgroup.c:894:2: note: Taking false branch
if (!entity) /* root group */
^
block/bfq-cgroup.c:901:2: note: Loop condition is true. Entering loop body
for (i = 0; i < BFQ_IOPRIO_CLASSES; i++) {
^
block/bfq-cgroup.c:916:3: note: Calling 'bfq_reparent_active_queues'
bfq_reparent_active_queues(bfqd, bfqg, st, i);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-cgroup.c:866:2: note: Loop condition is true. Entering loop body
while ((entity = bfq_entity_of(rb_first(active))))
^
block/bfq-cgroup.c:867:3: note: Calling 'bfq_reparent_leaf_entity'
bfq_reparent_leaf_entity(bfqd, entity, ioprio_class);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-cgroup.c:836:2: note: Loop condition is false. Execution continues on line 848
while (child_entity->my_sched_data) { /* leaf not reached yet */
^
block/bfq-cgroup.c:849:2: note: Calling 'bfq_bfqq_move'
bfq_bfqq_move(bfqd, bfqq, bfqd->root_group);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-cgroup.c:659:6: note: Assuming 'bfqq' is not equal to field 'in_service_queue'
if (bfqq == bfqd->in_service_queue)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/bfq-cgroup.c:659:2: note: Taking false branch
if (bfqq == bfqd->in_service_queue)
^
block/bfq-cgroup.c:663:6: note: Assuming the condition is true
if (bfq_bfqq_busy(bfqq))
^~~~~~~~~~~~~~~~~~~
block/bfq-cgroup.c:663:2: note: Taking true branch
if (bfq_bfqq_busy(bfqq))
^
block/bfq-cgroup.c:667:20: note: Calling 'bfqq_group'
bfqg_and_blkg_put(bfqq_group(bfqq));
^~~~~~~~~~~~~~~~
block/bfq-cgroup.c:312:9: note: Assuming 'group_entity' is non-null
return group_entity ? container_of(group_entity, struct bfq_group,
^~~~~~~~~~~~
block/bfq-cgroup.c:312:9: note: '?' condition is true
block/bfq-cgroup.c:312:24: note: Left side of '&&' is false
return group_entity ? container_of(group_entity, struct bfq_group,
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
block/bfq-cgroup.c:312:24: note: Taking false branch
return group_entity ? container_of(group_entity, struct bfq_group,
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
block/bfq-cgroup.c:312:24: note: Loop condition is false. Exiting loop
return group_entity ? container_of(group_entity, struct bfq_group,
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
vim +670 block/bfq-cgroup.c
ea25da48086d3b Paolo Valente 2017-04-19 627
ea25da48086d3b Paolo Valente 2017-04-19 628 /**
ea25da48086d3b Paolo Valente 2017-04-19 629 * bfq_bfqq_move - migrate @bfqq to @bfqg.
ea25da48086d3b Paolo Valente 2017-04-19 630 * @bfqd: queue descriptor.
ea25da48086d3b Paolo Valente 2017-04-19 631 * @bfqq: the queue to move.
ea25da48086d3b Paolo Valente 2017-04-19 632 * @bfqg: the group to move to.
ea25da48086d3b Paolo Valente 2017-04-19 633 *
ea25da48086d3b Paolo Valente 2017-04-19 634 * Move @bfqq to @bfqg, deactivating it from its old group and reactivating
ea25da48086d3b Paolo Valente 2017-04-19 635 * it on the new one. Avoid putting the entity on the old group idle tree.
ea25da48086d3b Paolo Valente 2017-04-19 636 *
8f9bebc33dd718 Paolo Valente 2017-06-05 637 * Must be called under the scheduler lock, to make sure that the blkg
8f9bebc33dd718 Paolo Valente 2017-06-05 638 * owning @bfqg does not disappear (see comments in
8f9bebc33dd718 Paolo Valente 2017-06-05 639 * bfq_bic_update_cgroup on guaranteeing the consistency of blkg
8f9bebc33dd718 Paolo Valente 2017-06-05 640 * objects).
ea25da48086d3b Paolo Valente 2017-04-19 641 */
ea25da48086d3b Paolo Valente 2017-04-19 642 void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
ea25da48086d3b Paolo Valente 2017-04-19 643 struct bfq_group *bfqg)
ea25da48086d3b Paolo Valente 2017-04-19 644 {
ea25da48086d3b Paolo Valente 2017-04-19 645 struct bfq_entity *entity = &bfqq->entity;
ea25da48086d3b Paolo Valente 2017-04-19 646
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 647 /*
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 648 * Get extra reference to prevent bfqq from being freed in
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 649 * next possible expire or deactivate.
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 650 */
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 651 bfqq->ref++;
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 652
ea25da48086d3b Paolo Valente 2017-04-19 653 /* If bfqq is empty, then bfq_bfqq_expire also invokes
ea25da48086d3b Paolo Valente 2017-04-19 654 * bfq_del_bfqq_busy, thereby removing bfqq and its entity
ea25da48086d3b Paolo Valente 2017-04-19 655 * from data structures related to current group. Otherwise we
ea25da48086d3b Paolo Valente 2017-04-19 656 * need to remove bfqq explicitly with bfq_deactivate_bfqq, as
ea25da48086d3b Paolo Valente 2017-04-19 657 * we do below.
ea25da48086d3b Paolo Valente 2017-04-19 658 */
ea25da48086d3b Paolo Valente 2017-04-19 659 if (bfqq == bfqd->in_service_queue)
ea25da48086d3b Paolo Valente 2017-04-19 660 bfq_bfqq_expire(bfqd, bfqd->in_service_queue,
ea25da48086d3b Paolo Valente 2017-04-19 661 false, BFQQE_PREEMPTED);
ea25da48086d3b Paolo Valente 2017-04-19 662
ea25da48086d3b Paolo Valente 2017-04-19 663 if (bfq_bfqq_busy(bfqq))
ea25da48086d3b Paolo Valente 2017-04-19 664 bfq_deactivate_bfqq(bfqd, bfqq, false, false);
33a16a9804688b Paolo Valente 2020-02-03 665 else if (entity->on_st_or_in_serv)
ea25da48086d3b Paolo Valente 2017-04-19 666 bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);
8f9bebc33dd718 Paolo Valente 2017-06-05 667 bfqg_and_blkg_put(bfqq_group(bfqq));
ea25da48086d3b Paolo Valente 2017-04-19 668
d29bd41428cfff Paolo Valente 2021-10-15 669 if (entity->parent &&
d29bd41428cfff Paolo Valente 2021-10-15 @670 entity->parent->last_bfqq_created == bfqq)
d29bd41428cfff Paolo Valente 2021-10-15 671 entity->parent->last_bfqq_created = NULL;
d29bd41428cfff Paolo Valente 2021-10-15 672 else if (bfqd->last_bfqq_created == bfqq)
d29bd41428cfff Paolo Valente 2021-10-15 673 bfqd->last_bfqq_created = NULL;
d29bd41428cfff Paolo Valente 2021-10-15 674
ea25da48086d3b Paolo Valente 2017-04-19 675 entity->parent = bfqg->my_entity;
ea25da48086d3b Paolo Valente 2017-04-19 676 entity->sched_data = &bfqg->sched_data;
8f9bebc33dd718 Paolo Valente 2017-06-05 677 /* pin down bfqg and its associated blkg */
8f9bebc33dd718 Paolo Valente 2017-06-05 678 bfqg_and_blkg_get(bfqg);
ea25da48086d3b Paolo Valente 2017-04-19 679
ea25da48086d3b Paolo Valente 2017-04-19 680 if (bfq_bfqq_busy(bfqq)) {
8cacc5ab3eacf5 Paolo Valente 2019-03-12 681 if (unlikely(!bfqd->nonrot_with_queueing))
ea25da48086d3b Paolo Valente 2017-04-19 682 bfq_pos_tree_add_move(bfqd, bfqq);
ea25da48086d3b Paolo Valente 2017-04-19 683 bfq_activate_bfqq(bfqd, bfqq);
ea25da48086d3b Paolo Valente 2017-04-19 684 }
ea25da48086d3b Paolo Valente 2017-04-19 685
ea25da48086d3b Paolo Valente 2017-04-19 686 if (!bfqd->in_service_queue && !bfqd->rq_in_driver)
ea25da48086d3b Paolo Valente 2017-04-19 687 bfq_schedule_dispatch(bfqd);
fd1bb3ae54a9a2 Paolo Valente 2020-03-21 688 /* release extra ref taken above, bfqq may happen to be freed now */
ecedd3d7e19911 Paolo Valente 2020-02-03 689 bfq_put_queue(bfqq);
ea25da48086d3b Paolo Valente 2017-04-19 690 }
ea25da48086d3b Paolo Valente 2017-04-19 691
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
drivers/memory/tegra/tegra20-emc.c:645:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/memory/tegra/tegra20-emc.c:645:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]"
::::::
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Dmitry Osipenko <digetx(a)gmail.com>
CC: Krzysztof Kozlowski <krzk(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d9b2ba67917c18822c6a09af41c32fa161f1606b
commit: 131dd9a436d8f6dbaf3d9597803765d271b2fc19 memory: tegra20-emc: Support matching timings by LPDDR2 configuration
date: 9 months ago
:::::: branch date: 27 hours ago
:::::: commit date: 9 months ago
config: arm-randconfig-c002-20220629 (https://download.01.org/0day-ci/archive/20220701/202207010353.iBNLJYzv-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a774ba7f60d1fef403b5507b1b1a7475d3684d71)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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 131dd9a436d8f6dbaf3d9597803765d271b2fc19
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
drivers/hwtracing/coresight/coresight-config.c:206:4: note: Value stored to 'name' is never read
name = feat_csdev->feat_desc->params_desc[j].name;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-config.c:234:3: warning: Value stored to 'csdev' is never read [clang-analyzer-deadcode.DeadStores]
csdev = feat_csdev->csdev;
^ ~~~~~~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-config.c:234:3: note: Value stored to 'csdev' is never read
csdev = feat_csdev->csdev;
^ ~~~~~~~~~~~~~~~~~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/usb/gadget/udc/bdc/bdc_udc.c:282:2: warning: Value stored to 'uspc' is never read [clang-analyzer-deadcode.DeadStores]
uspc &= (~BDC_USPSC_RW);
^ ~~~~~~~~~~~~~~~
drivers/usb/gadget/udc/bdc/bdc_udc.c:282:2: note: Value stored to 'uspc' is never read
uspc &= (~BDC_USPSC_RW);
^ ~~~~~~~~~~~~~~~
drivers/usb/gadget/udc/bdc/bdc_udc.c:349:2: warning: Value stored to 'srr_int' is never read [clang-analyzer-deadcode.DeadStores]
srr_int = bdc_readl(bdc->regs, BDC_SRRINT(0));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/udc/bdc/bdc_udc.c:349:2: note: Value stored to 'srr_int' is never read
srr_int = bdc_readl(bdc->regs, BDC_SRRINT(0));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/udc/bdc/bdc_udc.c:500:2: warning: Value stored to 'link_state' is never read [clang-analyzer-deadcode.DeadStores]
link_state = BDC_PST(uspc);
^
drivers/usb/gadget/udc/bdc/bdc_udc.c:500:2: note: Value stored to 'link_state' is never read
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
drivers/rtc/rtc-pcf2127.c:686:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = devm_rtc_nvmem_register(pcf2127->rtc, &nvmem_cfg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-pcf2127.c:686:3: note: Value stored to 'ret' is never read
ret = devm_rtc_nvmem_register(pcf2127->rtc, &nvmem_cfg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/mtd/mtdconcat.c:67:4: warning: Value stored to 'size' is never read [clang-analyzer-deadcode.DeadStores]
size = 0;
^ ~
drivers/mtd/mtdconcat.c:67:4: note: Value stored to 'size' is never read
size = 0;
^ ~
drivers/mtd/mtdconcat.c:159:4: warning: Value stored to 'size' is never read [clang-analyzer-deadcode.DeadStores]
size = 0;
^ ~
drivers/mtd/mtdconcat.c:159:4: note: Value stored to 'size' is never read
size = 0;
^ ~
drivers/mtd/mtdconcat.c:492:4: warning: Value stored to 'size' is never read [clang-analyzer-deadcode.DeadStores]
size = 0;
^ ~
drivers/mtd/mtdconcat.c:492:4: note: Value stored to 'size' is never read
size = 0;
^ ~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> drivers/memory/tegra/tegra20-emc.c:645:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]
dram_type_str = "INVALID";
^ ~~~~~~~~~
drivers/memory/tegra/tegra20-emc.c:645:3: note: Value stored to 'dram_type_str' is never read
dram_type_str = "INVALID";
^ ~~~~~~~~~
drivers/memory/tegra/tegra20-emc.c:648:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]
dram_type_str = "DDR1";
^ ~~~~~~
drivers/memory/tegra/tegra20-emc.c:648:3: note: Value stored to 'dram_type_str' is never read
dram_type_str = "DDR1";
^ ~~~~~~
drivers/memory/tegra/tegra20-emc.c:651:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]
dram_type_str = "LPDDR2";
^ ~~~~~~~~
drivers/memory/tegra/tegra20-emc.c:651:3: note: Value stored to 'dram_type_str' is never read
dram_type_str = "LPDDR2";
^ ~~~~~~~~
drivers/memory/tegra/tegra20-emc.c:654:3: warning: Value stored to 'dram_type_str' is never read [clang-analyzer-deadcode.DeadStores]
dram_type_str = "DDR2";
^ ~~~~~~
drivers/memory/tegra/tegra20-emc.c:654:3: note: Value stored to 'dram_type_str' is never read
dram_type_str = "DDR2";
^ ~~~~~~
1 warning generated.
drivers/fpga/altera-pr-ip-core.c:188:2: warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores]
val = readl(priv->reg_base + ALT_PR_CSR_OFST);
^
drivers/fpga/altera-pr-ip-core.c:188:2: note: Value stored to 'val' is never read
2 warnings generated.
drivers/fpga/altera-freeze-bridge.c:69:4: warning: Value stored to 'ctrl' is never read [clang-analyzer-deadcode.DeadStores]
ctrl = readl(priv->base_addr + FREEZE_CSR_CTRL_OFFSET);
^
drivers/fpga/altera-freeze-bridge.c:69:4: note: Value stored to 'ctrl' is never read
drivers/fpga/altera-freeze-bridge.c:150:2: warning: Value stored to 'status' is never read [clang-analyzer-deadcode.DeadStores]
status = readl(priv->base_addr + FREEZE_CSR_STATUS_OFFSET);
^
drivers/fpga/altera-freeze-bridge.c:150:2: note: Value stored to 'status' is never read
2 warnings generated.
Suppressed 2 warnings (1 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (1 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (1 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (1 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (1 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (1 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/media/tuners/tda18271-fe.c:473:2: warning: Value stored to 'bcal' is never read [clang-analyzer-deadcode.DeadStores]
bcal = 0;
^ ~
drivers/media/tuners/tda18271-fe.c:473:2: note: Value stored to 'bcal' is never read
bcal = 0;
^ ~
Suppressed 3 warnings (1 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/most/configfs.c:173:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(mdev_link->direction, page);
^~~~~~
drivers/most/configfs.c:173:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(mdev_link->direction, page);
^~~~~~
drivers/most/configfs.c:192:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(mdev_link->datatype, page);
^~~~~~
drivers/most/configfs.c:192:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(mdev_link->datatype, page);
^~~~~~
drivers/most/configfs.c:446:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(mdev_link->name, name);
^~~~~~
drivers/most/configfs.c:446:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(mdev_link->name, name);
^~~~~~
drivers/most/configfs.c:535:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(mdev_link->name, name);
^~~~~~
drivers/most/configfs.c:535:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(mdev_link->name, name);
^~~~~~
2 warnings generated.
drivers/most/most_usb.c:950:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = &usb_dev->dev;
^~~ ~~~~~~~~~~~~~
drivers/most/most_usb.c:950:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = &usb_dev->dev;
^~~ ~~~~~~~~~~~~~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
vim +/dram_type_str +645 drivers/memory/tegra/tegra20-emc.c
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 595
96e5da7c842424 Dmitry Osipenko 2018-10-21 596 static int emc_setup_hw(struct tegra_emc *emc)
96e5da7c842424 Dmitry Osipenko 2018-10-21 597 {
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 598 u32 emc_cfg, emc_dbg, emc_fbio, emc_adr_cfg;
adbcec8862cd7e Dmitry Osipenko 2020-03-19 599 u32 intmask = EMC_REFRESH_OVERFLOW_INT;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 600 static bool print_sdram_info_once;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 601 enum emc_dram_type dram_type;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 602 const char *dram_type_str;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 603 unsigned int emem_numdev;
96e5da7c842424 Dmitry Osipenko 2018-10-21 604
96e5da7c842424 Dmitry Osipenko 2018-10-21 605 emc_cfg = readl_relaxed(emc->regs + EMC_CFG_2);
96e5da7c842424 Dmitry Osipenko 2018-10-21 606
96e5da7c842424 Dmitry Osipenko 2018-10-21 607 /*
96e5da7c842424 Dmitry Osipenko 2018-10-21 608 * Depending on a memory type, DRAM should enter either self-refresh
96e5da7c842424 Dmitry Osipenko 2018-10-21 609 * or power-down state on EMC clock change.
96e5da7c842424 Dmitry Osipenko 2018-10-21 610 */
96e5da7c842424 Dmitry Osipenko 2018-10-21 611 if (!(emc_cfg & EMC_CLKCHANGE_PD_ENABLE) &&
96e5da7c842424 Dmitry Osipenko 2018-10-21 612 !(emc_cfg & EMC_CLKCHANGE_SR_ENABLE)) {
96e5da7c842424 Dmitry Osipenko 2018-10-21 613 dev_err(emc->dev,
96e5da7c842424 Dmitry Osipenko 2018-10-21 614 "bootloader didn't specify DRAM auto-suspend mode\n");
96e5da7c842424 Dmitry Osipenko 2018-10-21 615 return -EINVAL;
96e5da7c842424 Dmitry Osipenko 2018-10-21 616 }
96e5da7c842424 Dmitry Osipenko 2018-10-21 617
96e5da7c842424 Dmitry Osipenko 2018-10-21 618 /* enable EMC and CAR to handshake on PLL divider/source changes */
96e5da7c842424 Dmitry Osipenko 2018-10-21 619 emc_cfg |= EMC_CLKCHANGE_REQ_ENABLE;
96e5da7c842424 Dmitry Osipenko 2018-10-21 620 writel_relaxed(emc_cfg, emc->regs + EMC_CFG_2);
96e5da7c842424 Dmitry Osipenko 2018-10-21 621
96e5da7c842424 Dmitry Osipenko 2018-10-21 622 /* initialize interrupt */
96e5da7c842424 Dmitry Osipenko 2018-10-21 623 writel_relaxed(intmask, emc->regs + EMC_INTMASK);
96e5da7c842424 Dmitry Osipenko 2018-10-21 624 writel_relaxed(intmask, emc->regs + EMC_INTSTATUS);
96e5da7c842424 Dmitry Osipenko 2018-10-21 625
c72396f941fb9d Dmitry Osipenko 2019-08-12 626 /* ensure that unwanted debug features are disabled */
c72396f941fb9d Dmitry Osipenko 2019-08-12 627 emc_dbg = readl_relaxed(emc->regs + EMC_DBG);
c72396f941fb9d Dmitry Osipenko 2019-08-12 628 emc_dbg |= EMC_DBG_CFG_PRIORITY;
c72396f941fb9d Dmitry Osipenko 2019-08-12 629 emc_dbg &= ~EMC_DBG_READ_MUX_ASSEMBLY;
c72396f941fb9d Dmitry Osipenko 2019-08-12 630 emc_dbg &= ~EMC_DBG_WRITE_MUX_ACTIVE;
c72396f941fb9d Dmitry Osipenko 2019-08-12 631 emc_dbg &= ~EMC_DBG_FORCE_UPDATE;
c72396f941fb9d Dmitry Osipenko 2019-08-12 632 writel_relaxed(emc_dbg, emc->regs + EMC_DBG);
c72396f941fb9d Dmitry Osipenko 2019-08-12 633
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 634 emc_fbio = readl_relaxed(emc->regs + EMC_FBIO_CFG5);
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 635
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 636 if (emc_fbio & EMC_FBIO_CFG5_DRAM_WIDTH_X16)
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 637 emc->dram_bus_width = 16;
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 638 else
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 639 emc->dram_bus_width = 32;
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 640
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 641 dram_type = FIELD_GET(EMC_FBIO_CFG5_DRAM_TYPE, emc_fbio);
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 642
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 643 switch (dram_type) {
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 644 case DRAM_TYPE_RESERVED:
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 @645 dram_type_str = "INVALID";
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 646 break;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 647 case DRAM_TYPE_DDR1:
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 648 dram_type_str = "DDR1";
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 649 break;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 650 case DRAM_TYPE_LPDDR2:
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 651 dram_type_str = "LPDDR2";
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 652 break;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 653 case DRAM_TYPE_DDR2:
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 654 dram_type_str = "DDR2";
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 655 break;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 656 }
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 657
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 658 emc_adr_cfg = readl_relaxed(emc->regs + EMC_ADR_CFG_0);
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 659 emem_numdev = FIELD_GET(EMC_ADR_CFG_0_EMEM_NUMDEV, emc_adr_cfg) + 1;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 660
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 661 dev_info_once(emc->dev, "%ubit DRAM bus, %u %s %s attached\n",
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 662 emc->dram_bus_width, emem_numdev, dram_type_str,
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 663 emem_numdev == 2 ? "devices" : "device");
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 664
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 665 if (dram_type == DRAM_TYPE_LPDDR2) {
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 666 while (emem_numdev--)
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 667 emc_read_lpddr_sdram_info(emc, emem_numdev,
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 668 !print_sdram_info_once);
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 669 print_sdram_info_once = true;
131dd9a436d8f6 Dmitry Osipenko 2021-10-07 670 }
d5ef16ba5fbe12 Dmitry Osipenko 2020-11-04 671
96e5da7c842424 Dmitry Osipenko 2018-10-21 672 return 0;
96e5da7c842424 Dmitry Osipenko 2018-10-21 673 }
96e5da7c842424 Dmitry Osipenko 2018-10-21 674
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
arch/s390/kernel/vtime.c:148:13: sparse: sparse: too long token expansion
by kernel test robot
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: arch/s390/kernel/vtime.c:148:13: sparse: sparse: too long token expansion"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Ian Abbott <abbotti(a)mev.co.uk>
CC: 0day robot <lkp(a)intel.com>
tree: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20220624-185749/Ian...
head: cd7ada76c22048d07d7b311abf1d181d6d6fe6e2
commit: cd7ada76c22048d07d7b311abf1d181d6d6fe6e2 typecheck.h: Force a compilation error if typecheck(type,x) fails
date: 6 days ago
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: s390-randconfig-s031-20220629 (https://download.01.org/0day-ci/archive/20220701/202207010242.bHbSCpsB-lk...)
compiler: s390-linux-gcc (GCC) 11.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/cd7ada76c22048d07d7b311abf1...
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review UPDATE-20220624-185749/Ian-Abbott/typecheck-h-Force-a-compilation-error-if-typecheck-type-x-fails/20220203-223926
git checkout cd7ada76c22048d07d7b311abf1d181d6d6fe6e2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/s390/kernel/vtime.c:148:13: sparse: sparse: too long token expansion
vim +148 arch/s390/kernel/vtime.c
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 120
^1da177e4c3f41 Linus Torvalds 2005-04-16 121 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 122 * Update process times based on virtual cpu times stored by entry.S
^1da177e4c3f41 Linus Torvalds 2005-04-16 123 * to the lowcore fields user_timer, system_timer & steal_clock.
^1da177e4c3f41 Linus Torvalds 2005-04-16 124 */
8f2b468aadc81c Martin Schwidefsky 2016-12-20 125 static int do_account_vtime(struct task_struct *tsk)
^1da177e4c3f41 Linus Torvalds 2005-04-16 126 {
152e9b8676c6e7 Martin Schwidefsky 2019-03-06 127 u64 timer, clock, user, guest, system, hardirq, softirq;
^1da177e4c3f41 Linus Torvalds 2005-04-16 128
^1da177e4c3f41 Linus Torvalds 2005-04-16 129 timer = S390_lowcore.last_update_timer;
^1da177e4c3f41 Linus Torvalds 2005-04-16 130 clock = S390_lowcore.last_update_clock;
1c7673476b8298 Heiko Carstens 2021-02-02 131 /* Use STORE CLOCK by default, STORE CLOCK FAST if available. */
1c7673476b8298 Heiko Carstens 2021-02-02 132 alternative_io("stpt %0\n .insn s,0xb2050000,%1\n",
1c7673476b8298 Heiko Carstens 2021-02-02 133 "stpt %0\n .insn s,0xb27c0000,%1\n",
1c7673476b8298 Heiko Carstens 2021-02-02 134 25,
1c7673476b8298 Heiko Carstens 2021-02-02 135 ASM_OUTPUT2("=Q" (S390_lowcore.last_update_timer),
1c7673476b8298 Heiko Carstens 2021-02-02 136 "=Q" (S390_lowcore.last_update_clock)),
1c7673476b8298 Heiko Carstens 2021-02-02 137 ASM_NO_INPUT_CLOBBER("cc"));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 138 clock = S390_lowcore.last_update_clock - clock;
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 139 timer -= S390_lowcore.last_update_timer;
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 140
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 141 if (hardirq_count())
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 142 S390_lowcore.hardirq_timer += timer;
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 143 else
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 144 S390_lowcore.system_timer += timer;
^1da177e4c3f41 Linus Torvalds 2005-04-16 145
72d38b19781de4 Martin Schwidefsky 2015-09-18 146 /* Update MT utilization calculation */
f341b8dff9823a Martin Schwidefsky 2015-08-03 147 if (smp_cpu_mtid &&
72d38b19781de4 Martin Schwidefsky 2015-09-18 @148 time_after64(jiffies_64, this_cpu_read(mt_scaling_jiffies)))
72d38b19781de4 Martin Schwidefsky 2015-09-18 149 update_mt_scaling();
10ad34bc76dfbc Martin Schwidefsky 2015-01-14 150
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 151 /* Calculate cputime delta */
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 152 user = update_tsk_timer(&tsk->thread.user_timer,
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 153 READ_ONCE(S390_lowcore.user_timer));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 154 guest = update_tsk_timer(&tsk->thread.guest_timer,
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 155 READ_ONCE(S390_lowcore.guest_timer));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 156 system = update_tsk_timer(&tsk->thread.system_timer,
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 157 READ_ONCE(S390_lowcore.system_timer));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 158 hardirq = update_tsk_timer(&tsk->thread.hardirq_timer,
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 159 READ_ONCE(S390_lowcore.hardirq_timer));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 160 softirq = update_tsk_timer(&tsk->thread.softirq_timer,
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 161 READ_ONCE(S390_lowcore.softirq_timer));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 162 S390_lowcore.steal_timer +=
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 163 clock - user - guest - system - hardirq - softirq;
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 164
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 165 /* Push account value */
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 166 if (user) {
23244a5c8003d4 Frederic Weisbecker 2017-01-31 167 account_user_time(tsk, cputime_to_nsecs(user));
5613fda9a503cd Frederic Weisbecker 2017-01-31 168 tsk->utimescaled += cputime_to_nsecs(scale_vtime(user));
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 169 }
10ad34bc76dfbc Martin Schwidefsky 2015-01-14 170
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 171 if (guest) {
fb8b049c988f1f Frederic Weisbecker 2017-01-31 172 account_guest_time(tsk, cputime_to_nsecs(guest));
5613fda9a503cd Frederic Weisbecker 2017-01-31 173 tsk->utimescaled += cputime_to_nsecs(scale_vtime(guest));
10ad34bc76dfbc Martin Schwidefsky 2015-01-14 174 }
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 175
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 176 if (system)
b29e061bb7a8d2 Martin Schwidefsky 2017-05-12 177 account_system_index_scaled(tsk, system, CPUTIME_SYSTEM);
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 178 if (hardirq)
b29e061bb7a8d2 Martin Schwidefsky 2017-05-12 179 account_system_index_scaled(tsk, hardirq, CPUTIME_IRQ);
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 180 if (softirq)
b29e061bb7a8d2 Martin Schwidefsky 2017-05-12 181 account_system_index_scaled(tsk, softirq, CPUTIME_SOFTIRQ);
^1da177e4c3f41 Linus Torvalds 2005-04-16 182
b7394a5f4ce954 Martin Schwidefsky 2017-01-05 183 return virt_timer_forward(user + guest + system + hardirq + softirq);
^1da177e4c3f41 Linus Torvalds 2005-04-16 184 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 185
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
Re: [PATCH v2 17/28] KVM: VMX: Extend VMX controls macro shenanigans
by kernel test robot
::::::
:::::: Manual check reason: "commit no functional change"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220629150625.238286-18-vkuznets(a)redhat.com>
References: <20220629150625.238286-18-vkuznets(a)redhat.com>
TO: Vitaly Kuznetsov <vkuznets(a)redhat.com>
TO: kvm(a)vger.kernel.org
TO: Paolo Bonzini <pbonzini(a)redhat.com>
TO: Sean Christopherson <seanjc(a)google.com>
CC: Anirudh Rayabharam <anrayabh(a)linux.microsoft.com>
CC: Wanpeng Li <wanpengli(a)tencent.com>
CC: Jim Mattson <jmattson(a)google.com>
CC: Maxim Levitsky <mlevitsk(a)redhat.com>
CC: linux-hyperv(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi Vitaly,
I love your patch! Yet something to improve:
[auto build test ERROR on kvm/queue]
[cannot apply to tip/x86/core mst-vhost/linux-next linus/master v5.19-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Vitaly-Kuznetsov/KVM-VMX-S...
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
:::::: branch date: 20 hours ago
:::::: commit date: 20 hours ago
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220630/202206301959.fJmtKxv9-lk...)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/9c71af2ee4c61edceb5b7e478ee...
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vitaly-Kuznetsov/KVM-VMX-Support-TscScaling-and-EnclsExitingBitmap-with-eVMCS-use-vmcs_config-for-L1-VMX-MSRs/20220629-231053
git checkout 9c71af2ee4c61edceb5b7e478ee5db07b4a27bbc
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from <command-line>:
In function 'vm_entry_controls_setbit',
inlined from 'vmx_set_efer' at arch/x86/kvm/vmx/vmx.c:2903:3:
>> include/linux/compiler_types.h:352:45: error: call to '__compiletime_assert_532' declared with attribute error: BUILD_BUG_ON failed: !(val & (KVM_REQ_VMX_VM_ENTRY_CONTROLS | KVM_OPT_VMX_VM_ENTRY_CONTROLS))
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:333:25: note: in definition of macro '__compiletime_assert'
333 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:352:9: note: in expansion of macro '_compiletime_assert'
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/vmx.h:596:9: note: in expansion of macro 'BUILD_BUG_ON'
596 | BUILD_BUG_ON(!(val & (KVM_REQ_VMX_##uname | KVM_OPT_VMX_##uname))); \
| ^~~~~~~~~~~~
arch/x86/kvm/vmx/vmx.h:604:1: note: in expansion of macro 'BUILD_CONTROLS_SHADOW'
604 | BUILD_CONTROLS_SHADOW(vm_entry, VM_ENTRY_CONTROLS, 32)
| ^~~~~~~~~~~~~~~~~~~~~
In function 'vm_entry_controls_clearbit',
inlined from 'vmx_set_efer' at arch/x86/kvm/vmx/vmx.c:2905:3:
include/linux/compiler_types.h:352:45: error: call to '__compiletime_assert_533' declared with attribute error: BUILD_BUG_ON failed: !(val & (KVM_REQ_VMX_VM_ENTRY_CONTROLS | KVM_OPT_VMX_VM_ENTRY_CONTROLS))
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:333:25: note: in definition of macro '__compiletime_assert'
333 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:352:9: note: in expansion of macro '_compiletime_assert'
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
arch/x86/kvm/vmx/vmx.h:601:9: note: in expansion of macro 'BUILD_BUG_ON'
601 | BUILD_BUG_ON(!(val & (KVM_REQ_VMX_##uname | KVM_OPT_VMX_##uname))); \
| ^~~~~~~~~~~~
arch/x86/kvm/vmx/vmx.h:604:1: note: in expansion of macro 'BUILD_CONTROLS_SHADOW'
604 | BUILD_CONTROLS_SHADOW(vm_entry, VM_ENTRY_CONTROLS, 32)
| ^~~~~~~~~~~~~~~~~~~~~
vim +/__compiletime_assert_532 +352 include/linux/compiler_types.h
eb5c2d4b45e3d2 Will Deacon 2020-07-21 338
eb5c2d4b45e3d2 Will Deacon 2020-07-21 339 #define _compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 340 __compiletime_assert(condition, msg, prefix, suffix)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 341
eb5c2d4b45e3d2 Will Deacon 2020-07-21 342 /**
eb5c2d4b45e3d2 Will Deacon 2020-07-21 343 * compiletime_assert - break build and emit msg if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 344 * @condition: a compile-time constant condition to check
eb5c2d4b45e3d2 Will Deacon 2020-07-21 345 * @msg: a message to emit if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 346 *
eb5c2d4b45e3d2 Will Deacon 2020-07-21 347 * In tradition of POSIX assert, this macro will break the build if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 348 * supplied condition is *false*, emitting the supplied error message if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 349 * compiler has support to do so.
eb5c2d4b45e3d2 Will Deacon 2020-07-21 350 */
eb5c2d4b45e3d2 Will Deacon 2020-07-21 351 #define compiletime_assert(condition, msg) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @352 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 353
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
[chrome-os:chromeos-5.15 9/64] drivers/gpu/drm/display/drm_dp_cec.c:133:12-13: WARNING opportunity for min()
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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.15
head: f6e04b3c5f0a68039f511ba8c01fec8464cb717c
commit: e88a09b41b666add3bc3ca9194a80f0b4ee8af12 [9/64] BACKPORT: drm: Rename dp/ to display/
:::::: branch date: 15 hours ago
:::::: commit date: 3 days ago
config: parisc-randconfig-c024-20220629 (https://download.01.org/0day-ci/archive/20220630/202206301811.deGu8iHT-lk...)
compiler: hppa-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/display/drm_dp_cec.c:133:12-13: WARNING opportunity for min()
vim +133 drivers/gpu/drm/display/drm_dp_cec.c
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 117
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 118 static int drm_dp_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 119 u32 signal_free_time, struct cec_msg *msg)
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 120 {
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 121 struct drm_dp_aux *aux = cec_get_drvdata(adap);
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 122 unsigned int retries = min(5, attempts - 1);
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 123 ssize_t err;
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 124
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 125 err = drm_dp_dpcd_write(aux, DP_CEC_TX_MESSAGE_BUFFER,
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 126 msg->msg, msg->len);
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 127 if (err < 0)
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 128 return err;
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 129
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 130 err = drm_dp_dpcd_writeb(aux, DP_CEC_TX_MESSAGE_INFO,
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 131 (msg->len - 1) | (retries << 4) |
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 132 DP_CEC_TX_MESSAGE_SEND);
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 @133 return err < 0 ? err : 0;
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 134 }
2c6d1fffa1d9b0 drivers/gpu/drm/drm_dp_cec.c Hans Verkuil 2018-07-11 135
:::::: The code at line 133 was first introduced by commit
:::::: 2c6d1fffa1d9b0a5b5ac1a23be9ad64abe60910d drm: add support for DisplayPort CEC-Tunneling-over-AUX
:::::: TO: Hans Verkuil <hans.verkuil(a)cisco.com>
:::::: CC: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
[chrome-os:chromeos-5.15 9/64] drivers/gpu/drm/display/drm_dp.c:477:12-13: WARNING opportunity for min()
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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.15
head: 11c514c51d842f21af5ec2515d4839541be32c82
commit: e88a09b41b666add3bc3ca9194a80f0b4ee8af12 [9/64] BACKPORT: drm: Rename dp/ to display/
:::::: branch date: 68 minutes ago
:::::: commit date: 3 days ago
config: alpha-randconfig-c023-20220629 (https://download.01.org/0day-ci/archive/20220630/202206301746.LCiDw4d6-lk...)
compiler: alpha-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/display/drm_dp.c:477:12-13: WARNING opportunity for min()
--
>> drivers/gpu/drm/display/drm_dp_mst_topology.c:4504:64-67: ERROR: invalid reference to the index variable of the iterator on line 4492
drivers/gpu/drm/display/drm_dp_mst_topology.c:5230:13-17: ERROR: invalid reference to the index variable of the iterator on line 5207
drivers/gpu/drm/display/drm_dp_mst_topology.c:5394:5-8: ERROR: invalid reference to the index variable of the iterator on line 5380
vim +477 drivers/gpu/drm/display/drm_dp.c
c197db75ff5c1d drivers/gpu/drm/drm_dp_helper.c Thierry Reding 2013-11-28 455
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 456 /**
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 457 * drm_dp_dpcd_probe() - probe a given DPCD address with a 1-byte read access
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 458 * @aux: DisplayPort AUX channel (SST)
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 459 * @offset: address of the register to probe
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 460 *
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 461 * Probe the provided DPCD address by reading 1 byte from it. The function can
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 462 * be used to trigger some side-effect the read access has, like waking up the
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 463 * sink, without the need for the read-out value.
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 464 *
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 465 * Returns 0 if the read access suceeded, or a negative error code on failure.
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 466 */
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 467 int drm_dp_dpcd_probe(struct drm_dp_aux *aux, unsigned int offset)
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 468 {
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 469 u8 buffer;
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 470 int ret;
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 471
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 472 ret = drm_dp_dpcd_access(aux, DP_AUX_NATIVE_READ, offset, &buffer, 1);
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 473 WARN_ON(ret == 0);
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 474
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 475 drm_dp_dump_access(aux, DP_AUX_NATIVE_READ, offset, &buffer, ret);
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 476
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 @477 return ret < 0 ? ret : 0;
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 478 }
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 479 EXPORT_SYMBOL(drm_dp_dpcd_probe);
20c8ffb413be56 drivers/gpu/drm/dp/drm_dp.c Imre Deak 2022-04-11 480
:::::: The code at line 477 was first introduced by commit
:::::: 20c8ffb413be56d665f19d478bb2bebade409462 FROMGIT: drm/dp: Factor out a function to probe a DPCD address
:::::: TO: Imre Deak <imre.deak(a)intel.com>
:::::: CC: Chromeos LUCI <chromeos-scoped(a)luci-project-accounts.iam.gserviceaccount.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
[ammarfaizi2-block:google/android/kernel/common/android-4.9-q-release 7904/9999] include/linux/delayacct.h: linux/slab.h is included more than once.
by kernel test robot
::::::
:::::: Manual check reason: "low confidence bisect report"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
TO: Ammar Faizi <ammarfaizi2(a)gnuweeb.org>
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.9-q-release
head: 8c62b2bd034cfb52860b9e3f333b1ef587052af2
commit: 0f3e95cb46285a27db306d7a6e48fcf8a317b762 [7904/9999] UPSTREAM: sched/headers, delayacct: Move the 'struct task_delay_info' definition from <linux/sched.h> to <linux/delayacct.h>
:::::: branch date: 4 months ago
:::::: commit date: 3 years, 3 months ago
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
includecheck warnings: (new ones prefixed by >>)
>> include/linux/delayacct.h: linux/slab.h is included more than once.
>> /kbuild/src/consumer/include/linux/delayacct.h: linux/sched.h is included more than once.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
Re: [PATCH v7 2/8] media: uvcvideo: Add support for per-device control mapping overrides
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220617103645.71560-3-ribalda(a)chromium.org>
References: <20220617103645.71560-3-ribalda(a)chromium.org>
TO: Ricardo Ribalda <ribalda(a)chromium.org>
TO: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
TO: Mauro Carvalho Chehab <mchehab(a)kernel.org>
CC: linux-media(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
TO: tfiga(a)chromium.org
TO: senozhatsky(a)chromium.org
TO: yunkec(a)google.com
CC: Ricardo Ribalda <ribalda(a)chromium.org>
Hi Ricardo,
I love your patch! Perhaps something to improve:
[auto build test WARNING on media-tree/master]
[also build test WARNING on linus/master v5.19-rc4 next-20220629]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Ricardo-Ribalda/uvcvideo-F...
base: git://linuxtv.org/media_tree.git master
:::::: branch date: 13 days ago
:::::: commit date: 13 days ago
config: microblaze-randconfig-m031-20220629 (https://download.01.org/0day-ci/archive/20220630/202206301144.r7yv0yk2-lk...)
compiler: microblaze-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/media/usb/uvc/uvc_ctrl.c:2459 uvc_ctrl_init_ctrl() error: uninitialized symbol 'mapping'.
vim +/mapping +2459 drivers/media/usb/uvc/uvc_ctrl.c
2bdd29cf3d4d32 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2008-12-06 2396
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2397 /*
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2398 * Add control information and hardcoded stock control mappings to the given
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2399 * device.
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2400 */
866c6bdd5663d4 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2021-06-18 2401 static void uvc_ctrl_init_ctrl(struct uvc_video_chain *chain,
866c6bdd5663d4 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2021-06-18 2402 struct uvc_control *ctrl)
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2403 {
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2404 const struct uvc_control_info *info = uvc_ctrls;
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2405 const struct uvc_control_info *iend = info + ARRAY_SIZE(uvc_ctrls);
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2406 const struct uvc_control_mapping *mapping;
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2407 const struct uvc_control_mapping *mend;
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2408
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2409 /* XU controls initialization requires querying the device for control
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2410 * information. As some buggy UVC devices will crash when queried
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2411 * repeatedly in a tight loop, delay XU controls initialization until
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2412 * first use.
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2413 */
52c58ad6f95ff6 drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2414 if (UVC_ENTITY_TYPE(ctrl->entity) == UVC_VC_EXTENSION_UNIT)
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2415 return;
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2416
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2417 for (; info < iend; ++info) {
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2418 if (uvc_entity_match_guid(ctrl->entity, info->entity) &&
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2419 ctrl->index == info->index) {
866c6bdd5663d4 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2021-06-18 2420 uvc_ctrl_add_info(chain->dev, ctrl, info);
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2421 /*
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2422 * Retrieve control flags from the device. Ignore errors
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2423 * and work with default flag values from the uvc_ctrl
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2424 * array when the device doesn't properly implement
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2425 * GET_INFO on standard controls.
93df48d37c3f03 drivers/media/usb/uvc/uvc_ctrl.c Hans de Goede 2020-07-28 2426 */
866c6bdd5663d4 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2021-06-18 2427 uvc_ctrl_get_flags(chain->dev, ctrl, &ctrl->info);
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2428 break;
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2429 }
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2430 }
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2431
071c8bb827c80a drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2432 if (!ctrl->initialized)
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2433 return;
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2434
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2435 /*
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2436 * First check if the device provides a custom mapping for this control,
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2437 * used to override standard mappings for non-conformant devices. Don't
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2438 * process standard mappings if a custom mapping is found. This
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2439 * mechanism doesn't support combining standard and custom mappings for
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2440 * a single control.
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2441 */
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2442 if (chain->dev->info->mappings) {
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2443 bool custom = false;
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2444 unsigned int i;
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2445
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2446 for (i = 0; (mapping = chain->dev->info->mappings[i]); ++i) {
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2447 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) &&
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2448 ctrl->info.selector == mapping->selector) {
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2449 __uvc_ctrl_add_mapping(chain, ctrl, mapping);
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2450 custom = true;
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2451 }
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2452 }
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2453
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2454 if (custom)
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2455 return;
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2456 }
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2457
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2458 /* Process common mappings next. */
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 @2459 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings);
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2460 for (mapping = uvc_ctrl_mappings; mapping < mend; ++mapping) {
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2461 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) &&
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2462 ctrl->info.selector == mapping->selector)
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2463 __uvc_ctrl_add_mapping(chain, ctrl, mapping);
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2464 }
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2465
10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2466 /* Finally process version-specific mappings. */
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2467 if (chain->dev->uvc_version < 0x0150) {
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2468 mapping = uvc_ctrl_mappings_uvc11;
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2469 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc11);
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2470 } else {
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2471 mapping = uvc_ctrl_mappings_uvc15;
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2472 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings_uvc15);
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2473 }
87c205087585a0 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2474
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2475 for (; mapping < mend; ++mapping) {
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2476 if (uvc_entity_match_guid(ctrl->entity, mapping->entity) &&
071c8bb827c80a drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-29 2477 ctrl->info.selector == mapping->selector)
866c6bdd5663d4 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2021-06-18 2478 __uvc_ctrl_add_mapping(chain, ctrl, mapping);
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2479 }
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2480 }
ba2fa99668bb9b drivers/media/video/uvc/uvc_ctrl.c Laurent Pinchart 2010-09-20 2481
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
[chrome-os:chromeos-5.15 3/63] sound/soc/sof/amd/acp-common.c: ../sof-audio.h is included more than once.
by kernel test robot
::::::
:::::: Manual check reason: "low confidence bisect report"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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.15
head: dd04e927ac7a3637e375c92b3a6b4ceb3fc8e867
commit: ecc4093b35607454e588544176df93257b7b3459 [3/63] CHROMIUM: ASoC: SOF: amd: Make ACP core code generic for newer SOC transition
:::::: branch date: 27 hours ago
:::::: commit date: 3 days ago
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
includecheck warnings: (new ones prefixed by >>)
>> sound/soc/sof/amd/acp-common.c: ../sof-audio.h is included more than once.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week
drivers/net/ethernet/mediatek/mtk_eth_soc.c:926:17: warning: Parameter 'txd' can be declared with const [constParameter]
by kernel test robot
::::::
:::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/mediatek/mtk_eth_soc.c:926:17: warning: Parameter 'txd' can be declared with const [constParameter]"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Lorenzo Bianconi <lorenzo(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d9b2ba67917c18822c6a09af41c32fa161f1606b
commit: 7173eca8eeb7d58f885f7506f808f17851f934ce net: ethernet: mtk_eth_soc: convert ring dma pointer to void
date: 5 weeks ago
:::::: branch date: 8 hours ago
:::::: commit date: 5 weeks ago
compiler: microblaze-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 7173eca8eeb7d58f885f7506f808f17851f934ce
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/net/ethernet/mediatek/mtk_eth_soc.c:926:17: warning: Parameter 'txd' can be declared with const [constParameter]
void *txd, u32 txd_size)
^
>> drivers/net/ethernet/mediatek/mtk_eth_soc.c:939:55: warning: Parameter 'dma' can be declared with const [constParameter]
static int txd_to_idx(struct mtk_tx_ring *ring, void *dma, u32 txd_size)
^
>> drivers/net/ethernet/mediatek/mtk_eth_soc.c:1030:12: warning: Signed integer overflow for expression '0x7<<29'. [integerOverflow]
data |= TX_DMA_CHKSUM;
^
drivers/net/ethernet/mediatek/mtk_eth_soc.c:2054:13: warning: Signed integer overflow for expression '0x7<<29'. [integerOverflow]
if (val & MTK_LRO_RING_RELINQUISH_DONE) {
^
vim +/txd +926 drivers/net/ethernet/mediatek/mtk_eth_soc.c
656e705243fd0c John Crispin 2016-03-08 924
c4fd06c2bb82c8 Lorenzo Bianconi 2022-05-20 925 static struct mtk_tx_buf *mtk_desc_to_tx_buf(struct mtk_tx_ring *ring,
7173eca8eeb7d5 Lorenzo Bianconi 2022-05-20 @926 void *txd, u32 txd_size)
656e705243fd0c John Crispin 2016-03-08 927 {
7173eca8eeb7d5 Lorenzo Bianconi 2022-05-20 928 int idx = (txd - ring->dma) / txd_size;
656e705243fd0c John Crispin 2016-03-08 929
656e705243fd0c John Crispin 2016-03-08 930 return &ring->buf[idx];
656e705243fd0c John Crispin 2016-03-08 931 }
656e705243fd0c John Crispin 2016-03-08 932
296c9120752bab Stefan Roese 2019-08-16 933 static struct mtk_tx_dma *qdma_to_pdma(struct mtk_tx_ring *ring,
296c9120752bab Stefan Roese 2019-08-16 934 struct mtk_tx_dma *dma)
296c9120752bab Stefan Roese 2019-08-16 935 {
7173eca8eeb7d5 Lorenzo Bianconi 2022-05-20 936 return ring->dma_pdma - (struct mtk_tx_dma *)ring->dma + dma;
296c9120752bab Stefan Roese 2019-08-16 937 }
296c9120752bab Stefan Roese 2019-08-16 938
7173eca8eeb7d5 Lorenzo Bianconi 2022-05-20 @939 static int txd_to_idx(struct mtk_tx_ring *ring, void *dma, u32 txd_size)
296c9120752bab Stefan Roese 2019-08-16 940 {
7173eca8eeb7d5 Lorenzo Bianconi 2022-05-20 941 return (dma - ring->dma) / txd_size;
296c9120752bab Stefan Roese 2019-08-16 942 }
296c9120752bab Stefan Roese 2019-08-16 943
c30c4a82739090 Felix Fietkau 2021-04-22 944 static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
c30c4a82739090 Felix Fietkau 2021-04-22 945 bool napi)
656e705243fd0c John Crispin 2016-03-08 946 {
296c9120752bab Stefan Roese 2019-08-16 947 if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
656e705243fd0c John Crispin 2016-03-08 948 if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
d776a57e4a284b Felix Fietkau 2022-04-05 949 dma_unmap_single(eth->dma_dev,
656e705243fd0c John Crispin 2016-03-08 950 dma_unmap_addr(tx_buf, dma_addr0),
656e705243fd0c John Crispin 2016-03-08 951 dma_unmap_len(tx_buf, dma_len0),
656e705243fd0c John Crispin 2016-03-08 952 DMA_TO_DEVICE);
656e705243fd0c John Crispin 2016-03-08 953 } else if (tx_buf->flags & MTK_TX_FLAGS_PAGE0) {
d776a57e4a284b Felix Fietkau 2022-04-05 954 dma_unmap_page(eth->dma_dev,
656e705243fd0c John Crispin 2016-03-08 955 dma_unmap_addr(tx_buf, dma_addr0),
656e705243fd0c John Crispin 2016-03-08 956 dma_unmap_len(tx_buf, dma_len0),
656e705243fd0c John Crispin 2016-03-08 957 DMA_TO_DEVICE);
656e705243fd0c John Crispin 2016-03-08 958 }
296c9120752bab Stefan Roese 2019-08-16 959 } else {
296c9120752bab Stefan Roese 2019-08-16 960 if (dma_unmap_len(tx_buf, dma_len0)) {
d776a57e4a284b Felix Fietkau 2022-04-05 961 dma_unmap_page(eth->dma_dev,
296c9120752bab Stefan Roese 2019-08-16 962 dma_unmap_addr(tx_buf, dma_addr0),
296c9120752bab Stefan Roese 2019-08-16 963 dma_unmap_len(tx_buf, dma_len0),
296c9120752bab Stefan Roese 2019-08-16 964 DMA_TO_DEVICE);
296c9120752bab Stefan Roese 2019-08-16 965 }
296c9120752bab Stefan Roese 2019-08-16 966
296c9120752bab Stefan Roese 2019-08-16 967 if (dma_unmap_len(tx_buf, dma_len1)) {
d776a57e4a284b Felix Fietkau 2022-04-05 968 dma_unmap_page(eth->dma_dev,
296c9120752bab Stefan Roese 2019-08-16 969 dma_unmap_addr(tx_buf, dma_addr1),
296c9120752bab Stefan Roese 2019-08-16 970 dma_unmap_len(tx_buf, dma_len1),
296c9120752bab Stefan Roese 2019-08-16 971 DMA_TO_DEVICE);
296c9120752bab Stefan Roese 2019-08-16 972 }
296c9120752bab Stefan Roese 2019-08-16 973 }
296c9120752bab Stefan Roese 2019-08-16 974
656e705243fd0c John Crispin 2016-03-08 975 tx_buf->flags = 0;
656e705243fd0c John Crispin 2016-03-08 976 if (tx_buf->skb &&
c30c4a82739090 Felix Fietkau 2021-04-22 977 (tx_buf->skb != (struct sk_buff *)MTK_DMA_DUMMY_DESC)) {
c30c4a82739090 Felix Fietkau 2021-04-22 978 if (napi)
c30c4a82739090 Felix Fietkau 2021-04-22 979 napi_consume_skb(tx_buf->skb, napi);
c30c4a82739090 Felix Fietkau 2021-04-22 980 else
656e705243fd0c John Crispin 2016-03-08 981 dev_kfree_skb_any(tx_buf->skb);
c30c4a82739090 Felix Fietkau 2021-04-22 982 }
656e705243fd0c John Crispin 2016-03-08 983 tx_buf->skb = NULL;
656e705243fd0c John Crispin 2016-03-08 984 }
656e705243fd0c John Crispin 2016-03-08 985
296c9120752bab Stefan Roese 2019-08-16 986 static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
296c9120752bab Stefan Roese 2019-08-16 987 struct mtk_tx_dma *txd, dma_addr_t mapped_addr,
296c9120752bab Stefan Roese 2019-08-16 988 size_t size, int idx)
296c9120752bab Stefan Roese 2019-08-16 989 {
296c9120752bab Stefan Roese 2019-08-16 990 if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
296c9120752bab Stefan Roese 2019-08-16 991 dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
296c9120752bab Stefan Roese 2019-08-16 992 dma_unmap_len_set(tx_buf, dma_len0, size);
296c9120752bab Stefan Roese 2019-08-16 993 } else {
296c9120752bab Stefan Roese 2019-08-16 994 if (idx & 1) {
296c9120752bab Stefan Roese 2019-08-16 995 txd->txd3 = mapped_addr;
296c9120752bab Stefan Roese 2019-08-16 996 txd->txd2 |= TX_DMA_PLEN1(size);
296c9120752bab Stefan Roese 2019-08-16 997 dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr);
296c9120752bab Stefan Roese 2019-08-16 998 dma_unmap_len_set(tx_buf, dma_len1, size);
296c9120752bab Stefan Roese 2019-08-16 999 } else {
296c9120752bab Stefan Roese 2019-08-16 1000 tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC;
296c9120752bab Stefan Roese 2019-08-16 1001 txd->txd1 = mapped_addr;
296c9120752bab Stefan Roese 2019-08-16 1002 txd->txd2 = TX_DMA_PLEN0(size);
296c9120752bab Stefan Roese 2019-08-16 1003 dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
296c9120752bab Stefan Roese 2019-08-16 1004 dma_unmap_len_set(tx_buf, dma_len0, size);
296c9120752bab Stefan Roese 2019-08-16 1005 }
296c9120752bab Stefan Roese 2019-08-16 1006 }
296c9120752bab Stefan Roese 2019-08-16 1007 }
296c9120752bab Stefan Roese 2019-08-16 1008
160d3a9b192985 Lorenzo Bianconi 2022-05-20 1009 static void mtk_tx_set_dma_desc_v1(struct net_device *dev, void *txd,
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1010 struct mtk_tx_dma_desc_info *info)
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1011 {
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1012 struct mtk_mac *mac = netdev_priv(dev);
160d3a9b192985 Lorenzo Bianconi 2022-05-20 1013 struct mtk_eth *eth = mac->hw;
160d3a9b192985 Lorenzo Bianconi 2022-05-20 1014 struct mtk_tx_dma *desc = txd;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1015 u32 data;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1016
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1017 WRITE_ONCE(desc->txd1, info->addr);
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1018
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1019 data = TX_DMA_SWC | TX_DMA_PLEN0(info->size);
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1020 if (info->last)
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1021 data |= TX_DMA_LS0;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1022 WRITE_ONCE(desc->txd3, data);
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1023
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1024 data = (mac->id + 1) << TX_DMA_FPORT_SHIFT; /* forward port */
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1025 if (info->first) {
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1026 if (info->gso)
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1027 data |= TX_DMA_TSO;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1028 /* tx checksum offload */
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1029 if (info->csum)
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 @1030 data |= TX_DMA_CHKSUM;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1031 /* vlan header offload */
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1032 if (info->vlan)
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1033 data |= TX_DMA_INS_VLAN | info->vlan_tci;
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1034 }
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1035 WRITE_ONCE(desc->txd4, data);
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1036 }
731f3fd6bc879f Lorenzo Bianconi 2022-05-20 1037
--
0-DAY CI Kernel Test Service
https://01.org/lkp
1 month, 1 week