Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2298272rdg; Sun, 15 Oct 2023 22:37:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuFXMfJdcQgI8O25gC0KAvJYsZaQV/g6typoQLCepHSgAH83/iruPD2QYmXak2NJWMu8jk X-Received: by 2002:a05:6e02:164f:b0:351:a18:51be with SMTP id v15-20020a056e02164f00b003510a1851bemr45920084ilu.15.1697434627591; Sun, 15 Oct 2023 22:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697434627; cv=none; d=google.com; s=arc-20160816; b=zirFqwS9CLWrqVVpIzQpPWX+NP1c71E/+4NjfcMHuHmEHQjuU+3v7bF4z760cYSLtu Lir6bsegHkR1AjKirCxaVJ862XyJiJhuWcsypz4CDpz0hck6L4PmsDj9NnpBqupMxymK r62Sz9Jw1T6gloDnQm4QgSiLuYPlOfodaHk9kXgC8wSsp0C6nEm3dACnwsI0SEmiPbrA a6Iach1/XZmTpbpIwgQy2aGLUgknn9GKJ4OKKHtA4gvBvybzdMYZpR22d+QFUFtdzE6E 32/FDP6k6Pvyw9DHgS1o6Oo1FhE4Qn+fdB0NxOKUr6VS8C0FuSlhNZmsgag1gbP61qfM EGKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2xZKgOOfgmL7JEb4AXzrFkdbpcjjHVIV8b3t9ItGBDY=; fh=rwbbOpirGLazcG3VmHY7vQI1XGYPlr4kq9/FvO3l4jE=; b=B2OHHfkBeuBOV6JJOnkIuUQ4SAt8XxpDaBCUBUwfX1MRW6OAoIRRWcCsdP/WzB2qCp cf3jLw/g4/uXzJyOBPXn6HyxOkJfI7ITQ+3bBi4plLNdTm2wo3xZIDpMB/ceUHRXOwcv J05KlQLkPlWDELdo5r9dtszEsB/6UADi20V20bUd8T1OpV2dkY/JpyINw5QOVcO82jK0 2YL2xN1C+H08SKl8abhznQ1XzBDaAZa7BaZFx/j6S2NfjanVAuvSJmn/NJs1tpWqdgay O7YwzL++VcXiDT4fmdR2f08cM2ia/iHvh8m7SYBEyzj2JM6GKg/RjpYaaBGJO9bf2V9d zQvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k185-20020a6384c2000000b005aae2dd62b2si7145235pgd.527.2023.10.15.22.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 22:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B3D85807215A; Sun, 15 Oct 2023 22:37:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbjJPFhD (ORCPT + 51 others); Mon, 16 Oct 2023 01:37:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231921AbjJPFgp (ORCPT ); Mon, 16 Oct 2023 01:36:45 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18F6A19E for ; Sun, 15 Oct 2023 22:36:35 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39G5aRKb92175055, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39G5aRKb92175055 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Oct 2023 13:36:27 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Mon, 16 Oct 2023 13:36:28 +0800 Received: from [127.0.1.1] (172.21.71.113) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 16 Oct 2023 13:36:27 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/2] wifi: rtw88: debug: add to check if debug mask is enabled Date: Mon, 16 Oct 2023 13:35:53 +0800 Message-ID: <20231016053554.744180-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231016053554.744180-1-pkshih@realtek.com> References: <20231016053554.744180-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.71.113] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 15 Oct 2023 22:37:06 -0700 (PDT) From: Chin-Yen Lee The coming dump function for FW malfunction will add a function to dump registers to reflect status. However, if we are not debugging the mechanism, we don't print anything, so avoid reading registers by checking debug mask to reduce IO. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/debug.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/debug.h b/drivers/net/wireless/realtek/rtw88/debug.h index a9149c6c2b48..a03ced11bbe0 100644 --- a/drivers/net/wireless/realtek/rtw88/debug.h +++ b/drivers/net/wireless/realtek/rtw88/debug.h @@ -48,11 +48,23 @@ void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask, #define rtw_dbg(rtwdev, a...) __rtw_dbg(rtwdev, ##a) +static inline bool rtw_dbg_is_enabled(struct rtw_dev *rtwdev, + enum rtw_debug_mask mask) +{ + return !!(rtw_debug_mask & mask); +} + #else static inline void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask, const char *fmt, ...) {} +static inline bool rtw_dbg_is_enabled(struct rtw_dev *rtwdev, + enum rtw_debug_mask mask) +{ + return false; +} + #endif /* CONFIG_RTW88_DEBUG */ #define rtw_info(rtwdev, a...) dev_info(rtwdev->dev, ##a) -- 2.25.1