<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/wireless/ath/ath10k/sdio.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-09-30T17:07:31Z</updated>
<entry>
<title>Merge tag 'wireless-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next</title>
<updated>2022-09-30T17:07:31Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-09-30T17:07:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=915b96c52763e2988e6368b538b487a7138b8fa4'/>
<id>urn:sha1:915b96c52763e2988e6368b538b487a7138b8fa4</id>
<content type='text'>
Kalle Valo says:

====================
wireless-next patches for v6.1

Few stack changes and lots of driver changes in this round. brcmfmac
has more activity as usual and it gets new hardware support. ath11k
improves WCN6750 support and also other smaller features. And of
course changes all over.

Note: in early September wireless tree was merged to wireless-next to
avoid some conflicts with mac80211 patches, this shouldn't cause any
problems but wanted to mention anyway.

Major changes:

mac80211

 - refactoring and preparation for Wi-Fi 7 Multi-Link Operation (MLO)
  feature continues

brcmfmac

 - support CYW43439 SDIO chipset

 - support BCM4378 on Apple platforms

 - support CYW89459 PCIe chipset

rtw89

 - more work to get rtw8852c supported

 - P2P support

 - support for enabling and disabling MSDU aggregation via nl80211

mt76

 - tx status reporting improvements

ath11k

 - cold boot calibration support on WCN6750

 - Target Wake Time (TWT) debugfs support for STA interface

 - support to connect to a non-transmit MBSSID AP profile

 - enable remain-on-channel support on WCN6750

 - implement SRAM dump debugfs interface

 - enable threaded NAPI on all hardware

 - WoW support for WCN6750

 - support to provide transmit power from firmware via nl80211

 - support to get power save duration for each client

 - spectral scan support for 160 MHz

wcn36xx

 - add SNR from a received frame as a source of system entropy

* tag 'wireless-next-2022-09-30' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (231 commits)
  wifi: rtl8xxxu: Improve rtl8xxxu_queue_select
  wifi: rtl8xxxu: Fix AIFS written to REG_EDCA_*_PARAM
  wifi: rtl8xxxu: gen2: Enable 40 MHz channel width
  wifi: rtw89: 8852b: configure DLE mem
  wifi: rtw89: check DLE FIFO size with reserved size
  wifi: rtw89: mac: correct register of report IMR
  wifi: rtw89: pci: set power cut closed for 8852be
  wifi: rtw89: pci: add to do PCI auto calibration
  wifi: rtw89: 8852b: implement chip_ops::{enable,disable}_bb_rf
  wifi: rtw89: add DMA busy checking bits to chip info
  wifi: rtw89: mac: define DMA channel mask to avoid unsupported channels
  wifi: rtw89: pci: mask out unsupported TX channels
  iwlegacy: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
  ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
  wifi: iwlwifi: Track scan_cmd allocation size explicitly
  brcmfmac: Remove the call to "dtim_assoc" IOVAR
  brcmfmac: increase dcmd maximum buffer size
  brcmfmac: Support 89459 pcie
  brcmfmac: increase default max WOWL patterns to 16
  cw1200: fix incorrect check to determine if no element is found in list
  ...
====================

Link: https://lore.kernel.org/r/20220930150413.A7984C433D6@smtp.kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: drop the weight argument from netif_napi_add</title>
<updated>2022-09-29T01:57:14Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-09-27T13:27:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d'/>
<id>urn:sha1:b48b89f9c189d24eb5e2b4a0ac067da5a24ee86d</id>
<content type='text'>
We tell driver developers to always pass NAPI_POLL_WEIGHT
as the weight to netif_napi_add(). This may be confusing
to newcomers, drop the weight argument, those who really
need to tweak the weight can use netif_napi_add_weight().

Acked-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt; # for CAN
Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>wifi: ath10k: Fix miscellaneous spelling errors</title>
<updated>2022-09-16T09:18:51Z</updated>
<author>
<name>Jeff Johnson</name>
<email>quic_jjohnson@quicinc.com</email>
</author>
<published>2022-09-09T14:53:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b8a71b953653dfd6b005356bff8463503dd0f965'/>
<id>urn:sha1:b8a71b953653dfd6b005356bff8463503dd0f965</id>
<content type='text'>
Fix misspellings flagged by 'codespell'.

