linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>,
	linux-wireless@vger.kernel.org
Cc: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
	Avinash Patil <avinashp@quantenna.com>,
	Sergei Maksimenko <smaksimenko@quantenna.com>
Subject: Re: [PATCH 4/6] qtnfmac: fix rmmod for missing firmware
Date: Tue, 6 Feb 2018 12:18:45 +0100	[thread overview]
Message-ID: <5A798F15.4050703@broadcom.com> (raw)
In-Reply-To: <20180205150516.16030-5-sergey.matyukevich.os@quantenna.com>

On 2/5/2018 4:05 PM, Sergey Matyukevich wrote:
> Check that firmware exists prior to starting firmware download.

Why would you do that? It seems expensive given that you obtain the 
firmware and discard it immediately just to check it exists. Especially, 
given that such a call can take 60 seconds to complete depending on 
kernel config.

Apart from that see minor comment below although I would seriously 
reconsider this patch altogether.

> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
> ---
>   drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>
> diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
> index c0d1c5d94ef0..86368e345276 100644
> --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
> +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c
> @@ -1104,6 +1104,20 @@ static void qtnf_firmware_load(const struct firmware *fw, void *context)
>   	complete(&bus->request_firmware_complete);
>   }
>
> +static int qtnf_fw_exists(struct qtnf_bus *bus)
> +{
> +	struct qtnf_pcie_bus_priv *priv = (void *)get_bus_priv(bus);
> +	struct pci_dev *pdev = priv->pdev;
> +	const struct firmware *fw;

I think it is better to initialize fw to NULL here and ...

> +	int ret;
> +
> +	ret = request_firmware(&fw, bus->fwname, &pdev->dev);
> +	if (!ret)

do 'if (fw)' here instead.

Regards,
Arend

> +		release_firmware(fw);
> +
> +	return !ret;
> +}
> +

  reply	other threads:[~2018-02-06 11:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 15:05 [PATCH 0/6] qtnfmac: qsr10g pcie backend updates Sergey Matyukevich
2018-02-05 15:05 ` [PATCH 1/6] qtnfmac: fix releasing Tx/Rx data buffers Sergey Matyukevich
2018-02-05 15:05 ` [PATCH 2/6] qtnfmac: enable reloading of qtnfmac kernel modules Sergey Matyukevich
2018-02-05 15:05 ` [PATCH 3/6] qtnfmac: fix rmmod for firmware version mismatch Sergey Matyukevich
2018-02-05 15:05 ` [PATCH 4/6] qtnfmac: fix rmmod for missing firmware Sergey Matyukevich
2018-02-06 11:18   ` Arend van Spriel [this message]
2018-02-08  9:06     ` Sergey Matyukevich
2018-02-08  9:21       ` Arend van Spriel
2018-02-05 15:05 ` [PATCH 5/6] qtnfmac: implement asynchronous firmware loading Sergey Matyukevich
2018-02-06 11:22   ` Arend van Spriel
2018-02-07 11:09     ` Sergei Maksimenko
2018-02-08  9:51       ` Arend van Spriel
2018-02-05 15:05 ` [PATCH 6/6] qtnfmac: enable networked standby mode on device inactivity Sergey Matyukevich
2018-02-27 14:28 ` [PATCH 0/6] qtnfmac: qsr10g pcie backend updates Kalle Valo
2018-02-27 14:37   ` Sergey Matyukevich
2018-02-27 16:11     ` 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=5A798F15.4050703@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=avinashp@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sergey.matyukevich.os@quantenna.com \
    --cc=smaksimenko@quantenna.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;
as well as URLs for NNTP newsgroup(s).