From nobody Sun May 24 19:33:17 2026 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 87B762E6CA6 for ; Thu, 21 May 2026 23:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779405904; cv=none; b=Fuh6N8gScjxdEyzCxLXvpm9QtpyiszLea14A+bn0SlQZPzDdppswkesITon/6H8bqadrvRK74s5q1JmfLh3NivIgIz5SJ4467GBdhN3guJqd9ln/gEHeGRgaQl5xHFixApfdI2gom6kjASsrqKKE9TN77fH/Kp3sGvmJIe8xNHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779405904; c=relaxed/simple; bh=caQzFBVz9+JRDYs3VPB+WZdfbYRu03k6zu3PTsCnwLw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SNtjDPBLeHPinHNC8QOP4eKlqCvid89lu2EJszMeKYLxOfGnTTJTCQQvtIqmQRIFyDtmKg4gSxSPdRukF3OdM7lan0HbcdBsFCTGmA80q/xUeGumvEnOV8ZgdblOAq5bKfloPgOQLVgWXqhJ0sXhQXv6AMfZ3cXxGJ85OOKwMi4= 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=JS07uhtn; arc=none smtp.client-ip=209.85.215.180 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="JS07uhtn" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c80203b9d7bso3024536a12.0 for ; Thu, 21 May 2026 16:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779405903; x=1780010703; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/shh+HWrmrsrUU3hIQCrHnvACFJA2W4RqXWRdx38L90=; b=JS07uhtn8hRJksHVMFGGpieV1/TsCdFck0LGbKU6vjOOD7JN+SxMRzqaIEJhCbmWWv aQSK+YU5jLIExFny71lQt8aAJBzWwOo/qfzyE9aPk173tar5VBxa7OzpGu94h4MLsU3A W1eLr+KmNRwde31neUWKaTdWsScqBsYf+LGvhYLCQDFP7NFPa3EI5L4wPFot0dEHxc8V +pOG8wRHBzaUPzdHES8hkmJkBsRUlA7d5Qj85M9OgsyjLNR8D8SDhLzYSKUC1xnv8Xgb qQL2bEnveMxNQwvWz2TfC3lsmIC0RNbetfdnTYtzaILMyaBQerc6mhHdBoZW8iY7uGIi uGIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779405903; x=1780010703; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/shh+HWrmrsrUU3hIQCrHnvACFJA2W4RqXWRdx38L90=; b=ZKedIOQi8VZEYI9+Rr5zP0vEKsIo8vqU5MgHf+giBFquU0aeW7Yme6ninaFHANr1ui iR/ZMtEi0IHa+XxjYV5a/heosvzKz0Hz2hzJl8deurBleQ6pONb+a0YKjyOegFRwlz25 mtZo8cJb2EPrLZfvGf9IoRSojqr/Jxa/DErWxYKFMc7vI0nl/805PvGywDfFdhTRbDox kR7IkTmLLCK3SuI/oZXRcRw6S1otZPrVsn2i4lxoQJISvXAdlPM4p2YDMs/l34cvepEy nSWdzV12mjHQlK7U8J/2ae/ixI8nKECUTTSUZccZ+uKEZ0QAOa55sgMmaRshbLHkBLqj Cu2g== X-Forwarded-Encrypted: i=1; AFNElJ+UYdLdaqNd4R9F1tDwxAbRSc6vPS86eiRjo/sh7LnZOMJasEJwTYQ6z7FIdAqYwc0981hHJRgDDCDopKo=@vger.kernel.org X-Gm-Message-State: AOJu0YxG/On/HnL1SfWq112n5oknQV30l3l5utIUTz8HmUOa7ujDSz00 fikFzjoBQsk0UPu8TN6tDIYxMULGRehcVpfhsYWxrsvm5Mt5rxwt7ymy X-Gm-Gg: Acq92OHYlihIY9RFduDRYRSA9itLkzkQVU8AizIWclquoBX+JULlsF3GQpE6gfLpuvK 5ViLYVICqWsBjrVF9kpjmj4hbwctZrvEftTmQc0dXppMZeDI3ibYhiWHlso5GUkgSexPw3Swc5p b9xtIEEiFJ3iloLHYKNeIoxXzd0sdbD8zNrZ15H9E8QyL1VLPJhD3cudFZs5wAGyGQ2R45RGA0Q GRnZe1sD0NRfRGDB1IKOuRBXS+6XkoaGKJBg3HLQrywniyuoW+x0gM2w55P6it63VJVFfSFVD3i 4i6GfR+IjWoG3QjCMHwZNe6UhKVZNqrXWacx/ZQ435wxYlJOOeaXJyA50padZKvn+Cujprw/v61 B7g0fWdikOmwM6xxIUgo6bk0RBWYuY2XcyGRxs1YRbD70O4+FaWFJyo/YINuL6ReAk4DKhDVEXb wjRnm0DCq3nlaE1JgsLQ+tccZlL+S5s+Mo1BKkAP5o0ddHaNa2uNBoQqauElzQyaRHKvcChOys2 /SzJo0HzRtQeStoak6nZs6pG4r+S+1E1DY= X-Received: by 2002:a05:6a21:4d14:b0:3a3:a9c4:3d60 with SMTP id adf61e73a8af0-3b328e74760mr958894637.27.1779405902722; Thu, 21 May 2026 16:25:02 -0700 (PDT) Received: from ryzen ([2601:644:8000:5b5d:7285:c2ff:fe45:8a32]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-841628795d5sm185466b3a.38.2026.05.21.16.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 16:25:02 -0700 (PDT) From: Rosen Penev To: linux-wireless@vger.kernel.org Cc: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , linux-kernel@vger.kernel.org (open list) Subject: [PATCH ath-next] wifi: ath9k: improve stability on AR9330/AR9340 Date: Thu, 21 May 2026 16:24:45 -0700 Message-ID: <20260521232445.261915-1-rosenp@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Setting a couple of registers on these platforms improves stability. Signed-off-by: Rosen Penev --- drivers/net/wireless/ath/ath9k/hw.c | 25 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/phy.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath= /ath9k/hw.c index 05c95e67a853..5168c02bb73c 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -248,6 +248,19 @@ void ath9k_hw_get_channel_centers(struct ath_hw *ah, centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT); } =20 +static inline void ath9k_hw_disable_pll_lock_detect(struct ath_hw *ah) +{ + /* On AR9330 and AR9340 devices, some PHY registers must be + * tuned to gain better stability/performance. These registers + * might be changed while doing wlan reset so the registers must + * be reprogrammed after each reset. + */ + REG_CLR_BIT(ah, AR_PHY_USB_CTRL1, BIT(20)); + REG_RMW(ah, AR_PHY_USB_CTRL2, + (1 << 21) | (0xf << 22), + (1 << 21) | (0x3 << 22)); +} + /******************/ /* Chip Revisions */ /******************/ @@ -1438,6 +1451,9 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int= type) if (AR_SREV_9100(ah)) udelay(50); =20 + if (AR_SREV_9330(ah) || AR_SREV_9340(ah)) + ath9k_hw_disable_pll_lock_detect(ah); + return true; } =20 @@ -1537,6 +1553,9 @@ static bool ath9k_hw_chip_reset(struct ath_hw *ah, ar9003_hw_internal_regulator_apply(ah); ath9k_hw_init_pll(ah, chan); =20 + if (AR_SREV_9330(ah) || AR_SREV_9340(ah)) + ath9k_hw_disable_pll_lock_detect(ah); + return true; } =20 @@ -1843,6 +1862,9 @@ static int ath9k_hw_do_fastcc(struct ath_hw *ah, stru= ct ath9k_channel *chan) if (AR_SREV_9271(ah)) ar9002_hw_load_ani_reg(ah, chan); =20 + if (AR_SREV_9330(ah) || AR_SREV_9340(ah)) + ath9k_hw_disable_pll_lock_detect(ah); + return 0; fail: return -EINVAL; @@ -2074,6 +2096,9 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_ch= annel *chan, ath9k_hw_set_radar_params(ah); } =20 + if (AR_SREV_9330(ah) || AR_SREV_9340(ah)) + ath9k_hw_disable_pll_lock_detect(ah); + return 0; } EXPORT_SYMBOL(ath9k_hw_reset); diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/at= h/ath9k/phy.h index 4a1b99238ec2..af667a3629b1 100644 --- a/drivers/net/wireless/ath/ath9k/phy.h +++ b/drivers/net/wireless/ath/ath9k/phy.h @@ -48,6 +48,9 @@ #define AR_PHY_PLL_CONTROL 0x16180 #define AR_PHY_PLL_MODE 0x16184 =20 +#define AR_PHY_USB_CTRL1 0x16c84 +#define AR_PHY_USB_CTRL2 0x16c88 + enum ath9k_ant_div_comb_lna_conf { ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2, ATH_ANT_DIV_COMB_LNA2, --=20 2.54.0