]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw89: fw: add debug message for unexpected secure firmware
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 17 Feb 2025 06:43:07 +0000 (14:43 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 21 Feb 2025 01:51:26 +0000 (09:51 +0800)
If failed to load a non-secure firmware with a secure chip, it only throws
a unclear message:

   rtw89_8922ae 0000:03:00.0: parse fw header fail

To address this case simpler, add a message to point out this.

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

index e05034fbb898e219ae8bcf261d00a9d2be30c1fd..0cb2fee916cd4e7068e86b5f6604cb0e3c37dc2e 100644 (file)
@@ -414,8 +414,11 @@ static int __parse_security_section(struct rtw89_dev *rtwdev,
                        *mssc_len += section_info->mssc * FWDL_SECURITY_CHKSUM_LEN;
 
                if (sec->secure_boot) {
-                       if (sec->mss_idx >= section_info->mssc)
+                       if (sec->mss_idx >= section_info->mssc) {
+                               rtw89_err(rtwdev, "unexpected MSS %d >= %d\n",
+                                         sec->mss_idx, section_info->mssc);
                                return -EFAULT;
+                       }
                        section_info->key_addr = content + section_info->len +
                                                 sec->mss_idx * FWDL_SECURITY_SIGLEN;
                        section_info->key_len = FWDL_SECURITY_SIGLEN;