All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: mscc: Fix non-GPL export of regmap APIs
@ 2021-08-10 12:37 Mark Brown
  2021-08-10 12:49 ` Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Brown @ 2021-08-10 12:37 UTC (permalink / raw)
  To: Vladimir Oltean, Claudiu Manoil, Alexandre Belloni
  Cc: UNGLinuxDriver, David S . Miller, Jakub Kicinski, netdev, Mark Brown

The ocelot driver makes use of regmap, wrapping it with driver specific
operations that are thin wrappers around the core regmap APIs. These are
exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap
exports which is frowned upon. Add _GPL suffixes to at least the APIs that
are doing register I/O.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/net/ethernet/mscc/ocelot_io.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_io.c b/drivers/net/ethernet/mscc/ocelot_io.c
index ea4e83410fe4..7390fa3980ec 100644
--- a/drivers/net/ethernet/mscc/ocelot_io.c
+++ b/drivers/net/ethernet/mscc/ocelot_io.c
@@ -21,7 +21,7 @@ u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset)
 		    ocelot->map[target][reg & REG_MASK] + offset, &val);
 	return val;
 }
-EXPORT_SYMBOL(__ocelot_read_ix);
+EXPORT_SYMBOL_GPL(__ocelot_read_ix);
 
 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset)
 {
@@ -32,7 +32,7 @@ void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset)
 	regmap_write(ocelot->targets[target],
 		     ocelot->map[target][reg & REG_MASK] + offset, val);
 }
-EXPORT_SYMBOL(__ocelot_write_ix);
+EXPORT_SYMBOL_GPL(__ocelot_write_ix);
 
 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg,
 		     u32 offset)
@@ -45,7 +45,7 @@ void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg,
 			   ocelot->map[target][reg & REG_MASK] + offset,
 			   mask, val);
 }
-EXPORT_SYMBOL(__ocelot_rmw_ix);
+EXPORT_SYMBOL_GPL(__ocelot_rmw_ix);
 
 u32 ocelot_port_readl(struct ocelot_port *port, u32 reg)
 {
@@ -58,7 +58,7 @@ u32 ocelot_port_readl(struct ocelot_port *port, u32 reg)
 	regmap_read(port->target, ocelot->map[target][reg & REG_MASK], &val);
 	return val;
 }
-EXPORT_SYMBOL(ocelot_port_readl);
+EXPORT_SYMBOL_GPL(ocelot_port_readl);
 
 void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg)
 {
@@ -69,7 +69,7 @@ void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg)
 
 	regmap_write(port->target, ocelot->map[target][reg & REG_MASK], val);
 }
-EXPORT_SYMBOL(ocelot_port_writel);
+EXPORT_SYMBOL_GPL(ocelot_port_writel);
 
 void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg)
 {
@@ -77,7 +77,7 @@ void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg)
 
 	ocelot_port_writel(port, (cur & (~mask)) | val, reg);
 }
-EXPORT_SYMBOL(ocelot_port_rmwl);
+EXPORT_SYMBOL_GPL(ocelot_port_rmwl);
 
 u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target,
 			    u32 reg, u32 offset)
@@ -128,7 +128,7 @@ int ocelot_regfields_init(struct ocelot *ocelot,
 
 	return 0;
 }
-EXPORT_SYMBOL(ocelot_regfields_init);
+EXPORT_SYMBOL_GPL(ocelot_regfields_init);
 
 static struct regmap_config ocelot_regmap_config = {
 	.reg_bits	= 32,
@@ -148,4 +148,4 @@ struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res)
 
 	return devm_regmap_init_mmio(ocelot->dev, regs, &ocelot_regmap_config);
 }
-EXPORT_SYMBOL(ocelot_regmap_init);
+EXPORT_SYMBOL_GPL(ocelot_regmap_init);
-- 
2.20.1


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

* Re: [PATCH] net: mscc: Fix non-GPL export of regmap APIs
  2021-08-10 12:37 [PATCH] net: mscc: Fix non-GPL export of regmap APIs Mark Brown
@ 2021-08-10 12:49 ` Alexandre Belloni
  2021-08-10 12:55 ` Vladimir Oltean
  2021-08-11 22:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2021-08-10 12:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Vladimir Oltean, Claudiu Manoil, UNGLinuxDriver,
	David S . Miller, Jakub Kicinski, netdev

On 10/08/2021 13:37:48+0100, Mark Brown wrote:
> The ocelot driver makes use of regmap, wrapping it with driver specific
> operations that are thin wrappers around the core regmap APIs. These are
> exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap
> exports which is frowned upon. Add _GPL suffixes to at least the APIs that
> are doing register I/O.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/net/ethernet/mscc/ocelot_io.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mscc/ocelot_io.c b/drivers/net/ethernet/mscc/ocelot_io.c
> index ea4e83410fe4..7390fa3980ec 100644
> --- a/drivers/net/ethernet/mscc/ocelot_io.c
> +++ b/drivers/net/ethernet/mscc/ocelot_io.c
> @@ -21,7 +21,7 @@ u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset)
>  		    ocelot->map[target][reg & REG_MASK] + offset, &val);
>  	return val;
>  }
> -EXPORT_SYMBOL(__ocelot_read_ix);
> +EXPORT_SYMBOL_GPL(__ocelot_read_ix);
>  
>  void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset)
>  {
> @@ -32,7 +32,7 @@ void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset)
>  	regmap_write(ocelot->targets[target],
>  		     ocelot->map[target][reg & REG_MASK] + offset, val);
>  }
> -EXPORT_SYMBOL(__ocelot_write_ix);
> +EXPORT_SYMBOL_GPL(__ocelot_write_ix);
>  
>  void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg,
>  		     u32 offset)
> @@ -45,7 +45,7 @@ void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg,
>  			   ocelot->map[target][reg & REG_MASK] + offset,
>  			   mask, val);
>  }
> -EXPORT_SYMBOL(__ocelot_rmw_ix);
> +EXPORT_SYMBOL_GPL(__ocelot_rmw_ix);
>  
>  u32 ocelot_port_readl(struct ocelot_port *port, u32 reg)
>  {
> @@ -58,7 +58,7 @@ u32 ocelot_port_readl(struct ocelot_port *port, u32 reg)
>  	regmap_read(port->target, ocelot->map[target][reg & REG_MASK], &val);
>  	return val;
>  }
> -EXPORT_SYMBOL(ocelot_port_readl);
> +EXPORT_SYMBOL_GPL(ocelot_port_readl);
>  
>  void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg)
>  {
> @@ -69,7 +69,7 @@ void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg)
>  
>  	regmap_write(port->target, ocelot->map[target][reg & REG_MASK], val);
>  }
> -EXPORT_SYMBOL(ocelot_port_writel);
> +EXPORT_SYMBOL_GPL(ocelot_port_writel);
>  
>  void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg)
>  {
> @@ -77,7 +77,7 @@ void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg)
>  
>  	ocelot_port_writel(port, (cur & (~mask)) | val, reg);
>  }
> -EXPORT_SYMBOL(ocelot_port_rmwl);
> +EXPORT_SYMBOL_GPL(ocelot_port_rmwl);
>  
>  u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target,
>  			    u32 reg, u32 offset)
> @@ -128,7 +128,7 @@ int ocelot_regfields_init(struct ocelot *ocelot,
>  
>  	return 0;
>  }
> -EXPORT_SYMBOL(ocelot_regfields_init);
> +EXPORT_SYMBOL_GPL(ocelot_regfields_init);
>  
>  static struct regmap_config ocelot_regmap_config = {
>  	.reg_bits	= 32,
> @@ -148,4 +148,4 @@ struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res)
>  
>  	return devm_regmap_init_mmio(ocelot->dev, regs, &ocelot_regmap_config);
>  }
> -EXPORT_SYMBOL(ocelot_regmap_init);
> +EXPORT_SYMBOL_GPL(ocelot_regmap_init);
> -- 
> 2.20.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] net: mscc: Fix non-GPL export of regmap APIs
  2021-08-10 12:37 [PATCH] net: mscc: Fix non-GPL export of regmap APIs Mark Brown
  2021-08-10 12:49 ` Alexandre Belloni
