Michael Straube
3a0f2edf54
staging: r8188eu: convert switch to if statement in mgt_dispatcher()
...
The 'switch (GetFrameSubType(pframe))' in mgt_dispatcher() has only
one case that does something different than the default case. Convert
the switch to an if statement to improve readability.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220108082736.16788-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:52 +01:00
Michael Straube
a5ea39eaa7
staging: r8188eu: rtw_hostapd_mlme_rx() is empty
...
The function rtw_hostapd_mlme_rx() is empty. Remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220108082736.16788-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:52 +01:00
Phillip Potter
d601ad5686
staging: r8188eu: convert/remove DBG_88E calls in os_dep/usb_ops_linux.c
...
Convert DBG_88E macro calls in os_dep/usb_ops_linux.c to use netdev_dbg
when they may display useful information, and remove erroneous DBG_88E
calls entirely.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk >
Link: https://lore.kernel.org/r/20220108005550.26264-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:19 +01:00
Phillip Potter
198fae4213
staging: r8188eu: convert DBG_88E call in core/rtw_cmd.c
...
Convert the DBG_88E macro call in core/rtw_cmd.c to use netdev_dbg
as its information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk >
Link: https://lore.kernel.org/r/20220108005550.26264-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:18 +01:00
Phillip Potter
6397fb278b
staging: r8188eu: remove DBG_88E call from os_dep/osdep_service.c
...
Remove the single DBG_88E macro call from os_dep/osdep_service.c, as it
is unreachable anyway. This gets the driver closer to the eventual
removal of DBG_88E itself.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk >
Link: https://lore.kernel.org/r/20220108005550.26264-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:18 +01:00
Phillip Potter
0bfcc8b5c1
staging: r8188eu: convert DBG_88E calls in os_dep/xmit_linux.c
...
Convert three DBG_88E macro calls in core/rtw_ap.c to use netdev_dbg
as their information may be useful to observers, and this gets the
driver closer to the point of being able to remove DBG_88E itself.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk >
Link: https://lore.kernel.org/r/20220108005550.26264-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:18 +01:00
Phillip Potter
ea9ac80e2e
staging: r8188eu: convert/remove DBG_88E calls in core/rtw_ap.c
...
Convert DBG_88E macro calls in core/rtw_ap.c to use netdev_dbg when they
may display useful information, and remove erroneous DBG_88E calls
entirely.
This leaves six empty static functions which only had DBG_88E calls,
so just remove them:
update_bcn_fixed_ie
update_bcn_htcap_ie
update_bcn_htinfo_ie
update_bcn_rsn_ie
update_bcn_wpa_ie
update_bcn_wmm_ie
also modifying the if blocks/switch cases that invoke them to no longer do
so. This goes further towards the goal of removing this non-standard
debugging code.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk >
Link: https://lore.kernel.org/r/20220108005550.26264-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:15:18 +01:00
Michael Straube
53493c2535
staging: r8188eu: remove HW_VAR_APFM_ON_MAC
...
SetHwReg8188EU() and GetHwReg8188EU() are never called with
HW_VAR_APFM_ON_MAC. Remove that case from both functions.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
dce7cbb4e1
staging: r8188eu: EfuseUsedBytes is set but never used
...
The field EfuseUsedBytes of struct hal_data_8188e is set but never
used. Remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
762e47b34b
staging: r8188eu: remove HW_VAR_EFUSE_BYTES from GetHwReg8188EU()
...
GetHwReg8188EU() is never called with HW_VAR_EFUSE_BYTES. Remove that
case from the function.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
f3806385a4
staging: r8188eu: remove HW_VAR_CURRENT_ANTENNA from GetHwReg8188EU()
...
GetHwReg8188EU() is never called with HW_VAR_CURRENT_ANTENNA. Remove
that case from the function.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
08dc8feb14
staging: r8188eu: remove HW_VAR_TXPAUSE
...
SetHwReg8188EU() and GetHwReg8188EU() are never called with
HW_VAR_TXPAUSE. Remove that case from both functions.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
dba29039b6
staging: r8188eu: remove HW_VAR_BASIC_RATE from GetHwReg8188EU()
...
GetHwReg8188EU() is never called with HW_VAR_BASIC_RATE. Remove that
case from the function.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107215033.12257-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:14:42 +01:00
Michael Straube
f19fe1537c
staging: r8188eu: move firmware related macros to rtw_fw.h
...
Move firmware related macros from rtl8188e_hal.h to rtw_fw.h.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107143617.2214-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
9df7cc3a82
staging: r8188eu: add spaces around & operator in IS_FW_HEADER_EXIST
...
Add spaces around & operator in the macro IS_FW_HEADER_EXIST to
improve readability and follow kernel coding style.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107143617.2214-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
106ee4d8c3
staging: r8188eu: rename _pFwHdr in IS_FW_HEADER_EXIST
...
Rename _pFwHdr in the macro IS_FW_HEADER_EXIST to avoid camel case.
_pFwHdr -> _fwhdr
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107143617.2214-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
7235d165d3
staging: r8188eu: move firmware loading code out of the hal layer
...
Move the firmware loading functions from rtl8188e_hal_init.c into the
new file core/rtw_fw.c.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-20-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
dbf1c5e37e
staging: r8188eu: rename pFirmwareBuf and FirmwareLen
...
Rename the variables pFirmwareBuf and FirmwareLen in
rtl8188e_firmware_download() to avoid camel case.
pFirmwareBuf -> fw_data
FirmwareLen -> fw_size
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-19-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
b44dcfb787
staging: r8188eu: rename pFwHdr in rtl8188e_firmware_download()
...
Rename the variable pFwHdr in rtl8188e_firmware_download() to avoid
camel case.
pFwHdr -> fwhdr
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
9c010d7a72
staging: r8188eu: rename writeFW_retry
...
Rename the variable writeFW_retry in rtl8188e_firmware_download()
to avoid camel case.
writeFW_retry -> write_fw_retry
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
8a9ee2b4d0
staging: r8188eu: rename FWDL_ChkSum_rpt
...
Rename FWDL_ChkSum_rpt to avoid camel case.
FWDL_ChkSum_rpt -> FWDL_CHKSUM_RPT
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
fc6730404a
staging: r8188eu: rename rtSatus in rtl8188e_firmware_download()
...
Rename the variable rtStatus in rtl8188e_firmware_download() to avoid
camel case.
rtStatus -> ret
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
7a0c9c46c4
staging: r8188eu: rename Exit label in rtl8188e_firmware_download()
...
Rename the Exit label in rtl8188e_firmware_download() to avoid camel
case.
Exit -> exit
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
08c6f78e92
staging: r8188eu: convert two functions from s32 to int
...
Convert the return type of fw_free_to_go() and
rtl8188e_firmware_download() from s32 to the more common int.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
843e069870
staging: r8188eu: clean up rtw_reset_8051()
...
Rename the local variable u1bTmp in rtw_reset_8051() to avoid camel
case and remove a call to DBG_88E that contains no important
information.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
f1c140b62f
staging: r8188eu: rename fw related functions to avoid camel case
...
Rename firmware related functions to avoid camel case.
rtl8188e_FirmwareDownload -> rtl8188e_firmware_download
_FWDownloadEnable -> fw_download_enable
_8051Reset88E -> rtw_reset_8051
_FWFreeToGo -> fw_free_to_go
_BlockWrite -> block_write
_PageWrite -> page_write
_WriteFW -> write_fw
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:44 +01:00
Michael Straube
2441fa93a8
staging: r8188eu: use kmemdup instead of kzalloc and memcpy
...
Use kmemdup instead of kzalloc and memcpy in load_firmware().
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
2f8e84b2d1
staging: r8188eu: rename fields of struct rt_firmware
...
Rename fields of struct rt_firmware to avoid camel case.
szFwBuffer -> data
ulFwLength -> size
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
ca1cb3c278
staging: r8188eu: rename parameter pFirmware of load_firmware()
...
Rename the parameter pFirmware of load_firmware() to avoid camel case.
pFirmware -> rtfw
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
4339450145
staging: r8188eu: convert type of return variable in load_firmware()
...
The return type of load_firmware() is int. Change the type of the
return variable from s32 to int to match the function return type.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
996d0af0f4
staging: r8188eu: rename rtStatus in load_firmware()
...
Rename the local variable rtStatus in load_firmware() to avoid camel
case.
rtStatus -> ret
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
1541c8210a
staging: r8188eu: rename Exit label in load_firmware()
...
Rename Exit label in load_firmware() to avoid camel case.
Exit -> exit
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:43 +01:00
Michael Straube
39850edf2b
staging: r8188eu: release_firmware is not called if allocation fails
...
In function load_firmware() release_firmware() is not called if the
allocation of pFirmware->szFwBuffer fails or if fw->size is greater
than FW_8188E_SIZE.
Move the call to release_firmware() to the exit label at the end of
the function to fix this.
Fixes: 8cd574e6af ("staging: r8188eu: introduce new hal dir for RTL8188eu driver")
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:13:36 +01:00
Michael Straube
6da9712503
staging: r8188eu: remove rtl8188e_InitializeFirmwareVars()
...
Merge rtl8188e_InitializeFirmwareVars() into rtl8188eu_hal_init()
and remove rtl8188e_InitializeFirmwareVars().
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:07:40 +01:00
Michael Straube
915d5c3248
staging: r8188eu: remove Firmware* from struct hal_data_8188e
...
The fields FirmwareVersion, FirmwareSubVersion and FirmwareSignature
of struct hal_data_8188e are only used in the function
rtl8188e_FirmwareDownload(). Use local variables in that function and
remove the fields from struct hal_data_8188e. FirmwareVersionRev is
not used at all, remove it as well.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20220107103620.15648-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-25 16:07:40 +01:00
Linus Torvalds
e783362eb5
Linux 5.17-rc1
v5.17-rc1
2022-01-23 10:12:53 +02:00
Linus Torvalds
40c843218f
Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
...
Pull more perf tools updates from Arnaldo Carvalho de Melo:
- Fix printing 'phys_addr' in 'perf script'.
- Fix failure to add events with 'perf probe' in ppc64 due to not
removing leading dot (ppc64 ABIv1).
- Fix cpu_map__item() python binding building.
- Support event alias in form foo-bar-baz, add pmu-events and
parse-event tests for it.
- No need to setup affinities when starting a workload or attaching to
a pid.
- Use path__join() to compose a path instead of ad-hoc snprintf()
equivalent.
- Override attr->sample_period for non-libpfm4 events.
- Use libperf cpumap APIs instead of accessing the internal state
directly.
- Sync x86 arch prctl headers and files changed by the new
set_mempolicy_home_node syscall with the kernel sources.
- Remove duplicate include in cpumap.h.
- Remove redundant err variable.
* tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
perf tools: Remove redundant err variable
perf test: Add parse-events test for aliases with hyphens
perf test: Add pmu-events test for aliases with hyphens
perf parse-events: Support event alias in form foo-bar-baz
perf evsel: Override attr->sample_period for non-libpfm4 events
perf cpumap: Remove duplicate include in cpumap.h
perf cpumap: Migrate to libperf cpumap api
perf python: Fix cpu_map__item() building
perf script: Fix printing 'phys_addr' failure issue
tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall
tools headers UAPI: Sync x86 arch prctl headers with the kernel sources
perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)
perf evlist: No need to setup affinities when disabling events for pid targets
perf evlist: No need to setup affinities when enabling events for pid targets
perf stat: No need to setup affinities when starting a workload
perf affinity: Allow passing a NULL arg to affinity__cleanup()
perf probe: Fix ppc64 'perf probe add events failed' case
2022-01-23 08:14:21 +02:00
Linus Torvalds
67bfce0e01
Merge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
...
Pull ftrace fix from Steven Rostedt:
"Fix s390 breakage from sorting mcount tables.
The latest merge of the tracing tree sorts the mcount table at build
time. But s390 appears to do things differently (like always) and
replaces the sorted table back to the original unsorted one. As the
ftrace algorithm depends on it being sorted, bad things happen when it
is not, and s390 experienced those bad things.
Add a new config to tell the boot if the mcount table is sorted or
not, and allow s390 to opt out of it"
* tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
ftrace: Fix assuming build time sort works for s390
2022-01-23 08:07:02 +02:00
Steven Rostedt (Google)
6b9b641370
ftrace: Fix assuming build time sort works for s390
...
To speed up the boot process, as mcount_loc needs to be sorted for ftrace
to work properly, sorting it at build time is more efficient than boot up
and can save milliseconds of time. Unfortunately, this change broke s390
as it will modify the mcount_loc location after the sorting takes place
and will put back the unsorted locations. Since the sorting is skipped at
boot up if it is believed that it was sorted at run time, ftrace can crash
as its algorithms are dependent on the list being sorted.
Add a new config BUILDTIME_MCOUNT_SORT that is set when
BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
if sorting should take place at boot up.
Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
Fixes: 72b3942a17 ("scripts: ftrace - move the sort-processing in ftrace_init")
Reported-by: Sven Schnelle <svens@linux.ibm.com >
Tested-by: Heiko Carstens <hca@linux.ibm.com >
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org >
2022-01-23 00:10:09 -05:00
Linus Torvalds
473aec0e1f
Merge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
...
Pull Kbuild fixes from Masahiro Yamada:
- Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage
- Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH
- Fix build errors in certs/Makefile
* tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty
certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI
Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH"
usr/include/Makefile: add linux/nfc.h to the compile-test coverage
2022-01-23 06:32:29 +02:00
Linus Torvalds
3689f9f8b0
Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux
...
Pull bitmap updates from Yury Norov:
- introduce for_each_set_bitrange()
- use find_first_*_bit() instead of find_next_*_bit() where possible
- unify for_each_bit() macros
* tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
vsprintf: rework bitmap_list_string
lib: bitmap: add performance test for bitmap_print_to_pagebuf
bitmap: unify find_bit operations
mm/percpu: micro-optimize pcpu_is_populated()
Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
find: micro-optimize for_each_{set,clear}_bit()
include/linux: move for_each_bit() macros from bitops.h to find.h
cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
tools: sync tools/bitmap with mother linux
all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
cpumask: use find_first_and_bit()
lib: add find_first_and_bit()
arch: remove GENERIC_FIND_FIRST_BIT entirely
include: move find.h from asm_generic to linux
bitops: move find_bit_*_le functions from le.h to find.h
bitops: protect find_first_{,zero}_bit properly
2022-01-23 06:20:44 +02:00
Minghao Chi
f0ac5b8581
perf tools: Remove redundant err variable
...
Return value from perf_event__process_tracing_data() directly instead
of taking this in another redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: http://lore.kernel.org/lkml/20220112080109.666800-1-chi.minghao@zte.com.cn
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:25:02 -03:00
John Garry
b4a7276c5e
perf test: Add parse-events test for aliases with hyphens
...
Add a test which allows us to test parsing an event alias with hyphens.
Since these events typically do not exist on most host systems, add the
alias to the fake pmu.
Function perf_pmu__test_parse_init() has terms added to match known test
aliases.
Signed-off-by: John Garry <john.garry@huawei.com >
Acked-by: Ian Rogers <irogers@google.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Qi Liu <liuqi115@huawei.com >
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com >
Cc: linuxarm@huawei.com
Link: https://lore.kernel.org/r/1642432215-234089-4-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:21:41 -03:00
John Garry
34fa67e720
perf test: Add pmu-events test for aliases with hyphens
...
Add a test for aliases with hyphens in the name to ensure that the
pmu-events tables are as expects. There should be no reason why these sort
of aliases would be treated differently, but no harm in checking.
Signed-off-by: John Garry <john.garry@huawei.com >
Acked-by: Ian Rogers <irogers@google.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Qi Liu <liuqi115@huawei.com >
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com >
Cc: linuxarm@huawei.com
Link: https://lore.kernel.org/r/1642432215-234089-3-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:21:29 -03:00
John Garry
864bc8c905
perf parse-events: Support event alias in form foo-bar-baz
...
Event aliasing for events whose name in the form foo-bar-baz is not
supported, while foo-bar, foo_bar_baz, and other combinations are, i.e.
two hyphens are not supported.
The HiSilicon D06 platform has events in such form:
$ ./perf list sdir-home-migrate
List of pre-defined events (to be used in -e):
uncore hha:
sdir-home-migrate
[Unit: hisi_sccl,hha]
$ sudo ./perf stat -e sdir-home-migrate
event syntax error: 'sdir-home-migrate'
\___ parser error
Run 'perf list' for a list of valid events
Usage: perf stat [<options>] [<command>]
-e, --event <event>event selector. use 'perf list' to list available events
To support, add an extra PMU event symbol type for "baz", and add a new
rule in the bison file.
Signed-off-by: John Garry <john.garry@huawei.com >
Acked-by: Ian Rogers <irogers@google.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Qi Liu <liuqi115@huawei.com >
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com >
Cc: linuxarm@huawei.com
Link: https://lore.kernel.org/r/1642432215-234089-2-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:20:12 -03:00
German Gomez
3606c0e1a1
perf evsel: Override attr->sample_period for non-libpfm4 events
...
A previous patch preventing "attr->sample_period" values from being
overridden in pfm events changed a related behaviour in arm-spe.
Before said patch:
perf record -c 10000 -e arm_spe_0// -- sleep 1
Would yield an SPE event with period=10000. After the patch, the period
in "-c 10000" was being ignored because the arm-spe code initializes
sample_period to a non-zero value.
This patch restores the previous behaviour for non-libpfm4 events.
Fixes: ae5dcc8abe (“perf record: Prevent override of attr->sample_period for libpfm4 events”)
Reported-by: Chase Conklin <chase.conklin@arm.com >
Signed-off-by: German Gomez <german.gomez@arm.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: John Fastabend <john.fastabend@gmail.com >
Cc: KP Singh <kpsingh@kernel.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Martin KaFai Lau <kafai@fb.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Yonghong Song <yhs@fb.com >
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: http://lore.kernel.org/lkml/20220118144054.2541-1-german.gomez@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:15:47 -03:00
Lv Ruyi
24ead7c254
perf cpumap: Remove duplicate include in cpumap.h
...
Remove all but the first include of stdbool.h from cpumap.h.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn >
Acked-by: Ian Rogers <irogers@google.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20220117083730.863200-1-lv.ruyi@zte.com.cn
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:12:23 -03:00
Ian Rogers
4402869939
perf cpumap: Migrate to libperf cpumap api
...
Switch from directly accessing the perf_cpu_map to using the appropriate
libperf API when possible. Using the API simplifies the job of
refactoring use of perf_cpu_map.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: André Almeida <andrealmeid@collabora.com >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Darren Hart <dvhart@infradead.org >
Cc: Davidlohr Bueso <dave@stgolabs.net >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Eric Dumazet <edumazet@google.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jin Yao <yao.jin@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: John Garry <john.garry@huawei.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Madhavan Srinivasan <maddy@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miaoqian Lin <linmq006@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Riccardo Mancini <rickyman7@gmail.com >
Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com >
Cc: Song Liu <song@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Yury Norov <yury.norov@gmail.com >
Link: http://lore.kernel.org/lkml/20220122045811.3402706-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:08:42 -03:00
Ian Rogers
1d1d9af254
perf python: Fix cpu_map__item() building
...
Value should be built as an integer.
Switch some uses of perf_cpu_map to use the library API.
Fixes: 6d18804b96 ("perf cpumap: Give CPUs their own type")
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: André Almeida <andrealmeid@collabora.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Darren Hart <dvhart@infradead.org >
Cc: Davidlohr Bueso <dave@stgolabs.net >
Cc: Dmitriy Vyukov <dvyukov@google.com >
Cc: Eric Dumazet <edumazet@google.com >
Cc: German Gomez <german.gomez@arm.com >
Cc: Ian Rogers <irogers@google.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jin Yao <yao.jin@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: John Garry <john.garry@huawei.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Madhavan Srinivasan <maddy@linux.ibm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Miaoqian Lin <linmq006@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Riccardo Mancini <rickyman7@gmail.com >
Cc: Shunsuke Nakamura <nakamura.shun@fujitsu.com >
Cc: Song Liu <song@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Stephen Brennan <stephen.s.brennan@oracle.com >
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Yury Norov <yury.norov@gmail.com >
Link: http://lore.kernel.org/lkml/20220122045811.3402706-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:04:33 -03:00
Yao Jin
9edcde68d6
perf script: Fix printing 'phys_addr' failure issue
...
Perf script was failed to print the phys_addr for SPE profiling.
One 'dummy' event is added by SPE profiling but it doesn't have PHYS_ADDR
attribute set, perf script then exits with error.
Now referring to 'addr', use evsel__do_check_stype() to check the type.
Before:
# perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\
store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
# perf script -F pid,tid,addr,phys_addr
Samples for 'dummy:u' event do not have PHYS_ADDR attribute set. Cannot print 'phys_addr' field.
After:
# perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\
store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3
# perf script -F pid,tid,addr,phys_addr
4064384/4064384 ffff802f921be0d0 2f921be0d0
4064384/4064384 ffff802f921be0d0 2f921be0d0
Reviewed-by: German Gomez <german.gomez@arm.com >
Signed-off-by: Yao Jin <jinyao5@huawei.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Hanjun Guo <guohanjun@huawei.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lore.kernel.org/lkml/20220121065954.2121900-1-liwei391@huawei.com
Signed-off-by: Wei Li <liwei391@huawei.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2022-01-22 17:02:08 -03:00