From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 CA0EE3AA1BF for ; Fri, 10 Apr 2026 08:00:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775808040; cv=none; b=B7gShzazYz7tH1hdNxFSTez9yjNnIxnsdBxswFmNi3N8LvShMl9qu59ojxzarpMPOnw+gBfLXP7WYF9UMMCCZAsiECxuuA4z7glBz6JWosZIS3aeXD7XRMVcgqH4oWOJFLvSnXruJlrJ3YxR5/oLkY8Dw8RpasK3cyk3aAYbWCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775808040; c=relaxed/simple; bh=sJLUcEB5Ds5h7s1KzusNR0Xi7cPwLi/aMbVipBLZNf4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JbyQL6sI5GvfkpxuUprE8kRvWe8V0ImLQ6hIIkeAg1qeizSakgi4uvqlSJhsrvUSbxz414SDTVXGpHgYuMhUMhCOi4quRTkhQDm8nnHn4UyGQUupLRaL36O/7bHJhVnoYgJ5R0ckekmFW011XGzcgLIeo0HNJPNCnwrwxylMb3g= 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=UpRSBnY7; arc=none smtp.client-ip=209.85.221.48 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="UpRSBnY7" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-43b8e8e7432so1523488f8f.1 for ; Fri, 10 Apr 2026 01:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775808035; x=1776412835; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VbUT3h/LfG7smkTPhwuysdt9HcT3k1c4we51p644zaU=; b=UpRSBnY7EcZLH3DBjTOKWBU7CYY9RsXATYFTLOVx/xbY8jFBobjLsLMm8eM/s2sewb 9AaI2YrFLKmfrIheQKt7BaO6G2iCgZME3ppgQntdwewkwMoFFDul9qfwM3NBFf5CVyEK +zI1ymU3IaGQGiaC9cPxkhmaM7zXVdqpA/PFIqCeZXUtmhqn0r4nAXP/h12UcBM9jMOj pMyYPg5p5GYDEfyL/46sttJ5dbO9EN10drhGqZod3cPrL2MmzoxfyzcRAD4PbeaK+qOp 8zpoPoxFOLGLlMDH3ZwpgvWi8wdpVGV29TLKsbUs2fEP/3xLhs3b6IiWrhDEuBRWHPXy gmLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775808035; x=1776412835; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VbUT3h/LfG7smkTPhwuysdt9HcT3k1c4we51p644zaU=; b=hn0NdfHESuZk2vqvQ/ALxHj6pIomDPE5N7O0Lbe8t3jKvtuNdAF+NiV7J4N/jMY1+U BusGWXGL6+2XZ324Gf5WlQrcmcJnyhN5eUEoQOUSXPtM/9BV94ipv+gIHpgG3GIDns9X 0yqKtwgjfhtZiLtOKGYr01p36SOUFhrv+hSvBpm/FxcB4AbGALek9BSO2q9DA86I3ESY uAlREBJqBqCpzXopLnN+AbHmcEmX7t1HyyCkHsNiVpP52iDgvUem04ynwtbGumjVp39g q0VhV8pPfBnPds6VmWHSt+j6sFdTkfrKHNSaq/1Mn4cFnIxUW755mwRJRiihleXGXIxu 7eaw== X-Forwarded-Encrypted: i=1; AJvYcCUWyILUXwl/WxXzJN0I0ZsSBCmS4UdbPyPzn5zZ5GhujgklMZrE9C70WURozjC6jiz7b40ZnmSJ/voR/mA=@vger.kernel.org X-Gm-Message-State: AOJu0YyKuUAM1cghuTZPWAWB0b3kAKzPSZmzG5IRa+j1GJrc43q2jJcI 2v7qRaktfWZ0Yd6gHRYbrJXneJr1p9NWr9L0KOR79N93mSZBOcOfFJGj X-Gm-Gg: AeBDievSUio2wMSnmJuajczod81g3cq/4XGwi4V7k82E9daUaqCE509abDBBvpuepPW x3rHrIOrCWzeTmE4CUSgPc7PwsTMuoZ+seZkgKnu0uF6jRDgcKZ6tZPGbllg0RdpBRQq5vIutdG XSZ0ZSxn9waP9G8sw1UFUbIOoaq2FgjUXg08ZqUQ9M2QW7uYefJp2G01X/t3E+uN1F0wJFRwkpu rniP0PXWXeRGAUxzApXZ/Q4vM0ngCwK4c5hkdUcmt9Ic0OO6KhXBTc4v7eA0ta+GRdHSfM3hDb+ GrG3c6T6+K3nC0fZGYLLETIHyt6MU8slC7oy4DxtL2t4erKtmUIbKMTaGCIZPkI+o9Ct4UvBai2 JDEZRxJ17ckdOqxa8petkMIHQ/kPAUfV2Y3vBXOWwwGs3VV0qsIWd3jqm6+Tj1RA7bu+SMttU8f ex X-Received: by 2002:a05:6000:26c2:b0:439:ddf9:a205 with SMTP id ffacd0b85a97d-43d6427b793mr2975801f8f.10.1775808034579; Fri, 10 Apr 2026 01:00:34 -0700 (PDT) Received: from bazzite ([102.128.175.252]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d63e5c98fsm5891151f8f.35.2026.04.10.01.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 01:00:33 -0700 (PDT) From: Louis Kotze To: linux-wireless@vger.kernel.org Cc: pkshih@realtek.com, rtl8821cerfe2@gmail.com, linux-kernel@vger.kernel.org, Louis Kotze Subject: [PATCH 1/2] wifi: rtw89: phy: increase RF calibration timeouts for USB transport Date: Fri, 10 Apr 2026 10:00:16 +0200 Message-ID: <20260410080017.82946-2-loukot@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260410080017.82946-1-loukot@gmail.com> References: <795a8567fdbe48babc5cf0f2b5e10c0a@realtek.com> <20260410080017.82946-1-loukot@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit USB transport adds significant latency to H2C/C2H round-trips used by RF calibration. The existing timeout values were designed for PCIe and are too tight for USB, causing "failed to wait RF DACK", "failed to wait RF TSSI" and similar errors on USB adapters. Apply a 4x timeout multiplier when the device uses USB transport. The multiplier is applied in rtw89_phy_rfk_report_wait() so all calibrations benefit without changing any call sites or PCIe timeout values. The 4x multiplier was chosen based on measured data from two independent testers (RTL8922AU, 6GHz MLO and 2.4/5GHz): Calibration PCIe timeout Max measured (USB) 4x timeout PRE_NTFY 5ms 1ms 20ms DACK 58ms 72ms 232ms RX_DCK 128ms 374ms 512ms TSSI normal 20ms 24ms 80ms TSSI scan 6ms 14ms 24ms TXGAPK 54ms 18ms 216ms IQK 84ms 53ms 336ms DPK 34ms 30ms 136ms Tested with RTL8922AU on 6GHz MLO (5GHz + 6GHz simultaneous): 25 connect/disconnect cycles with zero failures. Signed-off-by: Louis Kotze --- drivers/net/wireless/realtek/rtw89/phy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index e70d0e283..4d809df8b 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -3956,6 +3956,13 @@ int rtw89_phy_rfk_report_wait(struct rtw89_dev *rtwdev, const char *rfk_name, struct rtw89_rfk_wait_info *wait = &rtwdev->rfk_wait; unsigned long time_left; + /* USB transport adds latency to H2C/C2H round-trips, so RF + * calibrations take longer than on PCIe. Apply a 4x multiplier + * to avoid spurious timeouts. + */ + if (rtwdev->hci.type == RTW89_HCI_TYPE_USB) + ms *= 4; + /* Since we can't receive C2H event during SER, use a fixed delay. */ if (test_bit(RTW89_FLAG_SER_HANDLING, rtwdev->flags)) { fsleep(1000 * ms / 2); -- 2.53.0