linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'?
@ 2022-07-16 16:21 kernel test robot
  2022-07-22 19:40 ` Bjorn Helgaas
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2022-07-16 16:21 UTC (permalink / raw)
  To: Pali Rohár; +Cc: kbuild-all, linux-pci, Bjorn Helgaas

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/misc
head:   c86c8360959ec706576baf17237dec3004154d4b
commit: c86c8360959ec706576baf17237dec3004154d4b [2/2] arm: ioremap: Fix pci_remap_iospace() when CONFIG_MMU unset
config: arm-randconfig-r016-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170012.RhbvYS0z-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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/helgaas/pci.git/commit/?id=c86c8360959ec706576baf17237dec3004154d4b
        git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
        git fetch --no-tags helgaas-pci pci/misc
        git checkout c86c8360959ec706576baf17237dec3004154d4b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/pcmcia/

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

All errors (new ones prefixed by >>):

   drivers/pcmcia/omap_cf.c: In function 'omap_cf_set_socket':
   drivers/pcmcia/omap_cf.c:127:25: warning: variable 'control' set but not used [-Wunused-but-set-variable]
     127 |         u16             control;
         |                         ^~~~~~~
   drivers/pcmcia/omap_cf.c: In function 'omap_cf_probe':
>> drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? [-Werror=implicit-function-declaration]
     240 |         status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
         |                  ^~~~~~~~~~~~~~~~~
         |                  pci_remap_cfgspace
   cc1: some warnings being treated as errors


vim +240 drivers/pcmcia/omap_cf.c

f74e48a51c38f5 David Brownell   2005-09-09  195  
f74e48a51c38f5 David Brownell   2005-09-09  196  /*
f74e48a51c38f5 David Brownell   2005-09-09  197   * NOTE:  right now the only board-specific platform_data is
f74e48a51c38f5 David Brownell   2005-09-09  198   * "what chipselect is used".  Boards could want more.
f74e48a51c38f5 David Brownell   2005-09-09  199   */
f74e48a51c38f5 David Brownell   2005-09-09  200  
b6d2cccb55b518 David Brownell   2007-04-08  201  static int __init omap_cf_probe(struct platform_device *pdev)
f74e48a51c38f5 David Brownell   2005-09-09  202  {
f74e48a51c38f5 David Brownell   2005-09-09  203  	unsigned		seg;
f74e48a51c38f5 David Brownell   2005-09-09  204  	struct omap_cf_socket	*cf;
f74e48a51c38f5 David Brownell   2005-09-09  205  	int			irq;
f74e48a51c38f5 David Brownell   2005-09-09  206  	int			status;
d87d44f7ab353d Arnd Bergmann    2019-08-05  207  	struct resource		*res;
df99e7bbbec318 Arnd Bergmann    2019-08-06  208  	struct resource		iospace = DEFINE_RES_IO(SZ_64, SZ_4K);
f74e48a51c38f5 David Brownell   2005-09-09  209  
b6d2cccb55b518 David Brownell   2007-04-08  210  	seg = (int) pdev->dev.platform_data;
f74e48a51c38f5 David Brownell   2005-09-09  211  	if (seg == 0 || seg > 3)
f74e48a51c38f5 David Brownell   2005-09-09  212  		return -ENODEV;
f74e48a51c38f5 David Brownell   2005-09-09  213  
f74e48a51c38f5 David Brownell   2005-09-09  214  	/* either CFLASH.IREQ (INT_1610_CF) or some GPIO */
f74e48a51c38f5 David Brownell   2005-09-09  215  	irq = platform_get_irq(pdev, 0);
489447380a2921 David Vrabel     2006-01-19  216  	if (irq < 0)
f74e48a51c38f5 David Brownell   2005-09-09  217  		return -EINVAL;
f74e48a51c38f5 David Brownell   2005-09-09  218  
d87d44f7ab353d Arnd Bergmann    2019-08-05  219  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
d87d44f7ab353d Arnd Bergmann    2019-08-05  220  
cd86128088554d Robert P. J. Day 2006-12-13  221  	cf = kzalloc(sizeof *cf, GFP_KERNEL);
f74e48a51c38f5 David Brownell   2005-09-09  222  	if (!cf)
f74e48a51c38f5 David Brownell   2005-09-09  223  		return -ENOMEM;
41760d0e0f1a01 Kees Cook        2017-10-21  224  	timer_setup(&cf->timer, omap_cf_timer, 0);
f74e48a51c38f5 David Brownell   2005-09-09  225  
f74e48a51c38f5 David Brownell   2005-09-09  226  	cf->pdev = pdev;
b6d2cccb55b518 David Brownell   2007-04-08  227  	platform_set_drvdata(pdev, cf);
f74e48a51c38f5 David Brownell   2005-09-09  228  
f74e48a51c38f5 David Brownell   2005-09-09  229  	/* this primarily just shuts up irq handling noise */
dace145374b8e3 Thomas Gleixner  2006-07-01  230  	status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
f74e48a51c38f5 David Brownell   2005-09-09  231  			driver_name, cf);
f74e48a51c38f5 David Brownell   2005-09-09  232  	if (status < 0)
f74e48a51c38f5 David Brownell   2005-09-09  233  		goto fail0;
f74e48a51c38f5 David Brownell   2005-09-09  234  	cf->irq = irq;
f74e48a51c38f5 David Brownell   2005-09-09  235  	cf->socket.pci_irq = irq;
d87d44f7ab353d Arnd Bergmann    2019-08-05  236  	cf->phys_cf = res->start;
f74e48a51c38f5 David Brownell   2005-09-09  237  
f74e48a51c38f5 David Brownell   2005-09-09  238  	/* pcmcia layer only remaps "real" memory */
df99e7bbbec318 Arnd Bergmann    2019-08-06  239  	cf->socket.io_offset = iospace.start;
df99e7bbbec318 Arnd Bergmann    2019-08-06 @240  	status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
df99e7bbbec318 Arnd Bergmann    2019-08-06  241  	if (status) {
70d3a462fc244b Wang ShaoBo      2020-11-25  242  		status = -ENOMEM;
f74e48a51c38f5 David Brownell   2005-09-09  243  		goto fail1;
70d3a462fc244b Wang ShaoBo      2020-11-25  244  	}
f74e48a51c38f5 David Brownell   2005-09-09  245  
70d3a462fc244b Wang ShaoBo      2020-11-25  246  	if (!request_mem_region(cf->phys_cf, SZ_8K, driver_name)) {
70d3a462fc244b Wang ShaoBo      2020-11-25  247  		status = -ENXIO;
f74e48a51c38f5 David Brownell   2005-09-09  248  		goto fail1;
70d3a462fc244b Wang ShaoBo      2020-11-25  249  	}
f74e48a51c38f5 David Brownell   2005-09-09  250  
f74e48a51c38f5 David Brownell   2005-09-09  251  	/* NOTE:  CF conflicts with MMC1 */
f74e48a51c38f5 David Brownell   2005-09-09  252  	omap_cfg_reg(W11_1610_CF_CD1);
f74e48a51c38f5 David Brownell   2005-09-09  253  	omap_cfg_reg(P11_1610_CF_CD2);
f74e48a51c38f5 David Brownell   2005-09-09  254  	omap_cfg_reg(R11_1610_CF_IOIS16);
f74e48a51c38f5 David Brownell   2005-09-09  255  	omap_cfg_reg(V10_1610_CF_IREQ);
f74e48a51c38f5 David Brownell   2005-09-09  256  	omap_cfg_reg(W10_1610_CF_RESET);
f74e48a51c38f5 David Brownell   2005-09-09  257  
030b15457d8069 Tony Lindgren    2008-07-03  258  	omap_writew(~(1 << seg), CF_CFG);
f74e48a51c38f5 David Brownell   2005-09-09  259  
f74e48a51c38f5 David Brownell   2005-09-09  260  	pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq);
f74e48a51c38f5 David Brownell   2005-09-09  261  
f74e48a51c38f5 David Brownell   2005-09-09  262  	/* CF uses armxor_ck, which is "always" available */
f74e48a51c38f5 David Brownell   2005-09-09  263  
f74e48a51c38f5 David Brownell   2005-09-09  264  	pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name,
030b15457d8069 Tony Lindgren    2008-07-03  265  		omap_readw(CF_STATUS), omap_readw(CF_CFG),
030b15457d8069 Tony Lindgren    2008-07-03  266  		omap_readw(CF_CONTROL),
f74e48a51c38f5 David Brownell   2005-09-09  267  		omap_cf_present() ? "present" : "(not present)");
f74e48a51c38f5 David Brownell   2005-09-09  268  
f74e48a51c38f5 David Brownell   2005-09-09  269  	cf->socket.owner = THIS_MODULE;
b6d2cccb55b518 David Brownell   2007-04-08  270  	cf->socket.dev.parent = &pdev->dev;
f74e48a51c38f5 David Brownell   2005-09-09  271  	cf->socket.ops = &omap_cf_ops;
f74e48a51c38f5 David Brownell   2005-09-09  272  	cf->socket.resource_ops = &pccard_static_ops;
f74e48a51c38f5 David Brownell   2005-09-09  273  	cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
f74e48a51c38f5 David Brownell   2005-09-09  274  				| SS_CAP_MEM_ALIGN;
f74e48a51c38f5 David Brownell   2005-09-09  275  	cf->socket.map_size = SZ_2K;
dcb9c39236a27c David Brownell   2006-09-30  276  	cf->socket.io[0].res = &cf->iomem;
f74e48a51c38f5 David Brownell   2005-09-09  277  
f74e48a51c38f5 David Brownell   2005-09-09  278  	status = pcmcia_register_socket(&cf->socket);
f74e48a51c38f5 David Brownell   2005-09-09  279  	if (status < 0)
f74e48a51c38f5 David Brownell   2005-09-09  280  		goto fail2;
f74e48a51c38f5 David Brownell   2005-09-09  281  
f74e48a51c38f5 David Brownell   2005-09-09  282  	cf->active = 1;
f74e48a51c38f5 David Brownell   2005-09-09  283  	mod_timer(&cf->timer, jiffies + POLL_INTERVAL);
f74e48a51c38f5 David Brownell   2005-09-09  284  	return 0;
f74e48a51c38f5 David Brownell   2005-09-09  285  
f74e48a51c38f5 David Brownell   2005-09-09  286  fail2:
f74e48a51c38f5 David Brownell   2005-09-09  287  	release_mem_region(cf->phys_cf, SZ_8K);
f74e48a51c38f5 David Brownell   2005-09-09  288  fail1:
f74e48a51c38f5 David Brownell   2005-09-09  289  	free_irq(irq, cf);
f74e48a51c38f5 David Brownell   2005-09-09  290  fail0:
f74e48a51c38f5 David Brownell   2005-09-09  291  	kfree(cf);
f74e48a51c38f5 David Brownell   2005-09-09  292  	return status;
f74e48a51c38f5 David Brownell   2005-09-09  293  }
f74e48a51c38f5 David Brownell   2005-09-09  294  

:::::: The code at line 240 was first introduced by commit
:::::: df99e7bbbec3180693b3d932a9cbc88346e2a30e ARM: omap1: use pci_remap_iospace() for omap_cf

:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: Arnd Bergmann <arnd@arndb.de>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'?
  2022-07-16 16:21 [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? kernel test robot
@ 2022-07-22 19:40 ` Bjorn Helgaas
  2022-07-22 20:19   ` Pali Rohár
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2022-07-22 19:40 UTC (permalink / raw)
  To: Pali Rohár; +Cc: kbuild-all, linux-pci, kernel test robot

On Sun, Jul 17, 2022 at 12:21:13AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/misc
> head:   c86c8360959ec706576baf17237dec3004154d4b
> commit: c86c8360959ec706576baf17237dec3004154d4b [2/2] arm: ioremap: Fix pci_remap_iospace() when CONFIG_MMU unset
> config: arm-randconfig-r016-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170012.RhbvYS0z-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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/helgaas/pci.git/commit/?id=c86c8360959ec706576baf17237dec3004154d4b
>         git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
>         git fetch --no-tags helgaas-pci pci/misc
>         git checkout c86c8360959ec706576baf17237dec3004154d4b
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/pcmcia/
> 
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/pcmcia/omap_cf.c: In function 'omap_cf_set_socket':
>    drivers/pcmcia/omap_cf.c:127:25: warning: variable 'control' set but not used [-Wunused-but-set-variable]
>      127 |         u16             control;
>          |                         ^~~~~~~

The above is a pre-existing warning, legitimate, but not our problem.

>    drivers/pcmcia/omap_cf.c: In function 'omap_cf_probe':
> >> drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? [-Werror=implicit-function-declaration]
>      240 |         status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
>          |                  ^~~~~~~~~~~~~~~~~
>          |                  pci_remap_cfgspace

This config (arm-randconfig-r016-20220715 above) has:

  # CONFIG_MMU is not set

I'll drop c86c8360959e ("arm: ioremap: Fix pci_remap_iospace() when
CONFIG_MMU unset") from pci/misc while we figure this out.

Related but separate question: I don't know why arm/include/asm/io.h
needs to have a declaration for pci_remap_iospace().  It looks like a
duplicate of the one in include/linux/pci.h, so I don't think we need
both.

> vim +240 drivers/pcmcia/omap_cf.c
> 
> f74e48a51c38f5 David Brownell   2005-09-09  195  
> f74e48a51c38f5 David Brownell   2005-09-09  196  /*
> f74e48a51c38f5 David Brownell   2005-09-09  197   * NOTE:  right now the only board-specific platform_data is
> f74e48a51c38f5 David Brownell   2005-09-09  198   * "what chipselect is used".  Boards could want more.
> f74e48a51c38f5 David Brownell   2005-09-09  199   */
> f74e48a51c38f5 David Brownell   2005-09-09  200  
> b6d2cccb55b518 David Brownell   2007-04-08  201  static int __init omap_cf_probe(struct platform_device *pdev)
> f74e48a51c38f5 David Brownell   2005-09-09  202  {
> f74e48a51c38f5 David Brownell   2005-09-09  203  	unsigned		seg;
> f74e48a51c38f5 David Brownell   2005-09-09  204  	struct omap_cf_socket	*cf;
> f74e48a51c38f5 David Brownell   2005-09-09  205  	int			irq;
> f74e48a51c38f5 David Brownell   2005-09-09  206  	int			status;
> d87d44f7ab353d Arnd Bergmann    2019-08-05  207  	struct resource		*res;
> df99e7bbbec318 Arnd Bergmann    2019-08-06  208  	struct resource		iospace = DEFINE_RES_IO(SZ_64, SZ_4K);
> f74e48a51c38f5 David Brownell   2005-09-09  209  
> b6d2cccb55b518 David Brownell   2007-04-08  210  	seg = (int) pdev->dev.platform_data;
> f74e48a51c38f5 David Brownell   2005-09-09  211  	if (seg == 0 || seg > 3)
> f74e48a51c38f5 David Brownell   2005-09-09  212  		return -ENODEV;
> f74e48a51c38f5 David Brownell   2005-09-09  213  
> f74e48a51c38f5 David Brownell   2005-09-09  214  	/* either CFLASH.IREQ (INT_1610_CF) or some GPIO */
> f74e48a51c38f5 David Brownell   2005-09-09  215  	irq = platform_get_irq(pdev, 0);
> 489447380a2921 David Vrabel     2006-01-19  216  	if (irq < 0)
> f74e48a51c38f5 David Brownell   2005-09-09  217  		return -EINVAL;
> f74e48a51c38f5 David Brownell   2005-09-09  218  
> d87d44f7ab353d Arnd Bergmann    2019-08-05  219  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> d87d44f7ab353d Arnd Bergmann    2019-08-05  220  
> cd86128088554d Robert P. J. Day 2006-12-13  221  	cf = kzalloc(sizeof *cf, GFP_KERNEL);
> f74e48a51c38f5 David Brownell   2005-09-09  222  	if (!cf)
> f74e48a51c38f5 David Brownell   2005-09-09  223  		return -ENOMEM;
> 41760d0e0f1a01 Kees Cook        2017-10-21  224  	timer_setup(&cf->timer, omap_cf_timer, 0);
> f74e48a51c38f5 David Brownell   2005-09-09  225  
> f74e48a51c38f5 David Brownell   2005-09-09  226  	cf->pdev = pdev;
> b6d2cccb55b518 David Brownell   2007-04-08  227  	platform_set_drvdata(pdev, cf);
> f74e48a51c38f5 David Brownell   2005-09-09  228  
> f74e48a51c38f5 David Brownell   2005-09-09  229  	/* this primarily just shuts up irq handling noise */
> dace145374b8e3 Thomas Gleixner  2006-07-01  230  	status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
> f74e48a51c38f5 David Brownell   2005-09-09  231  			driver_name, cf);
> f74e48a51c38f5 David Brownell   2005-09-09  232  	if (status < 0)
> f74e48a51c38f5 David Brownell   2005-09-09  233  		goto fail0;
> f74e48a51c38f5 David Brownell   2005-09-09  234  	cf->irq = irq;
> f74e48a51c38f5 David Brownell   2005-09-09  235  	cf->socket.pci_irq = irq;
> d87d44f7ab353d Arnd Bergmann    2019-08-05  236  	cf->phys_cf = res->start;
> f74e48a51c38f5 David Brownell   2005-09-09  237  
> f74e48a51c38f5 David Brownell   2005-09-09  238  	/* pcmcia layer only remaps "real" memory */
> df99e7bbbec318 Arnd Bergmann    2019-08-06  239  	cf->socket.io_offset = iospace.start;
> df99e7bbbec318 Arnd Bergmann    2019-08-06 @240  	status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
> df99e7bbbec318 Arnd Bergmann    2019-08-06  241  	if (status) {
> 70d3a462fc244b Wang ShaoBo      2020-11-25  242  		status = -ENOMEM;
> f74e48a51c38f5 David Brownell   2005-09-09  243  		goto fail1;
> 70d3a462fc244b Wang ShaoBo      2020-11-25  244  	}
> f74e48a51c38f5 David Brownell   2005-09-09  245  
> 70d3a462fc244b Wang ShaoBo      2020-11-25  246  	if (!request_mem_region(cf->phys_cf, SZ_8K, driver_name)) {
> 70d3a462fc244b Wang ShaoBo      2020-11-25  247  		status = -ENXIO;
> f74e48a51c38f5 David Brownell   2005-09-09  248  		goto fail1;
> 70d3a462fc244b Wang ShaoBo      2020-11-25  249  	}
> f74e48a51c38f5 David Brownell   2005-09-09  250  
> f74e48a51c38f5 David Brownell   2005-09-09  251  	/* NOTE:  CF conflicts with MMC1 */
> f74e48a51c38f5 David Brownell   2005-09-09  252  	omap_cfg_reg(W11_1610_CF_CD1);
> f74e48a51c38f5 David Brownell   2005-09-09  253  	omap_cfg_reg(P11_1610_CF_CD2);
> f74e48a51c38f5 David Brownell   2005-09-09  254  	omap_cfg_reg(R11_1610_CF_IOIS16);
> f74e48a51c38f5 David Brownell   2005-09-09  255  	omap_cfg_reg(V10_1610_CF_IREQ);
> f74e48a51c38f5 David Brownell   2005-09-09  256  	omap_cfg_reg(W10_1610_CF_RESET);
> f74e48a51c38f5 David Brownell   2005-09-09  257  
> 030b15457d8069 Tony Lindgren    2008-07-03  258  	omap_writew(~(1 << seg), CF_CFG);
> f74e48a51c38f5 David Brownell   2005-09-09  259  
> f74e48a51c38f5 David Brownell   2005-09-09  260  	pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq);
> f74e48a51c38f5 David Brownell   2005-09-09  261  
> f74e48a51c38f5 David Brownell   2005-09-09  262  	/* CF uses armxor_ck, which is "always" available */
> f74e48a51c38f5 David Brownell   2005-09-09  263  
> f74e48a51c38f5 David Brownell   2005-09-09  264  	pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name,
> 030b15457d8069 Tony Lindgren    2008-07-03  265  		omap_readw(CF_STATUS), omap_readw(CF_CFG),
> 030b15457d8069 Tony Lindgren    2008-07-03  266  		omap_readw(CF_CONTROL),
> f74e48a51c38f5 David Brownell   2005-09-09  267  		omap_cf_present() ? "present" : "(not present)");
> f74e48a51c38f5 David Brownell   2005-09-09  268  
> f74e48a51c38f5 David Brownell   2005-09-09  269  	cf->socket.owner = THIS_MODULE;
> b6d2cccb55b518 David Brownell   2007-04-08  270  	cf->socket.dev.parent = &pdev->dev;
> f74e48a51c38f5 David Brownell   2005-09-09  271  	cf->socket.ops = &omap_cf_ops;
> f74e48a51c38f5 David Brownell   2005-09-09  272  	cf->socket.resource_ops = &pccard_static_ops;
> f74e48a51c38f5 David Brownell   2005-09-09  273  	cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
> f74e48a51c38f5 David Brownell   2005-09-09  274  				| SS_CAP_MEM_ALIGN;
> f74e48a51c38f5 David Brownell   2005-09-09  275  	cf->socket.map_size = SZ_2K;
> dcb9c39236a27c David Brownell   2006-09-30  276  	cf->socket.io[0].res = &cf->iomem;
> f74e48a51c38f5 David Brownell   2005-09-09  277  
> f74e48a51c38f5 David Brownell   2005-09-09  278  	status = pcmcia_register_socket(&cf->socket);
> f74e48a51c38f5 David Brownell   2005-09-09  279  	if (status < 0)
> f74e48a51c38f5 David Brownell   2005-09-09  280  		goto fail2;
> f74e48a51c38f5 David Brownell   2005-09-09  281  
> f74e48a51c38f5 David Brownell   2005-09-09  282  	cf->active = 1;
> f74e48a51c38f5 David Brownell   2005-09-09  283  	mod_timer(&cf->timer, jiffies + POLL_INTERVAL);
> f74e48a51c38f5 David Brownell   2005-09-09  284  	return 0;
> f74e48a51c38f5 David Brownell   2005-09-09  285  
> f74e48a51c38f5 David Brownell   2005-09-09  286  fail2:
> f74e48a51c38f5 David Brownell   2005-09-09  287  	release_mem_region(cf->phys_cf, SZ_8K);
> f74e48a51c38f5 David Brownell   2005-09-09  288  fail1:
> f74e48a51c38f5 David Brownell   2005-09-09  289  	free_irq(irq, cf);
> f74e48a51c38f5 David Brownell   2005-09-09  290  fail0:
> f74e48a51c38f5 David Brownell   2005-09-09  291  	kfree(cf);
> f74e48a51c38f5 David Brownell   2005-09-09  292  	return status;
> f74e48a51c38f5 David Brownell   2005-09-09  293  }
> f74e48a51c38f5 David Brownell   2005-09-09  294  
> 
> :::::: The code at line 240 was first introduced by commit
> :::::: df99e7bbbec3180693b3d932a9cbc88346e2a30e ARM: omap1: use pci_remap_iospace() for omap_cf
> 
> :::::: TO: Arnd Bergmann <arnd@arndb.de>
> :::::: CC: Arnd Bergmann <arnd@arndb.de>
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'?
  2022-07-22 19:40 ` Bjorn Helgaas
