All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
@ 2022-06-30  7:10 Oleksij Rempel
  2022-06-30 16:10 ` Vladimir Oltean
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Oleksij Rempel @ 2022-06-30  7:10 UTC (permalink / raw)
  To: Vladimir Oltean, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Oleksij Rempel, kernel, linux-kernel, netdev

Add spi_device_id entries to silent following warnings:
 SPI driver sja1105 has no spi_device_id for nxp,sja1105e
 SPI driver sja1105 has no spi_device_id for nxp,sja1105t
 SPI driver sja1105 has no spi_device_id for nxp,sja1105p
 SPI driver sja1105 has no spi_device_id for nxp,sja1105q
 SPI driver sja1105 has no spi_device_id for nxp,sja1105r
 SPI driver sja1105 has no spi_device_id for nxp,sja1105s
 SPI driver sja1105 has no spi_device_id for nxp,sja1110a
 SPI driver sja1105 has no spi_device_id for nxp,sja1110b
 SPI driver sja1105 has no spi_device_id for nxp,sja1110c
 SPI driver sja1105 has no spi_device_id for nxp,sja1110d

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/sja1105/sja1105_main.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index b253e27bcfb4..b03d0d0c3dbf 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -3382,12 +3382,28 @@ static const struct of_device_id sja1105_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, sja1105_dt_ids);
 
+static const struct spi_device_id sja1105_spi_ids[] = {
+	{ "sja1105e" },
+	{ "sja1105t" },
+	{ "sja1105p" },
+	{ "sja1105q" },
+	{ "sja1105r" },
+	{ "sja1105s" },
+	{ "sja1110a" },
+	{ "sja1110b" },
+	{ "sja1110c" },
+	{ "sja1110d" },
+	{ },
+};
+MODULE_DEVICE_TABLE(spi, sja1105_spi_ids);
+
 static struct spi_driver sja1105_driver = {
 	.driver = {
 		.name  = "sja1105",
 		.owner = THIS_MODULE,
 		.of_match_table = of_match_ptr(sja1105_dt_ids),
 	},
+	.id_table = sja1105_spi_ids,
 	.probe  = sja1105_probe,
 	.remove = sja1105_remove,
 	.shutdown = sja1105_shutdown,
-- 
2.30.2


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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-06-30  7:10 [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings Oleksij Rempel
@ 2022-06-30 16:10 ` Vladimir Oltean
  2022-07-01  7:18   ` Oleksij Rempel
  2022-07-01 17:17 ` Vladimir Oltean
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Vladimir Oltean @ 2022-06-30 16:10 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-kernel,
	netdev

