From: Sven Joachim <svenjoac@gmx.de>
To: <gregkh@linuxfoundation.org>
Cc: kvalo@codeaurora.org, <stable@vger.kernel.org>
Subject: Re: FAILED: patch "[PATCH] rtlwifi: Fix fallback firmware loading" failed to apply to 4.13-stable tree
Date: Fri, 08 Sep 2017 11:31:05 +0200 [thread overview]
Message-ID: <871snheduu.fsf@turtle.gmx.de> (raw)
In-Reply-To: <150479472915883@kroah.com> (gregkh's message of "Thu, 07 Sep 2017 16:32:09 +0200")
On 2017-09-07 16:32 +0200, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 4.13-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
I think it would be best to pick up commit f2764f61fa10 ("rtlwifi: Fix
memory leak when firmware request fails") which also seems to be
suitable for stable. After that commit, 1d9b168d8ea9 applies fine.
Debian has included both of these patches for almost four weeks[1].
Cheers,
Sven
1. https://anonscm.debian.org/cgit/kernel/linux.git/commit/?id=831ae89c564f4898afdefa98c501c06b544fc1f7
> ------------------ original commit in Linus's tree ------------------
>
>>>From 1d9b168d8ea9a0f51947d0e2f84856e77d2fe7ff Mon Sep 17 00:00:00 2001
> From: Sven Joachim <svenjoac@gmx.de>
> Date: Mon, 31 Jul 2017 18:10:45 +0200
> Subject: [PATCH] rtlwifi: Fix fallback firmware loading
>
> Commit f70e4df2b384 ("rtlwifi: Add code to read new versions of
> firmware") added code to load an old firmware file if the new one is
> not available. Unfortunately that code is never reached because
> request_firmware_nowait() does not wait for the firmware to show up
> and returns 0 even if the file is not there.
>
> Use the existing fallback mechanism introduced by commit 62009b7f1279
> ("rtlwifi: rtl8192cu: Add new firmware") instead.
>
> Fixes: f70e4df2b384 ("rtlwifi: Add code to read new versions of firmware")
> Cc: stable@vger.kernel.org
> Signed-off-by: Sven Joachim <svenjoac@gmx.de>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
> index 56c05c4e1499..f47d839f388d 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
> @@ -187,18 +187,10 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
> rtlpriv->io.dev, GFP_KERNEL, hw,
> rtl_fw_cb);
> if (err) {
> - /* Failed to get firmware. Check if old version available */
> - fw_name = "rtlwifi/rtl8723befw.bin";
> - pr_info("Using firmware %s\n", fw_name);
> - err = request_firmware_nowait(THIS_MODULE, 1, fw_name,
> - rtlpriv->io.dev, GFP_KERNEL, hw,
> - rtl_fw_cb);
> - if (err) {
> - pr_err("Failed to request firmware!\n");
> - vfree(rtlpriv->rtlhal.pfirmware);
> - rtlpriv->rtlhal.pfirmware = NULL;
> - return 1;
> - }
> + pr_err("Failed to request firmware!\n");
> + vfree(rtlpriv->rtlhal.pfirmware);
> + rtlpriv->rtlhal.pfirmware = NULL;
> + return 1;
> }
> return 0;
> }
> @@ -289,6 +281,7 @@ static const struct rtl_hal_cfg rtl8723be_hal_cfg = {
> .bar_id = 2,
> .write_readback = true,
> .name = "rtl8723be_pci",
> + .alt_fw_name = "rtlwifi/rtl8723befw.bin",
> .ops = &rtl8723be_hal_ops,
> .mod_params = &rtl8723be_mod_params,
> .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL,
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
> index ec2d577ba85b..5925edf7877f 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
> @@ -216,18 +216,10 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
> rtlpriv->io.dev, GFP_KERNEL, hw,
> rtl_fw_cb);
> if (err) {
> - /* Failed to get firmware. Check if old version available */
> - fw_name = "rtlwifi/rtl8821aefw.bin";
> - pr_info("Using firmware %s\n", fw_name);
> - err = request_firmware_nowait(THIS_MODULE, 1, fw_name,
> - rtlpriv->io.dev, GFP_KERNEL, hw,
> - rtl_fw_cb);
> - if (err) {
> - pr_err("Failed to request normal firmware!\n");
> - vfree(rtlpriv->rtlhal.wowlan_firmware);
> - vfree(rtlpriv->rtlhal.pfirmware);
> - return 1;
> - }
> + pr_err("Failed to request normal firmware!\n");
> + vfree(rtlpriv->rtlhal.wowlan_firmware);
> + vfree(rtlpriv->rtlhal.pfirmware);
> + return 1;
> }
> /*load wowlan firmware*/
> pr_info("Using firmware %s\n", wowlan_fw_name);
> @@ -331,6 +323,7 @@ static const struct rtl_hal_cfg rtl8821ae_hal_cfg = {
> .bar_id = 2,
> .write_readback = true,
> .name = "rtl8821ae_pci",
> + .alt_fw_name = "rtlwifi/rtl8821aefw.bin",
> .ops = &rtl8821ae_hal_ops,
> .mod_params = &rtl8821ae_mod_params,
> .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL,
next prev parent reply other threads:[~2017-09-08 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 14:32 FAILED: patch "[PATCH] rtlwifi: Fix fallback firmware loading" failed to apply to 4.13-stable tree gregkh
2017-09-08 9:31 ` Sven Joachim [this message]
2017-09-08 9:44 ` Greg KH
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=871snheduu.fsf@turtle.gmx.de \
--to=svenjoac@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=kvalo@codeaurora.org \
--cc=stable@vger.kernel.org \
/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).