@ 2021-08-10 12:55 ` Vladimir Oltean
  2021-08-10 14:34   ` Mark Brown
  2021-08-11 22:00 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Vladimir Oltean @ 2021-08-10 12:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver,
	David S . Miller, Jakub Kicinski, netdev

On Tue, Aug 10, 2021 at 01:37:48PM +0100, Mark Brown wrote:
> The ocelot driver makes use of regmap, wrapping it with driver specific
> operations that are thin wrappers around the core regmap APIs. These are
> exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap
> exports which is frowned upon. Add _GPL suffixes to at least the APIs that
> are doing register I/O.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Stupid question: is this enough? We also have order-two symbols exported
as non-GPL, which call one of {__ocelot_read_ix, __ocelot_write_ix,
__ocelot_rmw_ix, ocelot_port_writel, ocelot_port_rmwl, ocelot_regfields_init,
ocelot_regmap_init}, and therefore indirectly call regmap. In fact, I
think that all symbols exported by ocelot do that.

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

* Re: [PATCH] net: mscc: Fix non-GPL export of regmap APIs
  2021-08-10 12:55 ` Vladimir Oltean
@ 2021-08-10 14:34   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2021-08-10 14:34 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver,
	David S . Miller, Jakub Kicinski, netdev

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

On Tue, Aug 10, 2021 at 12:55:37PM +0000, Vladimir Oltean wrote:
> On Tue, Aug 10, 2021 at 01:37:48PM +0100, Mark Brown wrote:

> > The ocelot driver makes use of regmap, wrapping it with driver specific
> > operations that are thin wrappers around the core regmap APIs. These are
> > exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap
> > exports which is frowned upon. Add _GPL suffixes to at least the APIs that
> > are doing register I/O.

> Stupid question: is this enough? We also have order-two symbols exported
> as non-GPL, which call one of {__ocelot_read_ix, __ocelot_write_ix,
> __ocelot_rmw_ix, ocelot_port_writel, ocelot_port_rmwl, ocelot_regfields_init,
> ocelot_regmap_init}, and therefore indirectly call regmap. In fact, I
> think that all symbols exported by ocelot do that.

Yes, that'd be much better I think - I have to confess I didn't look at
the driver in too much detail beyond these most obvious examples to
figure out how exactly they slotted in structurally.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] net: mscc: Fix non-GPL export of regmap APIs
  2021-08-10 12:37 [PATCH] net: mscc: Fix non-GPL export of regmap APIs Mark Brown
  2021-08-10 12:49 ` Alexandre Belloni
  2021-08-10 12:55 ` Vladimir Oltean
@ 2021-08-11 22:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-11 22:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni,
	UNGLinuxDriver, davem, kuba, netdev

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 10 Aug 2021 13:37:48 +0100 you wrote:
> The ocelot driver makes use of regmap, wrapping it with driver specific
> operations that are thin wrappers around the core regmap APIs. These are
> exported with EXPORT_SYMBOL, dropping the _GPL from the core regmap
> exports which is frowned upon. Add _GPL suffixes to at least the APIs that
> are doing register I/O.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> 
> [...]

Here is the summary with links:
  - net: mscc: Fix non-GPL export of regmap APIs
    https://git.kernel.org/netdev/net-next/c/bc8968e420dc

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-08-11 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 12:37 [PATCH] net: mscc: Fix non-GPL export of regmap APIs Mark Brown
2021-08-10 12:49 ` Alexandre Belloni
2021-08-10 12:55 ` Vladimir Oltean
2021-08-10 14:34   ` Mark Brown
2021-08-11 22:00 ` patchwork-bot+netdevbpf

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.