public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Rosen Penev <rosenp@gmail.com>, linux-wireless@vger.kernel.org
Cc: kvalo@kernel.org, nbd@nbd.name, yangshiji66@outlook.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2] wifi: ath9k: return by of_get_mac_address
Date: Tue, 05 Nov 2024 14:21:03 +0100	[thread overview]
Message-ID: <87ed3p95q8.fsf@toke.dk> (raw)
In-Reply-To: <20241003021732.1954299-1-rosenp@gmail.com>

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

  reply	other threads:[~2024-11-05 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-11-05 22:23   ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ed3p95q8.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=rosenp@gmail.com \
    --cc=yangshiji66@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox