Re: [RFC PATCH v3 9/9] power: supply: Add bd718(15/27/28/78) charger driver
by kernel test robot
Hi Matti,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on lee-mfd/for-mfd-next v5.16-rc1 next-20211116]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Matti-Vaittinen/power-supply-Add...
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: riscv-randconfig-s031-20211116 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 11.2.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-dirty
# https://github.com/0day-ci/linux/commit/bcab8f5e195119b2d4e405451a1b54bb7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matti-Vaittinen/power-supply-Add-some-fuel-gauge-logic/20211116-203220
git checkout bcab8f5e195119b2d4e405451a1b54bb7edb82c5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv
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/power/supply/bd71827-power.c:476:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [addressable] [usertype] tmp_curr @@ got int @@
drivers/power/supply/bd71827-power.c:476:26: sparse: expected restricted __be16 [addressable] [usertype] tmp_curr
drivers/power/supply/bd71827-power.c:476:26: sparse: got int
>> drivers/power/supply/bd71827-power.c:478:36: sparse: sparse: cast from restricted __be16
>> drivers/power/supply/bd71827-power.c:645:37: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] *swap_lo @@ got restricted __be16 [usertype] * @@
drivers/power/supply/bd71827-power.c:645:37: sparse: expected unsigned short [usertype] *swap_lo
drivers/power/supply/bd71827-power.c:645:37: sparse: got restricted __be16 [usertype] *
vim +476 drivers/power/supply/bd71827-power.c
456
457 static int bd71827_get_current_ds_adc(struct bd71827_power *pwr, int *curr, int *curr_avg)
458 {
459 __be16 tmp_curr;
460 char *tmp = (char *)&tmp_curr;
461 int dir = 1;
462 int regs[] = { pwr->regs->ibat, pwr->regs->ibat_avg };
463 int *vals[] = { curr, curr_avg };
464 int ret, i;
465
466 for (dir = 1, i = 0; i < ARRAY_SIZE(regs); i++) {
467 ret = regmap_bulk_read(pwr->regmap, regs[i], &tmp_curr,
468 sizeof(tmp_curr));
469 if (ret)
470 break;
471
472 if (*tmp & BD7182x_MASK_CURDIR_DISCHG)
473 dir = -1;
474
475 *tmp &= BD7182x_MASK_IBAT_U;
> 476 tmp_curr = be16_to_cpu(tmp_curr);
477
> 478 *vals[i] = dir * ((int)tmp_curr) * pwr->curr_factor;
479 }
480
481 return ret;
482 }
483
484 static int bd71827_voltage_to_capacity(struct simple_gauge *sw, int ocv,
485 int temp __always_unused,
486 int *dsoc);
487
488 static int bd71827_voltage_to_capacity(struct simple_gauge *sw, int ocv, int temp,
489 int *dsoc)
490 {
491 int i = 0;
492 struct bd71827_power *pwr;
493
494 /* If ocv_table is not given try luck with batinfo */
495 if (!use_load_bat_params || !ocv_table[0]) {
496 if (!sw)
497 return -EINVAL;
498
499 pwr = simple_gauge_get_drvdata(sw);
500 *dsoc = power_supply_batinfo_ocv2dcap(&pwr->batinfo, ocv, 0);
501 if (*dsoc < 0)
502 return *dsoc;
503
504 return 0;
505 }
506
507 /* Default or module param OCV table. We have NUM_BAT_PARAMS */
508 if (ocv > ocv_table[0]) {
509 *dsoc = soc_table[0];
510 } else {
511 for (i = 0; i < NUM_BAT_PARAMS; i++) {
512 if ((ocv <= ocv_table[i]) && (ocv > ocv_table[i+1])) {
513 *dsoc = (soc_table[i] - soc_table[i+1]) *
514 (ocv - ocv_table[i+1]) /
515 (ocv_table[i] - ocv_table[i+1]);
516 *dsoc += soc_table[i+1];
517 break;
518 }
519 }
520 if (i == NUM_BAT_PARAMS)
521 *dsoc = soc_table[i - 1];
522 }
523
524 return 0;
525 }
526
527 /* Unit is tenths of degree C */
528 static int bd71827_get_temp(struct simple_gauge *sw, int *temp)
529 {
530 struct bd71827_power *pwr = simple_gauge_get_drvdata(sw);
531 struct regmap *regmap = pwr->regmap;
532 int ret;
533 int t;
534
535 ret = regmap_read(regmap, pwr->regs->btemp_vth, &t);
536 t = 200 - t;
537
538 if (ret || t > 200) {
539 dev_err(pwr->dev, "Failed to read battery temperature\n");
540 *temp = 2000;
541 } else {
542 *temp = t * 10;
543 }
544
545 return ret;
546 }
547
548 /* Unit is tenths of degree C */
549 static int bd71828_get_temp(struct simple_gauge *sw, int *temp)
550 {
551 struct bd71827_power *pwr = simple_gauge_get_drvdata(sw);
552 uint16_t t;
553 int ret;
554 int tmp = 200 * 10000;
555
556 ret = bd7182x_read16_himask(pwr, pwr->regs->btemp_vth,
557 BD71828_MASK_VM_BTMP_U, &t);
558 if (ret || t > 3200)
559 dev_err(pwr->dev,
560 "Failed to read system min average voltage\n");
561
562 tmp -= 625ULL * (unsigned int)t;
563 *temp = tmp / 1000;
564
565 return ret;
566 }
567
568 static int bd71827_charge_status(struct bd71827_power *pwr,
569 int *s, int *h)
570 {
571 unsigned int state;
572 int status, health;
573 int ret = 1;
574
575 ret = regmap_read(pwr->regmap, pwr->regs->chg_state, &state);
576 if (ret)
577 dev_err(pwr->dev, "charger status reading failed (%d)\n", ret);
578
579 state &= BD7182x_MASK_CHG_STATE;
580
581 dev_dbg(pwr->dev, "CHG_STATE %d\n", state);
582
583 switch (state) {
584 case 0x00:
585 ret = 0;
586 status = POWER_SUPPLY_STATUS_DISCHARGING;
587 health = POWER_SUPPLY_HEALTH_GOOD;
588 break;
589 case 0x01:
590 case 0x02:
591 case 0x03:
592 case 0x0E:
593 status = POWER_SUPPLY_STATUS_CHARGING;
594 health = POWER_SUPPLY_HEALTH_GOOD;
595 break;
596 case 0x0F:
597 ret = 0;
598 status = POWER_SUPPLY_STATUS_FULL;
599 health = POWER_SUPPLY_HEALTH_GOOD;
600 break;
601 case 0x10:
602 case 0x11:
603 case 0x12:
604 case 0x13:
605 case 0x14:
606 case 0x20:
607 case 0x21:
608 case 0x22:
609 case 0x23:
610 case 0x24:
611 ret = 0;
612 status = POWER_SUPPLY_STATUS_NOT_CHARGING;
613 health = POWER_SUPPLY_HEALTH_OVERHEAT;
614 break;
615 case 0x30:
616 case 0x31:
617 case 0x32:
618 case 0x40:
619 ret = 0;
620 status = POWER_SUPPLY_STATUS_DISCHARGING;
621 health = POWER_SUPPLY_HEALTH_GOOD;
622 break;
623 case 0x7f:
624 default:
625 ret = 0;
626 status = POWER_SUPPLY_STATUS_NOT_CHARGING;
627 health = POWER_SUPPLY_HEALTH_DEAD;
628 break;
629 }
630
631 if (s)
632 *s = status;
633 if (h)
634 *h = health;
635
636 return ret;
637 }
638
639 static int __write_cc(struct bd71827_power *pwr, uint16_t bcap,
640 unsigned int reg, uint32_t *new)
641 {
642 int ret;
643 __be32 tmp;
644 __be16 *swap_hi = (__be16 *)&tmp;
> 645 uint16_t *swap_lo = swap_hi + 1;
646
647 *swap_hi = cpu_to_be16(bcap & BD7182x_MASK_CC_CCNTD_HI);
648 *swap_lo = 0;
649
650 ret = regmap_bulk_write(pwr->regmap, reg, &tmp, sizeof(tmp));
651 if (ret) {
652 dev_err(pwr->dev, "Failed to write coulomb counter\n");
653 return ret;
654 }
655 if (new)
656 *new = be32_to_cpu(tmp);
657
658 return ret;
659 }
660
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
net/netfilter/nft_osf.c:97:47: sparse: sparse: incorrect type in argument 3 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8ab774587903771821b59471cc723bba6d893942
commit: d991bb1c8da842a2a0b9dc83b1005e655783f861 include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
date: 7 months ago
config: i386-randconfig-s031-20211116 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-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 d991bb1c8da842a2a0b9dc83b1005e655783f861
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
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 >>)
net/netfilter/nft_osf.c:97:47: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_osf.c:97:47: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected restricted __be32 [usertype] value @@ got unsigned int [usertype] @@
net/netfilter/nft_osf.c:97:47: sparse: expected restricted __be32 [usertype] value
net/netfilter/nft_osf.c:97:47: sparse: got unsigned int [usertype]
vim +97 net/netfilter/nft_osf.c
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 89
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 90 static int nft_osf_dump(struct sk_buff *skb, const struct nft_expr *expr)
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 91 {
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 92 const struct nft_osf *priv = nft_expr_priv(expr);
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 93
a218dc82f0b5c6 Fernando Fernandez Mancera 2018-10-10 94 if (nla_put_u8(skb, NFTA_OSF_TTL, priv->ttl))
a218dc82f0b5c6 Fernando Fernandez Mancera 2018-10-10 95 goto nla_put_failure;
a218dc82f0b5c6 Fernando Fernandez Mancera 2018-10-10 96
22c7652cdaa8cd Fernando Fernandez Mancera 2019-03-27 @97 if (nla_put_be32(skb, NFTA_OSF_FLAGS, ntohl(priv->flags)))
22c7652cdaa8cd Fernando Fernandez Mancera 2019-03-27 98 goto nla_put_failure;
22c7652cdaa8cd Fernando Fernandez Mancera 2019-03-27 99
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 100 if (nft_dump_register(skb, NFTA_OSF_DREG, priv->dreg))
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 101 goto nla_put_failure;
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 102
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 103 return 0;
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 104
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 105 nla_put_failure:
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 106 return -1;
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 107 }
b96af92d6eaf9f Fernando Fernandez Mancera 2018-07-25 108
:::::: The code at line 97 was first introduced by commit
:::::: 22c7652cdaa8cd33ce78bacceb4e826a3f795873 netfilter: nft_osf: Add version option support
:::::: TO: Fernando Fernandez Mancera <ffmancera(a)riseup.net>
:::::: CC: Pablo Neira Ayuso <pablo(a)netfilter.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
net/netfilter/nft_set_pipapo_avx2.c:1052:17: warning: variable 'lt' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8ab774587903771821b59471cc723bba6d893942
commit: 7400b063969bdca4a06cd97f1294d765c8eecbe1 nft_set_pipapo: Introduce AVX2-based lookup implementation
date: 1 year, 8 months ago
config: x86_64-randconfig-r006-20211116 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
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
# 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 7400b063969bdca4a06cd97f1294d765c8eecbe1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/netfilter/nft_set_pipapo_avx2.c:1052:17: warning: variable 'lt' set but not used [-Wunused-but-set-variable]
unsigned long *lt = f->lt, bsize = f->bsize;
^
1 warning generated.
vim +/lt +1052 net/netfilter/nft_set_pipapo_avx2.c
1030
1031 /**
1032 * nft_pipapo_avx2_lookup_slow() - Fallback function for uncommon field sizes
1033 * @map: Previous match result, used as initial bitmap
1034 * @fill: Destination bitmap to be filled with current match result
1035 * @f: Field, containing lookup and mapping tables
1036 * @offset: Ignore buckets before the given index, no bits are filled there
1037 * @pkt: Packet data, pointer to input nftables register
1038 * @first: If this is the first field, don't source previous result
1039 * @last: Last field: stop at the first match and return bit index
1040 *
1041 * This function should never be called, but is provided for the case the field
1042 * size doesn't match any of the known data types. Matching rate is
1043 * substantially lower than AVX2 routines.
1044 *
1045 * Return: -1 on no match, rule index of match if @last, otherwise first long
1046 * word index to be checked next (i.e. first filled word).
1047 */
1048 static int nft_pipapo_avx2_lookup_slow(unsigned long *map, unsigned long *fill,
1049 struct nft_pipapo_field *f, int offset,
1050 const u8 *pkt, bool first, bool last)
1051 {
> 1052 unsigned long *lt = f->lt, bsize = f->bsize;
1053 int i, ret = -1, b;
1054
1055 lt += offset * NFT_PIPAPO_LONGS_PER_M256;
1056
1057 if (first)
1058 memset(map, 0xff, bsize * sizeof(*map));
1059
1060 for (i = offset; i < bsize; i++) {
1061 if (f->bb == 8)
1062 pipapo_and_field_buckets_8bit(f, map, pkt);
1063 else
1064 pipapo_and_field_buckets_4bit(f, map, pkt);
1065 NFT_PIPAPO_GROUP_BITS_ARE_8_OR_4;
1066
1067 b = pipapo_refill(map, bsize, f->rules, fill, f->mt, last);
1068
1069 if (last)
1070 return b;
1071
1072 if (ret == -1)
1073 ret = b / XSAVE_YMM_SIZE;
1074 }
1075
1076 return ret;
1077 }
1078
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
net/netfilter/nft_cmp.c:128:31: sparse: sparse: cast to restricted __be16
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8ab774587903771821b59471cc723bba6d893942
commit: ff4d90a89d3d4d9814e0a2696509a7d495be4163 netfilter: nftables_offload: VLAN id needs host byteorder in flow dissector
date: 7 months ago
config: i386-randconfig-s031-20211116 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-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 ff4d90a89d3d4d9814e0a2696509a7d495be4163
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash net/netfilter/
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 >>)
>> net/netfilter/nft_cmp.c:128:31: sparse: sparse: cast to restricted __be16
>> net/netfilter/nft_cmp.c:128:31: sparse: sparse: cast to restricted __be16
>> net/netfilter/nft_cmp.c:128:31: sparse: sparse: cast to restricted __be16
>> net/netfilter/nft_cmp.c:128:31: sparse: sparse: cast to restricted __be16
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:131:31: sparse: sparse: cast to restricted __be32
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
>> net/netfilter/nft_cmp.c:134:31: sparse: sparse: cast to restricted __be64
net/netfilter/nft_cmp.c: note: in included file:
include/net/netfilter/nf_tables_core.h:53:16: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted __le32 [usertype] @@
include/net/netfilter/nf_tables_core.h:53:16: sparse: expected unsigned int
include/net/netfilter/nf_tables_core.h:53:16: sparse: got restricted __le32 [usertype]
vim +128 net/netfilter/nft_cmp.c
122
123 static void nft_payload_n2h(union nft_cmp_offload_data *data,
124 const u8 *val, u32 len)
125 {
126 switch (len) {
127 case 2:
> 128 data->val16 = ntohs(*((u16 *)val));
129 break;
130 case 4:
> 131 data->val32 = ntohl(*((u32 *)val));
132 break;
133 case 8:
> 134 data->val64 = be64_to_cpu(*((u64 *)val));
135 break;
136 default:
137 WARN_ON_ONCE(1);
138 break;
139 }
140 }
141
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
Re: [PATCH] sched/idle: support busy loop polling on idle SMT cpus
by kernel test robot
Hi Peng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/master linux/master linus/master v5.16-rc1 next-20211116]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Peng-Wang/sched-idle-support-bus...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8ea9183db4ad8afbcb7089a77c23eaf965b0cacd
config: i386-randconfig-r034-20211116 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
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
# https://github.com/0day-ci/linux/commit/11c6a63e5c0f496b43058351f1e2a488e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Peng-Wang/sched-idle-support-busy-loop-polling-on-idle-SMT-cpus/20211116-195600
git checkout 11c6a63e5c0f496b43058351f1e2a488ee27a5ec
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> kernel/sched/idle.c:73:44: error: use of undeclared identifier 'cpu_cgrp_id'
tg = container_of(task_css_check(current, cpu_cgrp_id, true),
^
>> kernel/sched/idle.c:73:44: error: use of undeclared identifier 'cpu_cgrp_id'
>> kernel/sched/idle.c:73:44: error: use of undeclared identifier 'cpu_cgrp_id'
>> kernel/sched/idle.c:73:7: error: offsetof of incomplete type 'struct task_group'
tg = container_of(task_css_check(current, cpu_cgrp_id, true),
^
include/linux/kernel.h:498:21: note: expanded from macro 'container_of'
((type *)(__mptr - offsetof(type, member))); })
^ ~~~~
include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^ ~~~~
include/linux/compiler_types.h:140:35: note: expanded from macro '__compiler_offsetof'
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^ ~
include/linux/sched.h:69:8: note: forward declaration of 'struct task_group'
struct task_group;
^
>> kernel/sched/idle.c:73:5: error: assigning to 'struct task_group *' from incompatible type 'void'
tg = container_of(task_css_check(current, cpu_cgrp_id, true),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/sched/idle.c:75:29: error: incomplete definition of type 'struct task_group'
rq->need_smt_idle_poll = tg->need_smt_idle_poll;
~~^
include/linux/sched.h:69:8: note: forward declaration of 'struct task_group'
struct task_group;
^
6 errors generated.
vim +/cpu_cgrp_id +73 kernel/sched/idle.c
57
58 void smt_idle_poll_switch(struct rq *rq)
59 {
60 struct rq *smt_rq;
61 struct task_group *tg;
62 int smt, cpu;
63
64 if (!static_branch_unlikely(&__smt_idle_poll_enabled))
65 return;
66
67 if (rq->idle == current) {
68 rq->need_smt_idle_poll = false;
69 return;
70 }
71
72 rcu_read_lock();
> 73 tg = container_of(task_css_check(current, cpu_cgrp_id, true),
74 struct task_group, css);
> 75 rq->need_smt_idle_poll = tg->need_smt_idle_poll;
76 rcu_read_unlock();
77
78 if (!rq->need_smt_idle_poll)
79 return;
80
81 cpu = rq->cpu;
82 for_each_cpu(smt, cpu_smt_mask(cpu)) {
83 if (cpu == smt || !cpu_online(smt))
84 continue;
85 smt_rq = cpu_rq(smt);
86 if (smt_rq->idle == smt_rq->curr && !smt_rq->in_smt_idle_poll)
87 smp_send_reschedule(smt);
88 }
89 }
90
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[drm-misc:drm-misc-next 4/22] drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:40:17: sparse: sparse: cast removes address space '__iomem' of expression
by kernel test robot
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 393534f291d821779203cb74896abc26e07160d6
commit: 57cbdbe65e5f9ba9bfd67b66bc3ce24ef1c54643 [4/22] drm/nouveau/kms/nv140-: Use hard-coded wndws or core channel for CRC channel
config: riscv-randconfig-s031-20211116 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 11.2.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-dirty
git remote add drm-misc git://anongit.freedesktop.org/drm/drm-misc
git fetch --no-tags drm-misc drm-misc-next
git checkout 57cbdbe65e5f9ba9bfd67b66bc3ce24ef1c54643
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/drm/
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/gpu/drm/nouveau/dispnv50/crcc57d.c:40:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:40:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:41:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:41:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:43:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:43:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:44:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/crcc57d.c:44:17: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +40 drivers/gpu/drm/nouveau/dispnv50/crcc57d.c
12
13 static int crcc57d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source,
14 struct nv50_crc_notifier_ctx *ctx)
15 {
16 struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
17 const int i = head->base.index;
18 u32 crc_args = NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, CONTROLLING_CHANNEL, CORE) |
19 NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, EXPECT_BUFFER_COLLAPSE, FALSE) |
20 NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, SECONDARY_CRC, NONE) |
21 NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, CRC_DURING_SNOOZE, DISABLE);
22 int ret;
23
24 switch (source) {
25 case NV50_CRC_SOURCE_TYPE_SOR:
26 crc_args |= NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, PRIMARY_CRC, SOR(or));
27 break;
28 case NV50_CRC_SOURCE_TYPE_SF:
29 crc_args |= NVDEF(NVC57D, HEAD_SET_CRC_CONTROL, PRIMARY_CRC, SF);
30 break;
31 default:
32 break;
33 }
34
35 ret = PUSH_WAIT(push, 4);
36 if (ret)
37 return ret;
38
39 if (source) {
> 40 PUSH_MTHD(push, NVC57D, HEAD_SET_CONTEXT_DMA_CRC(i), ctx->ntfy.handle);
41 PUSH_MTHD(push, NVC57D, HEAD_SET_CRC_CONTROL(i), crc_args);
42 } else {
43 PUSH_MTHD(push, NVC57D, HEAD_SET_CRC_CONTROL(i), 0);
44 PUSH_MTHD(push, NVC57D, HEAD_SET_CONTEXT_DMA_CRC(i), 0);
45 }
46
47 return 0;
48 }
49
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
Re: [PATCH v5 6/8] leds: trigger: add hardware-phy-activity trigger
by kernel test robot
Hi Ansuel,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
[also build test ERROR on linus/master v5.16-rc1 next-20211116]
[cannot apply to pavel-leds/for-next robh/for-next net-next/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Ansuel-Smith/Adds-support-for-PH...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 5833291ab6de9c3e2374336b51c814e515e8f3a5
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/e7d3e80887a86c5ce15c7fb3cd93807cd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ansuel-Smith/Adds-support-for-PHY-LEDs-with-offload-triggers/20211112-233807
git checkout e7d3e80887a86c5ce15c7fb3cd93807cd19dfd53
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/leds/trigger/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_mode_common_show':
>> drivers/leds/trigger/ledtrig-hardware-phy-activity.c:17:42: error: dereferencing pointer to incomplete type 'struct hardware_phy_activity_data'
17 | val = test_bit(blink_mode, &trigger_data->mode);
| ^~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_mode_common_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:35:36: error: dereferencing pointer to incomplete type 'struct hardware_phy_activity_data'
35 | set_bit(blink_mode, &trigger_data->mode);
| ^~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_tx_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:59:32: error: 'TRIGGER_PHY_ACTIVITY_BLINK_TX' undeclared (first use in this function)
59 | DEFINE_HW_BLINK_MODE(blink_tx, TRIGGER_PHY_ACTIVITY_BLINK_TX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:59:32: note: each undeclared identifier is reported only once for each function it appears in
59 | DEFINE_HW_BLINK_MODE(blink_tx, TRIGGER_PHY_ACTIVITY_BLINK_TX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_tx_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:59:32: error: 'TRIGGER_PHY_ACTIVITY_BLINK_TX' undeclared (first use in this function)
59 | DEFINE_HW_BLINK_MODE(blink_tx, TRIGGER_PHY_ACTIVITY_BLINK_TX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_rx_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:60:32: error: 'TRIGGER_PHY_ACTIVITY_BLINK_RX' undeclared (first use in this function)
60 | DEFINE_HW_BLINK_MODE(blink_rx, TRIGGER_PHY_ACTIVITY_BLINK_RX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'blink_rx_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:60:32: error: 'TRIGGER_PHY_ACTIVITY_BLINK_RX' undeclared (first use in this function)
60 | DEFINE_HW_BLINK_MODE(blink_rx, TRIGGER_PHY_ACTIVITY_BLINK_RX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_10M_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:61:32: error: 'TRIGGER_PHY_ACTIVITY_LINK_10M' undeclared (first use in this function)
61 | DEFINE_HW_BLINK_MODE(link_10M, TRIGGER_PHY_ACTIVITY_LINK_10M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_10M_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:61:32: error: 'TRIGGER_PHY_ACTIVITY_LINK_10M' undeclared (first use in this function)
61 | DEFINE_HW_BLINK_MODE(link_10M, TRIGGER_PHY_ACTIVITY_LINK_10M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_100M_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:62:33: error: 'TRIGGER_PHY_ACTIVITY_LINK_100M' undeclared (first use in this function)
62 | DEFINE_HW_BLINK_MODE(link_100M, TRIGGER_PHY_ACTIVITY_LINK_100M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_100M_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:62:33: error: 'TRIGGER_PHY_ACTIVITY_LINK_100M' undeclared (first use in this function)
62 | DEFINE_HW_BLINK_MODE(link_100M, TRIGGER_PHY_ACTIVITY_LINK_100M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_1000M_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:63:34: error: 'TRIGGER_PHY_ACTIVITY_LINK_1000M' undeclared (first use in this function)
63 | DEFINE_HW_BLINK_MODE(link_1000M, TRIGGER_PHY_ACTIVITY_LINK_1000M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'link_1000M_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:63:34: error: 'TRIGGER_PHY_ACTIVITY_LINK_1000M' undeclared (first use in this function)
63 | DEFINE_HW_BLINK_MODE(link_1000M, TRIGGER_PHY_ACTIVITY_LINK_1000M);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'half_duplex_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:64:35: error: 'TRIGGER_PHY_ACTIVITY_HALF_DUPLEX' undeclared (first use in this function)
64 | DEFINE_HW_BLINK_MODE(half_duplex, TRIGGER_PHY_ACTIVITY_HALF_DUPLEX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:48:33: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
48 | return blink_mode_common_show(blink_bit, dev, attr, buf); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'half_duplex_store':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:64:35: error: 'TRIGGER_PHY_ACTIVITY_HALF_DUPLEX' undeclared (first use in this function)
64 | DEFINE_HW_BLINK_MODE(half_duplex, TRIGGER_PHY_ACTIVITY_HALF_DUPLEX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:54:34: note: in definition of macro 'DEFINE_HW_BLINK_MODE'
54 | return blink_mode_common_store(blink_bit, dev, attr, buf, size); \
| ^~~~~~~~~
drivers/leds/trigger/ledtrig-hardware-phy-activity.c: In function 'full_duplex_show':
drivers/leds/trigger/ledtrig-hardware-phy-activity.c:65:35: error: 'TRIGGER_PHY_ACTIVITY_FULL_DUPLEX' undeclared (first use in this function)
65 | DEFINE_HW_BLINK_MODE(full_duplex, TRIGGER_PHY_ACTIVITY_FULL_DUPLEX);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +17 drivers/leds/trigger/ledtrig-hardware-phy-activity.c
9
10 static ssize_t blink_mode_common_show(int blink_mode, struct device *dev,
11 struct device_attribute *attr, char *buf)
12 {
13 struct led_classdev *led_cdev = led_trigger_get_led(dev);
14 struct hardware_phy_activity_data *trigger_data = led_cdev->trigger_data;
15 int val;
16
> 17 val = test_bit(blink_mode, &trigger_data->mode);
18 return sprintf(buf, "%d\n", val ? 1 : 0);
19 }
20
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week