Signed-off-by: Jeff Johnson &lt;quic_jjohnson@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220909145300.19223-1-quic_jjohnson@quicinc.com
</content>
</entry>
<entry>
<title>Merge tag 'wireless-next-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next</title>
<updated>2022-05-04T00:27:51Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-05-04T00:27:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f43f0cd2d9b07caf38d744701b0b54d4244da8cc'/>
<id>urn:sha1:f43f0cd2d9b07caf38d744701b0b54d4244da8cc</id>
<content type='text'>
Kalle Valo says:

====================
wireless-next patches for v5.19

First set of patches for v5.19 and this is a big one. We have two new
drivers, a change in mac80211 STA API affecting most drivers and
ath11k getting support for WCN6750. And as usual lots of fixes and
cleanups all over.

Major changes:

new drivers
 - wfx: silicon labs devices
 - plfxlc: pureLiFi X, XL, XC devices

mac80211
 - host based BSS color collision detection
 - prepare sta handling for IEEE 802.11be Multi-Link Operation (MLO) support

rtw88
 - support TP-Link T2E devices

rtw89
 - support firmware crash simulation
 - preparation for 8852ce hardware support

ath11k
 - Wake-on-WLAN support for QCA6390 and WCN6855
 - device recovery (firmware restart) support for QCA6390 and WCN6855
 - support setting Specific Absorption Rate (SAR) for WCN6855
 - read country code from SMBIOS for WCN6855/QCA6390
 - support for WCN6750

wcn36xx
 - support for transmit rate reporting to user space

* tag 'wireless-next-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (228 commits)
  rtw89: 8852c: rfk: add DPK
  rtw89: 8852c: rfk: add IQK
  rtw89: 8852c: rfk: add RX DCK
  rtw89: 8852c: rfk: add RCK
  rtw89: 8852c: rfk: add TSSI
  rtw89: 8852c: rfk: add LCK
  rtw89: 8852c: rfk: add DACK
  rtw89: 8852c: rfk: add RFK tables
  plfxlc: fix le16_to_cpu warning for beacon_interval
  rtw88: remove a copy of the NAPI_POLL_WEIGHT define
  carl9170: tx: fix an incorrect use of list iterator
  wil6210: use NAPI_POLL_WEIGHT for napi budget
  ath10k: remove a copy of the NAPI_POLL_WEIGHT define
  ath11k: Add support for WCN6750 device
  ath11k: Datapath changes to support WCN6750
  ath11k: HAL changes to support WCN6750
  ath11k: Add QMI changes for WCN6750
  ath11k: Fetch device information via QMI for WCN6750
  ath11k: Add register access logic for WCN6750
  ath11k: Add HW params for WCN6750
  ...
====================

Link: https://lore.kernel.org/r/20220503153622.C1671C385A4@smtp.kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ath10k: remove a copy of the NAPI_POLL_WEIGHT define</title>
<updated>2022-05-02T14:00:11Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-04-29T17:46:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=52bcfd1b239b0a62d863b92abcc1a04528a41946'/>
<id>urn:sha1:52bcfd1b239b0a62d863b92abcc1a04528a41946</id>
<content type='text'>
Defining local versions of NAPI_POLL_WEIGHT with the same
values in the drivers just makes refactoring harder.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220429174643.196994-3-kuba@kernel.org
</content>
</entry>
<entry>
<title>mmc: core: improve API to make clear mmc_hw_reset is for cards</title>
<updated>2022-04-08T09:00:08Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-04-08T08:00:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b71597edfaade119157ded98991bac7160be80c2'/>
<id>urn:sha1:b71597edfaade119157ded98991bac7160be80c2</id>
<content type='text'>
To make it unambiguous that mmc_hw_reset() is for cards and not for
controllers, we make the function argument mmc_card instead of mmc_host.
Also, all users are converted.

Suggested-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Acked-by: Kalle Valo &lt;kvalo@kernel.org&gt;
Link: https://lore.kernel.org/r/20220408080045.6497-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>wireless: Remove redundant 'flush_workqueue()' calls</title>
<updated>2021-10-13T06:22:19Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-10-10T07:09:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ff1cc2fa3055ee4c83839f38b74b4ee370a2291c'/>
<id>urn:sha1:ff1cc2fa3055ee4c83839f38b74b4ee370a2291c</id>
<content type='text'>
'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- 	flush_workqueue(E);
	destroy_workqueue(E);

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/0855d51423578ad019c0264dad3fe47a2e8af9c7.1633849511.git.christophe.jaillet@wanadoo.fr
</content>
</entry>
<entry>
<title>ath10k: sdio: Add missing BH locking around napi_schdule()</title>
<updated>2021-09-28T14:36:00Z</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@denx.de</email>
</author>
<published>2021-09-28T11:00:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=019edd01d174ce4bb2e517dd332922514d176601'/>
<id>urn:sha1:019edd01d174ce4bb2e517dd332922514d176601</id>
<content type='text'>
On a i.MX-based board with a QCA9377 Wifi chip, the following errors
are seen after launching the 'hostapd' application:

