linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <yhchuang@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>, <briannorris@chromium.org>,
	<g.schlmm@googlemail.com>
Subject: [PATCH 6/6] rtw88: avoid FW info flood
Date: Fri, 25 Oct 2019 17:33:45 +0800	[thread overview]
Message-ID: <20191025093345.22643-7-yhchuang@realtek.com> (raw)
In-Reply-To: <20191025093345.22643-1-yhchuang@realtek.com>

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

The FW info was printed everytime driver is powered on, such as
leaving IDLE state. It will flood the kernel log.

Move the FW info printing to callback when FW is loaded, so
that will only be printed once when device is probed.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/mac.c  | 17 -----------------
 drivers/net/wireless/realtek/rtw88/main.c | 10 ++++++++++
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index c471117b1472..507970387b2a 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -567,21 +567,6 @@ download_firmware_to_mem(struct rtw_dev *rtwdev, const u8 *data,
 	return 0;
 }
 
-static void update_firmware_info(struct rtw_dev *rtwdev,
-				 struct rtw_fw_state *fw)
-{
-	const struct rtw_fw_hdr *fw_hdr =
-				(const struct rtw_fw_hdr *)fw->firmware->data;
-
-	fw->h2c_version = le16_to_cpu(fw_hdr->h2c_fmt_ver);
-	fw->version = le16_to_cpu(fw_hdr->version);
-	fw->sub_version = fw_hdr->subversion;
-	fw->sub_index = fw_hdr->subindex;
-
-	rtw_info(rtwdev, "Firmware version %u.%u.%u, H2C version %u\n",
-		 fw->version, fw->sub_version, fw->sub_index, fw->h2c_version);
-}
-
 static int
 start_download_firmware(struct rtw_dev *rtwdev, const u8 *data, u32 size)
 {
@@ -698,8 +683,6 @@ int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw)
 	if (ret)
 		goto dlfw_fail;
 
-	update_firmware_info(rtwdev, fw);
-
 	/* reset desc and index */
 	rtw_hci_setup(rtwdev);
 
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index bff8a0b129d9..bace9c583abb 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1025,12 +1025,22 @@ static void rtw_load_firmware_cb(const struct firmware *firmware, void *context)
 {
 	struct rtw_dev *rtwdev = context;
 	struct rtw_fw_state *fw = &rtwdev->fw;
+	const struct rtw_fw_hdr *fw_hdr;
 
 	if (!firmware)
 		rtw_err(rtwdev, "failed to request firmware\n");
 
+	fw_hdr = (const struct rtw_fw_hdr *)firmware->data;
+	fw->h2c_version = le16_to_cpu(fw_hdr->h2c_fmt_ver);
+	fw->version = le16_to_cpu(fw_hdr->version);
+	fw->sub_version = fw_hdr->subversion;
+	fw->sub_index = fw_hdr->subindex;
+
 	fw->firmware = firmware;
 	complete_all(&fw->completion);
+
+	rtw_info(rtwdev, "Firmware version %u.%u.%u, H2C version %u\n",
+		 fw->version, fw->sub_version, fw->sub_index, fw->h2c_version);
 }
 
 static int rtw_load_firmware(struct rtw_dev *rtwdev, const char *fw_name)
-- 
2.17.1


      parent reply	other threads:[~2019-10-25  9:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  9:33 [PATCH 0/6] rtw88: minor driver updates yhchuang
2019-10-25  9:33 ` [PATCH 1/6] rtw88: 8822b: add RFE type 3 support yhchuang
2019-10-31  8:04   ` Kalle Valo
2019-10-25  9:33 ` [PATCH 2/6] rtw88: use rtw_phy_pg_cfg_pair struct, not arrays yhchuang
2019-10-25  9:33 ` [PATCH 3/6] rtw88: use a module parameter to control LPS enter yhchuang
2019-10-25 10:51   ` Chris Chiu
2019-10-28  3:12     ` Tony Chuang
2019-10-29  4:01       ` Chris Chiu
2019-10-31  7:59   ` Kalle Valo
     [not found]   ` <20191031075911.3CCB86079C@smtp.codeaurora.org>
2019-10-31  8:17     ` Tony Chuang
2019-10-31 20:01       ` Brian Norris
2019-11-01  3:13         ` Tony Chuang
2019-11-01  8:35           ` Kalle Valo
2019-11-01  8:30       ` Kalle Valo
2019-10-25  9:33 ` [PATCH 4/6] rtw88: rearrange if..else statements for rx rate indexes yhchuang
2019-10-25  9:33 ` [PATCH 5/6] rtw88: fix potential read outside array boundary yhchuang
2019-10-25  9:33 ` yhchuang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191025093345.22643-7-yhchuang@realtek.com \
    --to=yhchuang@realtek.com \
    --cc=briannorris@chromium.org \
    --cc=g.schlmm@googlemail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).