Re: [v4,2/3] PCI: mediatek: Add new generation controller support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jianjun,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pci/next]
[also build test WARNING on v5.10-rc4 next-20201118]
[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/Jianjun-Wang/PCI-mediatek-Add-new-generation-controller-support/20201118-163418
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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/4b8f2b90a9127b0c70b6949026559172a2f5e707
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jianjun-Wang/PCI-mediatek-Add-new-generation-controller-support/20201118-163418
        git checkout 4b8f2b90a9127b0c70b6949026559172a2f5e707
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:409,
                    from include/linux/kernel.h:16,
                    from include/linux/clk.h:13,
                    from drivers/pci/controller/pcie-mediatek-gen3.c:9:
   drivers/pci/controller/pcie-mediatek-gen3.c: In function 'mtk_pcie_startup_port':
>> drivers/pci/controller/pcie-mediatek-gen3.c:304:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
     129 |   func(&id, ##__VA_ARGS__);  \
         |               ^~~~~~~~~~~
   include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
     161 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,   \
         |  ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |  ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                       ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:3: note: in expansion of macro 'dev_dbg'
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |   ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:63: note: format string is defined here
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                                                           ~~~~^
         |                                                               |
         |                                                               long long unsigned int
         |                                                           %#x
   In file included from include/linux/printk.h:409,
                    from include/linux/kernel.h:16,
                    from include/linux/clk.h:13,
                    from drivers/pci/controller/pcie-mediatek-gen3.c:9:
   drivers/pci/controller/pcie-mediatek-gen3.c:304:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
     129 |   func(&id, ##__VA_ARGS__);  \
         |               ^~~~~~~~~~~
   include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
     161 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,   \
         |  ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |  ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                       ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:3: note: in expansion of macro 'dev_dbg'
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |   ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:81: note: format string is defined here
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                                                                             ~~~~^
         |                                                                                 |
         |                                                                                 long long unsigned int
         |                                                                             %#x
   In file included from include/linux/printk.h:409,
                    from include/linux/kernel.h:16,
                    from include/linux/clk.h:13,
                    from drivers/pci/controller/pcie-mediatek-gen3.c:9:
   drivers/pci/controller/pcie-mediatek-gen3.c:304:22: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 8 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:129:15: note: in definition of macro '__dynamic_func_call'
     129 |   func(&id, ##__VA_ARGS__);  \
         |               ^~~~~~~~~~~
   include/linux/dynamic_debug.h:161:2: note: in expansion of macro '_dynamic_func_call'
     161 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,   \
         |  ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:2: note: in expansion of macro 'dynamic_dev_dbg'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |  ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:123:23: note: in expansion of macro 'dev_fmt'
     123 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                       ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:3: note: in expansion of macro 'dev_dbg'
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |   ^~~~~~~
   drivers/pci/controller/pcie-mediatek-gen3.c:304:95: note: format string is defined here
     304 |   dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
         |                                                                                           ~~~~^
         |                                                                                               |
         |                                                                                               long long unsigned int
         |                                                                                           %#x

vim +304 drivers/pci/controller/pcie-mediatek-gen3.c

   241	
   242	static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
   243	{
   244		struct resource_entry *entry;
   245		struct pci_host_bridge *host = pci_host_bridge_from_priv(port);
   246		unsigned int table_index = 0;
   247		int err;
   248		u32 val;
   249	
   250		/* Set as RC mode */
   251		val = readl(port->base + PCIE_SETTING_REG);
   252		val |= PCIE_RC_MODE;
   253		writel(val, port->base + PCIE_SETTING_REG);
   254	
   255		/* Set class code */
   256		val = readl(port->base + PCIE_PCI_IDS_1);
   257		val &= ~GENMASK(31, 8);
   258		val |= PCI_CLASS(PCI_CLASS_BRIDGE_PCI << 8);
   259		writel(val, port->base + PCIE_PCI_IDS_1);
   260	
   261		/* Assert all reset signals */
   262		val = readl(port->base + PCIE_RST_CTRL_REG);
   263		val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
   264		writel(val, port->base + PCIE_RST_CTRL_REG);
   265	
   266		/* De-assert reset signals*/
   267		val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB);
   268		writel(val, port->base + PCIE_RST_CTRL_REG);
   269	
   270		/* Delay 100ms to wait the reference clocks become stable */
   271		usleep_range(100 * 1000, 120 * 1000);
   272	
   273		/* De-assert pe reset*/
   274		val &= ~PCIE_PE_RSTB;
   275		writel(val, port->base + PCIE_RST_CTRL_REG);
   276	
   277		/* Check if the link is up or not */
   278		err = readl_poll_timeout(port->base + PCIE_LINK_STATUS_REG, val,
   279				!!(val & PCIE_PORT_LINKUP), 20,
   280				50 * USEC_PER_MSEC);
   281		if (err) {
   282			val = readl(port->base + PCIE_LTSSM_STATUS_REG);
   283			dev_dbg(port->dev, "ltssm reg val: %#x\n", val);
   284			return err;
   285		}
   286	
   287		/* Set PCIe translation windows */
   288		resource_list_for_each_entry(entry, &host->windows) {
   289			unsigned long type = resource_type(entry->res);
   290			struct resource *res = NULL;
   291			resource_size_t cpu_addr;
   292			resource_size_t pci_addr;
   293	
   294			if (!(type & (IORESOURCE_MEM | IORESOURCE_IO)))
   295				continue;
   296	
   297			res = entry->res;
   298			cpu_addr = res->start;
   299			pci_addr = res->start - entry->offset;
   300			mtk_pcie_set_trans_table(port->base + PCIE_TRANS_TABLE_BASE_REG,
   301						 cpu_addr, pci_addr, resource_size(res),
   302						 table_index);
   303	
 > 304			dev_dbg(port->dev, "Set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
   305				(!!(type & IORESOURCE_MEM) ? "MEM" : "IO"), table_index,
   306				cpu_addr, pci_addr, resource_size(res));
   307	
   308			table_index++;
   309		}
   310	
   311		return 0;
   312	}
   313	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux