linux/drivers
Sascha Hauer 2456e2889c wifi: rtw88: rtw8821c: Fix rfe_option field width
[ Upstream commit 14705f969d ]

On my RTW8821CU chipset rfe_option reads as 0x22. Looking at the
vendor driver suggests that the field width of rfe_option is 5 bit,
so rfe_option should be masked with 0x1f.

Without this the rfe_option comparisons with 2 further down the
driver evaluate as false when they should really evaluate as true.
The effect is that 2G channels do not work.

rfe_option is also used as an array index into rtw8821c_rfe_defs[].
rtw8821c_rfe_defs[34] (0x22) was added as part of adding USB support,
likely because rfe_option reads as 0x22. As this now becomes 0x2,
rtw8821c_rfe_defs[34] is no longer used and can be removed.

Note that this might not be the whole truth. In the vendor driver
there are indeed places where the unmasked rfe_option value is used.
However, the driver has several places where rfe_option is tested
with the pattern if (rfe_option == 2 || rfe_option == 0x22) or
if (rfe_option == 4 || rfe_option == 0x24), so that rfe_option BIT(5)
has no influence on the code path taken. We therefore mask BIT(5)
out from rfe_option entirely until this assumption is proved wrong
by some chip variant we do not know yet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Alexandru gagniuc <mr.nuke.me@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: ValdikSS <iam@valdikss.org.ru>
Cc: stable@vger.kernel.org
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230417140358.2240429-3-s.hauer@pengutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-05-17 11:50:28 +02:00
..
accessibility tty: fix possible null-ptr-defer in spk_ttyio_release 2023-01-24 07:22:46 +01:00
acpi ACPI: VIOT: Initialize the correct IOMMU fwspec 2023-05-11 23:00:23 +09:00
amba ARM: 9120/1: Revert "amba: make use of -1 IRQs warn" 2021-11-06 14:13:31 +01:00
android binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 2023-02-25 12:06:45 +01:00
ata ata: libata: Fix sata_down_spd_limit() when no link speed is reported 2023-02-09 11:26:37 +01:00
atm atm: idt77252: fix kmemleak when rmmod idt77252 2023-03-30 12:47:48 +02:00
auxdisplay auxdisplay: hd44780: Fix potential memory leak in hd44780_remove() 2023-03-11 13:57:22 +01:00
base platform: Provide a remove callback that returns no value 2023-05-11 23:00:24 +09:00
bcma Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
block loop: LOOP_CONFIGURE: send uevents for partitions 2023-04-05 11:24:56 +02:00
bluetooth Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work" 2023-05-11 23:00:31 +09:00
bus bus: mhi: host: Range check CHDBOFF and ERDBOFF 2023-05-17 11:50:14 +02:00
cdrom scsi: sr: cdrom: Move cdrom_read_cdda_bpc() into the sr driver 2021-07-30 22:13:09 -04:00
char ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it 2023-05-11 23:00:31 +09:00
clk clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent 2023-05-11 23:00:39 +09:00
clocksource clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails 2023-05-11 23:00:37 +09:00
comedi comedi: adv_pci1760: Fix PWM instruction handling 2023-01-24 07:22:45 +01:00
connector net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
counter counter: 104-quad-8: Fix race condition between FLAG and CNTR reads 2023-04-26 13:51:55 +02:00
cpufreq cpufreq: use correct unit when verify cur freq 2023-05-11 23:00:25 +09:00
cpuidle cpuidle: psci: Iterate backwards over list in psci_pd_remove() 2023-03-22 13:31:36 +01:00
crypto crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs() 2023-05-17 11:50:20 +02:00
cxl cxl/port: Hold port reference until decoder release 2022-07-12 16:34:58 +02:00
dax dax/kmem: Fix leak of memory-hotplug resources 2023-03-10 09:40:08 +01:00
dca dca: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:25:20 +02:00
devfreq PM/devfreq: governor: Add a private governor_data for governor 2023-01-12 11:58:51 +01:00
dio drivers: dio: fix possible memory leak in dio_init() 2022-12-31 13:14:27 +01:00
dma dmaengine: at_xdmac: do not enable all cyclic channels 2023-05-11 23:00:38 +09:00
dma-buf dma-buf: fix racing conflict of dma_heap_add() 2022-12-02 17:41:06 +01:00
edac EDAC/skx: Fix overflows on the DRAM row address mapping arrays 2023-05-11 23:00:20 +09:00
eisa EISA: use DEVICE_ATTR_RO() helper macro 2021-06-04 15:28:34 +02:00
extcon extcon: usbc-tusb320: fix kernel-doc warning 2023-02-06 07:59:01 +01:00
firewire firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region 2023-02-09 11:26:32 +01:00
firmware firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe 2023-05-11 23:00:33 +09:00
fpga fpga: bridge: fix kernel-doc parameter description 2023-05-11 23:00:31 +09:00
fsi WRITE is "data source", not destination... 2023-02-09 11:26:34 +01:00
gnss treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
gpio gpio: davinci: Add irq chip flag to skip set wake 2023-04-13 16:48:19 +02:00
gpu drm/amd/display: Add NULL plane_state check for cursor disable logic 2023-05-17 11:50:27 +02:00
greybus greybus: svc: fix an error handling bug in gb_svc_hello() 2022-04-08 14:22:50 +02:00
hid HID: wacom: insert timestamp to packed Bluetooth (BT) events 2023-05-17 11:50:26 +02:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2022-12-31 13:14:32 +01:00
hv Drivers: vmbus: Check for channel allocation before looking up relids 2023-04-13 16:48:17 +02:00
hwmon hwmon: (pmbus/fsp-3y) Fix functionality bitmask in FSP-3Y YM-2151E 2023-05-11 23:00:25 +09:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:58:13 +01:00
hwtracing coresight: etm_pmu: Set the module field 2023-05-11 23:00:33 +09:00
i2c i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path 2023-05-11 23:00:33 +09:00
i3c i3c: master: dw: check return of dw_i3c_master_get_free_pos() 2022-03-08 19:12:37 +01:00
idle intel_idle: Disable IBRS during long idle 2022-07-23 12:54:04 +02:00
iio iio: light: max44009: add missing OF device matching 2023-05-11 23:00:32 +09:00
infiniband RDMA/mlx5: Use correct device num_ports when modify DC 2023-05-11 23:00:37 +09:00
input Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe 2023-05-11 23:00:36 +09:00
interconnect interconnect: qcom: osm-l3: fix icc_onecell_data allocation 2023-03-30 12:47:41 +02:00
iommu iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE 2023-05-11 23:00:18 +09:00
ipack ipack: ipoctal: fix module reference leak 2021-09-27 17:38:49 +02:00
irqchip genirq: Add and use an irq_data_update_affinity helper 2023-03-11 13:57:31 +01:00
isdn mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2022-12-31 13:14:37 +01:00
leds leds: tca6507: Fix error handling of using fwnode_property_read_string 2023-05-11 23:00:37 +09:00
macintosh macintosh: via-pmu-led: requires ATA to be set 2023-05-11 23:00:34 +09:00
mailbox mailbox: zynqmp: Fix counts of child nodes 2023-05-17 11:50:14 +02:00
mcb mcb: mcb-parse: fix error handing in chameleon_parse_gdd() 2022-12-31 13:14:30 +01:00
md dm: don't lock fs when the map is NULL in process of resume 2023-05-11 23:00:40 +09:00
media media: venus: dec: Fix handling of the start cmd 2023-05-11 23:00:24 +09:00
memory memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() 2023-02-01 08:27:03 +01:00
memstick memstick: fix memory leak if card device is never registered 2023-04-26 13:51:51 +02:00
message scsi: message: mptfc: Switch from pci_ to dma_ API 2021-06-22 23:00:01 -04:00
mfd mfd: tqmx86: Correct board names for TQMxE39x 2023-05-11 23:00:38 +09:00
misc vmci_host: fix a race condition in vmci_host_poll() causing GPF 2023-05-11 23:00:32 +09:00
mmc mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data 2023-05-11 23:00:23 +09:00
most most: fix control-message timeouts 2021-11-18 19:16:08 +01:00
mtd mtd: core: fix error path for nvmem provider 2023-05-11 23:00:39 +09:00
mux mux: gpio: Simplify code by using dev_err_probe() 2021-04-02 16:28:53 +02:00
net wifi: rtw88: rtw8821c: Fix rfe_option field width 2023-05-17 11:50:28 +02:00
nfc nfc: st-nci: Fix use after free bug in ndlc_remove due to race condition 2023-03-22 13:31:26 +01:00
ntb NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-25 11:40:14 +02:00
nubus nubus: Simplify check in remove callback 2021-08-05 14:37:03 +02:00
nvdimm nvdimm: Fix badblocks clear off-by-one error 2022-07-07 17:53:24 +02:00
nvme nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage" 2023-05-11 23:00:28 +09:00
nvmem nvmem: core: fix return value 2023-02-22 12:57:03 +01:00
of of: Fix modalias string generation 2023-05-11 23:00:32 +09:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-03-10 09:39:15 +01:00
parisc genirq: Add and use an irq_data_update_affinity helper 2023-03-11 13:57:31 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:24:36 +01:00
pci PCI/EDR: Clear Device Status after EDR error recovery 2023-05-11 23:00:32 +09:00
pcmcia pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards 2022-06-14 18:36:02 +02:00
perf perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2022-12-31 13:13:58 +01:00
phy phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port 2023-05-11 23:00:38 +09:00
pinctrl pinctrl: renesas: r8a779a0: Remove incorrect AVB[01] pinmux configuration 2023-05-11 23:00:37 +09:00
platform platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i 2023-05-17 11:50:22 +02:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2022-12-31 13:14:02 +01:00
power power: supply: generic-adc-battery: fix unit scaling 2023-05-11 23:00:36 +09:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:39:12 +01:00
pps pps: clients: gpio: Propagate return value from pps_gpio_probe 2022-04-08 14:23:44 +02:00
ps3 powerpc/ps3: Warn on PS3 device errors 2021-06-10 21:44:58 +10:00
ptp ptp_qoriq: fix memory leak in probe() 2023-04-05 11:24:55 +02:00
pwm pwm: mtk-disp: Configure double buffering before reading in .get_state() 2023-05-11 23:00:38 +09:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-31 13:14:05 +01:00
ras RAS/CEC: Correct ce_add_elem()'s returned values 2021-04-07 11:52:26 +02:00
regulator regulator: stm32-pwr: fix of_iomap leak 2023-05-11 23:00:24 +09:00
remoteproc remoteproc: imx_rproc: Call of_node_put() on iteration error 2023-05-17 11:50:24 +02:00
reset reset: uniphier-glue: Fix possible null-ptr-deref 2023-02-01 08:27:04 +01:00
rpmsg rpmsg: glink: Avoid infinite loop on intent for missing channel 2023-03-10 09:39:46 +01:00
rtc rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time 2023-05-11 23:00:35 +09:00
s390 s390/dasd: fix hanging blockdevice after request requeue 2023-05-11 23:00:39 +09:00
sbus module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
scsi scsi: qedi: Fix use after free bug in qedi_remove() 2023-05-17 11:50:15 +02:00
sh genirq: Add and use an irq_data_update_affinity helper 2023-03-11 13:57:31 +01:00
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:24:36 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:24:44 +01:00
soc soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe 2023-05-11 23:00:20 +09:00
soundwire soundwire: qcom: correct setting ignore bit on v1.5.1 2023-05-11 23:00:17 +09:00
spi spi: cadence-quadspi: fix suspend-resume implementations 2023-05-11 23:00:33 +09:00
spmi spmi: Add a check for remove callback when removing a SPMI driver 2023-05-11 23:00:34 +09:00
ssb bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
staging staging: rtl8192e: Fix W_DISABLE# does not work after stop/start 2023-05-11 23:00:34 +09:00
target scsi: target: iscsit: Fix TAS handling during conn cleanup 2023-05-11 23:00:26 +09:00
tc The main MIPS changes for 5.6: 2020-01-31 11:28:31 -08:00
tee tee: amdtee: fix race condition in amdtee_open_session 2023-03-30 12:47:59 +02:00
thermal thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe 2023-05-11 23:00:38 +09:00
thunderbolt thunderbolt: Rename shadowed variables bit to interrupt_bit and auto_clear_bit 2023-03-30 12:47:52 +02:00
tty workqueue: Introduce show_one_worker_pool and show_one_workqueue. 2023-05-11 23:00:35 +09:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2022-12-31 13:14:27 +01:00
usb usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-11 23:00:33 +09:00
vdpa vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready 2023-03-22 13:31:24 +01:00
vfio vfio/type1: restore locked_vm 2023-03-10 09:40:13 +01:00
vhost vhost/net: Clear the pending messages when the backend is removed 2023-02-09 11:26:34 +01:00
video fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace 2023-04-20 12:13:52 +02:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:40:33 +02:00
virtio virtio_ring: don't update event idx on get_buf 2023-05-11 23:00:34 +09:00
visorbus visorbus: fix error return code in visorchipset_init() 2021-06-04 15:27:26 +02:00
vlynq bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
vme vme: Fix error not catched in fake_init() 2022-12-31 13:14:30 +01:00
w1 w1: fix WARNING after calling w1_process() 2023-02-01 08:27:14 +01:00
watchdog watchdog: dw_wdt: Fix the error handling path of dw_wdt_drv_probe() 2023-05-17 11:50:16 +02:00
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-11 23:00:22 +09:00
zorro zorro: Drop useless (and hardly used) .driver member in struct zorro_dev 2021-08-05 14:37:04 +02:00
Kconfig firmware: include drivers/firmware/Kconfig unconditionally 2021-10-07 16:51:26 +02:00
Makefile virtio: always enter drivers/virtio/ 2021-12-22 09:32:39 +01:00