diff mbox series

[net] net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address()

Message ID 20220405000404.3374734-1-andrew@lunn.ch (mailing list archive)
State Accepted
Commit 11f8e7c122ce013fa745029fa8c94c6db69c2e54
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/cc_maintainers warning 3 maintainers not CCed: davem@davemloft.net sebastian.hesselbarth@gmail.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andrew Lunn April 5, 2022, 12:04 a.m. UTC
There is often not a MAC address available in an EEPROM accessible by
Linux with Marvell devices. Instead the bootload has the MAC address
and directly programs it into the hardware. So don't consider an error
from of_get_mac_address() has fatal. However, the check was added for
the case where there is a MAC address in an the EEPROM, but the EEPROM
has not probed yet, and -EPROBE_DEFER is returned. In that case the
error should be returned. So make the check specific to this error
code.

Cc: Mauri Sandberg <maukka@ext.kapsi.fi>
Reported-by: Thomas Walther <walther-it@gmx.de>
Fixes: 42404d8f1c01 ("net: mv643xx_eth: process retval from of_get_mac_address")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 6, 2022, 1:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  5 Apr 2022 02:04:04 +0200 you wrote:
> There is often not a MAC address available in an EEPROM accessible by
> Linux with Marvell devices. Instead the bootload has the MAC address
> and directly programs it into the hardware. So don't consider an error
> from of_get_mac_address() has fatal. However, the check was added for
> the case where there is a MAC address in an the EEPROM, but the EEPROM
> has not probed yet, and -EPROBE_DEFER is returned. In that case the
> error should be returned. So make the check specific to this error
> code.
> 
> [...]

Here is the summary with links:
  - [net] net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address()
    https://git.kernel.org/netdev/net/c/11f8e7c122ce

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 5f9ab1842d49..c18801490649 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2751,7 +2751,7 @@  static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
 	}
 
 	ret = of_get_mac_address(pnp, ppd.mac_addr);
-	if (ret)
+	if (ret == -EPROBE_DEFER)
 		return ret;
 
 	mv643xx_eth_property(pnp, "tx-queue-size", ppd.tx_queue_size);