@ 2022-07-22 20:19   ` Pali Rohár
  2022-07-25  7:31     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Pali Rohár @ 2022-07-22 20:19 UTC (permalink / raw)
  To: Arnd Bergmann, Bjorn Helgaas; +Cc: kbuild-all, linux-pci, kernel test robot

+ Arnd

On Friday 22 July 2022 14:40:23 Bjorn Helgaas wrote:
> On Sun, Jul 17, 2022 at 12:21:13AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/misc
> > head:   c86c8360959ec706576baf17237dec3004154d4b
> > commit: c86c8360959ec706576baf17237dec3004154d4b [2/2] arm: ioremap: Fix pci_remap_iospace() when CONFIG_MMU unset
> > config: arm-randconfig-r016-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170012.RhbvYS0z-lkp@intel.com/config)
> > compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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/helgaas/pci.git/commit/?id=c86c8360959ec706576baf17237dec3004154d4b
> >         git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
> >         git fetch --no-tags helgaas-pci pci/misc
> >         git checkout c86c8360959ec706576baf17237dec3004154d4b
> >         # save the config file
> >         mkdir build_dir && cp config build_dir/.config
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/pcmcia/
> > 
> > If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    drivers/pcmcia/omap_cf.c: In function 'omap_cf_set_socket':
> >    drivers/pcmcia/omap_cf.c:127:25: warning: variable 'control' set but not used [-Wunused-but-set-variable]
> >      127 |         u16             control;
> >          |                         ^~~~~~~
> 
> The above is a pre-existing warning, legitimate, but not our problem.
> 
> >    drivers/pcmcia/omap_cf.c: In function 'omap_cf_probe':
> > >> drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? [-Werror=implicit-function-declaration]
> >      240 |         status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
> >          |                  ^~~~~~~~~~~~~~~~~
> >          |                  pci_remap_cfgspace
> 
> This config (arm-randconfig-r016-20220715 above) has:
> 
>   # CONFIG_MMU is not set

Arnd, any idea what is happening here with pcmcia omap driver?

It is just missing some include header file, or broken dependences in
Kconfig?

> I'll drop c86c8360959e ("arm: ioremap: Fix pci_remap_iospace() when
> CONFIG_MMU unset") from pci/misc while we figure this out.
> 
> Related but separate question: I don't know why arm/include/asm/io.h
> needs to have a declaration for pci_remap_iospace().  It looks like a
> duplicate of the one in include/linux/pci.h, so I don't think we need
> both.
> 
> > vim +240 drivers/pcmcia/omap_cf.c
> > 
> > f74e48a51c38f5 David Brownell   2005-09-09  195  
> > f74e48a51c38f5 David Brownell   2005-09-09  196  /*
> > f74e48a51c38f5 David Brownell   2005-09-09  197   * NOTE:  right now the only board-specific platform_data is
> > f74e48a51c38f5 David Brownell   2005-09-09  198   * "what chipselect is used".  Boards could want more.
> > f74e48a51c38f5 David Brownell   2005-09-09  199   */
> > f74e48a51c38f5 David Brownell   2005-09-09  200  
> > b6d2cccb55b518 David Brownell   2007-04-08  201  static int __init omap_cf_probe(struct platform_device *pdev)
> > f74e48a51c38f5 David Brownell   2005-09-09  202  {
> > f74e48a51c38f5 David Brownell   2005-09-09  203  	unsigned		seg;
> > f74e48a51c38f5 David Brownell   2005-09-09  204  	struct omap_cf_socket	*cf;
> > f74e48a51c38f5 David Brownell   2005-09-09  205  	int			irq;
> > f74e48a51c38f5 David Brownell   2005-09-09  206  	int			status;
> > d87d44f7ab353d Arnd Bergmann    2019-08-05  207  	struct resource		*res;
> > df99e7bbbec318 Arnd Bergmann    2019-08-06  208  	struct resource		iospace = DEFINE_RES_IO(SZ_64, SZ_4K);
> > f74e48a51c38f5 David Brownell   2005-09-09  209  
> > b6d2cccb55b518 David Brownell   2007-04-08  210  	seg = (int) pdev->dev.platform_data;
> > f74e48a51c38f5 David Brownell   2005-09-09  211  	if (seg == 0 || seg > 3)
> > f74e48a51c38f5 David Brownell   2005-09-09  212  		return -ENODEV;
> > f74e48a51c38f5 David Brownell   2005-09-09  213  
> > f74e48a51c38f5 David Brownell   2005-09-09  214  	/* either CFLASH.IREQ (INT_1610_CF) or some GPIO */
> > f74e48a51c38f5 David Brownell   2005-09-09  215  	irq = platform_get_irq(pdev, 0);
> > 489447380a2921 David Vrabel     2006-01-19  216  	if (irq < 0)
> > f74e48a51c38f5 David Brownell   2005-09-09  217  		return -EINVAL;
> > f74e48a51c38f5 David Brownell   2005-09-09  218  
> > d87d44f7ab353d Arnd Bergmann    2019-08-05  219  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > d87d44f7ab353d Arnd Bergmann    2019-08-05  220  
> > cd86128088554d Robert P. J. Day 2006-12-13  221  	cf = kzalloc(sizeof *cf, GFP_KERNEL);
> > f74e48a51c38f5 David Brownell   2005-09-09  222  	if (!cf)
> > f74e48a51c38f5 David Brownell   2005-09-09  223  		return -ENOMEM;
> > 41760d0e0f1a01 Kees Cook        2017-10-21  224  	timer_setup(&cf->timer, omap_cf_timer, 0);
> > f74e48a51c38f5 David Brownell   2005-09-09  225  
> > f74e48a51c38f5 David Brownell   2005-09-09  226  	cf->pdev = pdev;
> > b6d2cccb55b518 David Brownell   2007-04-08  227  	platform_set_drvdata(pdev, cf);
> > f74e48a51c38f5 David Brownell   2005-09-09  228  
> > f74e48a51c38f5 David Brownell   2005-09-09  229  	/* this primarily just shuts up irq handling noise */
> > dace145374b8e3 Thomas Gleixner  2006-07-01  230  	status = request_irq(irq, omap_cf_irq, IRQF_SHARED,
> > f74e48a51c38f5 David Brownell   2005-09-09  231  			driver_name, cf);
> > f74e48a51c38f5 David Brownell   2005-09-09  232  	if (status < 0)
> > f74e48a51c38f5 David Brownell   2005-09-09  233  		goto fail0;
> > f74e48a51c38f5 David Brownell   2005-09-09  234  	cf->irq = irq;
> > f74e48a51c38f5 David Brownell   2005-09-09  235  	cf->socket.pci_irq = irq;
> > d87d44f7ab353d Arnd Bergmann    2019-08-05  236  	cf->phys_cf = res->start;
> > f74e48a51c38f5 David Brownell   2005-09-09  237  
> > f74e48a51c38f5 David Brownell   2005-09-09  238  	/* pcmcia layer only remaps "real" memory */
> > df99e7bbbec318 Arnd Bergmann    2019-08-06  239  	cf->socket.io_offset = iospace.start;
> > df99e7bbbec318 Arnd Bergmann    2019-08-06 @240  	status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
> > df99e7bbbec318 Arnd Bergmann    2019-08-06  241  	if (status) {
> > 70d3a462fc244b Wang ShaoBo      2020-11-25  242  		status = -ENOMEM;
> > f74e48a51c38f5 David Brownell   2005-09-09  243  		goto fail1;
> > 70d3a462fc244b Wang ShaoBo      2020-11-25  244  	}
> > f74e48a51c38f5 David Brownell   2005-09-09  245  
> > 70d3a462fc244b Wang ShaoBo      2020-11-25  246  	if (!request_mem_region(cf->phys_cf, SZ_8K, driver_name)) {
> > 70d3a462fc244b Wang ShaoBo      2020-11-25  247  		status = -ENXIO;
> > f74e48a51c38f5 David Brownell   2005-09-09  248  		goto fail1;
> > 70d3a462fc244b Wang ShaoBo      2020-11-25  249  	}
> > f74e48a51c38f5 David Brownell   2005-09-09  250  
> > f74e48a51c38f5 David Brownell   2005-09-09  251  	/* NOTE:  CF conflicts with MMC1 */
> > f74e48a51c38f5 David Brownell   2005-09-09  252  	omap_cfg_reg(W11_1610_CF_CD1);
> > f74e48a51c38f5 David Brownell   2005-09-09  253  	omap_cfg_reg(P11_1610_CF_CD2);
> > f74e48a51c38f5 David Brownell   2005-09-09  254  	omap_cfg_reg(R11_1610_CF_IOIS16);
> > f74e48a51c38f5 David Brownell   2005-09-09  255  	omap_cfg_reg(V10_1610_CF_IREQ);
> > f74e48a51c38f5 David Brownell   2005-09-09  256  	omap_cfg_reg(W10_1610_CF_RESET);
> > f74e48a51c38f5 David Brownell   2005-09-09  257  
> > 030b15457d8069 Tony Lindgren    2008-07-03  258  	omap_writew(~(1 << seg), CF_CFG);
> > f74e48a51c38f5 David Brownell   2005-09-09  259  
> > f74e48a51c38f5 David Brownell   2005-09-09  260  	pr_info("%s: cs%d on irq %d\n", driver_name, seg, irq);
> > f74e48a51c38f5 David Brownell   2005-09-09  261  
> > f74e48a51c38f5 David Brownell   2005-09-09  262  	/* CF uses armxor_ck, which is "always" available */
> > f74e48a51c38f5 David Brownell   2005-09-09  263  
> > f74e48a51c38f5 David Brownell   2005-09-09  264  	pr_debug("%s: sts %04x cfg %04x control %04x %s\n", driver_name,
> > 030b15457d8069 Tony Lindgren    2008-07-03  265  		omap_readw(CF_STATUS), omap_readw(CF_CFG),
> > 030b15457d8069 Tony Lindgren    2008-07-03  266  		omap_readw(CF_CONTROL),
> > f74e48a51c38f5 David Brownell   2005-09-09  267  		omap_cf_present() ? "present" : "(not present)");
> > f74e48a51c38f5 David Brownell   2005-09-09  268  
> > f74e48a51c38f5 David Brownell   2005-09-09  269  	cf->socket.owner = THIS_MODULE;
> > b6d2cccb55b518 David Brownell   2007-04-08  270  	cf->socket.dev.parent = &pdev->dev;
> > f74e48a51c38f5 David Brownell   2005-09-09  271  	cf->socket.ops = &omap_cf_ops;
> > f74e48a51c38f5 David Brownell   2005-09-09  272  	cf->socket.resource_ops = &pccard_static_ops;
> > f74e48a51c38f5 David Brownell   2005-09-09  273  	cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
> > f74e48a51c38f5 David Brownell   2005-09-09  274  				| SS_CAP_MEM_ALIGN;
> > f74e48a51c38f5 David Brownell   2005-09-09  275  	cf->socket.map_size = SZ_2K;
> > dcb9c39236a27c David Brownell   2006-09-30  276  	cf->socket.io[0].res = &cf->iomem;
> > f74e48a51c38f5 David Brownell   2005-09-09  277  
> > f74e48a51c38f5 David Brownell   2005-09-09  278  	status = pcmcia_register_socket(&cf->socket);
> > f74e48a51c38f5 David Brownell   2005-09-09  279  	if (status < 0)
> > f74e48a51c38f5 David Brownell   2005-09-09  280  		goto fail2;
> > f74e48a51c38f5 David Brownell   2005-09-09  281  
> > f74e48a51c38f5 David Brownell   2005-09-09  282  	cf->active = 1;
> > f74e48a51c38f5 David Brownell   2005-09-09  283  	mod_timer(&cf->timer, jiffies + POLL_INTERVAL);
> > f74e48a51c38f5 David Brownell   2005-09-09  284  	return 0;
> > f74e48a51c38f5 David Brownell   2005-09-09  285  
> > f74e48a51c38f5 David Brownell   2005-09-09  286  fail2:
> > f74e48a51c38f5 David Brownell   2005-09-09  287  	release_mem_region(cf->phys_cf, SZ_8K);
> > f74e48a51c38f5 David Brownell   2005-09-09  288  fail1:
> > f74e48a51c38f5 David Brownell   2005-09-09  289  	free_irq(irq, cf);
> > f74e48a51c38f5 David Brownell   2005-09-09  290  fail0:
> > f74e48a51c38f5 David Brownell   2005-09-09  291  	kfree(cf);
> > f74e48a51c38f5 David Brownell   2005-09-09  292  	return status;
> > f74e48a51c38f5 David Brownell   2005-09-09  293  }
> > f74e48a51c38f5 David Brownell   2005-09-09  294  
> > 
> > :::::: The code at line 240 was first introduced by commit
> > :::::: df99e7bbbec3180693b3d932a9cbc88346e2a30e ARM: omap1: use pci_remap_iospace() for omap_cf
> > 
> > :::::: TO: Arnd Bergmann <arnd@arndb.de>
> > :::::: CC: Arnd Bergmann <arnd@arndb.de>
> > 
> > -- 
> > 0-DAY CI Kernel Test Service
> > https://01.org/lkp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'?
  2022-07-22 20:19   ` Pali Rohár
@ 2022-07-25  7:31     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-07-25  7:31 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Arnd Bergmann, Bjorn Helgaas, kbuild-all, linux-pci, kernel test robot

On Fri, Jul 22, 2022 at 10:19 PM Pali Rohár <pali@kernel.org> wrote:
> On Friday 22 July 2022 14:40:23 Bjorn Helgaas wrote:
> > On Sun, Jul 17, 2022 at 12:21:13AM +0800, kernel test robot wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/misc
> > > head:   c86c8360959ec706576baf17237dec3004154d4b
> > > commit: c86c8360959ec706576baf17237dec3004154d4b [2/2] arm: ioremap: Fix pci_remap_iospace() when CONFIG_MMU unset
> > > config: arm-randconfig-r016-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170012.RhbvYS0z-lkp@intel.com/config)
> > > compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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/helgaas/pci.git/commit/?id=c86c8360959ec706576baf17237dec3004154d4b
> > >         git remote add helgaas-pci https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
> > >         git fetch --no-tags helgaas-pci pci/misc
> > >         git checkout c86c8360959ec706576baf17237dec3004154d4b
> > >         # save the config file
> > >         mkdir build_dir && cp config build_dir/.config
> > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/pcmcia/
> > >
> > > If you fix the issue, kindly add following tag where applicable
> > > Reported-by: kernel test robot <lkp@intel.com>
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > >    drivers/pcmcia/omap_cf.c: In function 'omap_cf_set_socket':
> > >    drivers/pcmcia/omap_cf.c:127:25: warning: variable 'control' set but not used [-Wunused-but-set-variable]
> > >      127 |         u16             control;
> > >          |                         ^~~~~~~
> >
> > The above is a pre-existing warning, legitimate, but not our problem.
> >
> > >    drivers/pcmcia/omap_cf.c: In function 'omap_cf_probe':
> > > >> drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? [-Werror=implicit-function-declaration]
> > >      240 |         status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K);
> > >          |                  ^~~~~~~~~~~~~~~~~
> > >          |                  pci_remap_cfgspace
> >
> > This config (arm-randconfig-r016-20220715 above) has:
> >
> >   # CONFIG_MMU is not set
>
> Arnd, any idea what is happening here with pcmcia omap driver?

The OMAP PCMCIA driver can be enabled for non-MMU configurations when
compile testing, and it does not depend on PCI:

config OMAP_CF
        tristate "OMAP CompactFlash Controller"
        depends on PCMCIA
        depends on ARCH_OMAP16XX || (ARM && COMPILE_TEST)

> It is just missing some include header file, or broken dependences in
> Kconfig?

The problem is that the generic pci_remap_iospace() is only available
when PCI is enabled, both the function definition and the declaration are
guarded with CONFIG_PCI.

Since the I/O space accessors are shared between PCI, ISA and
PCMCIA, we have to use the same pci_remap_iospace() function to
map it when any of the three are in use. For some platforms,
we work around it using a static boot-time mapping to PCI_IOBASE
with iotable_init(), but pci_remap_iospace() is generally the cleaner
approach.

It's probably best to just mark this driver as depending on !MMU,
since we don't care about MMU-less OMAP kernels and the driver
is not usable elsewhere.

        Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-25  7:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-16 16:21 [helgaas-pci:pci/misc 2/2] drivers/pcmcia/omap_cf.c:240:18: error: implicit declaration of function 'pci_remap_iospace'; did you mean 'pci_remap_cfgspace'? kernel test robot
2022-07-22 19:40 ` Bjorn Helgaas
2022-07-22 20:19   ` Pali Rohár
2022-07-25  7:31     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).