From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19C6B33BBAF for ; Fri, 27 Mar 2026 10:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774608770; cv=none; b=tcys0f11sWI3NMYSUp2hleo4PLGs1OJZapIZ193yYd/rIS85FXSsqKW8v2kvqb1mrqb7gzzJmlHQj5MYNO9Lj1Xq2qykT/L7vb0I00PvQHzVeHRflzfD0rX8lSDXT4rcZcsYIuRkZts4GbsRRefSLYebioxFpsiqRgt2N6gjagg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774608770; c=relaxed/simple; bh=Xs0sUa4Fn+F1a2TYuZU7L6OtoWift4ZDNFfAdvnaqFA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aXFuPa6Vli4RP9Ng6AdpZw/DsgqrgJs2anpd4h/Oz6zhFbchUg5GktK/3DBBTPMldPMPQa5etjzMqJBd4YVmwxwkzeq4bTkieGNFIgNGnYzjobs8g0ittAOLUmeRp3BFsO/zvfz5ifhToPBDjz4BkzXJPVWwyUMPyRgzxMXQSV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KS6eEbCc; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KS6eEbCc" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-486fe655187so22614545e9.2 for ; Fri, 27 Mar 2026 03:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774608767; x=1775213567; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=O1pNU6dCeyGbc7RtcqSxu9UHHKgcZK1h4u5Ct1z0Esc=; b=KS6eEbCcBPPYocDia/rW+XAgqRcgHs3wsdZBXRaMTQb5MbjmP7GkTmOKIhvFkI7uHm YbHYr8CBzYWMnpDl5Rhf67xRe9VvtlAEY0gALI+nPDfva6n1tRHXwTAjUd5kXwBWX/yX kGuIdmSaUfYTcM3kAheAVljz57EWSek/eyXZschOrOk83qS80cCqPLUj1D/9Lw6XijLj xp+3b6gL1GQ1cQWfss+Zkd8lTa+5eA3OhcYj+Do3W/3ddan2qnnNnoTIABE5HoEW5KlP Tinsi7aFzc75zQZgRDzkwpuCI15MhPBxIwvHGSYBYPX+w50/iHb3s9bLOrAYWrHpwVTh rK4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774608767; x=1775213567; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O1pNU6dCeyGbc7RtcqSxu9UHHKgcZK1h4u5Ct1z0Esc=; b=kiStDdfq+AZdw7gcjgBmoOvocDErDcfiE0czayBqZWKyOiSUiim0shWvkq16IWVcC/ /aKh+ByGDZAmvM3I2vrF5CgSaom8OIOMwqonJ8QrnIBgzUVux8dB4aEP1Avq7QWMIS8t uS27WrQNmv21nF9WU3P2uEX9D6LthUUMZJt6u5qXgu/qUnB5/1wrzUelkOfkKBeKPwqx exm0qgLHYjHyu9ExVt15cpba5veiFLz9Rs6jJPwTOTK9u39Zu4dJarFyJoThcFgW4Sri uIEhfsBk5W0gnjqKLOUR0SY2Pb+zUzu8Sy71Q+dYxXRdNY27bK1ruvmIGgw6UE4K5mIr t35g== X-Forwarded-Encrypted: i=1; AJvYcCUMrvk6ySmt1LRqTR/aHacsuAUddCYZjShI6MhFObziENNvL3LoI4qbxtem9v+9+r0WgLeuq5Mm22cxOlI=@vger.kernel.org X-Gm-Message-State: AOJu0YwnV3fLgxOXP1SY68+sp5zioHvlk9ykyMBTEFqPmkcCEaO/FlzL qBk50jd8rhQuwX0aE0U4U2MISmSabV+ihJt/jGYzGtn7q+pYxOBRfAve/FBQ0w== X-Gm-Gg: ATEYQzzAoNnyrJULdcOMbGV3tx02tEeohR/GNKnrl3M7EQHZb0Upvu2t+QYuh5V5Zc4 hZCfGAT3Y9sMEKYzMKtj23PhUUVBXnIkxPrlqxVGgCuzz526etWr8DQBeW/DG/+RfJ9+e5dm1ka dnTUYeLmiCYvEEuEaXoHm+cDny4QCsVBF+bdtA+G2jJY/c2TqaEKMJNc12nNS1GHuFwsimYmYVK 90P2nybef4eYIASYJCYvhjQs3IBVeHpN23F3/2qajBa8c8TbhDZ4h2GNfxq99LLN9CDY5Nruj1j mDnKzZQIHAt1zoN/88O1VYS/o1b5+nK2zic2rmRIwSWoVsuWmqr1NqNrfUZkx0+c2tCgaOAncRd k8e7ecTe8EKv+Byihu3cgiI4LKB9QA3hr7i2sLSr0lOC9bU+2fOKL8FjppmFe4ka852HHuHygTv DjRvyPG+uYRk3uip91gIsb3vXlpPTs1w== X-Received: by 2002:a05:600c:6387:b0:487:cd8:4c9 with SMTP id 5b1f17b1804b1-48727ed5618mr29854465e9.27.1774608767051; Fri, 27 Mar 2026 03:52:47 -0700 (PDT) Received: from [192.168.1.50] ([81.196.40.93]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b919e722dsm12999210f8f.35.2026.03.27.03.52.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Mar 2026 03:52:46 -0700 (PDT) Message-ID: Date: Fri, 27 Mar 2026 12:52:45 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [BUG] wifi: rtw88: Hard system freeze on RTL8821CE when power_save is enabled (LPS/ASPM conflict) To: LB F , Ping-Ke Shih Cc: "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: Content-Language: en-US From: Bitterblue Smith In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 27/03/2026 01:52, LB F wrote: > Hi Ping-Ke, > > This is Oleksandr Havrylov again. Thank you for the ASPM/LPS Deep > quirk and the rate validation patches — they are both working correctly > (zero h2c timeouts, zero lps failures, zero mac80211 warnings). > > However, I'm experiencing a different, separate bug that causes kernel > oops and makes the system completely unresponsive, requiring a hard > power-off. After disassembling the crash site, I believe I've found > the root cause. > > == Summary == > > When firmware sends a C2H_ADAPTIVITY (0x37) command to an RTL8821CE > adapter, rtw_fw_adaptivity_result() dereferences rtwdev->chip->edcca_th > without a NULL check. The RTL8821C chip_info (rtw8821c_hw_spec) does > not define edcca_th, so the pointer is NULL, causing a kernel oops. > > The crash occurs on the phy0 workqueue while holding rtwdev->mutex, > which never gets released. This causes all subsequent processes that > touch the network stack to hang in uninterruptible D-state, making > the system completely unresponsive and requiring a hard power-off. > > == Root cause analysis == > > rtw_fw_adaptivity_result() in fw.c (line ~282): > > static void rtw_fw_adaptivity_result(struct rtw_dev *rtwdev, u8 *payload, > u8 length) > { > const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; > ... > rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY, "Reg Setting: L2H %x H2L %x\n", > rtw_read32_mask(rtwdev, edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr, > ^^^^^^^^^ NULL dereference here > edcca_th[EDCCA_TH_L2H_IDX].hw_reg.mask), > ... > > The RTL8822C defines .edcca_th = rtw8822c_edcca_th in its chip_info, > but RTL8821C does not set this field at all — it remains NULL. > > I verified this by disassembling the compiled rtw_core.ko module: > > Crash RIP: rtw_fw_c2h_cmd_handle+0x127 > Address: 0x1d527 = movl (%r12), %esi > > R12 is loaded at +0xe5 (0x1d4e5): > movq 0x140(%rax), %r12 ; rax = rtwdev->chip > ; 0x140 = offset of edcca_th in rtw_chip_info > ; R12 = chip->edcca_th = NULL for 8821c > > The function is entered via: > +0xd8 (0x1d4d8): cmpl $0x37, %ecx ; c2h->id == C2H_ADAPTIVITY (0x37) > > With R12 = 0, the instruction at +0x127: > movl (%r12), %esi ; reads from address 0x0 → NULL pointer dereference > > I also confirmed that rtw8821c_hw_spec in the mainline kernel > (torvalds/linux master, rtw8821c.c) does NOT set .edcca_th. > > == Reproduction == > > The crash is highly reproducible: it occurred in 4 out of 7 recent > boots. It happens during normal active usage with no specific trigger. > > boot date/time of crash uptime at crash > -5 2026-03-25 00:58:06 ~2 min > -4 2026-03-25 21:32:00 ~6h > -3 2026-03-26 00:28:14 ~2.5h > -1 2026-03-27 00:56:58 ~23.5h > > Both ASPM and LPS Deep are disabled via the DMI quirk. The crash > occurs every time with the same pattern and same RIP offset (+0x127). > > == Crash pattern == > > Every crash follows the same sequence: > > 1) Burst of 50-60 "unused phy status page" messages in ~1 second: > > rtw_8821ce 0000:13:00.0: unused phy status page (8) > rtw_8821ce 0000:13:00.0: unused phy status page (2) > ... (50+ more within same second) > It looks like the firmware is not sending C2H_ADAPTIVITY (unexpected for RTL8821CE), but rather you are getting garbage RX data. I am curious what kind of garbage it is. Can you try this? diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index da67a6845fd5..aae246c2bc8e 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -665,6 +665,7 @@ static void query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, struct rtw_rx_pkt_stat *pkt_stat) { u8 page; + u8 *rxdesc = phy_status - rtwdev->chip->rx_pkt_desc_sz - pkt_stat->shift; page = *phy_status & 0xf; @@ -677,6 +678,10 @@ static void query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, break; default: rtw_warn(rtwdev, "unused phy status page (%d)\n", page); + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 4, 4, + rxdesc, 56, true); + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, + rxdesc, 40, true); return; } }