From: Larry Finger <Larry.Finger@lwfinger.net>
To: 莊彥宣 <yhchuang@realtek.com>
Cc: Pkshih <pkshih@realtek.com>,
tehuang@realtek.com, briannorris@chromium.org,
sgruszka@redhat.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
Date: Mon, 28 Jan 2019 14:56:51 -0600 [thread overview]
Message-ID: <043aedf4-0ed4-e128-3cd2-242aaef128f6@lwfinger.net> (raw)
In-Reply-To: <1548654407-28469-1-git-send-email-yhchuang@realtek.com>
[-- Attachment #1: Type: text/plain, Size: 823 bytes --]
Tony,
I had not tested rtw88 for some time, so I built a kernel with the V3 patches
and found that rtw88 crashed with a NULL pointer dereference. I did some
debugging and found that the problem was in routine rtw_chip_efuse_enable()
where fw->firmware was NULL.
Next I verified that rtw_load_firmware() had been called, which gave a clue that
the firmware had not finished loading by the time rtw_chip_efuse_enable() was
called. By adding a wait_for_completion() call before the
rtw_download_firmware() call, the problem was fixed. The problem was a race
between calling rtw_chip_efuse_enable() and the firmware load from disk.
Obviously, the speed ratio between my CPU and the disk system is much different
on my laptop than on your test machines, thus I have the problem.
The patch I used is attached.
Larry
[-- Attachment #2: rtw88_fix_race_at_start.patch --]
[-- Type: text/x-patch, Size: 514 bytes --]
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index a189c4500fd9..690c0a68a038 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -902,6 +902,7 @@ static int rtw_chip_efuse_enable(struct rtw_dev *rtwdev)
goto err;
}
+ wait_for_completion(&fw->completion);
rtw_write8(rtwdev, REG_C2HEVT, C2H_HW_FEATURE_DUMP);
ret = rtw_download_firmware(rtwdev, fw->firmware->data,
fw->firmware->size);
next prev parent reply other threads:[~2019-01-28 20:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-28 5:46 [PATCH v3 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips yhchuang
2019-01-28 5:46 ` [PATCH v3 01/13] rtw88: main files yhchuang
2019-01-28 5:46 ` [PATCH v3 02/13] rtw88: core files yhchuang
2019-01-28 5:46 ` [PATCH v3 03/13] rtw88: hci files yhchuang
2019-01-28 5:46 ` [PATCH v3 04/13] rtw88: trx files yhchuang
2019-01-28 5:46 ` [PATCH v3 05/13] rtw88: mac files yhchuang
2019-01-28 5:46 ` [PATCH v3 06/13] rtw88: fw and efuse files yhchuang
2019-01-28 5:46 ` [PATCH v3 07/13] rtw88: phy files yhchuang
2019-01-28 5:46 ` [PATCH v3 08/13] rtw88: debug files yhchuang
2019-01-28 5:46 ` [PATCH v3 09/13] rtw88: chip files yhchuang
2019-01-28 5:46 ` [PATCH v3 10/13] rtw88: 8822B init table yhchuang
2019-01-28 5:46 ` [PATCH v3 11/13] rtw88: 8822C " yhchuang
2019-01-28 5:46 ` [PATCH v3 12/13] rtw88: Kconfig & Makefile yhchuang
2019-01-28 5:46 ` [PATCH v3 13/13] rtw88: add support for Realtek 802.11ac wireless chips yhchuang
2019-01-28 8:36 ` [PATCH v3 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips Kalle Valo
2019-01-28 9:25 ` Tony Chuang
2019-01-28 10:12 ` Stanislaw Gruszka
2019-01-28 22:38 ` Brian Norris
2019-01-29 2:27 ` Tony Chuang
2019-01-28 20:56 ` Larry Finger [this message]
2019-01-29 2:15 ` Tony Chuang
2019-01-29 2:41 ` Brian Norris
2019-01-29 2:53 ` Tony Chuang
2019-01-29 7:53 ` Kalle Valo
2019-01-29 3:23 ` Larry Finger
2019-01-29 4:03 ` Tony Chuang
2019-01-29 7:59 ` Kalle Valo
2019-01-29 13:01 ` Tony Chuang
2019-01-29 17:23 ` Kalle Valo
2019-01-29 14:54 ` Larry Finger
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=043aedf4-0ed4-e128-3cd2-242aaef128f6@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=briannorris@chromium.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=sgruszka@redhat.com \
--cc=tehuang@realtek.com \
--cc=yhchuang@realtek.com \
/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).