From patchwork Wed Aug 28 06:45:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: En-Wei Wu X-Patchwork-Id: 1977624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wtw174J21z1yfn for ; Wed, 28 Aug 2024 16:46:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sjCRU-0001Cg-LZ; Wed, 28 Aug 2024 06:46:08 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sjCRQ-0001CE-HX for kernel-team@lists.ubuntu.com; Wed, 28 Aug 2024 06:46:04 +0000 Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E18913F327 for ; Wed, 28 Aug 2024 06:46:03 +0000 (UTC) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-2d441cdb503so7245028a91.1 for ; Tue, 27 Aug 2024 23:46:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724827562; x=1725432362; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JtEdyHsbcDCzyDgobGwWyv1+oFsIwkChUtV4OQ2dLes=; b=Ln+xx0EYD+pv1YsRz8nxvNzwgducrf1oV0wn04/ghQWu2HIE3yxCmxOw0mjR+sjddH D/mpKMjKMd9WSh06nyOmZdlZ6kPl8W11COMUjGlG1fYT2TN5bDPVDcjeoZsB+SW3LNYI x1Sp3BS0Eo6c6MtUg46cXuK+Jq9ZikELnc6mLlzHm+BVl1wDnyNSJw3BeXYwbhWHeWGE HZlUyUYAg0cvZFmAMW1J+5sz3XEXw77VOEa0cV4m+Zl9WBb8lpMFcy0eLqHdQibmj/YM wzhzXN1wUshXE1ux1MV7Xc57+PG+h53U+c8sR4LgixZG0Pdg3yO27gTFUGIOe0Ibcjdh 9P0w== X-Gm-Message-State: AOJu0YyTr260lKiS5Qhu92f3TYJtwFV2OhKrNQAdPszfHbhHK33NFdsa Q8H7Pnirlozuq4IGiYApr8VmA0e0hi4Xt35yw5t10i6PlvdWevDEF+w9ExRurg2nOjFMGj1cNna Zk19dcn2Xqwlj1cM5FfOZGCKKvuLAuoJMQDqvaoU5yEqfwRZs3m4evf1fl05uh2Obt20PTakP3I pO+Z1eXpp4Rg== X-Received: by 2002:a17:903:11c5:b0:201:f18e:5077 with SMTP id d9443c01a7336-2039e50d411mr153184125ad.49.1724827561669; Tue, 27 Aug 2024 23:46:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQAs6qgEEbrX0DpxrTWiHoEgR2PjduHGplaggmaX/gb5vOJ48vzhFImU2O2Kec7sdR8l86eg== X-Received: by 2002:a17:903:11c5:b0:201:f18e:5077 with SMTP id d9443c01a7336-2039e50d411mr153183975ad.49.1724827561269; Tue, 27 Aug 2024 23:46:01 -0700 (PDT) Received: from rickywu0421-ThinkPad-X1-Carbon-Gen-11.. ([122.147.171.160]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038557e182sm92357865ad.64.2024.08.27.23.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 23:46:00 -0700 (PDT) From: En-Wei Wu To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH v2 1/1] wifi: rtw89: 885xb: reset IDMEM mode to prevent download firmware failure Date: Wed, 28 Aug 2024 14:45:53 +0800 Message-ID: <20240828064555.232026-2-en-wei.wu@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240828064555.232026-1-en-wei.wu@canonical.com> References: <20240828064555.232026-1-en-wei.wu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Ping-Ke Shih BugLink: https://bugs.launchpad.net/bugs/2077396 For different firmware type, it could change IDMEM mode, so reset it to default to avoid encountering error for RTL8851B/RTL8852B/RTL8852BT if that kind of firmware was downloaded before. rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 5 rtw89_8851be 0000:02:00.0: Firmware version 0.29.41.3, cmd version 0, type 3 rtw89_8851be 0000:02:00.0: MAC has already powered on rtw89_8851be 0000:02:00.0: fw security fail rtw89_8851be 0000:02:00.0: download firmware fail rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x1E0 = 0x62 rtw89_8851be 0000:02:00.0: [ERR]fwdl 0x83F2 = 0x8 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f500 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f51c rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f520 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f534 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f508 rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f53c rtw89_8851be 0000:02:00.0: [ERR]fw PC = 0xb892f524 rtw89_8851be 0000:02:00.0: failed to setup chip information rtw89_8851be: probe of 0000:02:00.0 failed with error -16 Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20240724052626.12774-4-pkshih@realtek.com (backported from commit 80fb81bb46a57daedd5decbcc253ea48428a254e linux-next) Signed-off-by: En-Wei Wu --- drivers/net/wireless/realtek/rtw89/core.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h index 82d7a2dd88b0..e48c4c7e4bda 100644 --- a/drivers/net/wireless/realtek/rtw89/core.h +++ b/drivers/net/wireless/realtek/rtw89/core.h @@ -129,6 +129,7 @@ enum rtw89_hci_type { enum rtw89_core_chip_id { RTL8852A, RTL8852B, + RTL8852BT, RTL8852C, RTL8851B, RTL8922A, diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c index c485ef2cc3d3..4c3a2083110f 100644 --- a/drivers/net/wireless/realtek/rtw89/mac.c +++ b/drivers/net/wireless/realtek/rtw89/mac.c @@ -3739,7 +3739,9 @@ static int rtw89_mac_enable_cpu_ax(struct rtw89_dev *rtwdev, u8 boot_reason, rtw89_write32(rtwdev, R_AX_WCPU_FW_CTRL, val); - if (rtwdev->chip->chip_id == RTL8852B) + if (rtwdev->chip->chip_id == RTL8852B || + rtwdev->chip->chip_id == RTL8851B || + rtwdev->chip->chip_id == RTL8852BT) rtw89_write32_mask(rtwdev, R_AX_SEC_CTRL, B_AX_SEC_IDMEM_SIZE_CONFIG_MASK, 0x2);