TencentOS-kernel/drivers/net
Tsuchiya Yuto 5cda45bceb mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
[ Upstream commit fa74cb1dc0f4da46c441b735ca865ac52de42c0e ]

When a PCIe function level reset (FLR) is performed but without fw reset for
some reasons (e.g., on Microsoft Surface devices, fw reset requires other
quirks), it fails to reset wifi properly. You can trigger the issue on such
devices via debugfs entry for reset:

    $ echo 1 | sudo tee /sys/kernel/debug/mwifiex/mlan0/reset

and the resulting dmesg log:

    [   45.740508] mwifiex_pcie 0000:03:00.0: Resetting per request
    [   45.742937] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 3
    [   45.744666] mwifiex_pcie 0000:03:00.0: info: shutdown mwifiex...
    [   45.751530] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.751539] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771691] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771695] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   45.771697] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771698] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   45.771699] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771701] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   45.771702] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771703] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   45.771704] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771705] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   45.771707] mwifiex_pcie 0000:03:00.0: PREP_CMD: card is removed
    [   45.771708] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   53.099343] mwifiex_pcie 0000:03:00.0: info: trying to associate to '[SSID]' bssid [BSSID]
    [   53.241870] mwifiex_pcie 0000:03:00.0: info: associated to bssid [BSSID] successfully
    [   75.377942] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
    [   85.385491] mwifiex_pcie 0000:03:00.0: info: successfully disconnected from [BSSID]: reason code 15
    [   87.539408] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
    [   87.539412] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [   99.699917] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
    [   99.699925] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [  111.859802] mwifiex_pcie 0000:03:00.0: cmd_wait_q terminated: -110
    [  111.859808] mwifiex_pcie 0000:03:00.0: deleting the crypto keys
    [...]

When comparing mwifiex_shutdown_sw() with mwifiex_pcie_remove(), it
lacks mwifiex_init_shutdown_fw().

This commit fixes mwifiex_shutdown_sw() by adding the missing
mwifiex_init_shutdown_fw().

Fixes: 4c5dae59d2e9 ("mwifiex: add PCIe function level reset support")
Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201028142110.18144-2-kitakar@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-16 16:42:44 +08:00
..
appletalk Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arcnet Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bonding bonding: wait for sysfs kobject destruction before freeing struct slave 2021-03-16 16:41:53 +08:00
caif Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
can can: softing: softing_netdev_open(): fix error handling 2021-03-16 16:42:25 +08:00
dsa net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset 2021-03-16 16:41:40 +08:00
ethernet net: mvpp2: add mvpp2_phylink_to_port() helper 2021-03-16 16:42:28 +08:00
fddi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fjes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hamradio yam: fix possible memory leak in yam_init_driver 2021-03-16 16:30:06 +08:00
hippi hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path 2021-03-16 16:32:23 +08:00
hyperv hv_netvsc: Remove "unlikely" from netvsc_select_queue 2021-03-16 16:36:11 +08:00
ieee802154 ieee802154/adf7242: check status of adf7242_read_reg 2021-03-16 16:37:32 +08:00
ipvlan ipvlan: fix device features 2021-03-16 16:34:45 +08:00
netdevsim netdevsim: fix unbalaced locking in nsim_create() 2021-03-16 16:32:26 +08:00
phy sfp: Fix error handing in sfp_probe() 2021-03-16 16:40:20 +08:00
plip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ppp pppoe: only process PADT targeted at local interfaces 2021-03-16 16:27:47 +08:00
slip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
team net: team: fix memory leak in __team_options_register 2021-03-16 16:38:00 +08:00
usb usbnet: ipheth: fix connectivity with iOS 14 2021-03-16 16:41:53 +08:00
vmxnet3 vmxnet3: use correct tcp hdr length when packet is encapsulated 2021-03-16 16:33:49 +08:00
wan cosa: Add missing kfree in error path of cosa_write 2021-03-16 16:40:51 +08:00
wimax wimax/i2400m: Fix potential urb refcnt leak 2021-03-16 16:27:27 +08:00
wireless mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure 2021-03-16 16:42:44 +08:00
xen-netback xen/netback: use lateeoi irq binding 2021-03-16 16:39:37 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
LICENSE.SRC Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Space.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dummy.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
eql.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
geneve.c Revert "geneve: pull IP header before ECN decapsulation" 2021-03-16 16:42:09 +08:00
gtp.c gtp: fix an use-before-init in gtp_newlink() 2021-03-16 16:39:30 +08:00
ifb.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
loopback.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
macsec.c macsec: avoid use-after-free in macsec_handle_frame() 2021-03-16 16:37:58 +08:00
macvlan.c macvlan: validate setting of multiple remote source MAC addresses 2021-03-16 16:35:08 +08:00
macvtap.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mdio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mii.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net_failover.c net_failover: fixed rollback in net_failover_open() 2021-03-16 16:28:54 +08:00
netconsole.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nlmon.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ntb_netdev.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rionet.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sb1000.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sungem_phy.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tap.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
thunderbolt.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tun.c tun: honor IOCB_NOWAIT flag 2021-03-16 16:41:53 +08:00
veth.c veth: Adjust hard_start offset on redirect XDP frames 2021-03-16 16:29:32 +08:00
virtio_net.c virtio-net: don't disable guest csum when disable LRO 2021-03-16 16:38:03 +08:00
vrf.c vrf: packets with lladdr src needs dst at input with orig_iif when needs strict 2021-03-16 16:42:16 +08:00
vsockmon.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vxlan.c vxlan: Copy needed_tailroom from lowerdev 2021-03-16 16:42:29 +08:00
xen-netfront.c xen-netfront: fix potential deadlock in xennet_remove() 2021-03-16 16:32:57 +08:00