* [PATCH V2 1/3 net] net: ethernet: oa_tc6: Handle failure of spi_setup
2025-08-27 11:53 [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues Stefan Wahren
@ 2025-08-27 11:53 ` Stefan Wahren
2025-08-29 21:15 ` Jacob Keller
2025-08-27 11:53 ` [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading Stefan Wahren
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2025-08-27 11:53 UTC (permalink / raw)
To: Parthiban Veerasooran, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, Stefan Wahren, stable, Andrew Lunn
There is no guarantee that spi_setup succeed, so properly handle
the error case.
Fixes: aa58bec064ab ("net: ethernet: oa_tc6: implement register write operation")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Cc: stable@kernel.org
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/ethernet/oa_tc6.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c
index db200e4ec284..91a906a7918a 100644
--- a/drivers/net/ethernet/oa_tc6.c
+++ b/drivers/net/ethernet/oa_tc6.c
@@ -1249,7 +1249,8 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev)
/* Set the SPI controller to pump at realtime priority */
tc6->spi->rt = true;
- spi_setup(tc6->spi);
+ if (spi_setup(tc6->spi) < 0)
+ return NULL;
tc6->spi_ctrl_tx_buf = devm_kzalloc(&tc6->spi->dev,
OA_TC6_CTRL_SPI_BUF_SIZE,
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V2 1/3 net] net: ethernet: oa_tc6: Handle failure of spi_setup
2025-08-27 11:53 ` [PATCH V2 1/3 net] net: ethernet: oa_tc6: Handle failure of spi_setup Stefan Wahren
@ 2025-08-29 21:15 ` Jacob Keller
0 siblings, 0 replies; 8+ messages in thread
From: Jacob Keller @ 2025-08-29 21:15 UTC (permalink / raw)
To: Stefan Wahren, Parthiban Veerasooran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, stable, Andrew Lunn
[-- Attachment #1.1: Type: text/plain, Size: 1409 bytes --]
On 8/27/2025 4:53 AM, Stefan Wahren wrote:
> There is no guarantee that spi_setup succeed, so properly handle
> the error case.
>
> Fixes: aa58bec064ab ("net: ethernet: oa_tc6: implement register write operation")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Cc: stable@kernel.org
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/net/ethernet/oa_tc6.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c
> index db200e4ec284..91a906a7918a 100644
> --- a/drivers/net/ethernet/oa_tc6.c
> +++ b/drivers/net/ethernet/oa_tc6.c
> @@ -1249,7 +1249,8 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev)
>
> /* Set the SPI controller to pump at realtime priority */
> tc6->spi->rt = true;
> - spi_setup(tc6->spi);
> + if (spi_setup(tc6->spi) < 0)
> + return NULL;
>
Was thinking this could maybe be a pointer error, but the rest of the
function only returns NULL, and that means callers aren't prepped to
handle such error pointers. Ok.
I would note that many of the other errors flows come with some logging
to indicate what failed, but I don't think thats critical for this fix.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> tc6->spi_ctrl_tx_buf = devm_kzalloc(&tc6->spi->dev,
> OA_TC6_CTRL_SPI_BUF_SIZE,
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading
2025-08-27 11:53 [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues Stefan Wahren
2025-08-27 11:53 ` [PATCH V2 1/3 net] net: ethernet: oa_tc6: Handle failure of spi_setup Stefan Wahren
@ 2025-08-27 11:53 ` Stefan Wahren
2025-08-29 21:19 ` Jacob Keller
2025-08-27 11:53 ` [PATCH V2 3/3 net] microchip: lan865x: Fix LAN8651 autoloading Stefan Wahren
2025-08-30 2:50 ` [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2025-08-27 11:53 UTC (permalink / raw)
To: Parthiban Veerasooran, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, Stefan Wahren, stable, Andrew Lunn
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
based on the alias from spi_device_id table. While at this, fix
the misleading variable name (spidev is unrelated to this driver).
Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Cc: stable@kernel.org
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/ethernet/microchip/lan865x/lan865x.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index 84c41f193561..9d94c8fb8b91 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -423,10 +423,11 @@ static void lan865x_remove(struct spi_device *spi)
free_netdev(priv->netdev);
}
-static const struct spi_device_id spidev_spi_ids[] = {
+static const struct spi_device_id lan865x_ids[] = {
{ .name = "lan8650" },
{},
};
+MODULE_DEVICE_TABLE(spi, lan865x_ids);
static const struct of_device_id lan865x_dt_ids[] = {
{ .compatible = "microchip,lan8650" },
@@ -441,7 +442,7 @@ static struct spi_driver lan865x_driver = {
},
.probe = lan865x_probe,
.remove = lan865x_remove,
- .id_table = spidev_spi_ids,
+ .id_table = lan865x_ids,
};
module_spi_driver(lan865x_driver);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading
2025-08-27 11:53 ` [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading Stefan Wahren
@ 2025-08-29 21:19 ` Jacob Keller
0 siblings, 0 replies; 8+ messages in thread
From: Jacob Keller @ 2025-08-29 21:19 UTC (permalink / raw)
To: Stefan Wahren, Parthiban Veerasooran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, stable, Andrew Lunn
[-- Attachment #1.1: Type: text/plain, Size: 1908 bytes --]
On 8/27/2025 4:53 AM, Stefan Wahren wrote:
> Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
> based on the alias from spi_device_id table. While at this, fix
> the misleading variable name (spidev is unrelated to this driver).
>
spidev likely is just someone short-handing the spi_device_id. Makes
sense to call this by the driver name.
> Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Cc: stable@kernel.org
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/net/ethernet/microchip/lan865x/lan865x.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index 84c41f193561..9d94c8fb8b91 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -423,10 +423,11 @@ static void lan865x_remove(struct spi_device *spi)
> free_netdev(priv->netdev);
> }
>
> -static const struct spi_device_id spidev_spi_ids[] = {
> +static const struct spi_device_id lan865x_ids[] = {
> { .name = "lan8650" },
> {},
> };
> +MODULE_DEVICE_TABLE(spi, lan865x_ids);
Right. Without MODULE_DEVICE_TABLE, the tables used by userspace won't
populate with this driver. That results in failure to automatically load
the module.
Makes sense.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>
> static const struct of_device_id lan865x_dt_ids[] = {
> { .compatible = "microchip,lan8650" },
> @@ -441,7 +442,7 @@ static struct spi_driver lan865x_driver = {
> },
> .probe = lan865x_probe,
> .remove = lan865x_remove,
> - .id_table = spidev_spi_ids,
> + .id_table = lan865x_ids,
> };
> module_spi_driver(lan865x_driver);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 3/3 net] microchip: lan865x: Fix LAN8651 autoloading
2025-08-27 11:53 [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues Stefan Wahren
2025-08-27 11:53 ` [PATCH V2 1/3 net] net: ethernet: oa_tc6: Handle failure of spi_setup Stefan Wahren
2025-08-27 11:53 ` [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading Stefan Wahren
@ 2025-08-27 11:53 ` Stefan Wahren
2025-08-29 21:20 ` Jacob Keller
2025-08-30 2:50 ` [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2025-08-27 11:53 UTC (permalink / raw)
To: Parthiban Veerasooran, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, Stefan Wahren, stable
Add missing IDs for LAN8651 devices, which are also defined in the
DT bindings.
Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Cc: stable@kernel.org
---
drivers/net/ethernet/microchip/lan865x/lan865x.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
index 9d94c8fb8b91..79b800d2b72c 100644
--- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
+++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
@@ -425,12 +425,14 @@ static void lan865x_remove(struct spi_device *spi)
static const struct spi_device_id lan865x_ids[] = {
{ .name = "lan8650" },
+ { .name = "lan8651" },
{},
};
MODULE_DEVICE_TABLE(spi, lan865x_ids);
static const struct of_device_id lan865x_dt_ids[] = {
{ .compatible = "microchip,lan8650" },
+ { .compatible = "microchip,lan8651" },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, lan865x_dt_ids);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V2 3/3 net] microchip: lan865x: Fix LAN8651 autoloading
2025-08-27 11:53 ` [PATCH V2 3/3 net] microchip: lan865x: Fix LAN8651 autoloading Stefan Wahren
@ 2025-08-29 21:20 ` Jacob Keller
0 siblings, 0 replies; 8+ messages in thread
From: Jacob Keller @ 2025-08-29 21:20 UTC (permalink / raw)
To: Stefan Wahren, Parthiban Veerasooran, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-spi, netdev, stable
[-- Attachment #1.1: Type: text/plain, Size: 1233 bytes --]
On 8/27/2025 4:53 AM, Stefan Wahren wrote:
> Add missing IDs for LAN8651 devices, which are also defined in the
> DT bindings.
>
> Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Cc: stable@kernel.org
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> drivers/net/ethernet/microchip/lan865x/lan865x.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index 9d94c8fb8b91..79b800d2b72c 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -425,12 +425,14 @@ static void lan865x_remove(struct spi_device *spi)
>
> static const struct spi_device_id lan865x_ids[] = {
> { .name = "lan8650" },
> + { .name = "lan8651" },
> {},
> };
> MODULE_DEVICE_TABLE(spi, lan865x_ids);
>
> static const struct of_device_id lan865x_dt_ids[] = {
> { .compatible = "microchip,lan8650" },
> + { .compatible = "microchip,lan8651" },
> { /* Sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, lan865x_dt_ids);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues
2025-08-27 11:53 [PATCH V2 0/3 net] microchip: lan865x: Fix probing issues Stefan Wahren
` (2 preceding siblings ...)
2025-08-27 11:53 ` [PATCH V2 3/3 net] microchip: lan865x: Fix LAN8651 autoloading Stefan Wahren
@ 2025-08-30 2:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-30 2:50 UTC (permalink / raw)
To: Stefan Wahren
Cc: parthiban.veerasooran, andrew+netdev, davem, edumazet, kuba,
pabeni, linux-spi, netdev
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 27 Aug 2025 13:53:38 +0200 you wrote:
> Recently I setup a customer i.MX93 board which contains a LAN8651 chip.
> During this process I discovered some probing related issues.
>
> Changes in V2:
> - Add Andrew's RB tags
> - Also add lan8651 compatible to Patch 3 as suggested by Andrew Lunn
> - CCs for stable
>
> [...]
Here is the summary with links:
- [V2,1/3,net] net: ethernet: oa_tc6: Handle failure of spi_setup
https://git.kernel.org/netdev/net/c/b3852ae3105e
- [V2,2/3,net] microchip: lan865x: Fix module autoloading
https://git.kernel.org/netdev/net/c/c7217963eb77
- [V2,3/3,net] microchip: lan865x: Fix LAN8651 autoloading
https://git.kernel.org/netdev/net/c/ca47c44d36a9
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] 8+ messages in thread