hostapd /etc/wifi.conf
Configuration file: /etc/wifi.conf
wlan0: interface state UNINITIALIZED-&gt;COUNTRY_UPDATE
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
Using interface wlan0 with hwaddr 00:1f:7b:31:04:a0 and ssid "thessid"
IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
wlan0: interface state COUNTRY_UPDATE-&gt;ENABLED
wlan0: AP-ENABLED
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
...

Fix this problem by adding the BH locking around napi-schedule(),
in the same way it was done in commit e63052a5dd3c ("mlx5e: add
add missing BH locking around napi_schdule()").

Its commit log provides the following explanation:

"It's not correct to call napi_schedule() in pure process
context. Because we use __raise_softirq_irqoff() we require
callers to be in a context which will eventually lead to
softirq handling (hardirq, bh disabled, etc.).

With code as is users will see:

NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!
"

Fixes: cfee8793a74d ("ath10k: enable napi on RX path for sdio")
Signed-off-by: Fabio Estevam &lt;festevam@denx.de&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210824144339.2796122-1-festevam@denx.de
</content>
</entry>
<entry>
<title>ath10k: prevent deinitializing NAPI twice</title>
<updated>2020-12-17T06:52:31Z</updated>
<author>
<name>Wen Gong</name>
<email>wgong@codeaurora.org</email>
</author>
<published>2020-12-15T06:35:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e2f8b74e58cb1560c1399ba94a470b770e858259'/>
<id>urn:sha1:e2f8b74e58cb1560c1399ba94a470b770e858259</id>
<content type='text'>
It happened "Kernel panic - not syncing: hung_task: blocked tasks" when
test simulate crash and ifconfig down/rmmod meanwhile.

Test steps:

1.Test commands, either can reproduce the hang for PCIe, SDIO and SNOC.
echo soft &gt; /sys/kernel/debug/ieee80211/phy0/ath10k/simulate_fw_crash;sleep 0.05;ifconfig wlan0 down
echo soft &gt; /sys/kernel/debug/ieee80211/phy0/ath10k/simulate_fw_crash;rmmod ath10k_sdio
echo hw-restart &gt; /sys/kernel/debug/ieee80211/phy0/ath10k/simulate_fw_crash;rmmod ath10k_pci

2. dmesg:
[ 5622.548630] ath10k_sdio mmc1:0001:1: simulating soft firmware crash
[ 5622.655995] ieee80211 phy0: Hardware restart was requested
[ 5776.355164] INFO: task shill:1572 blocked for more than 122 seconds.
[ 5776.355687] INFO: task kworker/1:2:24437 blocked for more than 122 seconds.
[ 5776.359812] Kernel panic - not syncing: hung_task: blocked tasks
[ 5776.359836] CPU: 1 PID: 55 Comm: khungtaskd Tainted: G        W         4.19.86 #137
[ 5776.359846] Hardware name: MediaTek krane sku176 board (DT)
[ 5776.359855] Call trace:
[ 5776.359868]  dump_backtrace+0x0/0x170
[ 5776.359881]  show_stack+0x20/0x2c
[ 5776.359896]  dump_stack+0xd4/0x10c
[ 5776.359916]  panic+0x12c/0x29c
[ 5776.359937]  hung_task_panic+0x0/0x50
[ 5776.359953]  kthread+0x120/0x130
[ 5776.359965]  ret_from_fork+0x10/0x18
[ 5776.359986] SMP: stopping secondary CPUs
[ 5776.360012] Kernel Offset: 0x141ea00000 from 0xffffff8008000000
[ 5776.360026] CPU features: 0x0,2188200c
[ 5776.360035] Memory Limit: none

command "ifconfig wlan0 down" or "rmmod ath10k_sdio" will be blocked
callstack of ifconfig:
[&lt;0&gt;] __switch_to+0x120/0x13c
[&lt;0&gt;] msleep+0x28/0x38
[&lt;0&gt;] ath10k_sdio_hif_stop+0x24c/0x294 [ath10k_sdio]
[&lt;0&gt;] ath10k_core_stop+0x50/0x78 [ath10k_core]
[&lt;0&gt;] ath10k_halt+0x120/0x178 [ath10k_core]
[&lt;0&gt;] ath10k_stop+0x4c/0x8c [ath10k_core]
[&lt;0&gt;] drv_stop+0xe0/0x1e4 [mac80211]
[&lt;0&gt;] ieee80211_stop_device+0x48/0x54 [mac80211]
[&lt;0&gt;] ieee80211_do_stop+0x678/0x6f8 [mac80211]
[&lt;0&gt;] ieee80211_stop+0x20/0x30 [mac80211]
[&lt;0&gt;] __dev_close_many+0xb8/0x11c
[&lt;0&gt;] __dev_change_flags+0xe0/0x1d0
[&lt;0&gt;] dev_change_flags+0x30/0x6c
[&lt;0&gt;] devinet_ioctl+0x370/0x564
[&lt;0&gt;] inet_ioctl+0xdc/0x304
[&lt;0&gt;] sock_do_ioctl+0x50/0x288
[&lt;0&gt;] compat_sock_ioctl+0x1b4/0x1aac
[&lt;0&gt;] __se_compat_sys_ioctl+0x100/0x26fc
[&lt;0&gt;] __arm64_compat_sys_ioctl+0x20/0x2c
[&lt;0&gt;] el0_svc_common+0xa4/0x154
[&lt;0&gt;] el0_svc_compat_handler+0x2c/0x38
[&lt;0&gt;] el0_svc_compat+0x8/0x18
[&lt;0&gt;] 0xffffffffffffffff

callstack of rmmod:
[&lt;0&gt;] __switch_to+0x120/0x13c
[&lt;0&gt;] msleep+0x28/0x38
[&lt;0&gt;] ath10k_sdio_hif_stop+0x294/0x31c [ath10k_sdio]
[&lt;0&gt;] ath10k_core_stop+0x50/0x78 [ath10k_core]
[&lt;0&gt;] ath10k_halt+0x120/0x178 [ath10k_core]
[&lt;0&gt;] ath10k_stop+0x4c/0x8c [ath10k_core]
[&lt;0&gt;] drv_stop+0xe0/0x1e4 [mac80211]
[&lt;0&gt;] ieee80211_stop_device+0x48/0x54 [mac80211]
[&lt;0&gt;] ieee80211_do_stop+0x678/0x6f8 [mac80211]
[&lt;0&gt;] ieee80211_stop+0x20/0x30 [mac80211]
[&lt;0&gt;] __dev_close_many+0xb8/0x11c
[&lt;0&gt;] dev_close_many+0x70/0x100
[&lt;0&gt;] dev_close+0x4c/0x80
[&lt;0&gt;] cfg80211_shutdown_all_interfaces+0x50/0xcc [cfg80211]
[&lt;0&gt;] ieee80211_remove_interfaces+0x58/0x1a0 [mac80211]
[&lt;0&gt;] ieee80211_unregister_hw+0x40/0x100 [mac80211]
[&lt;0&gt;] ath10k_mac_unregister+0x1c/0x44 [ath10k_core]
[&lt;0&gt;] ath10k_core_unregister+0x38/0x7c [ath10k_core]
[&lt;0&gt;] ath10k_sdio_remove+0x8c/0xd0 [ath10k_sdio]
[&lt;0&gt;] sdio_bus_remove+0x48/0x108
[&lt;0&gt;] device_release_driver_internal+0x138/0x1ec
[&lt;0&gt;] driver_detach+0x6c/0xa8
[&lt;0&gt;] bus_remove_driver+0x78/0xa8
[&lt;0&gt;] driver_unregister+0x30/0x50
[&lt;0&gt;] sdio_unregister_driver+0x28/0x34
[&lt;0&gt;] cleanup_module+0x14/0x6bc [ath10k_sdio]
[&lt;0&gt;] __arm64_sys_delete_module+0x1e0/0x22c
[&lt;0&gt;] el0_svc_common+0xa4/0x154
[&lt;0&gt;] el0_svc_compat_handler+0x2c/0x38
[&lt;0&gt;] el0_svc_compat+0x8/0x18
[&lt;0&gt;] 0xffffffffffffffff

SNOC:
[  647.156863] Call trace:
[  647.162166] [&lt;ffffff80080855a4&gt;] __switch_to+0x120/0x13c
[  647.164512] [&lt;ffffff800899d8b8&gt;] __schedule+0x5ec/0x798
[  647.170062] [&lt;ffffff800899dad8&gt;] schedule+0x74/0x94
[  647.175050] [&lt;ffffff80089a0848&gt;] schedule_timeout+0x314/0x42c
[  647.179874] [&lt;ffffff80089a0a14&gt;] schedule_timeout_uninterruptible+0x34/0x40
[  647.185780] [&lt;ffffff80082a494&gt;] msleep+0x28/0x38
[  647.192546] [&lt;ffffff800117ec4c&gt;] ath10k_snoc_hif_stop+0x4c/0x1e0 [ath10k_snoc]
[  647.197439] [&lt;ffffff80010dfbd8&gt;] ath10k_core_stop+0x50/0x7c [ath10k_core]
[  647.204652] [&lt;ffffff80010c8f48&gt;] ath10k_halt+0x114/0x16c [ath10k_core]
[  647.211420] [&lt;ffffff80010cad68&gt;] ath10k_stop+0x4c/0x88 [ath10k_core]
[  647.217865] [&lt;ffffff8000fdbf54&gt;] drv_stop+0x110/0x244 [mac80211]
[  647.224367] [&lt;ffffff80010147ac&gt;] ieee80211_stop_device+0x48/0x54 [mac80211]
[  647.230359] [&lt;ffffff8000ff3eec&gt;] ieee80211_do_stop+0x6a4/0x73c [mac80211]
[  647.237033] [&lt;ffffff8000ff4500&gt;] ieee80211_stop+0x20/0x30 [mac80211]
[  647.243942] [&lt;ffffff80087e39b8&gt;] __dev_close_many+0xa0/0xfc
[  647.250435] [&lt;ffffff80087e3888&gt;] dev_close_many+0x70/0x100
[  647.255651] [&lt;ffffff80087e3a60&gt;] dev_close+0x4c/0x80
[  647.261244] [&lt;ffffff8000f1ba54&gt;] cfg80211_shutdown_all_interfaces+0x44/0xcc [cfg80211]
[  647.266383] [&lt;ffffff8000ff3fdc&gt;] ieee80211_remove_interfaces+0x58/0x1b4 [mac80211]
[  647.274128] [&lt;ffffff8000fda540&gt;] ieee80211_unregister_hw+0x50/0x120 [mac80211]
[  647.281659] [&lt;ffffff80010ca314&gt;] ath10k_mac_unregister+0x1c/0x44 [ath10k_core]
[  647.288839] [&lt;ffffff80010dfc94&gt;] ath10k_core_unregister+0x48/0x90 [ath10k_core]
[  647.296027] [&lt;ffffff800117e598&gt;] ath10k_snoc_remove+0x5c/0x150 [ath10k_snoc]
[  647.303229] [&lt;ffffff80085625fc&gt;] platform_drv_remove+0x28/0x50
[  647.310517] [&lt;ffffff80085601a4&gt;] device_release_driver_internal+0x114/0x1b8
[  647.316257] [&lt;ffffff80085602e4&gt;] driver_detach+0x6c/0xa8
[  647.323021] [&lt;ffffff800855e5b8&gt;] bus_remove_driver+0x78/0xa8
[  647.328571] [&lt;ffffff800856107c&gt;] driver_unregister+0x30/0x50
[  647.334213] [&lt;ffffff8008562674&gt;] platform_driver_unregister+0x1c/0x28
[  647.339876] [&lt;ffffff800117fefc&gt;] cleanup_module+0x1c/0x120 [ath10k_snoc]
[  647.346196] [&lt;ffffff8008143ab8&gt;] SyS_delete_module+0x1dc/0x22c

PCIe:
[  615.392770] rmmod           D    0  3523   3458 0x00000080
[  615.392777] Call Trace:
[  615.392784]  __schedule+0x617/0x7d3
[  615.392791]  ? __mod_timer+0x263/0x35c
[  615.392797]  schedule+0x62/0x72
[  615.392803]  schedule_timeout+0x8d/0xf3
[  615.392809]  ? run_local_timers+0x6b/0x6b
[  615.392814]  msleep+0x1b/0x22
[  615.392824]  ath10k_pci_hif_stop+0x68/0xd6 [ath10k_pci]
[  615.392844]  ath10k_core_stop+0x44/0x67 [ath10k_core]
[  615.392859]  ath10k_halt+0x102/0x153 [ath10k_core]
[  615.392873]  ath10k_stop+0x38/0x75 [ath10k_core]
[  615.392893]  drv_stop+0x9a/0x13c [mac80211]
[  615.392915]  ieee80211_do_stop+0x772/0x7cd [mac80211]
[  615.392937]  ieee80211_stop+0x1a/0x1e [mac80211]
[  615.392945]  __dev_close_many+0x9e/0xf0
[  615.392952]  dev_close_many+0x62/0xe8
[  615.392958]  dev_close+0x54/0x7d
[  615.392975]  cfg80211_shutdown_all_interfaces+0x6e/0xa5 [cfg80211]
[  615.393021]  ieee80211_remove_interfaces+0x52/0x1aa [mac80211]
[  615.393049]  ieee80211_unregister_hw+0x54/0x136 [mac80211]
[  615.393068]  ath10k_mac_unregister+0x19/0x4a [ath10k_core]
[  615.393091]  ath10k_core_unregister+0x39/0x7e [ath10k_core]
[  615.393104]  ath10k_pci_remove+0x3d/0x7f [ath10k_pci]
[  615.393117]  pci_device_remove+0x41/0xa6
[  615.393129]  device_release_driver_internal+0x123/0x1ec
[  615.393140]  driver_detach+0x60/0x90
[  615.393152]  bus_remove_driver+0x72/0x9f
[  615.393164]  pci_unregister_driver+0x1e/0x87
[  615.393177]  SyS_delete_module+0x1d7/0x277
[  615.393188]  do_syscall_64+0x6b/0xf7
[  615.393199]  entry_SYSCALL_64_after_hwframe+0x41/0xa6

The test command run simulate_fw_crash firstly and it call into
ath10k_sdio_hif_stop from ath10k_core_restart, then napi_disable
is called and bit NAPI_STATE_SCHED is set. After that, function
ath10k_sdio_hif_stop is called again from ath10k_stop by command
"ifconfig wlan0 down" or "rmmod ath10k_sdio", then command blocked.

It is blocked by napi_synchronize, napi_disable will set bit with
NAPI_STATE_SCHED, and then napi_synchronize will enter dead loop
becuase bit NAPI_STATE_SCHED is set by napi_disable.

function of napi_synchronize
static inline void napi_synchronize(const struct napi_struct *n)
{
	if (IS_ENABLED(CONFIG_SMP))
		while (test_bit(NAPI_STATE_SCHED, &amp;n-&gt;state))
			msleep(1);
	else
		barrier();
}

function of napi_disable
void napi_disable(struct napi_struct *n)
{
	might_sleep();
	set_bit(NAPI_STATE_DISABLE, &amp;n-&gt;state);

	while (test_and_set_bit(NAPI_STATE_SCHED, &amp;n-&gt;state))
		msleep(1);
	while (test_and_set_bit(NAPI_STATE_NPSVC, &amp;n-&gt;state))
		msleep(1);

	hrtimer_cancel(&amp;n-&gt;timer);

	clear_bit(NAPI_STATE_DISABLE, &amp;n-&gt;state);
}

Add flag for it avoid the hang and crash.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
Tested-on: WCN3990 hw1.0 SNOC hw1.0 WLAN.HL.3.1-01307.1-QCAHLSWMTPL-2

Signed-off-by: Wen Gong &lt;wgong@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/1598617348-2325-1-git-send-email-wgong@codeaurora.org
</content>
</entry>
<entry>
<title>ath10k: add atomic protection for device recovery</title>
<updated>2020-12-12T04:38:12Z</updated>
<author>
<name>Wen Gong</name>
<email>wgong@codeaurora.org</email>
</author>
<published>2020-09-08T04:13:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5dadbe4e3718fb2214199b6dc7af1077fe14bf32'/>
<id>urn:sha1:5dadbe4e3718fb2214199b6dc7af1077fe14bf32</id>
<content type='text'>
When it has more than one restart_work queued meanwhile, the 2nd
restart_work is very easy to break the 1st restart work and lead
recovery fail.

Add a flag to allow only one restart work running untill
device successfully recovered.

It already has flag ATH10K_FLAG_CRASH_FLUSH, but it can not use this
flag again, because it is clear in ath10k_core_start. The function
ieee80211_reconfig(called by ieee80211_restart_work) of mac80211 do
many things and drv_start(call to ath10k_core_start) is 1st thing,
when drv_start complete, it does not mean restart complete. So it
add new flag and clear it in ath10k_reconfig_complete, because it
is the last thing called from drv_reconfig_complete of function
ieee80211_reconfig, after it, the restart process finished.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

Signed-off-by: Wen Gong &lt;wgong@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/010101746bead6a0-d5e97c66-dedd-4b92-810e-c2e4840fafc9-000000@us-west-2.amazonses.com
</content>
</entry>
</feed>
