linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable
@ 2022-04-13  7:11 Ramon Fried
  2022-04-13  7:27 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2022-04-13  7:11 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: Ramon Fried

MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS are hard-coded to 5.
This is not always sufficiant for some drivers.
Make the MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS configurable by
providing Kconfig int option with the defaut value of 5.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
---
 drivers/uio/Kconfig        | 14 ++++++++++++++
 include/linux/uio_driver.h |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 2e16c5338e5b..bc1fe83cec13 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -13,6 +13,20 @@ menuconfig UIO
 
 if UIO
 
+config UIO_MAX_MAPS
+	int "Maximum of memory nodes each uio device support(1-128)"
+	range 1 128
+	default 5
+	help
+	  Maximum memory mapping each uio device can support.
+
+config UIO_MAX_PORT_REGIONS
+	int "Maximum of port regions each uio device support(1-128)"
+	range 1 128
+	default 5
+	help
+	  Maximum port regions each uio device can support.
+
 config UIO_CIF
 	tristate "generic Hilscher CIF Card driver"
 	depends on PCI
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 47c5962b876b..f7dc47347c71 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_UIO_MAX_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_UIO_MAX_PORT_REGIONS
 
 struct uio_device {
 	struct module           *owner;
-- 
2.30.2


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

* Re: [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable
  2022-04-13  7:11 [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable Ramon Fried
@ 2022-04-13  7:27 ` Greg KH
  2022-04-13  7:40   ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-04-13  7:27 UTC (permalink / raw)
  To: Ramon Fried; +Cc: linux-kernel

On Wed, Apr 13, 2022 at 10:11:37AM +0300, Ramon Fried wrote:
> MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS are hard-coded to 5.
> This is not always sufficiant for some drivers.

Why not?  What in-kernel drivers need more than this?

> Make the MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS configurable by
> providing Kconfig int option with the defaut value of 5.

Spelling check?

> 
> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
> ---
>  drivers/uio/Kconfig        | 14 ++++++++++++++
>  include/linux/uio_driver.h |  4 ++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
> index 2e16c5338e5b..bc1fe83cec13 100644
> --- a/drivers/uio/Kconfig
> +++ b/drivers/uio/Kconfig
> @@ -13,6 +13,20 @@ menuconfig UIO
>  
>  if UIO
>  
> +config UIO_MAX_MAPS
> +	int "Maximum of memory nodes each uio device support(1-128)"

Space before "(" please.

> +	range 1 128
> +	default 5
> +	help
> +	  Maximum memory mapping each uio device can support.

Any hints as to what this means in more detail?

> +
> +config UIO_MAX_PORT_REGIONS
> +	int "Maximum of port regions each uio device support(1-128)"
> +	range 1 128
> +	default 5
> +	help
> +	  Maximum port regions each uio device can support.

Again more detail please.

thanks,

greg k-h

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

* Re: [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable
  2022-04-13  7:27 ` Greg KH
@ 2022-04-13  7:40   ` Ramon Fried
  2022-04-13  7:45     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ramon Fried @ 2022-04-13  7:40 UTC (permalink / raw)
  To: Greg KH; +Cc: LKML

On Wed, Apr 13, 2022 at 10:28 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Apr 13, 2022 at 10:11:37AM +0300, Ramon Fried wrote:
> > MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS are hard-coded to 5.
> > This is not always sufficiant for some drivers.
>
> Why not?  What in-kernel drivers need more than this?
Obviously kernel drivers don't need more, but I'm developing a driver
that needs more.
>
> > Make the MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS configurable by
> > providing Kconfig int option with the defaut value of 5.
>
> Spelling check?
Ack, will do.
>
> >
> > Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
> > ---
> >  drivers/uio/Kconfig        | 14 ++++++++++++++
> >  include/linux/uio_driver.h |  4 ++--
> >  2 files changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
> > index 2e16c5338e5b..bc1fe83cec13 100644
> > --- a/drivers/uio/Kconfig
> > +++ b/drivers/uio/Kconfig
> > @@ -13,6 +13,20 @@ menuconfig UIO
> >
> >  if UIO
> >
> > +config UIO_MAX_MAPS
> > +     int "Maximum of memory nodes each uio device support(1-128)"
>
> Space before "(" please.
Ack
>
> > +     range 1 128
> > +     default 5
> > +     help
> > +       Maximum memory mapping each uio device can support.
>
> Any hints as to what this means in more detail?
Sure.
>
> > +
> > +config UIO_MAX_PORT_REGIONS
> > +     int "Maximum of port regions each uio device support(1-128)"
> > +     range 1 128
> > +     default 5
> > +     help
> > +       Maximum port regions each uio device can support.
>
> Again more detail please.
Sure.
>
> thanks,
>
> greg k-h

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

* Re: [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable
  2022-04-13  7:40   ` Ramon Fried
@ 2022-04-13  7:45     ` Greg KH
  2022-04-13  7:55       ` Ramon Fried
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-04-13  7:45 UTC (permalink / raw)
  To: Ramon Fried; +Cc: LKML

On Wed, Apr 13, 2022 at 10:40:09AM +0300, Ramon Fried wrote:
> On Wed, Apr 13, 2022 at 10:28 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Apr 13, 2022 at 10:11:37AM +0300, Ramon Fried wrote:
> > > MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS are hard-coded to 5.
> > > This is not always sufficiant for some drivers.
> >
> > Why not?  What in-kernel drivers need more than this?
> Obviously kernel drivers don't need more, but I'm developing a driver
> that needs more.

Great, let's consider this change at the same time you submit your
driver, otherwise it doesn't make much sense now, right?

thanks,

greg k-h

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

* Re: [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable
  2022-04-13  7:45     ` Greg KH
@ 2022-04-13  7:55       ` Ramon Fried
  0 siblings, 0 replies; 5+ messages in thread
From: Ramon Fried @ 2022-04-13  7:55 UTC (permalink / raw)
  To: Greg KH; +Cc: LKML

On Wed, Apr 13, 2022 at 10:46 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Wed, Apr 13, 2022 at 10:40:09AM +0300, Ramon Fried wrote:
> > On Wed, Apr 13, 2022 at 10:28 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Wed, Apr 13, 2022 at 10:11:37AM +0300, Ramon Fried wrote:
> > > > MAX_UIO_MAPS and MAX_UIO_PORT_REGIONS are hard-coded to 5.
> > > > This is not always sufficiant for some drivers.
> > >
> > > Why not?  What in-kernel drivers need more than this?
> > Obviously kernel drivers don't need more, but I'm developing a driver
> > that needs more.
>
> Great, let's consider this change at the same time you submit your
> driver, otherwise it doesn't make much sense now, right?
NP.
>
> thanks,
>
> greg k-h

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

end of thread, other threads:[~2022-04-13  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13  7:11 [PATCH] uio: make MAX_UIO_MAPS & MAX_UIO_PORT_REGIONS configurable Ramon Fried
2022-04-13  7:27 ` Greg KH
2022-04-13  7:40   ` Ramon Fried
2022-04-13  7:45     ` Greg KH
2022-04-13  7:55       ` Ramon Fried

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