Re: [PATCH v6 2/5] PCI: qcom: Add retry logic for link to be stable in L1ss

From: kernel test robot
Date: Mon Sep 19 2022 - 12:23:59 EST


Hi Krishna,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on helgaas-pci/next]
[also build test WARNING on next-20220919]
[cannot apply to clk/clk-next linus/master v6.0-rc6]
[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/Krishna-chaitanya-chundru/PCI-qcom-Add-system-suspend-resume-support/20220909-164906
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: arm64-randconfig-r002-20220919 (https://download.01.org/0day-ci/archive/20220920/202209200020.ASFgBZac-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/629a2c707a31ccfdf891d6b580cf3e8c62ab9169
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Krishna-chaitanya-chundru/PCI-qcom-Add-system-suspend-resume-support/20220909-164906
git checkout 629a2c707a31ccfdf891d6b580cf3e8c62ab9169
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/pci/controller/dwc/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/pci/controller/dwc/pcie-qcom.c:1834:6: warning: format specifies type 'int' but the argument has type 's64' (aka 'long long') [-Wformat]
ktime_to_ms(ktime_get() - start));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:158:46: note: expanded from macro 'dev_dbg'
dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
_dev_printk(level, dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
1 warning generated.


vim +1834 drivers/pci/controller/dwc/pcie-qcom.c

1808
1809 static int __maybe_unused qcom_pcie_pm_suspend(struct qcom_pcie *pcie)
1810 {
1811 u32 val;
1812 ktime_t timeout, start;
1813 struct dw_pcie *pci = pcie->pci;
1814 struct device *dev = pci->dev;
1815
1816 if (!pcie->cfg->supports_system_suspend)
1817 return 0;
1818
1819 start = ktime_get();
1820 /* Wait max 200 ms */
1821 timeout = ktime_add_ms(start, 200);
1822
1823 while (1) {
1824
1825 if (!dw_pcie_link_up(pci)) {
1826 dev_warn(dev, "Link is not active\n");
1827 break;
1828 }
1829
1830 /* if the link is not in l1ss don't turn off clocks */
1831 val = readl(pcie->parf + PCIE20_PARF_PM_STTS);
1832 if ((val & PCIE20_PARF_PM_STTS_LINKST_IN_L1SUB)) {
1833 dev_dbg(dev, "Link enters L1ss after %d ms\n",
> 1834 ktime_to_ms(ktime_get() - start));
1835 break;
1836 }
1837
1838 if (ktime_after(ktime_get(), timeout)) {
1839 dev_warn(dev, "Link is not in L1ss\n");
1840 return 0;
1841 }
1842
1843 udelay(1000);
1844 }
1845
1846 if (pcie->cfg->ops->suspend)
1847 pcie->cfg->ops->suspend(pcie);
1848
1849 pcie->is_suspended = true;
1850
1851 return 0;
1852 }
1853

--
0-DAY CI Kernel Test Service
https://01.org/lkp