linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig
@ 2020-03-06  7:11 Qiang Su
  2020-03-06 14:55 ` kbuild test robot
  2020-03-06 15:04 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Qiang Su @ 2020-03-06  7:11 UTC (permalink / raw)
  To: gregkh, suqiang4; +Cc: linux-kernel, leeyou.li, nixiaoming

Now each uio device can only support 5 memory entry. It is
far from enough for some big system. On the other hand, the
hard-coded style is not flexible.
Consider the marco is used as array index, so we set a range
for the config in menuconfig. The range is set as 1 to 512.
The default value is still 5 to keep consistent with current
code.

Signed-off-by: Qiang Su <suqiang4@huawei.com>
---
 drivers/uio/Kconfig        | 9 +++++++++
 include/linux/uio_driver.h | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 202ee81cfc2b..31c53f1dd86a 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -165,4 +165,13 @@ config UIO_HV_GENERIC
 	  to network and storage devices from userspace.
 
 	  If you compile this as a module, it will be called uio_hv_generic.
+
+config UIO_MAX_UIO_MAPS
+	depends on UIO
+	int "Maximum of memory nodes each uio device support(1-512)"
+	range 1 512
+	default 5
+	help
+	  make the max number of uio device configurable.
+
 endif
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 01081c4726c0..efdf8f6bf8bf 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -44,7 +44,7 @@ struct uio_mem {
 	struct uio_map		*map;
 };
 
-#define MAX_UIO_MAPS	5
+#define MAX_UIO_MAPS	CONFIG_MAX_UIO_MAPS
 
 struct uio_portio;
 
-- 
2.12.3


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

* Re: [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig
  2020-03-06  7:11 [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig Qiang Su
@ 2020-03-06 14:55 ` kbuild test robot
  2020-03-06 15:04 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2020-03-06 14:55 UTC (permalink / raw)
  To: Qiang Su
  Cc: kbuild-all, gregkh, suqiang4, linux-kernel, leeyou.li, nixiaoming

[-- Attachment #1: Type: text/plain, Size: 4331 bytes --]

Hi Qiang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v5.6-rc4 next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Qiang-Su/UIO-make-MAX_UIO_MAPS-configurable-by-menuconfig/20200306-192239
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 1f836f5b10f2524d33efde47d2b694b861ecf319
config: nds32-randconfig-a001-20200306 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=nds32 

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

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

   In file included from drivers//uio/uio.c:26:
>> include/linux/uio_driver.h:47:22: error: 'CONFIG_MAX_UIO_MAPS' undeclared here (not in a function); did you mean 'CONFIG_UIO_MAX_UIO_MAPS'?
      47 | #define MAX_UIO_MAPS CONFIG_MAX_UIO_MAPS
         |                      ^~~~~~~~~~~~~~~~~~~
>> include/linux/uio_driver.h:102:22: note: in expansion of macro 'MAX_UIO_MAPS'
     102 |  struct uio_mem  mem[MAX_UIO_MAPS];
         |                      ^~~~~~~~~~~~

vim +47 include/linux/uio_driver.h

    46	
  > 47	#define MAX_UIO_MAPS	CONFIG_MAX_UIO_MAPS
    48	
    49	struct uio_portio;
    50	
    51	/**
    52	 * struct uio_port - description of a UIO port region
    53	 * @name:		name of the port region for identification
    54	 * @start:		start of port region
    55	 * @size:		size of port region
    56	 * @porttype:		type of port (see UIO_PORT_* below)
    57	 * @portio:		for use by the UIO core only.
    58	 */
    59	struct uio_port {
    60		const char		*name;
    61		unsigned long		start;
    62		unsigned long		size;
    63		int			porttype;
    64		struct uio_portio	*portio;
    65	};
    66	
    67	#define MAX_UIO_PORT_REGIONS	5
    68	
    69	struct uio_device {
    70	        struct module           *owner;
    71		struct device		dev;
    72	        int                     minor;
    73	        atomic_t                event;
    74	        struct fasync_struct    *async_queue;
    75	        wait_queue_head_t       wait;
    76	        struct uio_info         *info;
    77		struct mutex		info_lock;
    78	        struct kobject          *map_dir;
    79	        struct kobject          *portio_dir;
    80	};
    81	
    82	/**
    83	 * struct uio_info - UIO device capabilities
    84	 * @uio_dev:		the UIO device this info belongs to
    85	 * @name:		device name
    86	 * @version:		device driver version
    87	 * @mem:		list of mappable memory regions, size==0 for end of list
    88	 * @port:		list of port regions, size==0 for end of list
    89	 * @irq:		interrupt number or UIO_IRQ_CUSTOM
    90	 * @irq_flags:		flags for request_irq()
    91	 * @priv:		optional private data
    92	 * @handler:		the device's irq handler
    93	 * @mmap:		mmap operation for this uio device
    94	 * @open:		open operation for this uio device
    95	 * @release:		release operation for this uio device
    96	 * @irqcontrol:		disable/enable irqs when 0/1 is written to /dev/uioX
    97	 */
    98	struct uio_info {
    99		struct uio_device	*uio_dev;
   100		const char		*name;
   101		const char		*version;
 > 102		struct uio_mem		mem[MAX_UIO_MAPS];
   103		struct uio_port		port[MAX_UIO_PORT_REGIONS];
   104		long			irq;
   105		unsigned long		irq_flags;
   106		void			*priv;
   107		irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
   108		int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
   109		int (*open)(struct uio_info *info, struct inode *inode);
   110		int (*release)(struct uio_info *info, struct inode *inode);
   111		int (*irqcontrol)(struct uio_info *info, s32 irq_on);
   112	};
   113	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34850 bytes --]

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

* Re: [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig
  2020-03-06  7:11 [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig Qiang Su
  2020-03-06 14:55 ` kbuild test robot
@ 2020-03-06 15:04 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2020-03-06 15:04 UTC (permalink / raw)
  To: Qiang Su
  Cc: kbuild-all, gregkh, suqiang4, linux-kernel, leeyou.li, nixiaoming

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

Hi Qiang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v5.6-rc4 next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Qiang-Su/UIO-make-MAX_UIO_MAPS-configurable-by-menuconfig/20200306-192239
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 1f836f5b10f2524d33efde47d2b694b861ecf319
config: x86_64-randconfig-s0-20200306 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All errors (new ones prefixed by >>):

   In file included from drivers/uio/uio.c:26:0:
>> include/linux/uio_driver.h:47:22: error: 'CONFIG_MAX_UIO_MAPS' undeclared here (not in a function)
    #define MAX_UIO_MAPS CONFIG_MAX_UIO_MAPS
                         ^
   include/linux/uio_driver.h:102:22: note: in expansion of macro 'MAX_UIO_MAPS'
     struct uio_mem  mem[MAX_UIO_MAPS];
                         ^

vim +/CONFIG_MAX_UIO_MAPS +47 include/linux/uio_driver.h

    46	
  > 47	#define MAX_UIO_MAPS	CONFIG_MAX_UIO_MAPS
    48	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34592 bytes --]

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

end of thread, other threads:[~2020-03-06 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  7:11 [PATCH] UIO: make MAX_UIO_MAPS configurable by menuconfig Qiang Su
2020-03-06 14:55 ` kbuild test robot
2020-03-06 15:04 ` kbuild test robot

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).