Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2679228pxb; Fri, 5 Nov 2021 02:52:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJGKYQIW9ZCioKiwpBse4mRTCAGsJIH0jrBzoW3RHtJpH+kmsAwI6B/8l56maJTeZNGgei X-Received: by 2002:a17:906:5641:: with SMTP id v1mr20981334ejr.357.1636105927193; Fri, 05 Nov 2021 02:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636105927; cv=none; d=google.com; s=arc-20160816; b=1KOFVzb6jiP2s3h11CE2pIW4c4TsOa87gMKpizuIX3yOIi17OmelowWK0ssP+wZB66 AobBCHqbKHkxgm3Fdo4BBR4RRUlJ3MYOUs/RaSKdPgJuPB6VSnzomkOLkdassj7k0/2M k9PxxDcyXYqHtYS8IG5ckOc5q8uVk2bhNqRgkEv+MSLafhxKW5etYyreTekHv+EsP0R9 bMaM993MWItn4R+M4fORRtEjYw3a1yuyTJzLuxyuAxH1lRI/Oi5c+nrFn6o8ocH3bfF7 XFxnRI6YrZOsO6t4vF60h02ZPaBSAqh/GoWABAiLfuBL9M/smJvKOy4LKBQ+ppwfbbzd j5+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=hkgVCXlD0+1xJUok1c16c/l3Ax7k+8c2svHF6M1Ifj4=; b=LGNSCWBMj6MOidi52hVqkrQnC0vWP2Fi6YRmMwqgMhP3wYAuCWw3Wp2s53zPonumwP MPgG/j31m2SvRvk2R7gewcLZoOAdejpgelLiflPhac5m3PKCV/EK8GpYppd072fElgNp I4OzAkH56nmBXGSb/V/0c7Z/g/w50FEoXgkmRu5zJnkGCFEi5jOotFRL5PPIKb8HR0XD hddkvezFq7FDRjYBGASuoE36e1J8FS2K1KJ34JNqhgvoua/15q8n6eEHjuJwq7wVGEsR 55LsDtmuSji8KdRwy5d44SwAvr+XgtL0fGgjXrtaE5aZKrGptQh6yEiOrVI9cCmQTSqX EgVQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do16si15615929ejc.357.2021.11.05.02.51.45; Fri, 05 Nov 2021 02:52:07 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232890AbhKEJxm (ORCPT + 67 others); Fri, 5 Nov 2021 05:53:42 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:34744 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232895AbhKEJxi (ORCPT ); Fri, 5 Nov 2021 05:53:38 -0400 X-UUID: 1a36dc3408b74a5d94df5c795c8ac5ba-20211105 X-UUID: 1a36dc3408b74a5d94df5c795c8ac5ba-20211105 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 838537237; Fri, 05 Nov 2021 17:50:55 +0800 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 5 Nov 2021 17:50:54 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs10n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 5 Nov 2021 17:50:54 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , "Evelyn Tsai" , linux-mediatek , Shayne Chen Subject: [PATCH] mt76: mt7915: fix return condition in mt7915_tm_reg_backup_restore() Date: Fri, 5 Nov 2021 17:50:51 +0800 Message-ID: <20211105095051.4733-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix the issue that some registers not configured properly after restarting testmode. (e.g. change state from idle to off, and off to idle) Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c index 89aae32..a541fc4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c @@ -361,14 +361,14 @@ mt7915_tm_reg_backup_restore(struct mt7915_phy *phy) return; } - if (b) - return; + if (!b) { + b = devm_kzalloc(dev->mt76.dev, 4 * n_regs, GFP_KERNEL); + if (!b) + return; - b = devm_kzalloc(dev->mt76.dev, 4 * n_regs, GFP_KERNEL); - if (!b) - return; + phy->test.reg_backup = b; + } - phy->test.reg_backup = b; for (i = 0; i < n_regs; i++) b[i] = mt76_rr(dev, reg_backup_list[i].band[ext_phy]); -- 2.25.1