* [PATCH V3] UIO: make maximum memory and port regions configurable
@ 2020-03-19 7:39 Qiang Su
2020-03-19 7:48 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Qiang Su @ 2020-03-19 7:39 UTC (permalink / raw)
To: gregkh, suqiang4; +Cc: linux-kernel
Now each uio device can only support 5 memory regions and
5 port regions. It may be far from enough for some big system.
On the other hand, the hard-coded style is not flexible.
So make these values configurable by menuconfig, thus users
can easily expand them according to their actual situation.
Consider the marco is used as array index, so a range for
the config is set in menuconfig. The range is set as 1 to 512.
The default value is still set as 5 to keep consistent with
current code.
Signed-off-by: Qiang Su <suqiang4@huawei.com>
Reported-by: kbuild test robot <lkp@intel.com>
Reviewed-by: Greg KH <gregkh@linuxfoundation.org>
---
Changes since v1:
also make port regions configurable in menuconfig.
fix kbuild errors.
---
Changes since v2:
provide more information in the help texts.
---
drivers/uio/Kconfig | 28 ++++++++++++++++++++++++++++
include/linux/uio_driver.h | 4 ++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 202ee81cfc2b..669000df80df 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -165,4 +165,32 @@ 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 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 memory regions in uio device configurable.
+ For some big system, you may need to map more memory regions
+ than the default 5. For example, your driver need to access 10
+ discontinuous address space, thus you need to set this value.
+ to 10 or greater.
+
+ If you do not understand, just keep the default value.
+
+config MAX_UIO_PORT_REGIONS
+ depends on UIO
+ int "Maximum of port regions each uio device support(1-512)"
+ range 1 512
+ default 5
+ help
+ make the max number of port regions in uio device configurable.
+ For some big system, you may need to use more port regions than
+ the default 5. For example, your driver need to use 10 port regions
+ of gpio type, then you need to set this value to 10 or greater.
+
+ If you do not understand, just keep the default value.
+
endif
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 01081c4726c0..5dc60088834c 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;
@@ -64,7 +64,7 @@ struct uio_port {
struct uio_portio *portio;
};
-#define MAX_UIO_PORT_REGIONS 5
+#define MAX_UIO_PORT_REGIONS CONFIG_MAX_UIO_PORT_REGIONS
struct uio_device {
struct module *owner;
--
2.12.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH V3] UIO: make maximum memory and port regions configurable
2020-03-19 7:39 [PATCH V3] UIO: make maximum memory and port regions configurable Qiang Su
@ 2020-03-19 7:48 ` Greg KH
2020-03-19 8:07 ` suqiang (C)
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-03-19 7:48 UTC (permalink / raw)
To: Qiang Su; +Cc: linux-kernel
On Thu, Mar 19, 2020 at 03:39:23PM +0800, Qiang Su wrote:
> Now each uio device can only support 5 memory regions and
> 5 port regions. It may be far from enough for some big system.
> On the other hand, the hard-coded style is not flexible.
> So make these values configurable by menuconfig, thus users
> can easily expand them according to their actual situation.
>
> Consider the marco is used as array index, so a range for
> the config is set in menuconfig. The range is set as 1 to 512.
> The default value is still set as 5 to keep consistent with
> current code.
>
> Signed-off-by: Qiang Su <suqiang4@huawei.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> Reviewed-by: Greg KH <gregkh@linuxfoundation.org>
What? No, I did not review this, do not add a tag like that for a patch
that I have not explicitly given it for.
And how is the kbuild bot reporting problems that this patch fixes?
Where is that report?
Also, I want this to be dynamic, not static, please do that instead, no
one rebuilds their kernels for something like this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH V3] UIO: make maximum memory and port regions configurable
2020-03-19 7:48 ` Greg KH
@ 2020-03-19 8:07 ` suqiang (C)
0 siblings, 0 replies; 3+ messages in thread
From: suqiang (C) @ 2020-03-19 8:07 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
>What? No, I did not review this, do not add a tag like that for a patch that I have not explicitly given it for.
A: Sorry, I misunderstood the means of the message.
>And how is the kbuild bot reporting problems that this patch fixes?
>Where is that report?
A: It's a stupid mistake beacause of my wrong git operation. Just ignore it please.
>Also, I want this to be dynamic, not static, please do that instead, no one rebuilds their kernels for something like this.
A: Yes, I got it. I will finish a dynamic implement and send a new patch. I had already sent the PACTH V3 before I read your previous email reply. Sorry for that.
thanks,
Qiang Su
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-19 8:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 7:39 [PATCH V3] UIO: make maximum memory and port regions configurable Qiang Su
2020-03-19 7:48 ` Greg KH
2020-03-19 8:07 ` suqiang (C)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome