Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3393208yba; Mon, 29 Apr 2019 01:14:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmdyeqhjAEhmoRyH3wJ1WfBwbzngfr5CRzn6zzrYOeLzP9J6tzDKi/5QZF+9YB6jGwaHuq X-Received: by 2002:a17:902:b081:: with SMTP id p1mr11730268plr.110.1556525666166; Mon, 29 Apr 2019 01:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556525666; cv=none; d=google.com; s=arc-20160816; b=cpbQFTrJzqr/oh4GObVllsV5QiX6KluPTxXul3gtU8Hdh9ZzIuAVaMQ5QMo0DGcTlA NJDcCq5poBd4xA0XZuhpAJGNn586s3RRQcjkgIQMN7za7rR7RDeRS3O+rUVcDUev/1hp eMSBAsShq2MBxat0DEPogK7zQtUxou55fLt9gky7/M5iYZHPOPoWYrJQDyfB5d+yHqos ML8+sKHu92rxT+OfXXr1Q2KnV1wRyOWj4EtU8cLSyOaYY5BGAkuOOT4sQRrhoo78JI6w 5Ll+8KdPxikV7UwlgX6DLpzV4vkrszZKBKJ9eCCDxH3BQijwh+rYkRgpNKobT0hyVkWO 54sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jBGz8ZHglsoFqH6to43GUbhD8b848YkmJsMKVwyFfSs=; b=Ye1tqcystm/aiQvkExrpzdMGGkq54sWAn8+VTqtSJtLliCS9+VvvNBfI0HewIq2t/b 9EJf1vD+2aT13FtbtavvDu6i4tlYbAVg2vFTzfockqqHadP29vthUy5TwZkOWgYb0eOo AaR98ibpRdL9CDymrd7TywyKNyYCPYUmTcCoZ395LQKXzFvX0OviOcSPrHIQF9ITf2YM MQTV35Edrxpca0812HGfgehUlsgFen6NktFaPDX8GcfC9BcTT+9ZWM2x+8mrmLN+YpTg aBLOaAM129AzEjwzDUb4K87JFJmhuRtVyJFLX0OH9WzfAuism9WM8jHy43v52qiDNXes ARsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="b9z5dO/Q"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si4815285pfj.71.2019.04.29.01.14.12; Mon, 29 Apr 2019 01:14:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="b9z5dO/Q"; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbfD2INY (ORCPT + 99 others); Mon, 29 Apr 2019 04:13:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:33628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727439AbfD2INY (ORCPT ); Mon, 29 Apr 2019 04:13:24 -0400 Received: from localhost.localdomain (unknown [151.66.22.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4858206BF; Mon, 29 Apr 2019 08:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556525603; bh=IUHRsVcaJNrBDbvIzXB7Vi12fzSsh3tns/loE4eVwaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b9z5dO/QOZ4jxwBWiXFIgbBBxqviCIm1MoKXIoCx2q7q/U9d4hc0SXaHtSNlzkHJ2 tiaSWhSQeHUTL+7+QqxojeSEd8kaXC64Pv0WL3ww4y5Z9kHU3T60J1hHOtjc80pBLh 8wXe5aNwJDDczBnto2vSFoukutSZnFwnoMBu7/TM= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, sgruszka@redhat.com Subject: [PATCH v2 5/5] mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel Date: Mon, 29 Apr 2019 10:13:02 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Disable pre_tbtt_tasklet tasklet before setting the operating channel. Enable/disable beacon_timer in mt7603_set_channel Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7603/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c index be5d43050100..d879efc5a216 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c @@ -133,10 +133,12 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def) bool failed = false; cancel_delayed_work_sync(&dev->mt76.mac_work); + tasklet_disable(&dev->mt76.pre_tbtt_tasklet); mutex_lock(&dev->mt76.mutex); set_bit(MT76_RESET, &dev->mt76.state); + mt7603_beacon_set_timer(dev, -1, 0); mt76_set_channel(&dev->mt76); mt7603_mac_stop(dev); @@ -186,8 +188,11 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def) mt7603_init_edcca(dev); out: + mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int); mutex_unlock(&dev->mt76.mutex); + tasklet_enable(&dev->mt76.pre_tbtt_tasklet); + if (failed) mt7603_mac_work(&dev->mt76.mac_work.work); @@ -535,7 +540,6 @@ mt7603_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct mt7603_dev *dev = hw->priv; set_bit(MT76_SCANNING, &dev->mt76.state); - mt7603_beacon_set_timer(dev, -1, 0); } static void @@ -544,7 +548,6 @@ mt7603_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif) struct mt7603_dev *dev = hw->priv; clear_bit(MT76_SCANNING, &dev->mt76.state); - mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int); } static void -- 2.20.1