[PATCH V3 7/9] usb: dwc2: Refactor backup/restore of registers
kernel test robot
lkp at intel.com
Thu Aug 22 09:16:40 UTC 2024
Hi Stefan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on arm/for-next arm/fixes v6.11-rc4 next-20240822]
[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/Stefan-Wahren/mailbox-bcm2835-Fix-timeout-during-suspend-mode/20240822-063725
base: linus/master
patch link: https://lore.kernel.org/r/20240821214052.6800-8-wahrenst%40gmx.net
patch subject: [PATCH V3 7/9] usb: dwc2: Refactor backup/restore of registers
config: x86_64-randconfig-161-20240822 (https://download.01.org/0day-ci/archive/20240822/202408221629.jv9AgCrF-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240822/202408221629.jv9AgCrF-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408221629.jv9AgCrF-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/usb/dwc2/gadget.c:5605:28: warning: variable 'dr' set but not used [-Wunused-but-set-variable]
5605 | struct dwc2_dregs_backup *dr;
| ^
1 warning generated.
vim +/dr +5605 drivers/usb/dwc2/gadget.c
be2b960e57154a Artur Petrosyan 2021-04-08 5588
be2b960e57154a Artur Petrosyan 2021-04-08 5589 /*
be2b960e57154a Artur Petrosyan 2021-04-08 5590 * dwc2_gadget_exit_partial_power_down() - Exit controller from device partial
be2b960e57154a Artur Petrosyan 2021-04-08 5591 * power down.
be2b960e57154a Artur Petrosyan 2021-04-08 5592 *
be2b960e57154a Artur Petrosyan 2021-04-08 5593 * @hsotg: Programming view of the DWC_otg controller
be2b960e57154a Artur Petrosyan 2021-04-08 5594 * @restore: indicates whether need to restore the registers or not.
be2b960e57154a Artur Petrosyan 2021-04-08 5595 *
be2b960e57154a Artur Petrosyan 2021-04-08 5596 * Return: non-zero if failed to exit device partial power down.
be2b960e57154a Artur Petrosyan 2021-04-08 5597 *
be2b960e57154a Artur Petrosyan 2021-04-08 5598 * This function is for exiting from device mode partial power down.
be2b960e57154a Artur Petrosyan 2021-04-08 5599 */
be2b960e57154a Artur Petrosyan 2021-04-08 5600 int dwc2_gadget_exit_partial_power_down(struct dwc2_hsotg *hsotg,
be2b960e57154a Artur Petrosyan 2021-04-08 5601 bool restore)
be2b960e57154a Artur Petrosyan 2021-04-08 5602 {
be2b960e57154a Artur Petrosyan 2021-04-08 5603 u32 pcgcctl;
be2b960e57154a Artur Petrosyan 2021-04-08 5604 u32 dctl;
be2b960e57154a Artur Petrosyan 2021-04-08 @5605 struct dwc2_dregs_backup *dr;
be2b960e57154a Artur Petrosyan 2021-04-08 5606 int ret = 0;
be2b960e57154a Artur Petrosyan 2021-04-08 5607
be2b960e57154a Artur Petrosyan 2021-04-08 5608 dr = &hsotg->dr_backup;
be2b960e57154a Artur Petrosyan 2021-04-08 5609
be2b960e57154a Artur Petrosyan 2021-04-08 5610 dev_dbg(hsotg->dev, "Exiting device partial Power Down started.\n");
be2b960e57154a Artur Petrosyan 2021-04-08 5611
be2b960e57154a Artur Petrosyan 2021-04-08 5612 pcgcctl = dwc2_readl(hsotg, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5613 pcgcctl &= ~PCGCTL_STOPPCLK;
be2b960e57154a Artur Petrosyan 2021-04-08 5614 dwc2_writel(hsotg, pcgcctl, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5615
be2b960e57154a Artur Petrosyan 2021-04-08 5616 pcgcctl = dwc2_readl(hsotg, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5617 pcgcctl &= ~PCGCTL_PWRCLMP;
be2b960e57154a Artur Petrosyan 2021-04-08 5618 dwc2_writel(hsotg, pcgcctl, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5619
be2b960e57154a Artur Petrosyan 2021-04-08 5620 pcgcctl = dwc2_readl(hsotg, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5621 pcgcctl &= ~PCGCTL_RSTPDWNMODULE;
be2b960e57154a Artur Petrosyan 2021-04-08 5622 dwc2_writel(hsotg, pcgcctl, PCGCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5623
be2b960e57154a Artur Petrosyan 2021-04-08 5624 udelay(100);
be2b960e57154a Artur Petrosyan 2021-04-08 5625 if (restore) {
78c09c66698a77 Stefan Wahren 2024-08-21 5626 ret = dwc2_gadget_restore_critical_registers(hsotg);
78c09c66698a77 Stefan Wahren 2024-08-21 5627 if (ret)
be2b960e57154a Artur Petrosyan 2021-04-08 5628 return ret;
be2b960e57154a Artur Petrosyan 2021-04-08 5629 }
be2b960e57154a Artur Petrosyan 2021-04-08 5630
be2b960e57154a Artur Petrosyan 2021-04-08 5631 /* Set the Power-On Programming done bit */
be2b960e57154a Artur Petrosyan 2021-04-08 5632 dctl = dwc2_readl(hsotg, DCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5633 dctl |= DCTL_PWRONPRGDONE;
be2b960e57154a Artur Petrosyan 2021-04-08 5634 dwc2_writel(hsotg, dctl, DCTL);
be2b960e57154a Artur Petrosyan 2021-04-08 5635
be2b960e57154a Artur Petrosyan 2021-04-08 5636 /* Set in_ppd flag to 0 as here core exits from suspend. */
be2b960e57154a Artur Petrosyan 2021-04-08 5637 hsotg->in_ppd = 0;
be2b960e57154a Artur Petrosyan 2021-04-08 5638 hsotg->lx_state = DWC2_L0;
be2b960e57154a Artur Petrosyan 2021-04-08 5639
be2b960e57154a Artur Petrosyan 2021-04-08 5640 dev_dbg(hsotg->dev, "Exiting device partial Power Down completed.\n");
be2b960e57154a Artur Petrosyan 2021-04-08 5641 return ret;
be2b960e57154a Artur Petrosyan 2021-04-08 5642 }
012466fc8ccc01 Artur Petrosyan 2021-04-13 5643
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the dri-devel
mailing list