Phillip Potter [Wed, 23 Jun 2021 23:49:02 +0000 (00:49 +0100)]
staging: rtl8188eu: remove MSG_88E macro from include/rtw_debug.h
Remove definition of MSG_88E macro from include/rtw_debug.h, as it
no longer has any callers and does not follow kernel coding conventions.
Removing this macro leaves only RT_TRACE and associated definitions.
Phillip Potter [Wed, 23 Jun 2021 23:49:00 +0000 (00:49 +0100)]
staging: rtl8188eu: remove MSG_88E call from hal/odm.c
Remove MSG_88E call from hal/odm.c as this macro is unnecessary,
and this call is dubious in terms of necessity. Removing all calls
will ultimately allow the removal of the macro itself.
Phillip Potter [Wed, 23 Jun 2021 23:48:59 +0000 (00:48 +0100)]
staging: rtl8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h
Remove definition of DBG_88E_LEVEL macro from include/rtw_debug.h, as it
no longer has any callers and does not follow kernel coding conventions.
Removing all such macros will ultimately allow the removal of this file.
Phillip Potter [Wed, 23 Jun 2021 23:48:58 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_xmit.c
Remove all DBG_88E_LEVEL calls from core/rtw_xmit.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Wed, 23 Jun 2021 23:48:57 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_pwrctrl.c
Remove all DBG_88E_LEVEL calls from core/rtw_pwrctrl.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Wed, 23 Jun 2021 23:48:56 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_ioctl_set.c
Remove all DBG_88E_LEVEL calls from core/rtw_ioctl_set.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Wed, 23 Jun 2021 23:48:55 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from core/rtw_mlmw_ext.c
Remove all DBG_88E_LEVEL calls from core/rtw_mlmw_ext.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Wed, 23 Jun 2021 23:48:54 +0000 (00:48 +0100)]
staging: rtl8188eu: remove all DBG_88E_LEVEL calls from os_dep/ioctl_linux.c
Remove all DBG_88E_LEVEL calls from os_dep/ioctl_linux.c as this macro is
unnecessary, and these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
usb_read_port prepares a bulk in urb and calls usb_submit_urb to pass the
usb to the usb core. It seems wrong that usb_read_port returns success to
its caller if usb_submit_urb failed with -EPERM.
According to drivers/usb/core/urb.c, usb_submit_urb returns -EPERM when
an urb is resubmitted after being cancelled by usb_kill_urb etc.
The only caller who checks the return value of usb_read_port is
rtw_hal_inirp_init. This function submits the bulk in urbs for the first
time after the netdevice is opened. We'll not receive -EPERM from
usb_submit_urb in this case. The urbs are resubmitted by
read_port_complete, which does not check for errors from usb_read_port.
This driver may kill pending bulk in urbs when the netdevice is closed when
the driver is unloaded or the system goes to sleep. I don't think that this
will interrupt an ongoing netdev open.
Michael Straube [Sat, 19 Jun 2021 17:50:55 +0000 (19:50 +0200)]
staging: rtl8188eu: remove useless comment
Remove block comment about function HwSuspendModeEnable92Cu.
The comment contains no useful information and there is even
no HwSuspendModeEnable92Cu function in the driver code.
'git grep -n HwSuspendModeEnable92Cu drivers/staging/rtl8188eu'
returns nothing.
Merge tag 'iio-for-5.14b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of Counter and IIO new device support, cleanups etc for 5.14
Counter
------
First part of general rework of counter subsystem to add a chrdev interface
for event drive data capture. Most of it will hopefully land next cycle.
* Consolidate documentation to avoid multiple copies of same docs in per
device files.
* Constify various arrays etc across subsystem.
* 104-quad-8:
- Annotate the module config parameter to avoid using it when kernel is
locked down.
- Spelling and trivial comment drops etc
* Intel QEP
- Follow up cleanups of trivial stuff from initial patch series.
IIO
---
Includes some cleanups as part of two ongoing audits
- runtime pm usage in IIO.
- Insufficient alignment on buffers passed to
iio_push_to_buffers_with_timstamp()
New device support
* bosch,bmc150
- Add ID for BMA253
Minor features / cleanups / minor fixes / late breaking fixes
* iio_push_to_buffers_with_timestamp() alignment fixes.
This set includes those where the best option is to mark the buffer as
__aligned(8). Normally this choice was made because there is too high a degree
of possible variation in number of channels enabled to be able to guarantee
the timestamp was always in the same location. This ruled out the more
obvious structure form used in other drivers. Only one small class of
related issues have patches under review and we can finally tighten up the
explicit rules to reflect the hidden requirement.
* dummy
- Kconfig build dependency fix.
* adi,ad_sigma_delta
- General devm related simplifications for these devices.
* adi,adf4350
- Fix some missing cleanup on error path.
* adi,adis, ADC drivers.
- Clean out unneeded spi_set_drvdata()
* ams-taos,tcs3472
- Fix a potential free of an irq that was never allocated.
* atlas,sensor
- Drop unbalanced runtime pm call and use pm_runtime_resume_and_get()
to reduce boilerplate.
* bosch,bma180
- Fix bandwidth register values used.
* bosch,bmc150
- Fix wrong pointer being dereferenced in remove.
- Stop device trying unregister itself rather than the second device.
- Refactor ACPI second device handing.
- Add support for DUAL250E ACPI HID.
- Move some stuff into the header to enable following patches to not
add additional accessor functions. Drop existing accessors.
- Add support for hinge angle setting with DUAL250E ACPI DSM to ensure
keyboard and touchpad enabled correctly when in laptop mode and disabled
otherwise.
- Add label attr for the multiple sensor locations with DUAL250E ACPI HID.
- Fix scale units for bma222
- Various reordering of devices supported lists to be alphabetical order.
- Drop unnecessary duplicated chip_info_tbl[] entries.
- Document that some devices have two interrupts, even if not currently
used by the driver.
- Move bma254 over to the bma255 driver.
- Move to more consistent scale values, based on assumption that some
datasheets use lower precision in their calculations in comparison
with others.
* hid-sensors
- Use namespaces for exported symbols.
- Update includes using manual inspection of output of the
include-what-you-use tool.
* invensense,icp10100
- Drop unbalanced runtime pm put. Use pm_runtime_resume_and_get() to cleanly
handle potential error.
* invensense,mpu6050
- Drop use of %hhx string formatting.
- runtime pm boilerplate removal and drop an unbalanced call in remove.
* liteon,ltr501
- Fix inaccurate volatile register list.
- Fix wrong mode bit.
- Add a missing leXX_to_cpu() conversion.
- Mark ltr501_chip_info structure as const.
* pulsed-light-lidar:
- Boilerplate removal using runtime_pm_resume_and_get()
* scmi-sensors
- Formatting of SPDX fix.
* silabs,si1133
- Fix a string format warning.
- Drop remaining uses of %hhx string formatting.
* silabs,si1145
- Drop use of %hhx string formatting.
* ti,ads1015
- Drop unbalanced runtime pm call in remove and reduce boilerplate.
* tag 'iio-for-5.14b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (76 commits)
iio: light: tcs3472: do not free unallocated IRQ
iio: accel: bmc150: Use more consistent and accurate scale values
iio: hid-sensors: Update header includes
iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()
iio: prox: pulsed-light-v2: Use pm_runtime_resume_and_get()
iio: chemical: atlas-sensor: Balance runtime pm + pm_runtime_resume_and_get()
iio: adc: ads1015: Balance runtime pm + pm_runtime_resume_and_get()
iio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get()
iio: hid-sensors: lighten exported symbols by moving to IIO_HID namespace
iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
iio: light: vcnl4000: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
iio: adc: mxs-lradc: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
iio: adc: hx711: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
iio: adc: at91-sama5d2: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
counter: interrupt-cnt: Add const qualifier for actions_list array
iio: ltr501: mark ltr501_chip_info as const
iio: ltr501: ltr501_read_ps(): add missing endianness conversion
...
frank zago [Tue, 27 Apr 2021 02:20:17 +0000 (21:20 -0500)]
iio: light: tcs3472: do not free unallocated IRQ
Allocating an IRQ is conditional to the IRQ existence, but freeing it
was not. If no IRQ was allocate, the driver would still try to free
IRQ 0. Add the missing checks.
This fixes the following trace when the driver is removed:
Stephan Gerhold [Fri, 11 Jun 2021 18:24:42 +0000 (20:24 +0200)]
iio: accel: bmc150: Use more consistent and accurate scale values
It is quite strange that BMA222 and BMA222E have very close, yet
subtly different values in their scale tables. Comparing the datasheets
this is simply because the "Resolution" for the different measurement
ranges are documented with different precision.
For example, for +-2g the BMA222 datasheet [1] suggests a resolution
of 15.6 mg/LSB, while the BMA222E datasheet [2] suggests 15.63 mg/LSB.
Actually, there is no need to rely on the resolution given by the Bosch
datasheets. The resolution and scale can be calculated more consistently
and accurately using the range (e.g. +-2g) and the channel size (e.g. 8 bits).
Distributing 4g (-2g to 2g) over 8 bits results in an exact resolution
of (4g / 2^8) = 15.625 mg/LSB which is the same value as in both datasheets,
just slightly more accurate. Multiplying g = 9.80665 m/s^2 we get a more
accurate value for the IIO scale table.
Generalizing this we can calculate the scale tables more accurately using
(range / 2^bits) * g * 10^6 (because of IIO_VAL_INT_PLUS_MICRO).
Document this and make the scale tables more consistent and accurate
for all the variants using that formula. Now the scale tables for
BMA222 and BMA222E are consistent and probably slightly more accurate.
General driver churn doesn't always include updates of header includes.
Manual review of the output of the include-what-you-use checker lead to the
following cleanup. Hopefuly this brings things back to a good state for the
hid-sensor drivers.
Jonathan Cameron [Sun, 16 May 2021 16:21:03 +0000 (17:21 +0100)]
iio: pressure: icp10100: Balance runtime pm + use pm_runtime_resume_and_get()
The devm_ handled runtime pm disable calls pm_runtime_put_sync_suspend()
which isn't balancing a matching get call. It isn't a bug as such,
because the runtime pm core doesn't decrement the reference count below
zero, but it is missleading so let's drop it.
Using pm_runtime_resume_and_get() new call makes it easy to handle
failures in resume as it doesn't hold a reference count if it exits
with an error.
The pm_runtime_put_noidle() call in remove isn't balanced with any get, so
drop it. Note this isn't a bug as the runtime pm core will not allow the
reference count to go negative, making this a noop. However, it is
confusing to the reader so let's drop it.
pm_runtime_resume_and_get() replacement found using the coccicheck script
under review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/
As pm_runtime_resume_and_get() returns <= 0 take advantage of that to
change the error checking to if (ret) which is more in keeping with the
rest of this driver.
This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/20210516162103.1332291-4-jic23@kernel.org
The call to pm_runtime_put_noidle() in remove() is not balancing a
counter increment. Note this doesn't matter as the runtime pm core
will not allow the counter to go negative. However, it is confusing
to the reader so let's remove it.
The pm_runtime_resume_and_get() replacement was found using coccicheck
script under review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/
This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.
Jonathan Cameron [Sun, 16 May 2021 16:20:58 +0000 (17:20 +0100)]
iio: imu: mpu6050: Balance runtime pm + use pm_runtime_resume_and_get()
Remove an unblanced pm_runtime_put_sync_suspend() call
in inv_pu_pm_disable(). Not this call is not a bug, because the runtime
pm core will not allow the reference counter to go negative. It is
however confusing and serves no purpose.
pm_runtime_resume_and_get() case found using coccicheck script under
review at:
https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/
pm_runtime_resume_and_get() returns <= 0 only so simplify related checks
to bring this more inline with nearby calls.
This is a prequel to taking a closer look at the runtime pm in IIO drivers
in general.
Andy Shevchenko [Mon, 14 Jun 2021 16:24:47 +0000 (19:24 +0300)]
iio: hid-sensors: lighten exported symbols by moving to IIO_HID namespace
A namespace for exported symbols makes clear who is a provider
and who is a consumer of the certain resources. Besides that,
it doesn't pollute the common namespace.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20210614162447.5392-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Jonathan Cameron [Sun, 13 Jun 2021 15:23:01 +0000 (16:23 +0100)]
iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.
Here an explicit structure is not used, because the holes would
necessitate the addition of an explict memset(), to avoid a kernel
data leak, making for a less minimal fix.
Fixes: 1c28799257bc ("iio: light: isl29501: Add support for the ISL29501 ToF sensor.") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Mathieu Othacehe <m.othacehe@gmail.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210613152301.571002-9-jic23@kernel.org
Jonathan Cameron [Sun, 13 Jun 2021 15:23:00 +0000 (16:23 +0100)]
iio: light: vcnl4035: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.
Here an explicit structure is not used, because the holes would
necessitate the addition of an explict memset(), to avoid a potential
kernel data leak, making for a less minimal fix.
Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Parthiban Nallathambi <pn@denx.de> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210613152301.571002-8-jic23@kernel.org
Phillip Potter [Tue, 15 Jun 2021 22:36:07 +0000 (23:36 +0100)]
staging: rtl8188eu: remove _dbg_dump_tx_info function
Remove the _dbg_dump_tx_info function from hal/rtl8188e_xmit.c, as
it doesn't actually do anything and is only called from one place.
It used to have some redundant debugging statements in it, but these
have now been removed anyway, so all it does is read information from
the adapter to set a variable 'dump_txdesc' which is then never used.
This fixes a kernel test robot warning.
Phillip Potter [Tue, 15 Jun 2021 22:36:06 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variables from hal/rtl8188e_cmd.c
Remove set but unused variables from within the file hal/rtl8188e_cmd.c
in the function rtl8188e_set_FwMediaStatus_cmd, as they are triggering
kernel test robot warnings.
Phillip Potter [Tue, 15 Jun 2021 22:36:05 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variable from os_dep/ioctl_linux.c
Remove set but unused variable 'reason' from within the file
os_dep/ioctl_linux.c in the function rtw_wx_set_mlme, as it is
triggering a kernel test robot warning.
Phillip Potter [Tue, 15 Jun 2021 22:36:03 +0000 (23:36 +0100)]
staging: rtl8188eu: remove unused variables from core/rtw_efuse.c
Remove set but unused variables from within the file core/rtw_efuse.c
in the function efuse_read_phymap_from_txpktbuf, as they are triggering
kernel test robot warnings. Also, remove the local 'lenc' array as well,
as nothing is done with its values. Keep the two usb_read8 calls
however, as this patch is purely for warnings, not to change behaviour
of the code.
Phillip Potter [Tue, 15 Jun 2021 22:36:02 +0000 (23:36 +0100)]
staging: rtl8188eu: use prefix decrement operator on trycnt variable
Modify trycnt condition in the do/while loop of rtw_hal_set_hwreg to use
a prefix decrement operator instead of postfix. As an unsigned 8-bit
integer, this value would actually be 255 after the end of the do/while
loop, which is almost certainly not what was intended. It is more
reasonable to assume a loop counter should be zero at the end of all
loop iterations. Indeed, the line following the loop previously contained
an if statement which assumed trycnt was 0, and therefore was never
triggered.
Phillip Potter [Tue, 15 Jun 2021 22:36:01 +0000 (23:36 +0100)]
staging: rtl8188eu: remove empty label from mlmeext_joinbss_event_callback
Remove empty label at end of mlmeext_joinbss_event_callback function, as
it only contained a return in my last patch to make the code build. It
is better removed, and the corresponding goto converted to a return.
staging: mt7621-dts: fix pci address for PCI memory range
Driver code call 'devm_of_pci_get_host_bridge_resources'
to get resources and properly fill 'bridge->windows' and
'bridge->dma_ranges'. After parsing the ranges and store
as resources, at the end it makes a call to pci function
'pci_add_resource_offset' to set the offset for the
memory resource. To calculate offset, resource start address
subtracts pci address of the range. MT7621 does not need
any offset for the memory resource. Moreover, setting an
offset got into 'WARN_ON' calls from pci devices driver code.
Until now memory range pci_addr was being '0x00000000' and
res->start is '0x60000000' but becase pci controller driver
was manually setting resources and adding them using pci function
'pci_add_resource' where a zero is passed as offset, things
was properly working. Since PCI_IOBASE is defined now for
ralink we don't set nothing manually anymore so we have to
properly fix PCI address for this range to make things work
and the new pci address must be set to '0x60000000'. Doing
in this way the subtract result obtain zero as offset
and pci device driver code properly works.
After 'PCI_IOBASE' is defined for ralink, ranges are properly parsed
using pci generic APIS and there is no need to parse anything
manually. So function 'mt7621_pci_parse_request_of_pci_ranges'
used for this can be enterely removed. Since we have to configure
iocu memory regions and pci io windows resources must be retrieved
accordly from 'bridge->windows' but there is no need to store
anything as driver private data.
PCI_IOBASE is used to create VM maps for PCI I/O ports, it is
required by generic PCI drivers to make memory mapped I/O range
work. Hence define it for ralink architectures to be able to
avoid parsing manually IO ranges in PCI generic driver code.
Function 'plat_mem_setup' for ralink is using 'set_io_port_base'
call using '0xa0000000' as address, so use the same address in
the definition to align things.
Phillip Potter [Tue, 15 Jun 2021 00:15:06 +0000 (01:15 +0100)]
staging: rtl8188eu: remove core/rtw_debug.c
Remove core/rtw_debug.c as all the functions contained within it are
entirely unused, and modify the Makefile to remove it as a build
requirement. Also remove the function declarations from
include/rtw_debug.h - this is part of an ongoing effort to purge
dead/unused code and cleanup this driver. This has the helpful
side effect of removing all DBG_88E macro calls within this file
as well.
Phillip Potter [Tue, 15 Jun 2021 00:15:05 +0000 (01:15 +0100)]
staging: rtl8188eu: remove converted netdev_dbg calls from core/rtw_sta_mgt.c
Remove all previously converted netdev_dbg calls from core/rtw_sta_mgt.c,
as these were originally DBG_88E macro calls, and therefore of dubious
necessity to begin with.
Phillip Potter [Tue, 15 Jun 2021 00:15:04 +0000 (01:15 +0100)]
staging: rtl8188eu: remove converted netdev_dbg calls from core/rtw_recv.c
Remove all previously converted netdev_dbg calls from core/rtw_recv.c, as
these were originally DBG_88E macro calls, and therefore of dubious
necessity to begin with.
Phillip Potter [Tue, 15 Jun 2021 00:15:03 +0000 (01:15 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/rtl8188eu_xmit.c
Remove all DBG_88E calls from hal/rtl8188eu_xmit.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:15:02 +0000 (01:15 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/rtl8188eu_recv.c
Remove all DBG_88E calls from hal/rtl8188eu_recv.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:15:01 +0000 (01:15 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/usb_halinit.c
Remove all DBG_88E calls from hal/usb_halinit.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself. Also remove unused jiffies variable from the start of
rtl8188eu_hal_init.
Phillip Potter [Tue, 15 Jun 2021 00:15:00 +0000 (01:15 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/rtl8188e_xmit.c
Remove all DBG_88E calls from hal/rtl8188e_xmit.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:59 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/rtl8188e_hal_init.c
Remove all DBG_88E calls from hal/rtl8188e_hal_init.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:58 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/pwrseqcmd.c
Remove all DBG_88E calls from hal/pwrseqcmd.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:57 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/rtl8188e_cmd.c
Remove all DBG_88E calls from hal/rtl8188e_cmd.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:56 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from hal/hal_intf.c
Remove all DBG_88E calls from hal/hal_intf.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:55 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/rtw_android.c
Remove all DBG_88E calls from os_dep/rtw_android.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:54 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/xmit_linux.c
Remove all DBG_88E calls from os_dep/xmit_linux.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:53 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/mlme_linux.c
Remove all DBG_88E calls from os_dep/mlme_linux.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:52 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/os_intfs.c
Remove all DBG_88E calls from os_dep/os_intfs.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself. Also remove variable declarations for variables which now go
unused as a result of this change with os_dep/os_intfs.c
Phillip Potter [Tue, 15 Jun 2021 00:14:51 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/usb_intf.c
Remove all DBG_88E calls from os_dep/usb_intf.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:50 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from os_dep/ioctl_linux.c
Remove all DBG_88E calls from os_dep/ioctl_linux.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:49 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_mlme.c
Remove all DBG_88E calls from core/rtw_mlme.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:48 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_ioctl_set.c
Remove all DBG_88E calls from core/rtw_ioctl_set.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:47 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_security.c
Remove all DBG_88E calls from core/rtw_security.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:46 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_ieee80211.c
Remove all DBG_88E calls from core/rtw_ieee80211.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:45 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_pwrctrl.c
Remove all DBG_88E calls from core/rtw_pwrctrl.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself. Also remove pmlmepriv declaration from within rtw_ps_processor
as it is now no longer used.
Phillip Potter [Tue, 15 Jun 2021 00:14:44 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_ap.c
Remove all DBG_88E calls from core/rtw_ap.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:43 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_wlan_util.c
Remove all DBG_88E calls from core/rtw_wlan_util.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Phillip Potter [Tue, 15 Jun 2021 00:14:42 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_mlme_ext.c
Remove all DBG_88E calls from core/rtw_mlme_ext.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself. Also remove variable declarations for variables which now go
unused as a result of this change with core/rtw_mlme_ext.c
Phillip Potter [Tue, 15 Jun 2021 00:14:41 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_xmit.c
Remove all DBG_88E calls from core/rtw_xmit.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
Also remove static rtw_sctx_chk_warning_status function, as it no longer
has any callers.
Phillip Potter [Tue, 15 Jun 2021 00:14:40 +0000 (01:14 +0100)]
staging: rtl8188eu: remove all DBG_88E calls from core/rtw_efuse.c
Remove all DBG_88E calls from core/rtw_efuse.c as this macro is
unnecessary, and many of these calls are dubious in terms of necessity.
Removing all calls will ultimately allow the removal of the macro
itself.
staging: unisys: visorhba: Convert module from IDR to XArray
Converted visorhba from IDR to XArray. The abstract data type XArray is
more memory-efficient, parallelizable, and cache friendly. It takes
advantage of RCU to perform lookups without locking. Furthermore, IDR is
deprecated because XArray has a better (cleaner and more consistent)
API.
Pavel Skripkin [Sun, 13 Jun 2021 22:00:19 +0000 (01:00 +0300)]
staging: rtl8712: fix memory leak in rtl871x_load_fw_cb
There is a leak in rtl8712 driver.
The problem was in non-freed adapter data if
firmware load failed.
This leak can be reproduced with this code:
https://syzkaller.appspot.com/text?tag=ReproC&x=16612f02d00000,
Autoload must fail (to not hit memory leak reported by syzkaller)
There are 2 possible ways how rtl871x_load_fw_cb() and
r871xu_dev_remove() can be called (in case of fw load error).
1st case:
r871xu_dev_remove() then rtl871x_load_fw_cb()
In this case r871xu_dev_remove() will wait for
completion and then will jump to the end, because
rtl871x_load_fw_cb() set intfdata to NULL:
if (pnetdev) {
struct _adapter *padapter = netdev_priv(pnetdev);
/* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready);
pnetdev = usb_get_intfdata(pusb_intf);
usb_set_intfdata(pusb_intf, NULL);
if (!pnetdev)
goto firmware_load_fail;
... clean up code here ...
}
2nd case:
rtl871x_load_fw_cb() then r871xu_dev_remove()
In this case pnetdev (from code snippet above) will
be zero (because rtl871x_load_fw_cb() set it to NULL)
And clean up code won't be executed again.
So, in all cases we need to free adapted data in rtl871x_load_fw_cb(),
because disconnect function cannot take care of it. And there won't be
any race conditions, because complete() call happens after setting
intfdata to NULL.
In previous patch I moved out free_netdev() from r8712_free_drv_sw()
and that's why now it's possible to free adapter data and then call
complete.
Pavel Skripkin [Sun, 13 Jun 2021 22:00:13 +0000 (01:00 +0300)]
staging: rtl8712: fix error handling in r871xu_drv_init
Previous error handling path was unique for all
possible errors and there was unnecessary branching.
Also, one step for freeing drv_sw was missing. All
these problems was fixed by restructuring error
handling path.
Also, moved out free_netdev() from r8712_free_drv_sw() for
correct error handling.