[mchinth:sep_socwatch_linux_5_10 1/2] drivers/platform/x86/sepdk/pax/pax.c:763:18: sparse: sparse: cast removes address space '__user' of expression
by kernel test robot
Hi Manisha,
First bad commit (maybe != root cause):
tree: https://github.com/mchinth/linux sep_socwatch_linux_5_10
head: c55df4a2b60fc7c6c4d00fd9f9fb447087833513
commit: 50ccb9f3611a1cff43d9df2e2b303f817ad00a4d [1/2] platform/x86: Update SEP driver for 5.10 pull
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220208/202202081901.wpMee2f6-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/mchinth/linux/commit/50ccb9f3611a1cff43d9df2e2b303f817...
git remote add mchinth https://github.com/mchinth/linux
git fetch --no-tags mchinth sep_socwatch_linux_5_10
git checkout 50ccb9f3611a1cff43d9df2e2b303f817ad00a4d
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/platform/x86/sepdk/pax/ drivers/platform/x86/sepdk/sep/ drivers/platform/x86/socperf/
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/platform/x86/sepdk/pax/pax.c:763:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/sepdk/pax/pax.c:765:18: sparse: sparse: cast removes address space '__user' of expression
vim +/__user +763 drivers/platform/x86/sepdk/pax/pax.c
d605aabab41663 Jon Moeller 2018-11-13 741
d605aabab41663 Jon Moeller 2018-11-13 742 #if defined(CONFIG_COMPAT) && defined(DRV_EM64T)
d605aabab41663 Jon Moeller 2018-11-13 743 static IOCTL_OP_TYPE pax_Device_Control_Compat(struct file *filp,
d605aabab41663 Jon Moeller 2018-11-13 744 unsigned int cmd,
d605aabab41663 Jon Moeller 2018-11-13 745 unsigned long arg)
d605aabab41663 Jon Moeller 2018-11-13 746 {
d605aabab41663 Jon Moeller 2018-11-13 747 int status = OS_SUCCESS;
d605aabab41663 Jon Moeller 2018-11-13 748 IOCTL_COMPAT_ARGS_NODE local_args_compat;
d605aabab41663 Jon Moeller 2018-11-13 749 IOCTL_ARGS_NODE local_args;
d605aabab41663 Jon Moeller 2018-11-13 750
d605aabab41663 Jon Moeller 2018-11-13 751 memset(&local_args_compat, 0, sizeof(IOCTL_COMPAT_ARGS_NODE));
d605aabab41663 Jon Moeller 2018-11-13 752 if (arg) {
d605aabab41663 Jon Moeller 2018-11-13 753 status = copy_from_user(&local_args_compat,
d605aabab41663 Jon Moeller 2018-11-13 754 (void __user *)arg,
d605aabab41663 Jon Moeller 2018-11-13 755 sizeof(IOCTL_COMPAT_ARGS_NODE));
d605aabab41663 Jon Moeller 2018-11-13 756 if (status != OS_SUCCESS)
d605aabab41663 Jon Moeller 2018-11-13 757 return status;
d605aabab41663 Jon Moeller 2018-11-13 758 }
d605aabab41663 Jon Moeller 2018-11-13 759
d605aabab41663 Jon Moeller 2018-11-13 760 local_args.len_drv_to_usr = local_args_compat.len_drv_to_usr;
d605aabab41663 Jon Moeller 2018-11-13 761 local_args.len_usr_to_drv = local_args_compat.len_usr_to_drv;
d605aabab41663 Jon Moeller 2018-11-13 762 local_args.buf_drv_to_usr =
d605aabab41663 Jon Moeller 2018-11-13 @763 (char *)compat_ptr(local_args_compat.buf_drv_to_usr);
d605aabab41663 Jon Moeller 2018-11-13 764 local_args.buf_usr_to_drv =
d605aabab41663 Jon Moeller 2018-11-13 765 (char *)compat_ptr(local_args_compat.buf_usr_to_drv);
d605aabab41663 Jon Moeller 2018-11-13 766
d605aabab41663 Jon Moeller 2018-11-13 767 local_args.command = cmd;
d605aabab41663 Jon Moeller 2018-11-13 768
d605aabab41663 Jon Moeller 2018-11-13 769 status = pax_Service_IOCTL(filp, cmd, local_args);
d605aabab41663 Jon Moeller 2018-11-13 770
d605aabab41663 Jon Moeller 2018-11-13 771 return status;
d605aabab41663 Jon Moeller 2018-11-13 772 }
d605aabab41663 Jon Moeller 2018-11-13 773 #endif
d605aabab41663 Jon Moeller 2018-11-13 774
:::::: The code at line 763 was first introduced by commit
:::::: d605aabab41663c9be9e8c549042933189adbf2f platform/x86: add sep and socwatch drivers without socperf.
:::::: TO: Jon Moeller <jon.moeller(a)intel.com>
:::::: CC: Faycal Benmlih <faycal.benmlih(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 2 weeks
[plbossart-sound:pr/25 4/4] sound/soc/codecs/es8326.c:601:18: error: 'struct snd_soc_dai_driver' has no member named 'symmetric_rates'; did you mean 'symmetric_rate'?
by kernel test robot
tree: https://github.com/plbossart/sound pr/25
head: b4029a7d718a1281309cf2d46f2a52930d8f9ce4
commit: b4029a7d718a1281309cf2d46f2a52930d8f9ce4 [4/4] add support for es8326
config: csky-randconfig-r036-20220208 (https://download.01.org/0day-ci/archive/20220208/202202081943.UtmI9RnY-lk...)
compiler: csky-linux-gcc (GCC) 11.2.0
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/plbossart/sound/commit/b4029a7d718a1281309cf2d46f2a529...
git remote add plbossart-sound https://github.com/plbossart/sound
git fetch --no-tags plbossart-sound pr/25
git checkout b4029a7d718a1281309cf2d46f2a52930d8f9ce4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=csky SHELL=/bin/bash sound/soc/codecs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> sound/soc/codecs/es8326.c:601:18: error: 'struct snd_soc_dai_driver' has no member named 'symmetric_rates'; did you mean 'symmetric_rate'?
601 | .symmetric_rates = 1,
| ^~~~~~~~~~~~~~~
| symmetric_rate
>> sound/soc/codecs/es8326.c:601:36: warning: initialization of 'const struct snd_soc_cdai_ops *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
601 | .symmetric_rates = 1,
| ^
sound/soc/codecs/es8326.c:601:36: note: (near initialization for 'es8326_dai.cops')
sound/soc/codecs/es8326.c: In function 'es8326_i2c_probe':
>> sound/soc/codecs/es8326.c:748:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
748 | if (!es8326->mclk)
| ^~
sound/soc/codecs/es8326.c:750:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
750 | ret = clk_prepare_enable(es8326->mclk);
| ^~~
At top level:
sound/soc/codecs/es8326.c:30:33: warning: 'es8326_reg_defaults' defined but not used [-Wunused-const-variable=]
30 | static const struct reg_default es8326_reg_defaults[] = {
| ^~~~~~~~~~~~~~~~~~~
vim +601 sound/soc/codecs/es8326.c
583
584 static struct snd_soc_dai_driver es8326_dai = {
585 .name = "ES8326 HiFi",
586 .playback = {
587 .stream_name = "Playback",
588 .channels_min = 1,
589 .channels_max = 2,
590 .rates = es8326_RATES,
591 .formats = es8326_FORMATS,
592 },
593 .capture = {
594 .stream_name = "Capture",
595 .channels_min = 1,
596 .channels_max = 2,
597 .rates = es8326_RATES,
598 .formats = es8326_FORMATS,
599 },
600 .ops = &es8326_ops,
> 601 .symmetric_rates = 1,
602 };
603
604 static int es8326_probe(struct snd_soc_component*codec)
605 {
606 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(codec);
607 es8326->component = codec;
608
609 if (codec == NULL) {
610 dev_err(codec->dev, "Codec device not registered\n");
611 return -ENODEV;
612 }
613
614 snd_soc_component_write(codec, ES8326_CLK_CTL_01, ES8326_CLK_ON);
615 /* Two channel ADC */
616 snd_soc_component_write(codec, ES8326_PULLUP_CTL_F9, 0x02);
617 snd_soc_component_write(codec, ES8326_CLK_INV_02, 0x00);
618 snd_soc_component_write(codec, ES8326_CLK_DIV_CPC_0C, 0x1F);
619 snd_soc_component_write(codec, ES8326_CLK_VMIDS1_10, 0xC8);
620 snd_soc_component_write(codec, ES8326_CLK_VMIDS2_11, 0x88);
621 snd_soc_component_write(codec, ES8326_CLK_CAL_TIME_12, 0x20);
622 snd_soc_component_write(codec, ES8326_DAC_MUTE_14, 0x00);
623 snd_soc_component_write(codec, ES8326_ANA_LOWPOWER_19, 0xF0);
624 snd_soc_component_write(codec, ES8326_SYS_BIAS_1D, 0x08);
625 snd_soc_component_write(codec, ES8326_DAC2HPMIX_25, 0x22);
626 snd_soc_component_write(codec, ES8326_ADC_SCALE_29, 0x00);
627 snd_soc_component_write(codec, ES8326_ADC1_SRC_2A, es8326->mic1_src);
628 snd_soc_component_write(codec, ES8326_ADC2_SRC_2B, es8326->mic2_src);
629 snd_soc_component_write(codec, ES8326_HP_CAL_4A, 0x00);
630 snd_soc_component_write(codec, ES8326_DAC_DSM_4D, 0x08);
631 snd_soc_component_write(codec, ES8326_DAC_RAMPRATE_4E, 0x20);
632 snd_soc_component_write(codec, ES8326_DAC_VPPSCALE_4F, 0x15);
633 snd_soc_component_write(codec, ES8326_HPJACK_TIMER_56, 0x88);
634 snd_soc_component_write(codec, ES8326_HP_DET_57, ES8326_HP_DET_SRC_PIN9|es8326->jack_pol);
635 snd_soc_component_write(codec, ES8326_INT_SOURCE_58, 0x08);
636 snd_soc_component_write(codec, ES8326_INTOUT_IO_59, 0x45);
637 snd_soc_component_write(codec, ES8326_RESET_00, ES8326_CSM_ON);
638 snd_soc_component_update_bits(codec, ES8326_PAGGAIN_23,
639 ES8326_MIC_SEL_MASK, ES8326_MIC1_SEL);
640
641 es8326_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
642
643 return 0;
644 }
645
646 static void es8326_remove(struct snd_soc_component*codec)
647 {
648 es8326_set_bias_level(codec, SND_SOC_BIAS_OFF);
649 }
650
651 static void es8326_enable_jack_detect(struct snd_soc_component *component,
652 struct snd_soc_jack *jack)
653 {
654 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
655
656 dev_dbg(component->dev,"Enter into %s\n", __func__);
657
658 mutex_lock(&es8326->lock);
659
660 es8326->jack = jack;
661
662 mutex_unlock(&es8326->lock);
663 /* Enable irq and sync initial jack state */
664 enable_irq(es8326->irq);
665 es8326_irq(es8326->irq, es8326);
666 }
667
668
669
670 static void es8326_disable_jack_detect(struct snd_soc_component *component)
671 {
672 struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
673
674 dev_dbg(component->dev,"Enter into %s\n", __func__);
675 if (!es8326->jack)
676 return; /* Already disabled (or never enabled) */
677
678 disable_irq(es8326->irq);
679
680 mutex_lock(&es8326->lock);
681
682 if (es8326->jack->status & SND_JACK_MICROPHONE) {
683 snd_soc_jack_report(es8326->jack, 0, SND_JACK_BTN_0);
684 }
685
686 es8326->jack = NULL;
687
688 mutex_unlock(&es8326->lock);
689 }
690
691 static int es8326_set_jack(struct snd_soc_component *component,
692 struct snd_soc_jack *jack, void *data)
693 {
694 if (jack)
695 es8326_enable_jack_detect(component, jack);
696 else
697 es8326_disable_jack_detect(component);
698
699 return 0;
700 }
701 static struct snd_soc_component_driver soc_component_dev_es8326 = {
702 .probe = es8326_probe,
703 .remove = es8326_remove,
704 .set_bias_level = es8326_set_bias_level,
705 .set_jack = es8326_set_jack,
706
707 .dapm_widgets = es8326_dapm_widgets,
708 .num_dapm_widgets = ARRAY_SIZE(es8326_dapm_widgets),
709 .dapm_routes = es8326_dapm_routes,
710 .num_dapm_routes = ARRAY_SIZE(es8326_dapm_routes),
711 .controls = es8326_snd_controls,
712 .num_controls = ARRAY_SIZE(es8326_snd_controls),
713 };
714
715 static int es8326_i2c_probe(struct i2c_client *i2c,
716 const struct i2c_device_id *id)
717 {
718 struct es8326_priv *es8326;
719 u8 reg;
720 int ret = -1;
721 struct i2c_adapter *adapter = to_i2c_adapter(i2c->dev.parent);
722
723 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
724 dev_warn(&adapter->dev,
725 "I2C-Adapter doesn't support I2C_FUNC_I2C\n");
726 return -EIO;
727 }
728
729 es8326 = devm_kzalloc(&i2c->dev, sizeof(struct es8326_priv), GFP_KERNEL);
730 if (es8326 == NULL)
731 return -ENOMEM;
732
733 i2c_set_clientdata(i2c, es8326);
734 es8326->i2c = i2c;
735 mutex_init(&es8326->lock);
736 es8326->regmap = devm_regmap_init_i2c(i2c, &es8326_regmap_config);
737 if (IS_ERR(es8326->regmap)) {
738 ret = PTR_ERR(es8326->regmap);
739 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
740 return ret;
741 }
742
743 es8326->mclk = devm_clk_get_optional(&i2c->dev, "mclk");
744 if (IS_ERR(es8326->mclk)) {
745 dev_err(&i2c->dev,"%s,unable to get mclk\n", __func__);
746 return PTR_ERR(es8326->mclk);
747 }
> 748 if (!es8326->mclk)
749 dev_err(&i2c->dev,"%s, assuming static mclk\n", __func__);
750 ret = clk_prepare_enable(es8326->mclk);
751 if (ret) {
752 dev_err(&i2c->dev,"%s, unable to enable mclk\n", __func__);
753 return ret;
754 }
755
756 reg = 0x00;
757 ret = i2c_master_recv(i2c, ®, 1);
758 if (ret < 0) {
759 dev_err(&i2c->dev, "i2c recv Failed\n");
760 return ret;
761 }
762 es8326->irq = i2c->irq;
763 ret = devm_request_threaded_irq(&i2c->dev, es8326->irq, NULL, es8326_irq,
764 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
765 "es8326", es8326);
766 if(ret == 0)
767 {
768 disable_irq(es8326->irq);
769 }
770 else{
771 dev_warn(&i2c->dev, "Getting irq failed.");
772 }
773
774 ret = of_property_read_u8(i2c->dev.of_node, "amic1-src", &es8326->amic1_src);
775 if (ret != 0) {
776 dev_dbg(&i2c->dev, "amic1-src return %d", ret);
777 es8326->amic1_src = ES8326_MIC1_SEL;
778 }
779
780 ret = of_property_read_u8(i2c->dev.of_node, "amic2-src", &es8326->amic2_src);
781 if (ret != 0) {
782 dev_dbg(&i2c->dev, "amic2-src return %d", ret);
783 es8326->amic2_src = ES8326_MIC1_SEL;
784 }
785
786 ret = of_property_read_u8(i2c->dev.of_node, "mic1-src", &es8326->mic1_src);
787 if (ret != 0) {
788 dev_dbg(&i2c->dev, "mic1-src return %d", ret);
789 es8326->mic1_src = ES8326_ADC_AMIC;
790 }
791 dev_dbg(&i2c->dev, "mic1-src %x",es8326->mic1_src);
792
793 ret = of_property_read_u8(i2c->dev.of_node, "mic2-src", &es8326->mic2_src);
794 if (ret != 0) {
795 dev_dbg(&i2c->dev, "mic2-src return %d", ret);
796 es8326->mic2_src = ES8326_ADC_DMIC;
797 }
798 dev_dbg(&i2c->dev, "mic2-src %x",es8326->mic2_src);
799
800 ret = of_property_read_u8(i2c->dev.of_node, "jack-pol", &es8326->jack_pol);
801 if (ret != 0) {
802 dev_dbg(&i2c->dev, "jack-pol return %d", ret);
803 es8326->jack_pol = ES8326_HP_DET_JACK_POL|ES8326_HP_DET_BUTTON_POL|ES8326_HP_TYPE_OMTP;
804 }
805 dev_dbg(&i2c->dev, "jack-pol %x",es8326->jack_pol);
806
807 ret = of_property_read_u32(i2c->dev.of_node, "mclk-rate", &es8326->mclk_rate);
808 if (ret != 0) {
809 dev_dbg(&i2c->dev, "mclk-rate return %d", ret);
810 es8326->mclk_rate = 19200000;
811 }
812 dev_dbg(&i2c->dev, "mclk-rate %u",es8326->mclk_rate);
813
814 return devm_snd_soc_register_component(&i2c->dev,
815 &soc_component_dev_es8326,
816 &es8326_dai, 1);
817 }
818
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 2 weeks
[bpf-next:master 212/221] arch/sparc/net/bpf_jit_comp_64.c:1602:56: error: 'struct bpf_binary_header' has no member named 'pages'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
head: 5d1e9f437df5ef21e7567f1970a00fda3b5d1126
commit: ed2d9e1a26cca963ff5ed3b76326d70f7d8201a9 [212/221] bpf: Use size instead of pages in bpf_binary_header
config: sparc-randconfig-r036-20220207 (https://download.01.org/0day-ci/archive/20220208/202202081815.gh1kFj08-lk...)
compiler: sparc64-linux-gcc (GCC) 11.2.0
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/bpf/bpf-next.git/commit/?...
git remote add bpf-next https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
git fetch --no-tags bpf-next master
git checkout ed2d9e1a26cca963ff5ed3b76326d70f7d8201a9
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc 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 >>):
arch/sparc/net/bpf_jit_comp_64.c: In function 'bpf_int_jit_compile':
>> arch/sparc/net/bpf_jit_comp_64.c:1602:56: error: 'struct bpf_binary_header' has no member named 'pages'
1602 | bpf_flush_icache(header, (u8 *)header + (header->pages * PAGE_SIZE));
| ^~
vim +1602 arch/sparc/net/bpf_jit_comp_64.c
5f5a641116391f David Miller 2017-12-22 1479
7a12b5031c6b94 David S. Miller 2017-04-17 1480 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
7a12b5031c6b94 David S. Miller 2017-04-17 1481 {
7a12b5031c6b94 David S. Miller 2017-04-17 1482 struct bpf_prog *tmp, *orig_prog = prog;
5f5a641116391f David Miller 2017-12-22 1483 struct sparc64_jit_data *jit_data;
7a12b5031c6b94 David S. Miller 2017-04-17 1484 struct bpf_binary_header *header;
c44768a33da81b David Miller 2018-11-26 1485 u32 prev_image_size, image_size;
7a12b5031c6b94 David S. Miller 2017-04-17 1486 bool tmp_blinded = false;
5f5a641116391f David Miller 2017-12-22 1487 bool extra_pass = false;
7a12b5031c6b94 David S. Miller 2017-04-17 1488 struct jit_ctx ctx;
7a12b5031c6b94 David S. Miller 2017-04-17 1489 u8 *image_ptr;
c44768a33da81b David Miller 2018-11-26 1490 int pass, i;
7a12b5031c6b94 David S. Miller 2017-04-17 1491
60b58afc96c9df Alexei Starovoitov 2017-12-14 1492 if (!prog->jit_requested)
7a12b5031c6b94 David S. Miller 2017-04-17 1493 return orig_prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1494
7a12b5031c6b94 David S. Miller 2017-04-17 1495 tmp = bpf_jit_blind_constants(prog);
7a12b5031c6b94 David S. Miller 2017-04-17 1496 /* If blinding was requested and we failed during blinding,
7a12b5031c6b94 David S. Miller 2017-04-17 1497 * we must fall back to the interpreter.
7a12b5031c6b94 David S. Miller 2017-04-17 1498 */
7a12b5031c6b94 David S. Miller 2017-04-17 1499 if (IS_ERR(tmp))
7a12b5031c6b94 David S. Miller 2017-04-17 1500 return orig_prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1501 if (tmp != prog) {
7a12b5031c6b94 David S. Miller 2017-04-17 1502 tmp_blinded = true;
7a12b5031c6b94 David S. Miller 2017-04-17 1503 prog = tmp;
7a12b5031c6b94 David S. Miller 2017-04-17 1504 }
7a12b5031c6b94 David S. Miller 2017-04-17 1505
5f5a641116391f David Miller 2017-12-22 1506 jit_data = prog->aux->jit_data;
5f5a641116391f David Miller 2017-12-22 1507 if (!jit_data) {
5f5a641116391f David Miller 2017-12-22 1508 jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL);
5f5a641116391f David Miller 2017-12-22 1509 if (!jit_data) {
5f5a641116391f David Miller 2017-12-22 1510 prog = orig_prog;
5f5a641116391f David Miller 2017-12-22 1511 goto out;
5f5a641116391f David Miller 2017-12-22 1512 }
5f5a641116391f David Miller 2017-12-22 1513 prog->aux->jit_data = jit_data;
5f5a641116391f David Miller 2017-12-22 1514 }
5f5a641116391f David Miller 2017-12-22 1515 if (jit_data->ctx.offset) {
5f5a641116391f David Miller 2017-12-22 1516 ctx = jit_data->ctx;
5f5a641116391f David Miller 2017-12-22 1517 image_ptr = jit_data->image;
5f5a641116391f David Miller 2017-12-22 1518 header = jit_data->header;
5f5a641116391f David Miller 2017-12-22 1519 extra_pass = true;
5f5a641116391f David Miller 2017-12-22 1520 image_size = sizeof(u32) * ctx.idx;
c44768a33da81b David Miller 2018-11-26 1521 prev_image_size = image_size;
c44768a33da81b David Miller 2018-11-26 1522 pass = 1;
5f5a641116391f David Miller 2017-12-22 1523 goto skip_init_ctx;
5f5a641116391f David Miller 2017-12-22 1524 }
5f5a641116391f David Miller 2017-12-22 1525
7a12b5031c6b94 David S. Miller 2017-04-17 1526 memset(&ctx, 0, sizeof(ctx));
7a12b5031c6b94 David S. Miller 2017-04-17 1527 ctx.prog = prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1528
c44768a33da81b David Miller 2018-11-26 1529 ctx.offset = kmalloc_array(prog->len, sizeof(unsigned int), GFP_KERNEL);
7a12b5031c6b94 David S. Miller 2017-04-17 1530 if (ctx.offset == NULL) {
7a12b5031c6b94 David S. Miller 2017-04-17 1531 prog = orig_prog;
5f5a641116391f David Miller 2017-12-22 1532 goto out_off;
7a12b5031c6b94 David S. Miller 2017-04-17 1533 }
7a12b5031c6b94 David S. Miller 2017-04-17 1534
c44768a33da81b David Miller 2018-11-26 1535 /* Longest sequence emitted is for bswap32, 12 instructions. Pre-cook
c44768a33da81b David Miller 2018-11-26 1536 * the offset array so that we converge faster.
7a12b5031c6b94 David S. Miller 2017-04-17 1537 */
c44768a33da81b David Miller 2018-11-26 1538 for (i = 0; i < prog->len; i++)
c44768a33da81b David Miller 2018-11-26 1539 ctx.offset[i] = i * (12 * 4);
c44768a33da81b David Miller 2018-11-26 1540
c44768a33da81b David Miller 2018-11-26 1541 prev_image_size = ~0U;
c44768a33da81b David Miller 2018-11-26 1542 for (pass = 1; pass < 40; pass++) {
c44768a33da81b David Miller 2018-11-26 1543 ctx.idx = 0;
c44768a33da81b David Miller 2018-11-26 1544
c44768a33da81b David Miller 2018-11-26 1545 build_prologue(&ctx);
7a12b5031c6b94 David S. Miller 2017-04-17 1546 if (build_body(&ctx)) {
7a12b5031c6b94 David S. Miller 2017-04-17 1547 prog = orig_prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1548 goto out_off;
7a12b5031c6b94 David S. Miller 2017-04-17 1549 }
7a12b5031c6b94 David S. Miller 2017-04-17 1550 build_epilogue(&ctx);
7a12b5031c6b94 David S. Miller 2017-04-17 1551
c44768a33da81b David Miller 2018-11-26 1552 if (bpf_jit_enable > 1)
c44768a33da81b David Miller 2018-11-26 1553 pr_info("Pass %d: size = %u, seen = [%c%c%c%c%c%c]\n", pass,
c44768a33da81b David Miller 2018-11-26 1554 ctx.idx * 4,
c44768a33da81b David Miller 2018-11-26 1555 ctx.tmp_1_used ? '1' : ' ',
c44768a33da81b David Miller 2018-11-26 1556 ctx.tmp_2_used ? '2' : ' ',
c44768a33da81b David Miller 2018-11-26 1557 ctx.tmp_3_used ? '3' : ' ',
c44768a33da81b David Miller 2018-11-26 1558 ctx.saw_frame_pointer ? 'F' : ' ',
c44768a33da81b David Miller 2018-11-26 1559 ctx.saw_call ? 'C' : ' ',
c44768a33da81b David Miller 2018-11-26 1560 ctx.saw_tail_call ? 'T' : ' ');
c44768a33da81b David Miller 2018-11-26 1561
c44768a33da81b David Miller 2018-11-26 1562 if (ctx.idx * 4 == prev_image_size)
c44768a33da81b David Miller 2018-11-26 1563 break;
c44768a33da81b David Miller 2018-11-26 1564 prev_image_size = ctx.idx * 4;
c44768a33da81b David Miller 2018-11-26 1565 cond_resched();
c44768a33da81b David Miller 2018-11-26 1566 }
c44768a33da81b David Miller 2018-11-26 1567
7a12b5031c6b94 David S. Miller 2017-04-17 1568 /* Now we know the actual image size. */
7a12b5031c6b94 David S. Miller 2017-04-17 1569 image_size = sizeof(u32) * ctx.idx;
7a12b5031c6b94 David S. Miller 2017-04-17 1570 header = bpf_jit_binary_alloc(image_size, &image_ptr,
7a12b5031c6b94 David S. Miller 2017-04-17 1571 sizeof(u32), jit_fill_hole);
7a12b5031c6b94 David S. Miller 2017-04-17 1572 if (header == NULL) {
7a12b5031c6b94 David S. Miller 2017-04-17 1573 prog = orig_prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1574 goto out_off;
7a12b5031c6b94 David S. Miller 2017-04-17 1575 }
7a12b5031c6b94 David S. Miller 2017-04-17 1576
7a12b5031c6b94 David S. Miller 2017-04-17 1577 ctx.image = (u32 *)image_ptr;
5f5a641116391f David Miller 2017-12-22 1578 skip_init_ctx:
7a12b5031c6b94 David S. Miller 2017-04-17 1579 ctx.idx = 0;
7a12b5031c6b94 David S. Miller 2017-04-17 1580
7a12b5031c6b94 David S. Miller 2017-04-17 1581 build_prologue(&ctx);
7a12b5031c6b94 David S. Miller 2017-04-17 1582
7a12b5031c6b94 David S. Miller 2017-04-17 1583 if (build_body(&ctx)) {
7a12b5031c6b94 David S. Miller 2017-04-17 1584 bpf_jit_binary_free(header);
7a12b5031c6b94 David S. Miller 2017-04-17 1585 prog = orig_prog;
7a12b5031c6b94 David S. Miller 2017-04-17 1586 goto out_off;
7a12b5031c6b94 David S. Miller 2017-04-17 1587 }
7a12b5031c6b94 David S. Miller 2017-04-17 1588
7a12b5031c6b94 David S. Miller 2017-04-17 1589 build_epilogue(&ctx);
7a12b5031c6b94 David S. Miller 2017-04-17 1590
c44768a33da81b David Miller 2018-11-26 1591 if (ctx.idx * 4 != prev_image_size) {
c44768a33da81b David Miller 2018-11-26 1592 pr_err("bpf_jit: Failed to converge, prev_size=%u size=%d\n",
c44768a33da81b David Miller 2018-11-26 1593 prev_image_size, ctx.idx * 4);
c44768a33da81b David Miller 2018-11-26 1594 bpf_jit_binary_free(header);
c44768a33da81b David Miller 2018-11-26 1595 prog = orig_prog;
c44768a33da81b David Miller 2018-11-26 1596 goto out_off;
7a12b5031c6b94 David S. Miller 2017-04-17 1597 }
7a12b5031c6b94 David S. Miller 2017-04-17 1598
7a12b5031c6b94 David S. Miller 2017-04-17 1599 if (bpf_jit_enable > 1)
7a12b5031c6b94 David S. Miller 2017-04-17 1600 bpf_jit_dump(prog->len, image_size, pass, ctx.image);
7a12b5031c6b94 David S. Miller 2017-04-17 1601
7a12b5031c6b94 David S. Miller 2017-04-17 @1602 bpf_flush_icache(header, (u8 *)header + (header->pages * PAGE_SIZE));
:::::: The code at line 1602 was first introduced by commit
:::::: 7a12b5031c6b947cc13918237ae652b536243b76 sparc64: Add eBPF JIT.
:::::: TO: David S. Miller <davem(a)davemloft.net>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 2 weeks
Re: [PATCH v3 1/6] ath11k: Add basic WoW functionalities
by kernel test robot
Hi Carl,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 76680d49b5e0e661bc4abcdaf13fb7e124b4ca08]
url: https://github.com/0day-ci/linux/commits/Carl-Huang/ath11k-support-WoW-fu...
base: 76680d49b5e0e661bc4abcdaf13fb7e124b4ca08
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220208/202202081841.ZjlgFyK7-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
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/e2f5c30ed6c6deadc01bfdd0210ce36ef...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Carl-Huang/ath11k-support-WoW-functionalities/20220208-161634
git checkout e2f5c30ed6c6deadc01bfdd0210ce36ef2fbdf41
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/net/wireless/ath/ath11k/
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 >>):
>> drivers/net/wireless/ath/ath11k/mac.c:7242:5: warning: no previous prototype for 'ath11k_mac_flush_tx_complete' [-Wmissing-prototypes]
7242 | int ath11k_mac_flush_tx_complete(struct ath11k *ar)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/ath11k_mac_flush_tx_complete +7242 drivers/net/wireless/ath/ath11k/mac.c
7241
> 7242 int ath11k_mac_flush_tx_complete(struct ath11k *ar)
7243 {
7244 long time_left;
7245 int ret = 0;
7246
7247 time_left = wait_event_timeout(ar->dp.tx_empty_waitq,
7248 (atomic_read(&ar->dp.num_tx_pending) == 0),
7249 ATH11K_FLUSH_TIMEOUT);
7250 if (time_left == 0) {
7251 ath11k_warn(ar->ab, "failed to flush transmit queue, data pkts pending %d\n",
7252 atomic_read(&ar->dp.num_tx_pending));
7253 ret = -ETIMEDOUT;
7254 }
7255
7256 time_left = wait_event_timeout(ar->txmgmt_empty_waitq,
7257 (atomic_read(&ar->num_pending_mgmt_tx) == 0),
7258 ATH11K_FLUSH_TIMEOUT);
7259 if (time_left == 0) {
7260 ath11k_warn(ar->ab, "failed to flush mgmt transmit queue, mgmt pkts pending %d\n",
7261 atomic_read(&ar->num_pending_mgmt_tx));
7262 ret = -ETIMEDOUT;
7263 }
7264
7265 return ret;
7266 }
7267
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 2 weeks