]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw89: fw: don't reject firmware in blacklist to prevent breaking users
authorPing-Ke Shih <pkshih@realtek.com>
Thu, 27 Feb 2025 13:12:28 +0000 (21:12 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 5 Mar 2025 11:46:52 +0000 (19:46 +0800)
Once update driver blacklist of firmware, users' firmware might be in
the list, and then driver stops working. Since breaking users is not
expected, report a significant message instead of stopping.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250227131228.8457-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c

index 15d6bda1fcf0089fa97cf4bd5a6150ac6ae30341..d0a246f415ffc66c27c97037dfc1f3566b686a6e 100644 (file)
@@ -372,7 +372,7 @@ static int __check_secure_blacklist(struct rtw89_dev *rtwdev,
                return 0;
 
        if (!chip_blacklist) {
-               rtw89_err(rtwdev, "chip no blacklist for secure firmware\n");
+               rtw89_warn(rtwdev, "chip no blacklist for secure firmware\n");
                return -ENOENT;
        }
 
@@ -380,14 +380,14 @@ static int __check_secure_blacklist(struct rtw89_dev *rtwdev,
        bit_mask = BIT(section_content->blacklist.bit_in_chip_list & 0x7);
 
        if (section_content->blacklist.ver > chip_blacklist->ver) {
-               rtw89_err(rtwdev, "chip blacklist out of date (%u, %u)\n",
-                         section_content->blacklist.ver, chip_blacklist->ver);
+               rtw89_warn(rtwdev, "chip blacklist out of date (%u, %u)\n",
+                          section_content->blacklist.ver, chip_blacklist->ver);
                return -EINVAL;
        }
 
        if (chip_blacklist->list[byte_idx] & bit_mask) {
-               rtw89_err(rtwdev, "firmware %u in chip blacklist\n",
-                         section_content->blacklist.ver);
+               rtw89_warn(rtwdev, "firmware %u in chip blacklist\n",
+                          section_content->blacklist.ver);
                return -EPERM;
        }
 
@@ -427,7 +427,10 @@ static int __parse_security_section(struct rtw89_dev *rtwdev,
                info->secure_section_exist = true;
        }
 
-       return __check_secure_blacklist(rtwdev, info, section_info, content);
+       ret = __check_secure_blacklist(rtwdev, info, section_info, content);
+       WARN_ONCE(ret, "Current firmware in blacklist. Please update firmware.\n");
+
+       return 0;
 }
 
 static int rtw89_fw_hdr_parser_v1(struct rtw89_dev *rtwdev, const u8 *fw, u32 len,