From patchwork Fri Sep 7 21:13:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10592597 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3FCC6CB for ; Fri, 7 Sep 2018 21:58:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5B992B0AD for ; Fri, 7 Sep 2018 21:58:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A80932B0D0; Fri, 7 Sep 2018 21:58:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53A512B0AD for ; Fri, 7 Sep 2018 21:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbeIHB4E (ORCPT ); Fri, 7 Sep 2018 21:56:04 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35155 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbeIHB4E (ORCPT ); Fri, 7 Sep 2018 21:56:04 -0400 Received: by mail-wm0-f65.google.com with SMTP id o18-v6so15893626wmc.0 for ; Fri, 07 Sep 2018 14:13:18 -0700 (PDT) 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; bh=+jKodjoPkNWWCzzBaYy3avz9sva8aQISqLmwn4kG5+U=; b=fJX0gyCMtrRMx2Kbov6PfjXD3HCCxtWx/gJng2KMHtPmvzUZxPLy3F0pYUF9Ca44NG /16pkV67nFowLSrI1yzeH9sNTEFaWpS0UKnXoYLedET5SyZvjbkP+ZARtSJg/z1KjST4 4Fl+JzzhqgLJDXVF3P6xmHQxSLcK4vvAJrID++g09yJZQPyvbk2Y4VEVHeBFv0Z8BJB2 6/SWnVQl9LqOOxITGn3UFWaguD/LiWqmZezW4+1wh2KY7Zqkg5LNzf/k/6jS7byvVvxh 1QmUTFkdyuVIMC62HJ7kgYYVXXyyFdB6LDCgUrNmeoEvMrvu9mYwYdRN8OlqgJ0tNhXH WMMA== X-Gm-Message-State: APzg51DASOxFr4eXA0KGwOQWuMVbxw5P9yfYUsXy/Cl3edI3DqEWw7tJ 352et1ctcc/ViFkUU0THLl3UQA== X-Google-Smtp-Source: ANB0VdYTuZRI4h72JsT+34VMX4Mb/TDhQ8y5HPAm9iHSYkJ7SMwEcwNZp4pGl+40rYXTj7vAy0/PGQ== X-Received: by 2002:a1c:ac07:: with SMTP id v7-v6mr5866840wme.110.1536354797327; Fri, 07 Sep 2018 14:13:17 -0700 (PDT) Received: from localhost.localdomain ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id 94-v6sm8927192wrc.10.2018.09.07.14.13.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 14:13:16 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: sgruszka@redhat.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH] mt76x0: run vco calibration for each channel configuration Date: Fri, 7 Sep 2018 23:13:12 +0200 Message-Id: <20180907211312.17918-1-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.18.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to vendor sdk, vco calibration has to be executed for each channel configuration whereas mcu calibration has to be performed during channel scanning. This patch fixes the mt76x0 monitor mode issue since in that configuration vco calibration was never executed Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Tested-by: Sid Hayn Signed-off-by: Lorenzo Bianconi Acked-by: Stanislaw Gruszka --- drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c index 5da7bfbe907f..14e8c575f6c3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c @@ -757,10 +757,10 @@ __mt76x0_phy_set_channel(struct mt76x0_dev *dev, /* Vendor driver don't do it */ /* mt76x0_phy_set_tx_power(dev, channel, rf_bw_band); */ + mt76x0_vco_cal(dev, channel); if (scan) - mt76x0_vco_cal(dev, channel); + mt76x0_mcu_calibrate(dev, MCU_CAL_RXDCOC, 1); - mt76x0_mcu_calibrate(dev, MCU_CAL_RXDCOC, 1); mt76x0_phy_set_chan_pwr(dev, channel); dev->mt76.chandef = *chandef;