On Thu, Jun 30, 2022 at 09:10:13AM +0200, Oleksij Rempel wrote:
> Add spi_device_id entries to silent following warnings:
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105e
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105t
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105p
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105q
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105r
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105s
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110a
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110b
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110c
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110d
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/dsa/sja1105/sja1105_main.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
> index b253e27bcfb4..b03d0d0c3dbf 100644
> --- a/drivers/net/dsa/sja1105/sja1105_main.c
> +++ b/drivers/net/dsa/sja1105/sja1105_main.c
> @@ -3382,12 +3382,28 @@ static const struct of_device_id sja1105_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, sja1105_dt_ids);
>  
> +static const struct spi_device_id sja1105_spi_ids[] = {
> +	{ "sja1105e" },
> +	{ "sja1105t" },
> +	{ "sja1105p" },
> +	{ "sja1105q" },
> +	{ "sja1105r" },
> +	{ "sja1105s" },
> +	{ "sja1110a" },
> +	{ "sja1110b" },
> +	{ "sja1110c" },
> +	{ "sja1110d" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(spi, sja1105_spi_ids);
> +
>  static struct spi_driver sja1105_driver = {
>  	.driver = {
>  		.name  = "sja1105",
>  		.owner = THIS_MODULE,
>  		.of_match_table = of_match_ptr(sja1105_dt_ids),
>  	},
> +	.id_table = sja1105_spi_ids,
>  	.probe  = sja1105_probe,
>  	.remove = sja1105_remove,
>  	.shutdown = sja1105_shutdown,
> -- 
> 2.30.2
> 

Do we also need these?

MODULE_ALIAS("spi:sja1105e");
MODULE_ALIAS("spi:sja1105t");
MODULE_ALIAS("spi:sja1105p");
MODULE_ALIAS("spi:sja1105q");
MODULE_ALIAS("spi:sja1105r");
MODULE_ALIAS("spi:sja1105s");
MODULE_ALIAS("spi:sja1110a");
MODULE_ALIAS("spi:sja1110b");
MODULE_ALIAS("spi:sja1110c");
MODULE_ALIAS("spi:sja1110d");

To be honest I don't do much testing with modules at all, so I'm not
sure if udev-based module loading is broken or not. I remember becoming
vaguely curious after commit 5fa6863ba692 ("spi: Check we have a
spi_device_id for each DT compatible"), and I did some basic testing
without the spi_device_id table and MODULE_ALIASes, and it appeared that
udev could still autoload the sja1105 kernel module just fine.
So I'm not really sure what's broken.

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-06-30 16:10 ` Vladimir Oltean
@ 2022-07-01  7:18   ` Oleksij Rempel
  2022-07-01 10:20     ` Vladimir Oltean
  0 siblings, 1 reply; 8+ messages in thread
From: Oleksij Rempel @ 2022-07-01  7:18 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-kernel,
	netdev

On Thu, Jun 30, 2022 at 07:10:59PM +0300, Vladimir Oltean wrote:
> On Thu, Jun 30, 2022 at 09:10:13AM +0200, Oleksij Rempel wrote:
> > Add spi_device_id entries to silent following warnings:
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105e
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105t
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105p
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105q
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105r
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1105s
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1110a
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1110b
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1110c
> >  SPI driver sja1105 has no spi_device_id for nxp,sja1110d
> > 
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> >  drivers/net/dsa/sja1105/sja1105_main.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
> > index b253e27bcfb4..b03d0d0c3dbf 100644
> > --- a/drivers/net/dsa/sja1105/sja1105_main.c
> > +++ b/drivers/net/dsa/sja1105/sja1105_main.c
> > @@ -3382,12 +3382,28 @@ static const struct of_device_id sja1105_dt_ids[] = {
> >  };
> >  MODULE_DEVICE_TABLE(of, sja1105_dt_ids);
> >  
> > +static const struct spi_device_id sja1105_spi_ids[] = {
> > +	{ "sja1105e" },
> > +	{ "sja1105t" },
> > +	{ "sja1105p" },
> > +	{ "sja1105q" },
> > +	{ "sja1105r" },
> > +	{ "sja1105s" },
> > +	{ "sja1110a" },
> > +	{ "sja1110b" },
> > +	{ "sja1110c" },
> > +	{ "sja1110d" },
> > +	{ },
> > +};
> > +MODULE_DEVICE_TABLE(spi, sja1105_spi_ids);
> > +
> >  static struct spi_driver sja1105_driver = {
> >  	.driver = {
> >  		.name  = "sja1105",
> >  		.owner = THIS_MODULE,
> >  		.of_match_table = of_match_ptr(sja1105_dt_ids),
> >  	},
> > +	.id_table = sja1105_spi_ids,
> >  	.probe  = sja1105_probe,
> >  	.remove = sja1105_remove,
> >  	.shutdown = sja1105_shutdown,
> > -- 
> > 2.30.2
> > 
> 
> Do we also need these?
> 
> MODULE_ALIAS("spi:sja1105e");
> MODULE_ALIAS("spi:sja1105t");
> MODULE_ALIAS("spi:sja1105p");
> MODULE_ALIAS("spi:sja1105q");
> MODULE_ALIAS("spi:sja1105r");
> MODULE_ALIAS("spi:sja1105s");
> MODULE_ALIAS("spi:sja1110a");
> MODULE_ALIAS("spi:sja1110b");
> MODULE_ALIAS("spi:sja1110c");
> MODULE_ALIAS("spi:sja1110d");

No, it is not needed. With this patch modinfo will show this additional
aliases:
alias:          spi:sja1110d
alias:          spi:sja1110c
alias:          spi:sja1110b
alias:          spi:sja1110a
alias:          spi:sja1105s
alias:          spi:sja1105r
alias:          spi:sja1105q
alias:          spi:sja1105p
alias:          spi:sja1105t
alias:          spi:sja1105e

This seems to be enough for properly working module auto loading.

> To be honest I don't do much testing with modules at all, so I'm not
> sure if udev-based module loading is broken or not. I remember becoming
> vaguely curious after commit 5fa6863ba692 ("spi: Check we have a
> spi_device_id for each DT compatible"), and I did some basic testing
> without the spi_device_id table and MODULE_ALIASes, and it appeared that
> udev could still autoload the sja1105 kernel module just fine.
> So I'm not really sure what's broken.

Without this patch, module is not automatically loaded on my testing
system.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-07-01  7:18   ` Oleksij Rempel
@ 2022-07-01 10:20     ` Vladimir Oltean
  2022-07-01 11:04       ` Oleksij Rempel
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Oltean @ 2022-07-01 10:20 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-kernel,
	netdev

On Fri, Jul 01, 2022 at 09:18:35AM +0200, Oleksij Rempel wrote:
> Without this patch, module is not automatically loaded on my testing
> system.

Ok, in that case do we need to target 'net' and split the patch into 2,
one with Fixes: 8aa9ebccae87 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
and one with Fixes: 3e77e59bf8cf ("net: dsa: sja1105: add support for the SJA1110 switch family")?

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-07-01 10:20     ` Vladimir Oltean
@ 2022-07-01 11:04       ` Oleksij Rempel
  0 siblings, 0 replies; 8+ messages in thread
From: Oleksij Rempel @ 2022-07-01 11:04 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Andrew Lunn, Florian Fainelli, netdev, linux-kernel,
	David S. Miller, Eric Dumazet, kernel, Jakub Kicinski,
	Paolo Abeni, Vivien Didelot

On Fri, Jul 01, 2022 at 01:20:24PM +0300, Vladimir Oltean wrote:
> On Fri, Jul 01, 2022 at 09:18:35AM +0200, Oleksij Rempel wrote:
> > Without this patch, module is not automatically loaded on my testing
> > system.
> 
> Ok, in that case do we need to target 'net' and split the patch into 2,
> one with Fixes: 8aa9ebccae87 ("net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch")
> and one with Fixes: 3e77e59bf8cf ("net: dsa: sja1105: add support for the SJA1110 switch family")?

Hard to say, it looks like no one reported module autoload issue till
kernel started warn about missing spi_device_id.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-06-30  7:10 [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings Oleksij Rempel
  2022-06-30 16:10 ` Vladimir Oltean
@ 2022-07-01 17:17 ` Vladimir Oltean
  2022-07-01 17:33 ` Florian Fainelli
  2022-07-06 14:43 ` Vladimir Oltean
  3 siblings, 0 replies; 8+ messages in thread
From: Vladimir Oltean @ 2022-07-01 17:17 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-kernel,
	netdev

On Thu, Jun 30, 2022 at 09:10:13AM +0200, Oleksij Rempel wrote:
> Add spi_device_id entries to silent following warnings:
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105e
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105t
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105p
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105q
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105r
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105s
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110a
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110b
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110c
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110d
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-06-30  7:10 [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings Oleksij Rempel
  2022-06-30 16:10 ` Vladimir Oltean
  2022-07-01 17:17 ` Vladimir Oltean
@ 2022-07-01 17:33 ` Florian Fainelli
  2022-07-06 14:43 ` Vladimir Oltean
  3 siblings, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2022-07-01 17:33 UTC (permalink / raw)
  To: Oleksij Rempel, Vladimir Oltean, Andrew Lunn, Vivien Didelot,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: kernel, linux-kernel, netdev

On 6/30/22 00:10, Oleksij Rempel wrote:
> Add spi_device_id entries to silent following warnings:
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105e
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105t
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105p
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105q
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105r
>   SPI driver sja1105 has no spi_device_id for nxp,sja1105s
>   SPI driver sja1105 has no spi_device_id for nxp,sja1110a
>   SPI driver sja1105 has no spi_device_id for nxp,sja1110b
>   SPI driver sja1105 has no spi_device_id for nxp,sja1110c
>   SPI driver sja1105 has no spi_device_id for nxp,sja1110d
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings
  2022-06-30  7:10 [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings Oleksij Rempel
                   ` (2 preceding siblings ...)
  2022-07-01 17:33 ` Florian Fainelli
@ 2022-07-06 14:43 ` Vladimir Oltean
  3 siblings, 0 replies; 8+ messages in thread
From: Vladimir Oltean @ 2022-07-06 14:43 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-kernel,
	netdev

Hi Oleksij,

On Thu, 30 Jun 2022 at 10:10, Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> Add spi_device_id entries to silent following warnings:
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105e
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105t
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105p
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105q
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105r
>  SPI driver sja1105 has no spi_device_id for nxp,sja1105s
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110a
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110b
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110c
>  SPI driver sja1105 has no spi_device_id for nxp,sja1110d
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---

This was marked as "Changes Requested" in patchwork. Could you please
slap a Fixes: tag onto it and resend to net?
Also, would you mind applying the same treatment to
vitesse-vsc73xx-spi.c so that we get rid of the warnings for all DSA
drivers?
You can blame the spi.c commit that introduced the warning.

Thanks!

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

end of thread, other threads:[~2022-07-06 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  7:10 [PATCH net-next v1 1/1] net: dsa: sja1105: silent spi_device_id warnings Oleksij Rempel
2022-06-30 16:10 ` Vladimir Oltean
2022-07-01  7:18   ` Oleksij Rempel
2022-07-01 10:20     ` Vladimir Oltean
2022-07-01 11:04       ` Oleksij Rempel
2022-07-01 17:17 ` Vladimir Oltean
2022-07-01 17:33 ` Florian Fainelli
2022-07-06 14:43 ` Vladimir Oltean

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.