Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Lior David <liord@codeaurora.org>
Cc: qca_merez <qca_merez@qca.qualcomm.com>,
	qca_liord <qca_liord@qca.qualcomm.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	wil6210 <wil6210@qca.qualcomm.com>
Subject: Re: [PATCH 03/12] wil6210: refresh FW capabilities during interface up
Date: Mon, 30 Oct 2017 06:54:35 +0000	[thread overview]
Message-ID: <87lgjt3z2t.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <17994ee8-0d84-2e67-c290-5f1a2f18e0a1@codeaurora.org> (Lior David's message of "Sat, 28 Oct 2017 18:25:59 +0300")

Lior David <liord@codeaurora.org> writes:

> On 10/28/2017 6:01 PM, Kalle Valo wrote:
>> Maya Erez <qca_merez@qca.qualcomm.com> writes:
>>=20
>>> From: Lior David <qca_liord@qca.qualcomm.com>
>>>
>>> FW capabilities are currently retrieved only during module
>>> initialization, but userspace can replace the firmware while
>>> interface is down, so refresh the FW capabilities when
>>> interface is up (after FW is loaded) to ensure driver
>>> functionality matches the loaded FW.
>>=20
>> I think usually the firmware is loaded only once during probe() and I
>> think it's quite special that you retrieve it during interface up. Being
>> able to change the firmware version runtime like that can lead to
>> problems eventually, for example cfg80211 might not allow changing
>> already registered configuration etc.
>>=20
> Yes you are right, it is not perfect.
> We shutdown our chip in interface down so the FW is lost, we have to load=
 it
> every interface up. We could request_firmware only once at insmod and sto=
re it
> so the same FW will be used every time but this is a big waste of memory =
(FW
> size is ~400KB and may be larger with future chips). We only touch one or=
 two
> very simple fields in struct wiphy that are not validated in wiphy_regist=
er. The
> behavior is not 100% proof but good enough, and we recommend to our users=
 to
> always rmmod/insmod when replacing FW (replacing FW at runtime is usually=
 not
> done in production systems, this is only for debugging).
> However, if we do not refresh the capabilities we will have larger proble=
ms -
> the driver can try to access features not supported by FW and cause FW/ho=
st crashes.

Yes, I agree that this patch does improve things and should be applied.
But I think in the long run you should consider changing this and do the
same as other drivers do (load the firmware only on probe()).

--=20
Kalle Valo=

  reply	other threads:[~2017-10-30  6:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 13:13 [PATCH 00/12] wil6210 patches Maya Erez
2017-10-25 13:13 ` [PATCH 01/12] wil6210: run-time PM when interface down Maya Erez
2017-10-27 13:33   ` [01/12] " Kalle Valo
2017-10-29 19:58     ` Maya Haim
2017-10-25 13:13 ` [PATCH 02/12] wil6210: print human readable names of WMI commands and events Maya Erez
2017-10-25 13:13 ` [PATCH 03/12] wil6210: refresh FW capabilities during interface up Maya Erez
2017-10-28 15:01   ` Kalle Valo
2017-10-28 15:25     ` Lior David
2017-10-30  6:54       ` Kalle Valo [this message]
2017-10-25 13:13 ` [PATCH 04/12] wil6210: abort properly in cfg suspend Maya Erez
2017-10-25 13:14 ` [PATCH 05/12] wil6210: fix length check in __wmi_send Maya Erez
2017-10-25 13:14 ` [PATCH 06/12] wil6210: add block size checks during FW load Maya Erez
2017-10-25 13:14 ` [PATCH 07/12] wil6210: missing length check in wmi_set_ie Maya Erez
2017-10-25 13:14 ` [PATCH 08/12] wil6210: missing length check in wil_cfg80211_mgmt_tx Maya Erez
2017-10-25 13:14 ` [PATCH 09/12] wil6210: get suspend reject reason and resume triggers from FW Maya Erez
2017-10-25 13:14 ` [PATCH 10/12] wil6210: fix PCIe bus mastering in case of interface down Maya Erez
2017-10-25 13:14 ` [PATCH 11/12] wil6210: remove suspend time statistics Maya Erez
2017-10-25 13:14 ` [PATCH 12/12] wil6210: update statistics for suspend Maya Erez
2017-10-28 15:18   ` Kalle Valo

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=87lgjt3z2t.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liord@codeaurora.org \
    --cc=qca_liord@qca.qualcomm.com \
    --cc=qca_merez@qca.qualcomm.com \
    --cc=wil6210@qca.qualcomm.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