From patchwork Tue Jan 9 13:13:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10152031 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.web.codeaurora.org (Postfix) with ESMTP id 8ECF3602CA for ; Tue, 9 Jan 2018 13:13:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A96828997 for ; Tue, 9 Jan 2018 13:13:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E77A289D0; Tue, 9 Jan 2018 13:13:26 +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=-6.9 required=2.0 tests=BAYES_00,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 24BE928997 for ; Tue, 9 Jan 2018 13:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757295AbeAINNY (ORCPT ); Tue, 9 Jan 2018 08:13:24 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40575 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753707AbeAINNU (ORCPT ); Tue, 9 Jan 2018 08:13:20 -0500 Received: by mail-wm0-f67.google.com with SMTP id f206so20531203wmf.5 for ; Tue, 09 Jan 2018 05:13:19 -0800 (PST) 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; bh=WG9+DHSKziWzKvaHU4xj4ugXKB0kIGFbSxO8bFbrMEQ=; b=LR9sLTm0jC8RwJyEH5VXmjmqSvHNC9EGOJTZRXnHXvFyhscC4InuEuKrOnf55zNTzh 0kp/MjkboIUABtvedewTK8aNZnRvo+y0uLV2m1qwHnhzukuWV81iFwfi91y1tpwCwb1I +ytVijIpPaUSKO8mY+lGnjpI8o3uo2FRVwFqom9rrzgMryuGAwtA5bNGEFaLN5qaLf37 EkMbZpecDonqfkxMB4jCLylHU7rtvGoJ+SbCoaLXFe0WFONX5ayjwqvG1o9YVhKUNlIZ S5kE4YBt5qMJPIO6wfV6C1EkEY3rFdj64HfO+s53ixurq8M19uymfMumO3iu0iQ99Z9x loww== X-Gm-Message-State: AKGB3mK0sg0KT+D6U1VWIVTqZC1ddCAOe9eJ0Eowt2rqGrQb7DiMVq6g oZBYMyedRL1YpvUGTUJheB9//jUuXuw= X-Google-Smtp-Source: ACJfBov6a1BO0BOlkbihwwESGz9D2xxPSSUJ7INBkWCZ4BKTWB0/iEbU9zabL2st81A+NtC/AbrhFA== X-Received: by 10.28.17.149 with SMTP id 143mr12484782wmr.96.1515503599109; Tue, 09 Jan 2018 05:13:19 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 17sm17488732wmq.10.2018.01.09.05.13.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2018 05:13:18 -0800 (PST) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org Subject: [PATCH 1/3] mt76x2: dfs: avoid tasklet scheduling during mt76x2_dfs_init_params() Date: Tue, 9 Jan 2018 14:13:10 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: 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 Substitute tasklet_kill with tasklet_disable/tasklet_enable in order to guarantee dfs tasklet can not be executed during dfs parameter initialization Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c | 1 - drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c index 5b452a596016..1a6282a8b64b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c @@ -460,7 +460,6 @@ void mt76x2_dfs_init_params(struct mt76x2_dev *dev) { struct cfg80211_chan_def *chandef = &dev->mt76.chandef; - tasklet_kill(&dev->dfs_pd.dfs_tasklet); if (chandef->chan->flags & IEEE80211_CHAN_RADAR) { mt76x2_dfs_set_bbp_params(dev); /* enable debug mode */ diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c index 963aea9e8801..c96e9348d3a9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c @@ -127,6 +127,7 @@ mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef) mt76_set_channel(&dev->mt76); tasklet_disable(&dev->pre_tbtt_tasklet); + tasklet_disable(&dev->dfs_pd.dfs_tasklet); cancel_delayed_work_sync(&dev->cal_work); mt76x2_mac_stop(dev, true); @@ -139,6 +140,7 @@ mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef) mt76x2_dfs_init_params(dev); mt76x2_mac_resume(dev); + tasklet_enable(&dev->dfs_pd.dfs_tasklet); tasklet_enable(&dev->pre_tbtt_tasklet); return ret;