From patchwork Fri Apr 24 00:49:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 215876 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55016C55186 for ; Fri, 24 Apr 2020 00:49:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 365032087E for ; Fri, 24 Apr 2020 00:49:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ivfmR3fx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728397AbgDXAti (ORCPT ); Thu, 23 Apr 2020 20:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbgDXAti (ORCPT ); Thu, 23 Apr 2020 20:49:38 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B91D5C09B042 for ; Thu, 23 Apr 2020 17:49:37 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id u6so8182928ljl.6 for ; Thu, 23 Apr 2020 17:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=la2G1HCrrxK1MLNy6dIeXCgUDsqvGwugG5O298GMJH0=; b=ivfmR3fxwtTtJZ7Kps8x3n0DD5etjSZuYFLSIBl+FzwgZWpQt53VX+7HgnQB6k0bXl qwNvpya5UywSba9PVKj3CCJmLRwujWaVjPnUgEOzKnUeljPDQnZQ5ByNYxycRTY6Tm9T 4DPmcBlZTX/ZjssCSqolhpt3g4/nd5wov8O+a4TNPlyLU49SG23E7gQU4Ri6e9Bmb56V gv+DMSkBCEnDQz+ijyaJSa63YlJiliQPa8G6ZvBTo1hmpElsuFWynOy+CrTqGIYY6fyl j6smX9YiOtCmJHnG7tqAzXAj7TeZ+NFMoO8L5er+Hze7eVV619Jn6FAv47VZGe1vf+nY cvUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=la2G1HCrrxK1MLNy6dIeXCgUDsqvGwugG5O298GMJH0=; b=g0w3669QFwjUIebHoHEPVuw8y/d4DcHsKp5VmkQyKmKWNE6wOaZG3SCmPMBZIcLj+x 7z9cLQdsOd3DypdLlc2E8/Or1YURS2SDKqD9pLfJGOThhi8GXFTBrSk+urxcEQUZvZad 3tZJgPpiOzQ1F9OlVbNkLzkVl8FttDJfzO9s4fp9H0kfHGZJqWA0HzPER1TWe3rRSzOy vSZgCE4jqzWGfjTyQU/FpFYA4S7V0/QfnqqxtQkrI9rGFmASSvtjJ/ABgGobGx4nBFBs FCSTmd/IHkfF9koBchm3fElthsn+i12aMwSWqoKIwU0kChwgoTTw0epTFBoRq/yZZ4MO q04A== X-Gm-Message-State: AGi0PuZEuKZQQZPtlFlul55vxZvGqGhsrazxnl5bgtB1XWfasI7lYjFl 3uwqCDXwNsvPKTzVOeplIb95IzHW X-Google-Smtp-Source: APiQypLOQn7S7ljmLV9Rd91S7f06hsLdK2yHiRPxjwAP+WbP/PX1VlbZJwMjJWMThpjb1nzJfB8Bzg== X-Received: by 2002:a05:651c:403:: with SMTP id 3mr3944631lja.231.1587689376268; Thu, 23 Apr 2020 17:49:36 -0700 (PDT) Received: from rsa-laptop.internal.lan ([217.25.229.52]) by smtp.gmail.com with ESMTPSA id r12sm1555056ljc.12.2020.04.23.17.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 17:49:35 -0700 (PDT) From: Sergey Ryazanov To: Kalle Valo Cc: QCA ath9k Development , linux-wireless@vger.kernel.org Subject: [PATCH 1/6] ath9k: fix AR9002 ADC and NF calibrations Date: Fri, 24 Apr 2020 03:49:18 +0300 Message-Id: <20200424004923.17129-2-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200424004923.17129-1-ryazanov.s.a@gmail.com> References: <20200424004923.17129-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org ADC calibration is only required for a 80 MHz sampling rate (i.e. for 40 MHz channels), when the chip utilizes the pair of ADCs in interleved mode. Calibration on a 20 MHz channel will never be completed. Previous channel check is trying to exclude all channels where the calibration will get stuck. It effectively blocks the calibration run for HT20 channels, but fails to exclude 20 MHz channels without HT (e.g. legacy mode channels). Fix this issue by reworking the channel check to explicitly allow ADCs gain & DC offset calibrations for HT40 channels only. Also update the complicated comment to make it clear that these calibrations are for multi-ADC mode only. Stuck ADCs calibration blocks the NF calibration, what could make it impossible to work in a noisy evironment: too big Rx attentuation, invalid RSSI value, etc. So this change is actually more of a NF calibration fix rather then the ADC calibration fix. Run tested with AR9220. Signed-off-by: Sergey Ryazanov --- drivers/net/wireless/ath/ath9k/ar9002_calib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c index fd9db8ca99d7..14eee06744ed 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c @@ -37,9 +37,8 @@ static bool ar9002_hw_is_cal_supported(struct ath_hw *ah, break; case ADC_GAIN_CAL: case ADC_DC_CAL: - /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */ - if (!((IS_CHAN_2GHZ(chan) || IS_CHAN_A_FAST_CLOCK(ah, chan)) && - IS_CHAN_HT20(chan))) + /* Run even/odd ADCs calibrations for HT40 channels only */ + if (IS_CHAN_HT40(chan)) supported = true; break; } From patchwork Fri Apr 24 00:49:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 215875 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0209AC2BA19 for ; Fri, 24 Apr 2020 00:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6CA82087E for ; Fri, 24 Apr 2020 00:49:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MaoIKNM6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728458AbgDXAtl (ORCPT ); Thu, 23 Apr 2020 20:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728426AbgDXAtk (ORCPT ); Thu, 23 Apr 2020 20:49:40 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE83CC09B042 for ; Thu, 23 Apr 2020 17:49:39 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id u10so6274599lfo.8 for ; Thu, 23 Apr 2020 17:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W2VxuGgPQg0BX0NNuAgyx42HRNt4gO8knSgu6spqd9A=; b=MaoIKNM6qLCqVN74eZUoO8dQIaXg1wRugqSkdOM+P6/NJ9HeG6KjEDuUu2rNpAYgKe 7vtXLFhDSFebmqI1oUOQV0zkJG0kz1NXZvGZzOmT5O37G+OzzYkqbtj7apSV7QpYBCiG 62HsbPMYBwyK31frmAjFX7u/6m+o7Fr7caoZ7BiopfGhmCFDJ8OSsyhicSZgLDaeXxnL HkyqaKEOmwRN8kAdX38s+HYwHQt+oUb1zDjbTWI/qWdpz+Dneh2S25ANezzjgr045k74 1Yy6p+dkWHQu8CSBr9YZXEhM+cazLdHRyNdsw6puxgz5t/ToIaZSRVpxxBGNKb4j2N8Y Eweg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W2VxuGgPQg0BX0NNuAgyx42HRNt4gO8knSgu6spqd9A=; b=pN+qWnBXWLoIoENh98qyhHPdO6jP2kTGFF7dXizS+fJL9WT+u/VqqD0rkAwbGfIlZt 9G6SEahlC0XU43z6+WVH3YfLcNgXXHRkK9bpCf7t3ONtJOMQrMN0zYxMs4kJSiaHauwI Gk0G9/xPJWypOYdntPhFB1tZ3H3D/HqVjgKeoYukLnAQ7x8ZkFKvq1UYLNwmcWJ/nr7f izgM+4AGrgemZfkQxhbTVSuOahJ5RCJJd3GlpvQUkTnLcnH0wXID8vesQW6dAy0h47R0 3rhFngVPQy40pgx1odr69UjGBo6zroPjSn+E4Jj5AMw5j4cT/G2LXxNBFTpsqGe7drOM Rr3g== X-Gm-Message-State: AGi0PuaPZUlTzKYLtcN7W8eJ3UABdsII40SjGzsrbyKo7A2HFEvUNExU PF+mF/93O8qkhqJM+3BS8q32RkWu X-Google-Smtp-Source: APiQypJW5v/1Q/Pnnlzy2KvZR94Jg9TObRBcqwOno7MSdmS817egr+/NIdI9Qj1e0/91BceROZWbKg== X-Received: by 2002:a19:c78d:: with SMTP id x135mr4096890lff.151.1587689378419; Thu, 23 Apr 2020 17:49:38 -0700 (PDT) Received: from rsa-laptop.internal.lan ([217.25.229.52]) by smtp.gmail.com with ESMTPSA id r12sm1555056ljc.12.2020.04.23.17.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 17:49:37 -0700 (PDT) From: Sergey Ryazanov To: Kalle Valo Cc: QCA ath9k Development , linux-wireless@vger.kernel.org Subject: [PATCH 3/6] ath9k: do not miss longcal on AR9002 Date: Fri, 24 Apr 2020 03:49:20 +0300 Message-Id: <20200424004923.17129-4-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200424004923.17129-1-ryazanov.s.a@gmail.com> References: <20200424004923.17129-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Each of AGC & I/Q calibrations can take a long time. Long calibration and NF calibration in particular are forbiden for parallel run with ADC & I/Q calibrations. So, the chip could not be ready to perform the long calibration at the time of request. And a request to perform the long calibration may be lost. In order to fix this, preserve the long calibration request as a calibration state flag and restore the long calibration request each time the calibration function is called again (i.e. on each subsequent ivocation of the short calibration). This feature will be twice useful after the next change, which will make it possible to start the long calibration before all ADCs & I/Q calibrations are completed. Run tested with AR9220. Signed-off-by: Sergey Ryazanov --- drivers/net/wireless/ath/ath9k/ar9002_calib.c | 10 +++++++++- drivers/net/wireless/ath/ath9k/hw.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c index 0f7c5812e5c2..ad8db7720993 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c @@ -663,8 +663,13 @@ static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, int ret; nfcal = !!(REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF); - if (ah->caldata) + if (ah->caldata) { nfcal_pending = test_bit(NFCAL_PENDING, &ah->caldata->cal_flags); + if (longcal) /* Remember to not miss */ + set_bit(LONGCAL_PENDING, &ah->caldata->cal_flags); + else if (test_bit(LONGCAL_PENDING, &ah->caldata->cal_flags)) + longcal = true; /* Respin a previous one */ + } percal_pending = (currCal && (currCal->calState == CAL_RUNNING || @@ -700,6 +705,9 @@ static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, } if (longcal) { + if (ah->caldata) + clear_bit(LONGCAL_PENDING, + &ah->caldata->cal_flags); ath9k_hw_start_nfcal(ah, false); /* Do periodic PAOffset Cal */ ar9002_hw_pa_cal(ah, false); diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 2e4489700a85..c99f3c77c823 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h @@ -427,6 +427,7 @@ enum ath9k_cal_flags { TXIQCAL_DONE, TXCLCAL_DONE, SW_PKDET_DONE, + LONGCAL_PENDING, }; struct ath9k_hw_cal_data { From patchwork Fri Apr 24 00:49:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 215874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F003CC55192 for ; Fri, 24 Apr 2020 00:49:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1FD820CC7 for ; Fri, 24 Apr 2020 00:49:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CiEOTicG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728342AbgDXAto (ORCPT ); Thu, 23 Apr 2020 20:49:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728480AbgDXAtm (ORCPT ); Thu, 23 Apr 2020 20:49:42 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20CDAC09B042 for ; Thu, 23 Apr 2020 17:49:42 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id u10so6274631lfo.8 for ; Thu, 23 Apr 2020 17:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=enNVEIEyKc8khXu44plNNu16PsTEyKATqm81c6KZKDE=; b=CiEOTicGRsNjS1GnPyZExyFEMCK2xzGmbDVwBzRPoBXZ+g81nfMTy0nS9Pu3GrPKpK HXEfnTnCrqAEWpLtTXfx2GYwZZRDQUQqs3xswmW2aOS56RAS8oZSxql+2+uhwLkGIgHy rY+7XXOupwPqPTVrhLb0xJoclaw3CLYN/IS64hVGUI2/pM76PIHDHmZ3D9keqEfS+bsn bV/TNfYO7RgnrWiwUnsEW3xXnOx77/DcP3JOtETGd2qs7+DKcW2QSSD/Nh6PUo33Qid0 LhkBeIiMip8MQpBiWfPuwJN0dM2p0md11jxFth2QU63uNTOPy+gOtECjrYEAVlMF4GR4 vaQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=enNVEIEyKc8khXu44plNNu16PsTEyKATqm81c6KZKDE=; b=JHqgaYgrC/r0v7gZxdNW9EB4XNvL8vgdYEN0VifOeHkc9hOQDNuw+/cb7jiBlVO+oe NDAuLzItMrLk+ZVSEglXp1zPxfBnXPpcE/kQ6Knr5b7MiyU8rFiVxpijZinm1oNzu/DK rJrZpeQ4KeprKjrxrdXxuZyAEqqpNLUnXYVfjP9TRuwweMPpVIqbffSElQvUNqUdhLb5 6qqfn3DrnT7mih2Hcdk88O019dhmOMZUj++RfAiiXEbHgS6fPFd+qOVMTF5RRrEmE/ql 2vQCY9QFmx5Uh+3qyPjocKVksIGTNmodOaPuBvzeSWLcWC6NY5klbksXkvBqtiYBfwBt dUjw== X-Gm-Message-State: AGi0PuYy1arsYRZ4x1Wuzz3y6Cdjti3ugTENI+Xk1BMjjQ3gz07FIXZE lqC5ospqWqM0m8B2MSI/kEU= X-Google-Smtp-Source: APiQypIqPLV0zJLFr5z1nqP9RFhCm3+3lTcHomAYsnYqXkLZTna1dg93yMhYj3oKAfZG/83+9I3jwA== X-Received: by 2002:a19:c895:: with SMTP id y143mr4007457lff.123.1587689380652; Thu, 23 Apr 2020 17:49:40 -0700 (PDT) Received: from rsa-laptop.internal.lan ([217.25.229.52]) by smtp.gmail.com with ESMTPSA id r12sm1555056ljc.12.2020.04.23.17.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 17:49:40 -0700 (PDT) From: Sergey Ryazanov To: Kalle Valo Cc: QCA ath9k Development , linux-wireless@vger.kernel.org Subject: [PATCH 5/6] ath9k: invalidate all calibrations at once Date: Fri, 24 Apr 2020 03:49:22 +0300 Message-Id: <20200424004923.17129-6-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200424004923.17129-1-ryazanov.s.a@gmail.com> References: <20200424004923.17129-1-ryazanov.s.a@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Previously after the calibration validity period is over, calibrations are invalidated in a one at time manner. So, for AR9002 family, which has three calibrations, the full recalibration interval becomes 3 x ATH_RESTART_CALINTERVAL. And each next calibration will be separated by the ATH_RESTART_CALINTERVAL time from a previous one. It seems like it is better to do whole recalibration at once. Also, this change makes the driver behaviour a little simpler. So, invalidate all calibrations at once at the end of the calibration validity interval. This change affects only AR9002 chips family, since the AR9003 utilize only a single calibration. Signed-off-by: Sergey Ryazanov --- drivers/net/wireless/ath/ath9k/calib.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c index 695c779ae8cf..2ac3eefd3851 100644 --- a/drivers/net/wireless/ath/ath9k/calib.c +++ b/drivers/net/wireless/ath/ath9k/calib.c @@ -209,14 +209,17 @@ bool ath9k_hw_reset_calvalid(struct ath_hw *ah) return true; } - if (!(ah->supp_cals & currCal->calData->calType)) - return true; + currCal = ah->cal_list; + do { + ath_dbg(common, CALIBRATE, "Resetting Cal %d state for channel %u\n", + currCal->calData->calType, + ah->curchan->chan->center_freq); - ath_dbg(common, CALIBRATE, "Resetting Cal %d state for channel %u\n", - currCal->calData->calType, ah->curchan->chan->center_freq); + ah->caldata->CalValid &= ~currCal->calData->calType; + currCal->calState = CAL_WAITING; - ah->caldata->CalValid &= ~currCal->calData->calType; - currCal->calState = CAL_WAITING; + currCal = currCal->calNext; + } while (currCal != ah->cal_list); return false; }