[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202411291940.6T4OMy3k-lkp@intel.com>
Date: Fri, 29 Nov 2024 19:30:51 +0800
From: kernel test robot <lkp@...el.com>
To: "Rafael V. Volkmer" <rafael.v.volkmer@...il.com>, ukleinek@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org, rafael.v.volkmer@...il.com
Subject: Re: [PATCH] pwm: tiehrpwm: ensures that state.enabled is
synchronized during .probe()
Hi Rafael,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.12 next-20241128]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rafael-V-Volkmer/pwm-tiehrpwm-ensures-that-state-enabled-is-synchronized-during-probe/20241129-114649
base: linus/master
patch link: https://lore.kernel.org/r/20241129034334.27203-1-rafael.v.volkmer%40gmail.com
patch subject: [PATCH] pwm: tiehrpwm: ensures that state.enabled is synchronized during .probe()
config: alpha-randconfig-r053-20241129 (https://download.01.org/0day-ci/archive/20241129/202411291940.6T4OMy3k-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241129/202411291940.6T4OMy3k-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411291940.6T4OMy3k-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/pwm/pwm-tiehrpwm.c: In function 'ehrpwm_pwm_probe':
>> drivers/pwm/pwm-tiehrpwm.c:642:32: error: 'struct ehrpwm_pwm_chip' has no member named 'chip'
642 | ehrpwm_get_hw_state(&pc->chip, &pc->chip.pwms[0], &state);
| ^~
drivers/pwm/pwm-tiehrpwm.c:642:43: error: 'struct ehrpwm_pwm_chip' has no member named 'chip'
642 | ehrpwm_get_hw_state(&pc->chip, &pc->chip.pwms[0], &state);
| ^~
>> drivers/pwm/pwm-tiehrpwm.c:642:60: error: 'state' undeclared (first use in this function); did you mean 'statx'?
642 | ehrpwm_get_hw_state(&pc->chip, &pc->chip.pwms[0], &state);
| ^~~~~
| statx
drivers/pwm/pwm-tiehrpwm.c:642:60: note: each undeclared identifier is reported only once for each function it appears in
drivers/pwm/pwm-tiehrpwm.c:664:27: error: 'struct ehrpwm_pwm_chip' has no member named 'chip'
664 | pwmchip_remove(&pc->chip);
| ^~
vim +642 drivers/pwm/pwm-tiehrpwm.c
584
585 static int ehrpwm_pwm_probe(struct platform_device *pdev)
586 {
587 struct device_node *np = pdev->dev.of_node;
588 struct ehrpwm_pwm_chip *pc;
589 struct pwm_chip *chip;
590 bool tbclk_enabled;
591 struct clk *clk;
592 int ret;
593
594 chip = devm_pwmchip_alloc(&pdev->dev, NUM_PWM_CHANNEL, sizeof(*pc));
595 if (IS_ERR(chip))
596 return PTR_ERR(chip);
597 pc = to_ehrpwm_pwm_chip(chip);
598
599 clk = devm_clk_get(&pdev->dev, "fck");
600 if (IS_ERR(clk)) {
601 if (of_device_is_compatible(np, "ti,am33xx-ecap")) {
602 dev_warn(&pdev->dev, "Binding is obsolete.\n");
603 clk = devm_clk_get(pdev->dev.parent, "fck");
604 }
605 }
606
607 if (IS_ERR(clk))
608 return dev_err_probe(&pdev->dev, PTR_ERR(clk), "Failed to get fck\n");
609
610 pc->clk_rate = clk_get_rate(clk);
611 if (!pc->clk_rate) {
612 dev_err(&pdev->dev, "failed to get clock rate\n");
613 return -EINVAL;
614 }
615
616 chip->ops = &ehrpwm_pwm_ops;
617
618 pc->mmio_base = devm_platform_ioremap_resource(pdev, 0);
619 if (IS_ERR(pc->mmio_base))
620 return PTR_ERR(pc->mmio_base);
621
622 /* Acquire tbclk for Time Base EHRPWM submodule */
623 pc->tbclk = devm_clk_get(&pdev->dev, "tbclk");
624 if (IS_ERR(pc->tbclk))
625 return dev_err_probe(&pdev->dev, PTR_ERR(pc->tbclk), "Failed to get tbclk\n");
626
627 ret = clk_prepare(pc->tbclk);
628 if (ret < 0) {
629 dev_err(&pdev->dev, "clk_prepare() failed: %d\n", ret);
630 return ret;
631 }
632
633 ret = pwmchip_add(chip);
634 if (ret < 0) {
635 dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
636 goto err_clk_unprepare;
637 }
638
639 platform_set_drvdata(pdev, chip);
640 pm_runtime_enable(&pdev->dev);
641
> 642 ehrpwm_get_hw_state(&pc->chip, &pc->chip.pwms[0], &state);
643
644 if(state.enabled == true) {
645 ret = clk_prepare_enable(pc->tbclk);
646 if (ret) {
647 dev_err(&pdev->dev, "clk_prepare_enable() failed: %d\n", ret);
648 goto err_pwmchip_remove;
649 }
650
651 tbclk_enabled = true;
652
653 ret = pm_runtime_get_sync(&pdev->dev);
654 if(ret < 0) {
655 dev_err(&pdev->dev, "pm_runtime_get_sync() failed: %d\n", ret);
656 clk_disable_unprepare(pc->tbclk);
657 goto err_pwmchip_remove;
658 }
659 }
660
661 return 0;
662
663 err_pwmchip_remove:
664 pwmchip_remove(&pc->chip);
665 err_clk_unprepare:
666 if(tbclk_enabled)
667 clk_unprepare(pc->tbclk);
668
669 return ret;
670 }
671
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists