All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/misc/edu_srpoc.c:68:14: error: implicit declaration of function 'pci_test_and_clear_disconnect_enable'
@ 2026-09-09  6:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-09  6:39 UTC (permalink / raw)
  To: Abhin Parekadan Jose; +Cc: oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Abhin-Parekadan-Jose/PCI-Report-surprise-removal-event/20260905-183858
head:   f51e8b77fe2127c01876734cd72ff3d28f589793
commit: f51e8b77fe2127c01876734cd72ff3d28f589793 misc: Add edu_srpoc surprise removal POC driver
date:   3 days ago
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260909/202609090802.xwkQ0OBv-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260909/202609090802.xwkQ0OBv-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609090802.xwkQ0OBv-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/misc/edu_srpoc.c: In function 'edu_disconnect':
>> drivers/misc/edu_srpoc.c:68:14: error: implicit declaration of function 'pci_test_and_clear_disconnect_enable' [-Wimplicit-function-declaration]
      68 |         if (!pci_test_and_clear_disconnect_enable(pdev))
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/edu_srpoc.c: In function 'edu_probe':
>> drivers/misc/edu_srpoc.c:98:21: error: implicit declaration of function 'pci_iomap'; did you mean 'pcim_iomap'? [-Wimplicit-function-declaration]
      98 |         edu->regs = pci_iomap(pdev, 0, 0);
         |                     ^~~~~~~~~
         |                     pcim_iomap
>> drivers/misc/edu_srpoc.c:98:19: error: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      98 |         edu->regs = pci_iomap(pdev, 0, 0);
         |                   ^
>> drivers/misc/edu_srpoc.c:118:9: error: implicit declaration of function 'pci_set_disconnect_work' [-Wimplicit-function-declaration]
     118 |         pci_set_disconnect_work(pdev);
         |         ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/io.h:12,
                    from include/linux/irq.h:20,
                    from include/asm-generic/hardirq.h:17,
                    from arch/sh/include/asm/hardirq.h:9,
                    from include/linux/hardirq.h:11,
                    from include/linux/interrupt.h:11,
                    from include/linux/pci.h:39,
                    from drivers/misc/edu_srpoc.c:20:
>> arch/sh/include/asm/io.h:122:21: error: implicit declaration of function 'pci_iounmap'; did you mean 'pcim_iounmap'? [-Wimplicit-function-declaration]
     122 | #define pci_iounmap pci_iounmap
         |                     ^~~~~~~~~~~
   drivers/misc/edu_srpoc.c:126:9: note: in expansion of macro 'pci_iounmap'
     126 |         pci_iounmap(pdev, edu->regs);
         |         ^~~~~~~~~~~
   drivers/misc/edu_srpoc.c: In function 'edu_remove':
>> drivers/misc/edu_srpoc.c:145:9: error: implicit declaration of function 'pci_clear_disconnect_work' [-Wimplicit-function-declaration]
     145 |         pci_clear_disconnect_work(pdev);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/edu_srpoc.c: At top level:
>> drivers/misc/edu_srpoc.c:166:1: warning: data definition has no type or storage class
     166 | module_pci_driver(edu_driver);
         | ^~~~~~~~~~~~~~~~~
>> drivers/misc/edu_srpoc.c:166:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Wimplicit-int]
>> drivers/misc/edu_srpoc.c:166:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
>> drivers/misc/edu_srpoc.c:159:26: warning: 'edu_driver' defined but not used [-Wunused-variable]
     159 | static struct pci_driver edu_driver = {
         |                          ^~~~~~~~~~


vim +/pci_test_and_clear_disconnect_enable +68 drivers/misc/edu_srpoc.c

  > 20	#include <linux/pci.h>
    21	#include <linux/interrupt.h>
    22	#include <linux/completion.h>
    23	#include <linux/delay.h>
    24	
    25	#define PCI_VENDOR_ID_EDU	0x1234
    26	#define PCI_DEVICE_ID_EDU	0x11e8
    27	
    28	#define EDU_REG_FACT		0x08
    29	#define EDU_REG_STATUS		0x20
    30	#define EDU_REG_DELAYED_IRQ	0x30
    31	#define EDU_REG_IRQ_STATUS	0x24
    32	#define EDU_REG_IRQ_LOWER	0x64
    33	
    34	#define EDU_STATUS_IRQFACT	0x80
    35	#define EDU_FACT_IRQ		BIT(0)
    36	#define EDU_DELAY_IRQ		BIT(9)
    37	
    38	struct edu_dev {
    39		struct pci_dev		*pdev;
    40		void __iomem		*regs;
    41		struct completion	irq_done;
    42	};
    43	
    44	static irqreturn_t edu_irq_handler(int irq, void *data)
    45	{
    46		struct edu_dev *edu = data;
    47		u32 status;
    48	
    49		status = ioread32(edu->regs + EDU_REG_IRQ_STATUS);
    50		if (!status)
    51			return IRQ_NONE;
    52	
    53		iowrite32(status, edu->regs + EDU_REG_IRQ_LOWER);
    54	
    55		if (status & (EDU_FACT_IRQ | EDU_DELAY_IRQ)) {
    56			complete(&edu->irq_done);
    57		}
    58	
    59		return IRQ_HANDLED;
    60	}
    61	
    62	static void edu_disconnect(struct work_struct *work)
    63	{
    64		struct pci_dev *pdev = container_of(work, struct pci_dev,
    65						    disconnect_work);
    66		struct edu_dev *edu = pci_get_drvdata(pdev);
    67	
  > 68		if (!pci_test_and_clear_disconnect_enable(pdev))
    69			return;
    70	
    71		if (!edu)
    72			return;
    73	
    74		dev_info(&pdev->dev, "disconnect_work fired — unblocking remove()\n");
    75		complete(&edu->irq_done);
    76	}
    77	
    78	static int edu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
    79	{
    80		struct edu_dev *edu;
    81		int err;
    82	
    83		edu = devm_kzalloc(&pdev->dev, sizeof(*edu), GFP_KERNEL);
    84		if (!edu)
    85			return -ENOMEM;
    86	
    87		edu->pdev = pdev;
    88		init_completion(&edu->irq_done);
    89	
    90		err = pci_enable_device(pdev);
    91		if (err)
    92			return err;
    93	
    94		err = pci_request_regions(pdev, "edu_srpoc");
    95		if (err)
    96			goto err_disable;
    97	
  > 98		edu->regs = pci_iomap(pdev, 0, 0);
    99		if (!edu->regs) {
   100			err = -ENOMEM;
   101			goto err_release;
   102		}
   103	
   104		pci_set_master(pdev);
   105	
   106		err = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI | PCI_IRQ_INTX);
   107		if (err < 0)
   108			goto err_iounmap;
   109	
   110		err = request_irq(pci_irq_vector(pdev, 0), edu_irq_handler,
   111				  IRQF_SHARED, "edu_srpoc", edu);
   112		if (err)
   113			goto err_free_vectors;
   114	
   115		pci_set_drvdata(pdev, edu);
   116	
   117		INIT_WORK(&pdev->disconnect_work, edu_disconnect);
 > 118		pci_set_disconnect_work(pdev);
   119	
   120		dev_info(&pdev->dev, "edu_srpoc probed\n");
   121		return 0;
   122	
   123	err_free_vectors:
   124		pci_free_irq_vectors(pdev);
   125	err_iounmap:
 > 126		pci_iounmap(pdev, edu->regs);
   127	err_release:
   128		pci_release_regions(pdev);
   129	err_disable:
   130		pci_disable_device(pdev);
   131		return err;
   132	}
   133	
   134	static void edu_remove(struct pci_dev *pdev)
   135	{
   136		struct edu_dev *edu = pci_get_drvdata(pdev);
   137	
   138		iowrite32(EDU_STATUS_IRQFACT, edu->regs + EDU_REG_STATUS);
   139		iowrite32(600000, edu->regs + EDU_REG_DELAYED_IRQ);
   140	
   141		dev_info(&pdev->dev, "Waiting for IRQ in remove()\n");
   142		wait_for_completion(&edu->irq_done);
   143		dev_info(&pdev->dev, "Unblocked, cleaning up\n");
   144	
 > 145		pci_clear_disconnect_work(pdev);
   146		free_irq(pci_irq_vector(pdev, 0), edu);
   147		pci_free_irq_vectors(pdev);
   148		pci_iounmap(pdev, edu->regs);
   149		pci_release_regions(pdev);
   150		pci_disable_device(pdev);
   151	}
   152	
   153	static const struct pci_device_id edu_ids[] = {
   154		{ PCI_DEVICE(PCI_VENDOR_ID_EDU, PCI_DEVICE_ID_EDU) },
   155		{ 0 }
   156	};
   157	MODULE_DEVICE_TABLE(pci, edu_ids);
   158	
 > 159	static struct pci_driver edu_driver = {
   160		.name		= "edu_srpoc",
   161		.id_table	= edu_ids,
   162		.probe		= edu_probe,
   163		.remove		= edu_remove,
   164	};
   165	
 > 166	module_pci_driver(edu_driver);

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-09  6:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09  6:39 drivers/misc/edu_srpoc.c:68:14: error: implicit declaration of function 'pci_test_and_clear_disconnect_enable' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.