* [PATCHv2] wifi: ath9k: return by of_get_mac_address
@ 2024-10-03 2:17 Rosen Penev
2024-11-05 13:21 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2024-10-03 2:17 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, toke, nbd, yangshiji66, linux-kernel
When using nvmem, ath9k could potentially be loaded before nvmem, which
loads after mtd. This is an issue if DT contains an nvmem mac address.
If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass
it to _probe so that ath9k can properly grab a potentially present MAC
address.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2: modified commit message
drivers/net/wireless/ath/ath9k/init.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index f712bb6d1f47..5f4efc760183 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc)
ah->ah_flags |= AH_NO_EEP_SWAP;
}
- of_get_mac_address(np, common->macaddr);
-
- return 0;
+ return of_get_mac_address(np, common->macaddr);
}
static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
--
2.46.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv2] wifi: ath9k: return by of_get_mac_address
2024-10-03 2:17 [PATCHv2] wifi: ath9k: return by of_get_mac_address Rosen Penev
@ 2024-11-05 13:21 ` Toke Høiland-Jørgensen
2024-11-05 22:23 ` Rosen Penev
0 siblings, 1 reply; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-11-05 13:21 UTC (permalink / raw)
To: Rosen Penev, linux-wireless; +Cc: kvalo, nbd, yangshiji66, linux-kernel
Rosen Penev <rosenp@gmail.com> writes:
> When using nvmem, ath9k could potentially be loaded before nvmem, which
> loads after mtd. This is an issue if DT contains an nvmem mac address.
>
> If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass
> it to _probe so that ath9k can properly grab a potentially present MAC
> address.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> v2: modified commit message
> drivers/net/wireless/ath/ath9k/init.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
> index f712bb6d1f47..5f4efc760183 100644
> --- a/drivers/net/wireless/ath/ath9k/init.c
> +++ b/drivers/net/wireless/ath/ath9k/init.c
> @@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc)
> ah->ah_flags |= AH_NO_EEP_SWAP;
> }
>
> - of_get_mac_address(np, common->macaddr);
> -
> - return 0;
> + return of_get_mac_address(np, common->macaddr);
Hmm, so AFAICT, of_get_mac_address() can fail with lots of other error
codes than EPROBE_DEFER, no? And with this change, if it does, we now
abort the ath9k device init, where before we just ignored any errors.
So, to be conservative, maybe it's better to do something like:
ret = of_get_mac_address(np, common->macaddr);
if (ret == -EPROBE_DEFER)
return ret;
return 0;
WDYT?
-Toke
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2] wifi: ath9k: return by of_get_mac_address
2024-11-05 13:21 ` Toke Høiland-Jørgensen
@ 2024-11-05 22:23 ` Rosen Penev
0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2024-11-05 22:23 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: linux-wireless, kvalo, nbd, yangshiji66, linux-kernel
On Tue, Nov 5, 2024 at 5:21 AM Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>
> Rosen Penev <rosenp@gmail.com> writes:
>
> > When using nvmem, ath9k could potentially be loaded before nvmem, which
> > loads after mtd. This is an issue if DT contains an nvmem mac address.
> >
> > If nvmem is not ready in time for ath9k, -EPROBE_DEFER is returned. Pass
> > it to _probe so that ath9k can properly grab a potentially present MAC
> > address.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> > v2: modified commit message
> > drivers/net/wireless/ath/ath9k/init.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
> > index f712bb6d1f47..5f4efc760183 100644
> > --- a/drivers/net/wireless/ath/ath9k/init.c
> > +++ b/drivers/net/wireless/ath/ath9k/init.c
> > @@ -647,9 +647,7 @@ static int ath9k_of_init(struct ath_softc *sc)
> > ah->ah_flags |= AH_NO_EEP_SWAP;
> > }
> >
> > - of_get_mac_address(np, common->macaddr);
> > -
> > - return 0;
> > + return of_get_mac_address(np, common->macaddr);
>
> Hmm, so AFAICT, of_get_mac_address() can fail with lots of other error
> codes than EPROBE_DEFER, no? And with this change, if it does, we now
> abort the ath9k device init, where before we just ignored any errors.
>
> So, to be conservative, maybe it's better to do something like:
>
> ret = of_get_mac_address(np, common->macaddr);
> if (ret == -EPROBE_DEFER)
> return ret;
>
> return 0;
>
>
> WDYT?
I agree. Sent v3.
>
> -Toke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-05 22:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03 2:17 [PATCHv2] wifi: ath9k: return by of_get_mac_address Rosen Penev
2024-11-05 13:21 ` Toke Høiland-Jørgensen
2024-11-05 22:23 ` Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox