linux-stable/drivers/net
Baochen Qiang 805a1cdde8 wifi: ath11k: decrease MHI channel buffer length to 8KB
[ Upstream commit 1cca1bddf9 ]

Currently buf_len field of ath11k_mhi_config_qca6390 is assigned
with 0, making MHI use a default size, 64KB, to allocate channel
buffers. This is likely to fail in some scenarios where system
memory is highly fragmented and memory compaction or reclaim is
not allowed.

There is a fail report which is caused by it:
kworker/u32:45: page allocation failure: order:4, mode:0x40c00(GFP_NOIO|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0
CPU: 0 PID: 19318 Comm: kworker/u32:45 Not tainted 6.8.0-rc3-1.gae4495f-default #1 openSUSE Tumbleweed (unreleased) 493b6d5b382c603654d7a81fc3c144d59a1dfceb
Workqueue: events_unbound async_run_entry_fn
Call Trace:
 <TASK>
 dump_stack_lvl+0x47/0x60
 warn_alloc+0x13a/0x1b0
 ? srso_alias_return_thunk+0x5/0xfbef5
 ? __alloc_pages_direct_compact+0xab/0x210
 __alloc_pages_slowpath.constprop.0+0xd3e/0xda0
 __alloc_pages+0x32d/0x350
 ? mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 __kmalloc_large_node+0x72/0x110
 __kmalloc+0x37c/0x480
 ? mhi_map_single_no_bb+0x77/0xf0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 ? mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 mhi_prepare_channel+0x127/0x2d0 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 __mhi_prepare_for_transfer+0x44/0x80 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 ? __pfx_____mhi_prepare_for_transfer+0x10/0x10 [mhi 40df44e07c05479f7a6e7b90fba9f0e0031a7814]
 device_for_each_child+0x5c/0xa0
 ? __pfx_pci_pm_resume+0x10/0x10
 ath11k_core_resume+0x65/0x100 [ath11k a5094e22d7223135c40d93c8f5321cf09fd85e4e]
 ? srso_alias_return_thunk+0x5/0xfbef5
 ath11k_pci_pm_resume+0x32/0x60 [ath11k_pci 830b7bfc3ea80ebef32e563cafe2cb55e9cc73ec]
 ? srso_alias_return_thunk+0x5/0xfbef5
 dpm_run_callback+0x8c/0x1e0
 device_resume+0x104/0x340
 ? __pfx_dpm_watchdog_handler+0x10/0x10
 async_resume+0x1d/0x30
 async_run_entry_fn+0x32/0x120
 process_one_work+0x168/0x330
 worker_thread+0x2f5/0x410
 ? __pfx_worker_thread+0x10/0x10
 kthread+0xe8/0x120
 ? __pfx_kthread+0x10/0x10
 ret_from_fork+0x34/0x50
 ? __pfx_kthread+0x10/0x10
 ret_from_fork_asm+0x1b/0x30
 </TASK>

Actually those buffers are used only by QMI target -> host communication.
And for WCN6855 and QCA6390, the largest packet size for that is less
than 6KB. So change buf_len field to 8KB, which results in order 1
allocation if page size is 4KB. In this way, we can at least save some
memory, and as well as decrease the possibility of allocation failure
in those scenarios.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30

Reported-by: Vlastimil Babka <vbabka@suse.cz>
Closes: https://lore.kernel.org/ath11k/96481a45-3547-4d23-ad34-3a8f1d90c1cd@suse.cz/
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240223053111.29170-1-quic_bqiang@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:01:43 +02:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:36:35 +01:00
bonding bonding: remove print in bond_verify_device_path 2024-02-23 08:54:55 +01:00
caif
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:08:15 +01:00
dsa net: dsa: mt7530: fix handling of all link-local frames 2024-03-26 18:21:37 -04:00
ethernet ionic: set adminq irq affinity 2024-04-13 13:01:43 +02:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-02-23 08:54:30 +01:00
hamradio
hippi
hyperv hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed 2024-03-15 10:48:21 -04:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-11-08 17:26:38 +01:00
ipa
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 16:56:22 +00:00
mctp
mdio
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-23 13:47:45 +02:00
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:01:43 +02:00
phy net: phy: fix phy_read_poll_timeout argument type in genphy_loopback 2024-03-26 18:21:36 -04:00
plip
ppp ppp_async: limit MRU to 64K 2024-02-23 08:54:58 +01:00
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 15:17:41 +01:00
usb drivers: net: convert to boolean for the mac_managed_pm flag 2024-04-10 16:19:40 +02:00
vmxnet3
vxlan vxlan: generalize vxlan_parse_gpe_hdr and remove unused args 2023-09-19 12:22:27 +02:00
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 21:59:06 +02:00
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-10 16:18:43 +02:00
wireless wifi: ath11k: decrease MHI channel buffer length to 8KB 2024-04-13 13:01:43 +02:00
wwan
xen-netback xen-netback: properly sync TX responses 2024-02-23 08:55:05 +01:00
Kconfig
LICENSE.SRC
Makefile vxlan: move to its own directory 2023-08-03 10:22:34 +02:00
Space.c
bareudp.c
dummy.c
eql.c
geneve.c geneve: make sure to pull inner header in geneve_rx() 2024-03-15 10:48:14 -04:00
gtp.c gtp: fix use-after-free and null-ptr-deref in gtp_newlink() 2024-03-06 14:38:48 +00:00
ifb.c
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:08:16 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 16:56:25 +00:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 15:13:57 +02:00
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-06 13:18:23 +02:00
tun.c tun: Fix xdp_rxq_info's queue_index when detaching 2024-03-06 14:38:45 +00:00
veth.c net: veth: do not manipulate GRO when using XDP 2024-03-26 18:21:35 -04:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-02-23 08:54:51 +01:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:19:37 +02:00