Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp955746ybt; Fri, 19 Jun 2020 19:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHUs0p8U5R9fFbc1ATOXD9EyV5etAnB3bd7pJ2z23DtdfoKr2NuegRBnZSNNjhyuebFont X-Received: by 2002:a17:906:3282:: with SMTP id 2mr6113607ejw.93.1592620099375; Fri, 19 Jun 2020 19:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592620099; cv=none; d=google.com; s=arc-20160816; b=NaUWHws2emH15xysq3UyCEd5HOTs1w9hFU8VBWS32SXUte6k9rEDB+IzSfJHi521Cg Febs44RUhWckFvNVNt92F6lTOCbFkXxwOXUZZbReZsi+jkPuCicwDK6Xy0N/bBBmK8j1 mJNYrfDUdCMwZ7nfeWjccnocd0a3GWE7pXdF4p+czm+ASWvnBRtOt3+Q9ssmfXMY5K70 3c/eFV3ak4TdzcIs99wzfCm0zg8UuWtGGKw+iqojEGl42nJjje2lTrPrZmfkJBhJKUYA KY448zsJP0Pe9E7ebyH46kr9MlIqhCY09M8bscoiZBNtNeHIR2tT5rTowpqQcd/dyq0h i+Iw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pYRWADn+ikz/q+KVhG0HyJaX/1xdzH2YkrjwjQMbJ4o=; b=NbvpcFU0ve3KT5V6/WD3djBOyszA+miMWiu99qqTzzHw1DnuccKjNQwQerF4u9usYn oTIQXlEjE3aUMLVOYO4zG0OtgppwnUwgHZvPrlKUWKEgSgeK0ymNyKG+b46mPc29bg1a lti9oIzaQeEXc/TcDbc2lRZaEIis643f0IUaBheFQlGS7lNdXR2WeZPb4NbJl2+KPili rJ201MWckZRodXZbKN20LQi8v0+T46a6WXzPAA7ZACXO8Af6RCX8m7A6TSdvcnIi+4PN 3Ndk15pJl4478EqTqoQCu/HavYLN+e369U+MP2gAq6W7QVLG/KRDupG3am+04ab0DQn+ gqzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i0u3FSHF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si4838548edy.494.2020.06.19.19.27.57; Fri, 19 Jun 2020 19:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i0u3FSHF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394062AbgFSPtq (ORCPT + 99 others); Fri, 19 Jun 2020 11:49:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393359AbgFSPY7 (ORCPT ); Fri, 19 Jun 2020 11:24:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 EF7A921548; Fri, 19 Jun 2020 15:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592580298; bh=+6kXrgQ4NVOvyd8KUFY2r+iOtJb5sRwbTKszCOGlshU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i0u3FSHFE7hcGBsYK/FeygP+WklbmbSSx+tK54w+5A1YDaN9INDX/1WjHSIKAnb18 o/NBqr8AYKbBII0/nc9L3fZ7Nsxsftti1DebRDjsx/wnB1Ku/czlv8WeODAU6cWZdN TOnr8bZ4OiEGjyBI+xzensJmVF5a2ZMkM9gDrMRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Felix Fietkau , Sasha Levin Subject: [PATCH 5.7 179/376] mt76: mt7615: do not always reset the dfs state setting the channel Date: Fri, 19 Jun 2020 16:31:37 +0200 Message-Id: <20200619141718.830907647@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141710.350494719@linuxfoundation.org> References: <20200619141710.350494719@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit fdb786cce0ef3615dcbb30d8baf06a1d4cb7a344 ] mac80211/hostapd runs mt7615_set_channel with the same channel parameters sending multiple rdd commands overwriting the previous ones. This behaviour is causing tpt issues on dfs channels. Fix the issue checking new channel freq/width with the running one. Fixes: 5dabdf71e94e ("mt76: mt7615: add multiple wiphy support to the dfs support code") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- .../net/wireless/mediatek/mt76/mt7615/main.c | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 6586176c29af..f92ac9a916fc 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -218,6 +218,25 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw, spin_unlock_bh(&dev->sta_poll_lock); } +static void mt7615_init_dfs_state(struct mt7615_phy *phy) +{ + struct mt76_phy *mphy = phy->mt76; + struct ieee80211_hw *hw = mphy->hw; + struct cfg80211_chan_def *chandef = &hw->conf.chandef; + + if (hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) + return; + + if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) + return; + + if (mphy->chandef.chan->center_freq == chandef->chan->center_freq && + mphy->chandef.width == chandef->width) + return; + + phy->dfs_state = -1; +} + static int mt7615_set_channel(struct mt7615_phy *phy) { struct mt7615_dev *dev = phy->dev; @@ -229,7 +248,7 @@ static int mt7615_set_channel(struct mt7615_phy *phy) mutex_lock(&dev->mt76.mutex); set_bit(MT76_RESET, &phy->mt76->state); - phy->dfs_state = -1; + mt7615_init_dfs_state(phy); mt76_set_channel(phy->mt76); ret = mt7615_mcu_set_chan_info(phy, MCU_EXT_CMD_CHANNEL_SWITCH); -- 2.25.1