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: 10592549 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 60A751515 for ; Fri, 7 Sep 2018 21:13:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 461E52B7D1 for ; Fri, 7 Sep 2018 21:13:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39E0F2B7F3; Fri, 7 Sep 2018 21:13:41 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E094F2B7E3 for ; Fri, 7 Sep 2018 21:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=0jqWPCpgWR6Q3yBizNAXMH1BjdWC9nIlkHvkvAJVUmE=; b=NXZ HOjIn5k0gQEbcW/BCp8YzTIEyloakLdPKBfBq2pWj5rDP+vsKaLt3E54zE2cadWFkY5k4Bw98IKh4 M9e8TTJUUaIHfjmOuc12SBW/YP7qdRfxsTrHxYQfSXvi30a7IhLHfE7VB9nV9P3ToCuUe8ltMPknk oO+17SeWIL2JyJY90J4ginrXsuezh6dwEKfqhsog58fG0TxbMStBYlzQ07e3UVe6iNLOxdDcyzpQe C9wW5ueAFWis+YFoxEc8sAwW1Iw6AtArIrj2gvz552twE7HcnBe8gzcpi0rbRlU+aLsalMp1PJ++U Vib8Qf5fBUF5zHHcGkI6JtIG2QXRJng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyO4P-00057N-5z for patchwork-linux-mediatek@patchwork.kernel.org; Fri, 07 Sep 2018 21:13:37 +0000 Received: from mail-wm0-f68.google.com ([74.125.82.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyO4H-00052i-Hh for linux-mediatek@lists.infradead.org; Fri, 07 Sep 2018 21:13:32 +0000 Received: by mail-wm0-f68.google.com with SMTP id q8-v6so15871806wmq.4 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=Mwjfg8YHozRqvV9QiRXPvoxg4izbwROgexa5B7/GRNPtovB/UWEUEqf7VDFu1SCWMl pM7n4z7xWUwyCpMmndkpkehMyvzOS3hoxo7IhddfcDU43nudpKjuS01GHfJfXqLhkV5D 0k1f1ePugbPY2YwAcDgWQ5gZvIoCf5tXXbFBguV//QyDUdgp4K/QVrZHjqr5EMPBLkRG R0mLF5okEK4IKKQ9haTR0x5ijCg4qdoK8KcAXUt/TEyBMsmVdzZG3YPziKx5MzSWGoo0 rAqxK+diEExVKHNXn6LSIfC5W0c6epsDCgXU1LGgrjJ3T6F85tmWSKt0XMoKXK/Uz46H PdZA== X-Gm-Message-State: APzg51D84/bi3i154mkmHXlxeOvmp7ndYEYyZqapsaXEH937uGEXr4m1 M96GAxWSgeEZWDrk/snKMIOzLA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180907_141329_582571_DF180927 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, sgruszka@redhat.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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;