Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp856186ybz; Wed, 22 Apr 2020 09:09:23 -0700 (PDT) X-Google-Smtp-Source: APiQypI1pYYn1UptRC9UdNlZsjkw+p4iJn8tPhpXZa5RXzpRVvOS6PPM4OCkWpR0OiA8At26fySt X-Received: by 2002:a50:f61b:: with SMTP id c27mr22340797edn.256.1587571763349; Wed, 22 Apr 2020 09:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587571763; cv=none; d=google.com; s=arc-20160816; b=Uf/KYgCrCG3haMrgPXyQYwsPqbk7Q+T+r65nHJQ+QAJidAz4onV3u2OLgqsjtqeSCD 92A+r6bkJzsUyq+07/H95qIu+mLj4YjR9o7ro2WTnENhcwzxzMfvJBXFXGyguF6YLOPB Lu+T2/yo9/s+y42kDOfmOp/BjhYv5QSbCeZKSesituHs4O+izDnDWiUhxjwi1LrlXU3e wd0LFtwyvY0unvtqvJQwogjsNZo+KKF9LqQv/dbRjzFcWg5g1cAFplLrM6ZdGTHx8ldw WWex+cv1qcUG7/auI+JN9ACbA/d27GYpdaaxl2sTPw4o12rShsfh+Par5zh8DSOhXsme p1tA== 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:to:from :dkim-signature; bh=gRPWckED+SPZ+xqwCJzxVsC1UHMbNeClY5C7b0uddsA=; b=QCGCOZef3CnOAVg6O8/UC18GM/B+XO13SJy+Hj5Zf5/PgZef1P28pBLwjcXfzPd0WZ bvVFiBGA6kgKv8iQyqxJPL0Rz6qloAARfJllPxAY5I4hq2odJDTnkpZgjtbOC0TsnA6G rwf5CqhSVggn75kJ92p7ats4wcOkWc9djVD7i7hZkts2B2JA7xc5JS6a+RVj8Av87sT/ 5WU0vyskdvsekRUHqtyU7gBoL21ujRcupZvl/UQKb3Dz5HIpJwyFVKU8eKlRNf5g37BL L72AllrrAuowCjZyJsZ9vJ76nPoxR1GobR1PGHm++dhoOEXuocGSwNpJI4SjJdux/CFQ wgeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=e0uPA1Ni; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 i21si3865793ejh.256.2020.04.22.09.08.52; Wed, 22 Apr 2020 09:09:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=e0uPA1Ni; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbgDVQEz (ORCPT + 99 others); Wed, 22 Apr 2020 12:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgDVQEm (ORCPT ); Wed, 22 Apr 2020 12:04:42 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 219F1C03C1AA for ; Wed, 22 Apr 2020 09:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gRPWckED+SPZ+xqwCJzxVsC1UHMbNeClY5C7b0uddsA=; b=e0uPA1NikEA0rfuLttVSKRecgD 2SYo2uT0uUbjl4Lvl+3bX3LAcHE7vy7nNNhVEfDWLP+qXuR0nV9nGk08+tJ+yuhEnPK93xZxKTBNX VFfdzBeFPbNu3dHEVsfYFw4/xFp/tikSfRuP/eoTiez7tjoz9und9Lr0Xrn3WA4eAzz0=; Received: from p54ae965b.dip0.t-ipconnect.de ([84.174.150.91] helo=maeck.lan) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRHrb-00054n-5F for linux-wireless@vger.kernel.org; Wed, 22 Apr 2020 18:04:39 +0200 Received: by maeck.lan (Postfix, from userid 501) id 97DBA8419629; Wed, 22 Apr 2020 18:04:38 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 7/9] mt76: mt7615: do not adjust MAC timings if the device is not running Date: Wed, 22 Apr 2020 18:04:35 +0200 Message-Id: <20200422160437.99466-7-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200422160437.99466-1-nbd@nbd.name> References: <20200422160437.99466-1-nbd@nbd.name> 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 Avoids register writes and MAC start/stop when the hardware isn't ready for it Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 88cbf5ffa290..89aed6d67de0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -119,6 +119,9 @@ void mt7615_mac_set_timing(struct mt7615_phy *phy) int sifs, offset; bool is_5ghz = phy->mt76->chandef.chan->band == NL80211_BAND_5GHZ; + if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) + return; + if (is_5ghz) sifs = 16; else -- 2.24.0