From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Stefan Wahren <wahrenst@gmx.net>,
Johannes Berg <johannes@sipsolutions.net>,
Arend van Spriel <aspriel@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-wireless@vger.kernel.org>,
<brcm80211-dev-list.pdl@broadcom.com>,
<SHA-cyfmac-dev-list@infineon.com>, Kalle Valo <kvalo@kernel.org>,
"linux-mmc" <linux-mmc@vger.kernel.org>
Subject: Re: brcmfmac: error messages while entering suspend
Date: Sat, 23 Nov 2024 10:51:35 +0100 [thread overview]
Message-ID: <193586f1458.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> (raw)
In-Reply-To: <a122ad79-086b-42a9-894e-d589092bac80@gmx.net>
On November 4, 2024 9:06:04 PM Stefan Wahren <wahrenst@gmx.net> wrote:
> Hi,
>
> Am 04.11.24 um 13:18 schrieb Johannes Berg:
>> On Mon, 2024-11-04 at 12:59 +0100, Stefan Wahren wrote:
>>>>> [ 384.292071] ieee80211 phy0: brcmf_fil_cmd_data: bus is down. we have
>>>>> nothing to do.
>>>>> [ 384.292079] ieee80211 phy0: brcmf_cfg80211_get_tx_power: error (-5)
>>>>>
>>>>> These errors are not new and I assume they have always been there. I'm
>>>>> not an expert here, so I want to know is the problem here that the SDIO
>>>>> interface is shutdown before brcmfmac is suspended or lies the issue
>>>>> within brcmfmac suspend itself?
>>>> Upon suspend we execute the remove path and cleaning the interfaces.
>>>> We notify cfg80211 about the removal, which in turn will notify
>>>> userspace, but is tries to obtain the tx power from brcmfmac.
>> I guess "it tries to obtain" is some sort of event path that wants to
>> include the TX power in an event. That doesn't seem to make all that
>> much sense on removal events though, so perhaps we could remove the
>> get_channel and get_tx_power calls for NL80211_CMD_DEL_INTERFACE.
> Not sure if I get it right, but the follow patch make the errors go away:
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 1ac8a196f376..52120cce2f7e 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -4006,23 +4006,25 @@ static int nl80211_send_iface(struct sk_buff
> *msg, u32 portid, u32 seq, int flag
> nla_put_u32(msg, NL80211_ATTR_VIF_RADIO_MASK, wdev->radio_mask))
> goto nla_put_failure;
>
> - if (rdev->ops->get_channel && !wdev->valid_links) {
> - struct cfg80211_chan_def chandef = {};
> - int ret;
> + if (cmd != NL80211_CMD_DEL_INTERFACE) {
> + if (rdev->ops->get_channel && !wdev->valid_links) {
> + struct cfg80211_chan_def chandef = {};
> + int ret;
>
> - ret = rdev_get_channel(rdev, wdev, 0, &chandef);
> - if (ret == 0 && nl80211_send_chandef(msg, &chandef))
> - goto nla_put_failure;
> - }
> + ret = rdev_get_channel(rdev, wdev, 0, &chandef);
> + if (ret == 0 && nl80211_send_chandef(msg, &chandef))
> + goto nla_put_failure;
> + }
>
> - if (rdev->ops->get_tx_power) {
> - int dbm, ret;
> + if (rdev->ops->get_tx_power) {
> + int dbm, ret;
>
> - ret = rdev_get_tx_power(rdev, wdev, &dbm);
> - if (ret == 0 &&
> - nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
> - DBM_TO_MBM(dbm)))
> - goto nla_put_failure;
> + ret = rdev_get_tx_power(rdev, wdev, &dbm);
> + if (ret == 0 &&
> + nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
> + DBM_TO_MBM(dbm)))
> + goto nla_put_failure;
> + }
> }
>
> switch (wdev->iftype) {
>
> But this change doesn't consider get_txq_stats and the further calls
> rdev_get_channel for the valid_links.
>
> Do we actually need nl80211_send_iface() for NL80211_CMD_DEL_INTERFACE?
In term of user-space API the answer would (probably) be yes. At least the
primitive should be send. What attributes should be included is debatable.
The primitive is probably used by user-space to cleanup or disable
functionality using the given interface. So only attributes identifying the
interface are likely sufficient (wdev-id, if-index).
Regards,
Arend
prev parent reply other threads:[~2024-11-23 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-03 11:01 brcmfmac: error messages while entering suspend Stefan Wahren
2024-11-04 10:06 ` Arend van Spriel
2024-11-04 11:59 ` Stefan Wahren
2024-11-04 12:18 ` Johannes Berg
2024-11-04 15:41 ` Arend Van Spriel
2024-11-04 20:06 ` Stefan Wahren
2024-11-23 9:51 ` Arend Van Spriel [this message]
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=193586f1458.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=SHA-cyfmac-dev-list@infineon.com \
--cc=aspriel@gmail.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=wahrenst@gmx.net \
/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