5.4.229-rc1 review
Subsystems (8)
Greg Kroah-Hartman
maintainercover 5.4.229-rc1 review
This is the start of the stable review cycle for the 5.4.229 release. There are 658 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 18 Jan 2023 15:47:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.229-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.229-rc1
Xin Long <[email protected]>
tipc: call tipc_lxc_xmit without holding node_read_lock
Heming Zhao <[email protected]>
ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown
Mahesh Salgaonkar <[email protected]>
pseries/eeh: Fix the kdump kernel crash during eeh_pseries_init
Hoang Le <[email protected]>
tipc: Add a missing case of TIPC_DIRECT_MSG type
Dmitry Osipenko <[email protected]>
tty: serial: tegra: Handle RX transfer in PIO mode if DMA wasn't started
Tuong Lien <[email protected]>
tipc: fix use-after-free in tipc_disc_rcv()
Ferry Toth <[email protected]>
Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout"
Aaron Thompson <[email protected]>
mm: Always release pages to the buddy allocator in memblock_free_late().
Johan Hovold <[email protected]>
efi: fix NULL-deref in init error path
Mark Rutland <[email protected]>
arm64: cmpxchg_double*: hazard against entire exchange variable
Mark Rutland <[email protected]>
arm64: atomics: remove LL/SC trampolines
Mark Rutland <[email protected]>
arm64: atomics: format whitespace consistently
Rob Clark <[email protected]>
drm/virtio: Fix GEM handle creation UAF
Peter Newman <[email protected]>
x86/resctrl: Fix task CLOSID/RMID update race
Reinette Chatre <[email protected]>
x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI
Christophe JAILLET <[email protected]>
iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe()
Yong Wu <[email protected]>
iommu/mediatek-v1: Add error handle for mtk_iommu_probe
Rahul Rameshbabu <[email protected]>
net/mlx5: Fix ptp max frequency adjustment range
Eran Ben Elisha <[email protected]>
net/mlx5: Rename ptp clock info
Ido Schimmel <[email protected]>
net/sched: act_mpls: Fix warning during failed attribute validation
Minsuk Kang <[email protected]>
nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()
Roger Pau Monne <[email protected]>
hvc/xen: lock console list traversal
Tung Nguyen <[email protected]>
tipc: fix unexpected link reset due to discovery messages
Hoang Le <[email protected]>
tipc: eliminate checking netns if node established
Hoang Le <[email protected]>
tipc: improve throughput between nodes in netns
Ricardo Ribalda <[email protected]>
regulator: da9211: Use irq handler when ready
Eliav Farber <[email protected]>
EDAC/device: Fix period calculation in edac_device_reset_delay_period()
Peter Zijlstra <[email protected]>
x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
Kajol Jain <[email protected]>
powerpc/imc-pmu: Fix use of mutex in IRQs disabled section
Gavrilov Ilia <[email protected]>
netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
Ye Bin <[email protected]>
ext4: fix uninititialized value in 'ext4_evict_inode'
Baokun Li <[email protected]>
ext4: fix use-after-free in ext4_orphan_cleanup
zhengliang <[email protected]>
ext4: lost matching-pair of trace in ext4_truncate
Baokun Li <[email protected]>
ext4: fix bug_on in __es_tree_search caused by bad quota inode
Jan Kara <[email protected]>
quota: Factor out setup of quota inode
Bixuan Cui <[email protected]>
jbd2: use the correct print format
Jan Kara <[email protected]>
jbd2: Factor out common parts of stopping and restarting a handle
Jan Kara <[email protected]>
jbd2: Drop pointless wakeup from jbd2_journal_stop()
Jan Kara <[email protected]>
jbd2: Reorganize jbd2_journal_stop()
Jan Kara <[email protected]>
ocfs2: Use accessor function for h_buffer_credits
Jan Kara <[email protected]>
ext4, jbd2: Provide accessor function for handle credits
Jan Kara <[email protected]>
ext4: Provide function to handle transaction restarts
Ferry Toth <[email protected]>
usb: ulpi: defer ulpi_register on ulpi_read_id timeout
Michael Walle <[email protected]>
wifi: wilc1000: sdio: fix module autoloading
Herbert Xu <[email protected]>
ipv6: raw: Deduct extension header length in rawv6_push_pending_frames
Yang Yingliang <[email protected]>
ixgbe: fix pci device refcount leak
Hans de Goede <[email protected]>
platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
Konrad Dybcio <[email protected]>
drm/msm/adreno: Make adreno quirks not overwrite each other
Volker Lendecke <[email protected]>
cifs: Fix uninitialized memory read for smb311 posix symlink create
Adrian Chan <[email protected]>
ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
Clement Lecigne <[email protected]>
ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
Paolo Abeni <[email protected]>
net/ulp: prevent ULP without clone op from entering the LISTEN status
Heiko Carstens <[email protected]>
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
Alexander Egorenkov <[email protected]>
s390/kexec: fix ipl report address for kdump
Adrian Hunter <[email protected]>
perf auxtrace: Fix address filter duplicate symbol selection
Jonathan Corbet <[email protected]>
docs: Fix the docs build with Sphinx 6.0
Ard Biesheuvel <[email protected]>
efi: tpm: Avoid READ_ONCE() for accessing the event log
Marc Zyngier <[email protected]>
KVM: arm64: Fix S1PTW handling on RO memslots
Frederick Lawler <[email protected]>
net: sched: disallow noqueue for qdisc classes
Isaac J. Manjarres <[email protected]>
driver core: Fix bus_type.match() error handling in __driver_attach()
Muhammad Usama Anjum <[email protected]>
selftests: set the BUILD variable to absolute path
Shuah Khan <[email protected]>
selftests: Fix kselftest O=objdir build from cluttering top level objdir
Helge Deller <[email protected]>
parisc: Align parisc MADV_XXX constants with all other architectures
Jan Kara <[email protected]>
mbcache: Avoid nesting of cache->c_list_lock under bit locks
Linus Torvalds <[email protected]>
hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
Arnd Bergmann <[email protected]>
hfs/hfsplus: use WARN_ON for sanity check
Eric Biggers <[email protected]>
ext4: don't allow journal inode to have encrypt flag
Ben Dooks <[email protected]>
riscv: uaccess: fix type of 0 variable on error in get_user()
Jeff Layton <[email protected]>
nfsd: fix handling of readdir in v4root vs. mount upcall timeout
Rodrigo Branco <[email protected]>
x86/bugs: Flush IBP in ib_prctl_set()
Hans de Goede <[email protected]>
ASoC: Intel: bytcr_rt5640: Add quirk for the Advantech MICA-071 tablet
Jan Kara <[email protected]>
udf: Fix extension of the last extent in the file
Zhengchao Shao <[email protected]>
caif: fix memory leak in cfctrl_linkup_request()
Dan Carpenter <[email protected]>
drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
Szymon Heidrich <[email protected]>
usb: rndis_host: Secure rndis_query check against int overflow
Daniil Tatianin <[email protected]>
drivers/net/bonding/bond_3ad: return when there's no aggregator
Miaoqian Lin <[email protected]>
perf tools: Fix resources leak in perf_data__open_dir()
Jamal Hadi Salim <[email protected]>
net: sched: cbq: dont intepret cls results when asked to drop
Jamal Hadi Salim <[email protected]>
net: sched: atm: dont intepret cls results when asked to drop
Maor Gottlieb <[email protected]>
RDMA/mlx5: Fix validation of max_rd_atomic caps for DC
Leon Romanovsky <[email protected]>
RDMA/uverbs: Silence shiftTooManyBitsSigned warning
Miaoqian Lin <[email protected]>
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
Jiguang Xiao <[email protected]>
net: amd-xgbe: add missed tasklet_kill
Stefano Garzarella <[email protected]>
vhost: fix range used in translate_desc()
Miaoqian Lin <[email protected]>
nfc: Fix potential resource leaks
Daniil Tatianin <[email protected]>
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
Hawkins Jiawei <[email protected]>
net: sched: fix memory leak in tcindex_set_parms
Jie Wang <[email protected]>
net: hns3: add interrupts re-initialization while doing VF FLR
Jeff Layton <[email protected]>
nfsd: shut down the NFSv4 state objects before the filecache
Jakub Kicinski <[email protected]>
bpf: pull before calling skb_postpull_rcsum()
minoura makoto <[email protected]>
SUNRPC: ensure the matching upcall is in-flight upon downcall
Jan Kara <[email protected]>
ext4: fix deadlock due to mbcache entry corruption
Jan Kara <[email protected]>
mbcache: automatically delete entries from cache on freeing
Jan Kara <[email protected]>
ext4: fix race when reusing xattr blocks
Jan Kara <[email protected]>
ext4: unindent codeblock in ext4_xattr_block_set()
Jan Kara <[email protected]>
ext4: remove EA inode entry from mbcache on inode eviction
Jan Kara <[email protected]>
mbcache: add functions to delete entry if unused
Jan Kara <[email protected]>
mbcache: don't reclaim used entries
Shuqi Zhang <[email protected]>
ext4: use kmemdup() to replace kmalloc + memcpy
Alexander Potapenko <[email protected]>
fs: ext4: initialize fsdata in pagecache_write()
Chaitanya Kulkarni <[email protected]>
ext4: use memcpy_to_page() in pagecache_write()
Ira Weiny <[email protected]>
mm/highmem: Lift memcpy_[to|from]_page to core
Baokun Li <[email protected]>
ext4: correct inconsistent error msg in nojournal mode
Jason Yan <[email protected]>
ext4: goto right label 'failed_mount3a'
Guo Ren <[email protected]>
riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument
Chen Huang <[email protected]>
riscv/stacktrace: Fix stack output without ra on the stack top
Biju Das <[email protected]>
ravb: Fix "failed to switch device to config mode" message during unbind
Sean Christopherson <[email protected]>
KVM: nVMX: Properly expose ENABLE_USR_WAIT_PAUSE control to L1
Xiaoyao Li <[email protected]>
KVM: VMX: Fix the spelling of CPU_BASED_USE_TSC_OFFSETTING
Xiaoyao Li <[email protected]>
KVM: VMX: Rename NMI_PENDING to NMI_WINDOW
Xiaoyao Li <[email protected]>
KVM: VMX: Rename INTERRUPT_PENDING to INTERRUPT_WINDOW
Andrea Arcangeli <[email protected]>
KVM: retpolines: x86: eliminate retpoline from vmx.c exit handlers
Andrea Arcangeli <[email protected]>
KVM: x86: optimize more exit handlers in vmx.c
Masami Hiramatsu (Google) <[email protected]>
perf probe: Fix to get the DW_AT_decl_file and DW_AT_call_file as unsinged data
Masami Hiramatsu (Google) <[email protected]>
perf probe: Use dwarf_attr_integrate as generic DWARF attr accessor
Luo Meng <[email protected]>
dm thin: resume even if in FAIL mode
Smitha T Murthy <[email protected]>
media: s5p-mfc: Fix in register read and write for H264
Smitha T Murthy <[email protected]>
media: s5p-mfc: Clear workbit to handle error condition
Smitha T Murthy <[email protected]>
media: s5p-mfc: Fix to handle reference queue during finishing
Kant Fan <[email protected]>
PM/devfreq: governor: Add a private governor_data for governor
Sasha Levin <[email protected]>
btrfs: replace strncpy() with strscpy()
Alex Deucher <[email protected]>
drm/amdgpu: make display pinning more flexible (v2)
Ye Bin <[email protected]>
ext4: allocate extended attribute value in vmalloc area
Jan Kara <[email protected]>
ext4: avoid unaccounted block allocation when expanding inode
Jan Kara <[email protected]>
ext4: initialize quota before expanding inode in setproject ioctl
Ye Bin <[email protected]>
ext4: fix inode leak in ext4_xattr_inode_create() on an error path
Jan Kara <[email protected]>
ext4: avoid BUG_ON when creating xattrs
Luís Henriques <[email protected]>
ext4: fix error code return to user-space in ext4_get_branch()
Baokun Li <[email protected]>
ext4: fix corruption when online resizing a 1K bigalloc fs
Eric Whitney <[email protected]>
ext4: fix delayed allocation bug in ext4_clu_mapped for bigalloc + inline
Ye Bin <[email protected]>
ext4: init quota for 'old.inode' in 'ext4_rename'
Baokun Li <[email protected]>
ext4: fix bug_on in __es_tree_search caused by bad boot loader inode
Ye Bin <[email protected]>
ext4: fix reserved cluster accounting in __es_remove_extent()
Baokun Li <[email protected]>
ext4: add helper to check quota inums
Baokun Li <[email protected]>
ext4: add EXT4_IGET_BAD flag to prevent unexpected bad inode
Gaosheng Cui <[email protected]>
ext4: fix undefined behavior in bit shift for ext4_check_flag_values
Baokun Li <[email protected]>
ext4: add inode table check in __ext4_get_inode_loc to aovid possible infinite loop
Zack Rusin <[email protected]>
drm/vmwgfx: Validate the box size for the snooped cursor
Simon Ser <[email protected]>
drm/connector: send hotplug uevent on connector cleanup
Wang Weiyang <[email protected]>
device_cgroup: Roll back to original exceptions after copy failure
Shang XiaoJing <[email protected]>
parisc: led: Fix potential null-ptr-deref in start_task()
Kim Phillips <[email protected]>
iommu/amd: Fix ivrs_acpihid cmdline parsing code
Corentin Labbe <[email protected]>
crypto: n2 - add missing hash statesize
Sascha Hauer <[email protected]>
PCI/sysfs: Fix double free in error path
Michael S. Tsirkin <[email protected]>
PCI: Fix pci_device_is_present() for VFs by checking PF
Dan Carpenter <[email protected]>
ipmi: fix use after free in _ipmi_destroy_user()
Huaxin Lu <[email protected]>
ima: Fix a potential NULL pointer access in ima_restore_measurement_list
Alexander Sverdlin <[email protected]>
mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type()
Zhang Yuchen <[email protected]>
ipmi: fix long wait in unload when IPMI disconnect
Aditya Garg <[email protected]>
efi: Add iMac Pro 2017 to uefi skip cert quirk
Florian-Ewald Mueller <[email protected]>
md/bitmap: Fix bitmap chunk size overflow issues
Steve French <[email protected]>
cifs: fix missing display of three mount options
Paulo Alcantara <[email protected]>
cifs: fix confusing debug message
Takashi Iwai <[email protected]>
media: dvb-core: Fix UAF due to refcount races at releasing
Keita Suzuki <[email protected]>
media: dvb-core: Fix double free in dvb_register_device()
Nick Desaulniers <[email protected]>
ARM: 9256/1: NWFPE: avoid compiler-generated __aeabi_uldivmod
Yang Jihong <[email protected]>
tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line
Zheng Yejian <[email protected]>
tracing/hist: Fix wrong return value in parse_action_params()
Ashok Raj <[email protected]>
x86/microcode/intel: Do not retry microcode reloading on the APs
Zheng Yejian <[email protected]>
tracing/hist: Fix out-of-bound write on 'action_data.var_ref_idx'
Mike Snitzer <[email protected]>
dm cache: set needs_check flag after aborting metadata
Luo Meng <[email protected]>
dm cache: Fix UAF in destroy()
Luo Meng <[email protected]>
dm clone: Fix UAF in clone_dtr()
Luo Meng <[email protected]>
dm integrity: Fix UAF in dm_integrity_dtr()
Luo Meng <[email protected]>
dm thin: Fix UAF in run_timer_softirq()
Zhihao Cheng <[email protected]>
dm thin: Use last transaction's pmd->root when commit failed
Zhihao Cheng <[email protected]>
dm thin: Fix ABBA deadlock between shrink_slab and dm_pool_abort_metadata
Mike Snitzer <[email protected]>
dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort
Wang Yufen <[email protected]>
binfmt: Fix error return code in load_elf_fdpic_binary()
Eric W. Biederman <[email protected]>
binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf
Yongqiang Liu <[email protected]>
cpufreq: Init completion before kobject_init_and_add()
Mickaël Salaün <[email protected]>
selftests: Use optional USERCFLAGS and USERLDFLAGS
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm850-lenovo-yoga-c630: correct I2C12 pins drive strength
Jason A. Donenfeld <[email protected]>
ARM: ux500: do not directly dereference __iomem
Boris Burkov <[email protected]>
btrfs: fix resolving backrefs for inline extent followed by prealloc
Wenchao Chen <[email protected]>
mmc: sdhci-sprd: Disable CLK_AUTO when the clock is less than 400K
Steven Rostedt <[email protected]>
ktest.pl minconfig: Unset configs instead of just removing them
Steven Rostedt <[email protected]>
kest.pl: Fix grub2 menu handling for rebooting
Manivannan Sadhasivam <[email protected]>
soc: qcom: Select REMAP_MMIO for LLCC driver
Jason A. Donenfeld <[email protected]>
media: stv0288: use explicitly signed char
Eric Dumazet <[email protected]>
net/af_packet: make sure to pull mac header
Hangbin Liu <[email protected]>
net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO
Chuck Lever <[email protected]>
SUNRPC: Don't leak netobj memory when gss_read_proxy_verf() fails
Hanjun Guo <[email protected]>
tpm: tpm_tis: Add the missed acpi_put_table() to fix memory leak
Hanjun Guo <[email protected]>
tpm: tpm_crb: Add the missed acpi_put_table() to fix memory leak
Deren Wu <[email protected]>
mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING
Pavel Machek <[email protected]>
f2fs: should put a page when checking the summary info
NARIBAYASHI Akira <[email protected]>
mm, compaction: fix fast_isolate_around() to stay within boundaries
Mikulas Patocka <[email protected]>
md: fix a crash in mempool_free
Christian Brauner <[email protected]>
pnode: terminate at peers of source
Artem Egorkine <[email protected]>
ALSA: line6: fix stack overflow in line6_midi_transmit
Artem Egorkine <[email protected]>
ALSA: line6: correct midi status byte when receiving data from podxt
Zhang Tianci <[email protected]>
ovl: Use ovl mounter's fsuid and fsgid in ovl_link()
Aditya Garg <[email protected]>
hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount
Terry Junge <[email protected]>
HID: plantronics: Additional PIDs for double volume key presses quirk
José Expósito <[email protected]>
HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint
Nathan Lynch <[email protected]>
powerpc/rtas: avoid scheduling in rtas_os_term()
Nathan Lynch <[email protected]>
powerpc/rtas: avoid device tree lookups in rtas_os_term()
Christophe Leroy <[email protected]>
objtool: Fix SEGFAULT
Christoph Hellwig <[email protected]>
nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
Revanth Rajashekar <[email protected]>
nvme: resync include/linux/nvme.h with nvmecli
Adam Vodopjan <[email protected]>
ata: ahci: Fix PCS quirk application for suspend
Baolin Wang <[email protected]>
nvme-pci: use the consistent return type of nvme_pci_iod_alloc_size()
Baolin Wang <[email protected]>
nvme-pci: add a blank line after declarations
Klaus Jensen <[email protected]>
nvme-pci: fix doorbell buffer value endianness
Paulo Alcantara <[email protected]>
cifs: fix oops during encryption
Lin Ma <[email protected]>
media: dvbdev: fix refcnt bug
Lin Ma <[email protected]>
media: dvbdev: fix build warning due to comments
Rickard x Andersson <[email protected]>
gcov: add support for checksum field
Johan Hovold <[email protected]>
regulator: core: fix deadlock on regulator enable
Rasmus Villemoes <[email protected]>
iio: adc128s052: add proper .data members in adc128_of_match table
Nuno Sá <[email protected]>
iio: adc: ad_sigma_delta: do not use internal iio_dev lock
Roberto Sassu <[email protected]>
reiserfs: Add missing calls to reiserfs_security_free()
Jason Gerecke <[email protected]>
HID: wacom: Ensure bootloader PID is usable in hidraw mode
Ferry Toth <[email protected]>
usb: dwc3: core: defer probe on ulpi_read_id timeout
Jiao Zhou <[email protected]>
ALSA: hda/hdmi: Add HP Device 0x8711 to force connect list
Edward Pacman <[email protected]>
ALSA: hda/realtek: Add quirk for Lenovo TianYi510Pro-14IOB
John Stultz <[email protected]>
pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
Yang Jihong <[email protected]>
perf debug: Set debug_peo_args and redirect_to_stderr variable to correct values in perf_quiet_option()
John Stultz <[email protected]>
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
Hans de Goede <[email protected]>
ASoC: rt5670: Remove unbalanced pm_runtime_put()
Wang Jingjin <[email protected]>
ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
Marek Szyprowski <[email protected]>
ASoC: wm8994: Fix potential deadlock
Wang Jingjin <[email protected]>
ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in rockchip_pdm_runtime_resume()
Wang Yufen <[email protected]>
ASoC: audio-graph-card: fix refcount leak of cpu_ep in __graph_for_each_link()
Wang Yufen <[email protected]>
ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe()
Cezary Rojewski <[email protected]>
ASoC: Intel: Skylake: Fix driver hang during shutdown
Pierre-Louis Bossart <[email protected]>
ALSA: hda: add snd_hdac_stop_streams() helper
Pierre-Louis Bossart <[email protected]>
ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to hdac_stream.c
Zhang Xiaoxu <[email protected]>
orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()
Zhang Xiaoxu <[email protected]>
orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string()
Nathan Chancellor <[email protected]>
drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
Nathan Chancellor <[email protected]>
drm/fsl-dcu: Fix return type of fsl_dcu_drm_connector_mode_valid()
Hawkins Jiawei <[email protected]>
hugetlbfs: fix null-ptr-deref in hugetlbfs_parse_param()
Xiu Jianfeng <[email protected]>
clk: st: Fix memory leak in st_of_quadfs_setup()
Shigeru Yoshida <[email protected]>
media: si470x: Fix use-after-free in si470x_int_in_callback()
Kunihiko Hayashi <[email protected]>
mmc: f-sdh30: Add quirks for broken timeout clock capability
Rui Zhang <[email protected]>
regulator: core: fix use_count leakage when handling boot-on
Ye Bin <[email protected]>
blk-mq: fix possible memleak when register 'hctx' failed
Mazin Al Haddad <[email protected]>
media: dvb-usb: fix memory leak in dvb_usb_adapter_init()
Lin Ma <[email protected]>
media: dvbdev: adopts refcnt to avoid UAF
Yan Lei <[email protected]>
media: dvb-frontends: fix leak of memory fw
Stanislav Fomichev <[email protected]>
bpf: Prevent decl_tag from being referenced in func_proto arg
Stanislav Fomichev <[email protected]>
ppp: associate skb with a device at tx
Schspa Shi <[email protected]>
mrp: introduce active flags to prevent UAF when applicant uninit
Eric Dumazet <[email protected]>
net: add atomic_long_t to net_device_stats fields
Jiang Li <[email protected]>
md/raid1: stop mdx_raid1 thread when raid1 array run failed
Li Zhong <[email protected]>
drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()
Ville Syrjälä <[email protected]>
drm/sti: Use drm_mode_copy()
Ville Syrjälä <[email protected]>
drm/rockchip: Use drm_mode_copy()
Nathan Chancellor <[email protected]>
s390/lcs: Fix return type of lcs_start_xmit()
Nathan Chancellor <[email protected]>
s390/netiucv: Fix return type of netiucv_tx()
Nathan Chancellor <[email protected]>
s390/ctcm: Fix return type of ctc{mp,}m_tx()
Kees Cook <[email protected]>
igb: Do not free q_vector unless new one was allocated
Minsuk Kang <[email protected]>
wifi: brcmfmac: Fix potential shift-out-of-bounds in brcmf_fw_alloc_request()
Nathan Chancellor <[email protected]>
hamradio: baycom_epp: Fix return type of baycom_send_packet()
Nathan Chancellor <[email protected]>
net: ethernet: ti: Fix return type of netcp_ndo_start_xmit()
Stanislav Fomichev <[email protected]>
bpf: make sure skb->len != 0 when redirecting to a tunneling device
Zhang Yuchen <[email protected]>
ipmi: fix memleak when unload ipmi driver
Amadeusz Sławiński <[email protected]>
ASoC: codecs: rt298: Add quirk for KBL-R RVP platform
Shigeru Yoshida <[email protected]>
wifi: ar5523: Fix use-after-free on ar5523_cmd() timed out
Fedor Pchelkin <[email protected]>
wifi: ath9k: verify the expected usb_endpoints are present
Wright Feng <[email protected]>
brcmfmac: return error when getting invalid max_flowrings from dongle
Doug Brown <[email protected]>
drm/etnaviv: add missing quirks for GC300
ZhangPeng <[email protected]>
hfs: fix OOB Read in __hfs_brec_find
Zheng Yejian <[email protected]>
acct: fix potential integer overflow in encode_comp_t()
Ryusuke Konishi <[email protected]>
nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
Rafael J. Wysocki <[email protected]>
ACPICA: Fix error code path in acpi_ds_call_control_method()
Hoi Pok Wu <[email protected]>
fs: jfs: fix shift-out-of-bounds in dbDiscardAG
Shigeru Yoshida <[email protected]>
udf: Avoid double brelse() in udf_rename()
Dongliang Mu <[email protected]>
fs: jfs: fix shift-out-of-bounds in dbAllocAG
Liu Shixin <[email protected]>
binfmt_misc: fix shift-out-of-bounds in check_special_flags
Zqiang <[email protected]>
rcu: Fix __this_cpu_read() lockdep warning in rcu_force_quiescent_state()
Eric Dumazet <[email protected]>
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Christophe JAILLET <[email protected]>
myri10ge: Fix an error handling path in myri10ge_probe()
David Howells <[email protected]>
rxrpc: Fix missing unlock in rxrpc_do_sendmsg()
Cong Wang <[email protected]>
net_sched: reject TCF_EM_SIMPLE case for complex ematch module
Yang Yingliang <[email protected]>
mailbox: zynq-ipi: fix error handling while device_register() fails
Subash Abhinov Kasiviswanathan <[email protected]>
skbuff: Account for tail adjustment during pull operations
Eelco Chaudron <[email protected]>
openvswitch: Fix flow lookup to use unmasked key
GUO Zihua <[email protected]>
rtc: mxc_v2: Add missing clk_disable_unprepare()
Li Zetao <[email protected]>
r6040: Fix kmemleak in probe and remove
Minsuk Kang <[email protected]>
nfc: pn533: Clear nfc_target before being used
Yang Yingliang <[email protected]>
mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
mISDN: hfcpci: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
mISDN: hfcsusb: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
Dan Aloni <[email protected]>
nfsd: under NFSv4.1, fix double svc_xprt_put on rpc_create failure
Chuck Lever <[email protected]>
NFSD: Add tracepoints to NFSD's duplicate reply cache
Trond Myklebust <[email protected]>
nfsd: Define the file access mode enum for tracing
Gaosheng Cui <[email protected]>
rtc: pic32: Move devm_rtc_allocate_device earlier in pic32_rtc_probe()
Gaosheng Cui <[email protected]>
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
Nathan Lynch <[email protected]>
powerpc/pseries/eeh: use correct API for error log size
Haowen Bai <[email protected]>
powerpc/eeh: Drop redundant spinlock initialization
Oliver O'Halloran <[email protected]>
powerpc/pseries: Stop using eeh_ops->init()
Wen Xiong <[email protected]>
powerpc/pseries: PCIE PHB reset
Sam Bobroff <[email protected]>
powerpc/eeh: Fix pseries_eeh_configure_bridge()
Yuan Can <[email protected]>
remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region()
Gaosheng Cui <[email protected]>
remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()
Uwe Kleine-König <[email protected]>
pwm: sifive: Call pwm_sifive_update_clock() while mutex is held
Miaoqian Lin <[email protected]>
selftests/powerpc: Fix resource leaks
Kajol Jain <[email protected]>
powerpc/hv-gpci: Fix hv_gpci event list
Yang Yingliang <[email protected]>
powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()
Nicholas Piggin <[email protected]>
powerpc/perf: callchain validate kernel stack pointer bounds
Yang Yingliang <[email protected]>
powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data()
Miaoqian Lin <[email protected]>
cxl: Fix refcount leak in cxl_calc_capp_routing
Christophe JAILLET <[email protected]>
powerpc/52xx: Fix a resource leak in an error handling path
Xie Shaowen <[email protected]>
macintosh/macio-adb: check the return value of ioremap()
Yang Yingliang <[email protected]>
macintosh: fix possible memory leak in macio_add_one_device()
Yuan Can <[email protected]>
iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
Yang Yingliang <[email protected]>
iommu/amd: Fix pci device refcount leak in ppr_notifier()
Alexander Stein <[email protected]>
rtc: pcf85063: Fix reading alarm
Stefan Eichenberger <[email protected]>
rtc: snvs: Allow a time difference on clock register read
Rafael J. Wysocki <[email protected]>
rtc: cmos: Disable ACPI RTC event on removal
Rafael J. Wysocki <[email protected]>
rtc: cmos: Rename ACPI-related functions
Rafael J. Wysocki <[email protected]>
rtc: cmos: Eliminate forward declarations of some functions
Rafael J. Wysocki <[email protected]>
rtc: cmos: Call rtc_wake_setup() from cmos_do_probe()
Rafael J. Wysocki <[email protected]>
rtc: cmos: Call cmos_wake_setup() from cmos_do_probe()
Alexandre Belloni <[email protected]>
rtc: cmos: fix build on non-ACPI platforms
Rafael J. Wysocki <[email protected]>
rtc: cmos: Fix wake alarm breakage
Rafael J. Wysocki <[email protected]>
rtc: cmos: Fix event handler registration ordering issue
Rafael J. Wysocki <[email protected]>
rtc: rtc-cmos: Do not check ACPI_FADT_LOW_POWER_S0
Andy Shevchenko <[email protected]>
rtc: cmos: Refactor code by using the new dmi_get_bios_year() helper
Matt Redfearn <[email protected]>
include/uapi/linux/swab: Fix potentially missing __always_inline
Arnd Bergmann <[email protected]>
RDMA/siw: Fix pointer cast warning
ruanjinjie <[email protected]>
power: supply: fix null pointer dereferencing in power_supply_get_battery_info
Yuan Can <[email protected]>
HSI: omap_ssi_core: Fix error handling in ssi_init()
Ajay Kaher <[email protected]>
perf symbol: correction while adjusting symbol
Leo Yan <[email protected]>
perf trace: Handle failure when trace point folder is missed
Leo Yan <[email protected]>
perf trace: Use macro RAW_SYSCALL_ARGS_NUM to replace number
Arnaldo Carvalho de Melo <[email protected]>
perf trace: Add a strtoul() method to 'struct syscall_arg_fmt'
Arnaldo Carvalho de Melo <[email protected]>
perf trace: Allow associating scnprintf routines with well known arg names
Arnaldo Carvalho de Melo <[email protected]>
perf trace: Add the syscall_arg_fmt pointer to syscall_arg
Arnaldo Carvalho de Melo <[email protected]>
perf trace: Factor out the initialization of syscal_arg_fmt->scnprintf
Arnaldo Carvalho de Melo <[email protected]>
perf trace: Separate 'struct syscall_fmt' definition from syscall_fmts variable
Leo Yan <[email protected]>
perf trace: Return error if a system call doesn't exist
Zeng Heng <[email protected]>
power: supply: fix residue sysfs file in error handle route of __power_supply_register()
Yang Yingliang <[email protected]>
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
Yang Yingliang <[email protected]>
HSI: omap_ssi_core: fix unbalanced pm_runtime_disable()
Christophe JAILLET <[email protected]>
fbdev: uvesafb: Fixes an error handling path in uvesafb_probe()
Xiongfeng Wang <[email protected]>
fbdev: vermilion: decrease reference count in error path
Shang XiaoJing <[email protected]>
fbdev: via: Fix error in via_core_init()
Yang Yingliang <[email protected]>
fbdev: pm2fb: fix missing pci_disable_device()
Andy Shevchenko <[email protected]>
fbdev: ssd1307fb: Drop optional dependency
Shang XiaoJing <[email protected]>
samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
Zheng Yejian <[email protected]>
tracing/hist: Fix issue of losting command info in error_log
Jiasheng Jiang <[email protected]>
usb: storage: Add check for kcalloc
Zheyu Ma <[email protected]>
i2c: ismt: Fix an out-of-bounds bug in ismt_access()
Yang Yingliang <[email protected]>
i2c: mux: reg: check return value after calling platform_get_resource()
Dejin Zheng <[email protected]>
drivers: provide devm_platform_get_and_ioremap_resource()
Chen Zhongjin <[email protected]>
vme: Fix error not catched in fake_init()
YueHaibing <[email protected]>
staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
Dan Carpenter <[email protected]>
staging: rtl8192u: Fix use after free in ieee80211_rx()
Hui Tang <[email protected]>
i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
Yang Yingliang <[email protected]>
chardev: fix error handling in cdev_device_add()
Yang Yingliang <[email protected]>
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
Zhengchao Shao <[email protected]>
drivers: mcb: fix resource leak in mcb_probe()
John Keeping <[email protected]>
usb: gadget: f_hid: fix refcount leak on error path
John Keeping <[email protected]>
usb: gadget: f_hid: fix f_hidg lifetime vs cdev
Maxim Devaev <[email protected]>
usb: gadget: f_hid: optional SETUP/SET_REPORT mode
Yang Yingliang <[email protected]>
usb: roles: fix of node refcount leak in usb_role_switch_is_parent()
Fabrice Gasnier <[email protected]>
counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update
Yang Yingliang <[email protected]>
cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()
Yang Yingliang <[email protected]>
cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
Zheng Wang <[email protected]>
misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
ruanjinjie <[email protected]>
misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
Yang Yingliang <[email protected]>
misc: ocxl: fix possible name leak in ocxl_file_register_afu()
Zhengchao Shao <[email protected]>
test_firmware: fix memory leak in test_firmware_init()
Yuan Can <[email protected]>
serial: sunsab: Fix error handling in sunsab_init()
Gabriel Somlo <[email protected]>
serial: altera_uart: fix locking in polling mode
Jiri Slaby <[email protected]>
tty: serial: altera_uart_{r,t}x_chars() need only uart_port
Jiri Slaby <[email protected]>
tty: serial: clean up stop-tx part in altera_uart_tx_chars()
Xiongfeng Wang <[email protected]>
serial: pch: Fix PCI device refcount leak in pch_request_dma()
delisun <[email protected]>
serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle.
Jiamei Xie <[email protected]>
serial: amba-pl011: avoid SBSA UART accessing DMACR register
Yang Yingliang <[email protected]>
usb: typec: tcpci: fix of node refcount leak in tcpci_register_port()
Sven Peter <[email protected]>
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
Gaosheng Cui <[email protected]>
staging: vme_user: Fix possible UAF in tsi148_dma_list_add
Linus Walleij <[email protected]>
usb: fotg210-udc: Fix ages old endianness issues
Rafael Mendonca <[email protected]>
uio: uio_dmem_genirq: Fix deadlock between irq config and handling
Rafael Mendonca <[email protected]>
uio: uio_dmem_genirq: Fix missing unlock in irq configuration
Rafael Mendonca <[email protected]>
vfio: platform: Do not pass return buffer to ACPI _RST method
Yang Yingliang <[email protected]>
class: fix possible memory leak in __class_register()
Kartik <[email protected]>
serial: tegra: Read DMA status before terminating
Dmitry Osipenko <[email protected]>
tty: serial: tegra: Activate RX DMA transfer by request
Yang Yingliang <[email protected]>
drivers: dio: fix possible memory leak in dio_init()
Dragos Tatulea <[email protected]>
IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
Xiongfeng Wang <[email protected]>
hwrng: geode - Fix PCI device refcount leak
Xiongfeng Wang <[email protected]>
hwrng: amd - Fix PCI device refcount leak
Gaosheng Cui <[email protected]>
crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
Zhang Xiaoxu <[email protected]>
orangefs: Fix sysfs not cleanup when dev init failed
Wang Yufen <[email protected]>
RDMA/hfi1: Fix error return code in parse_platform_config()
Shang XiaoJing <[email protected]>
crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe()
Yonggil Song <[email protected]>
f2fs: avoid victim selection from previous victim section
Yuan Can <[email protected]>
RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
Gaosheng Cui <[email protected]>
scsi: snic: Fix possible UAF in snic_tgt_create()
Chen Zhongjin <[email protected]>
scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
Shang XiaoJing <[email protected]>
scsi: ipr: Fix WARNING in ipr_init()
Yang Yingliang <[email protected]>
scsi: fcoe: Fix possible name leak when device_register() fails
Yang Yingliang <[email protected]>
scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
Yang Yingliang <[email protected]>
scsi: hpsa: Fix error handling in hpsa_add_sas_host()
Yang Yingliang <[email protected]>
scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()
Zhang Yiqun <[email protected]>
crypto: tcrypt - Fix multibuffer skcipher speed test mem leak
Yuan Can <[email protected]>
scsi: hpsa: Fix possible memory leak in hpsa_init_one()
Zhang Xiaoxu <[email protected]>
RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed
Uwe Kleine-König <[email protected]>
crypto: ccree - Make cc_debugfs_global_fini() available for module init function
Xiongfeng Wang <[email protected]>
RDMA/hfi: Decrease PCI device reference count in error path
Zeng Heng <[email protected]>
PCI: Check for alloc failure in pci_request_irq()
Gaosheng Cui <[email protected]>
crypto: ccree - Remove debugfs when platform_driver_register failed
Geert Uytterhoeven <[email protected]>
crypto: ccree - swap SHA384 and SHA512 larval hashes at build time
Harshit Mogalapalli <[email protected]>
scsi: scsi_debug: Fix a warning in resp_write_scat()
Bernard Metzler <[email protected]>
RDMA/siw: Set defined status for work completion with undefined status
Mark Zhang <[email protected]>
RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port
Bernard Metzler <[email protected]>
RDMA/siw: Fix immediate work request flush to completion queue
Dongdong Zhang <[email protected]>
f2fs: fix normal discard process
Leon Romanovsky <[email protected]>
RDMA/core: Fix order of nldev_exit call
Xiu Jianfeng <[email protected]>
apparmor: Use pointer to struct aa_label for lbs_cred
John Johansen <[email protected]>
apparmor: Fix abi check to include v8 abi
John Johansen <[email protected]>
apparmor: fix lockdep warning when removing a namespace
Gaosheng Cui <[email protected]>
apparmor: fix a memleak in multi_transaction_new()
Piergiorgio Beruto <[email protected]>
stmmac: fix potential division by 0
Yang Yingliang <[email protected]>
Bluetooth: RFCOMM: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_core: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_h5: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_ll: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
Bluetooth: btusb: don't call kfree_skb() under spin_lock_irqsave()
Eric Pilmore <[email protected]>
ntb_netdev: Use dev_kfree_skb_any() in interrupt context
Jerry Ray <[email protected]>
net: lan9303: Fix read error execution path
Markus Schneider-Pargmann <[email protected]>
can: tcan4x5x: Remove invalid write in clear_interrupts
Tom Lendacky <[email protected]>
net: amd-xgbe: Check only the minimum speed for active/passive cables
Tom Lendacky <[email protected]>
net: amd-xgbe: Fix logic around active and passive cables
Yang Yingliang <[email protected]>
net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
hamradio: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: emaclite: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave()
Yang Yingliang <[email protected]>
net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave()
Hangbin Liu <[email protected]>
net/tunnel: wait until all sk_user_data reader finish before releasing the sock
Li Zetao <[email protected]>
net: farsync: Fix kmemleak when rmmods farsync
Yang Yingliang <[email protected]>
ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave()
ruanjinjie <[email protected]>
of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop()
Yuan Can <[email protected]>
drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
Zhang Changzhong <[email protected]>
net: stmmac: selftests: fix potential memleak in stmmac_test_arpoffload()
Yongqiang Liu <[email protected]>
net: defxx: Fix missing err handling in dfx_init()
Artem Chernyshev <[email protected]>
net: vmw_vsock: vmci: Check memcpy_from_msg()
Xiu Jianfeng <[email protected]>
clk: socfpga: Fix memory leak in socfpga_gate_init()
Dinh Nguyen <[email protected]>
clk: socfpga: use clk_hw_register for a5/c5
Lee Jones <[email protected]>
clk: socfpga: clk-pll: Remove unused variable 'rc'
Yang Jihong <[email protected]>
blktrace: Fix output non-blktrace event when blk_classic option enabled
Wang Yufen <[email protected]>
wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Add __packed to struct rtl8723bu_c2h
Kris Bahnsen <[email protected]>
spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode
Xiu Jianfeng <[email protected]>
clk: samsung: Fix memory leak in _samsung_clk_register_pll()
Jiasheng Jiang <[email protected]>
media: coda: Add check for kmalloc
Jiasheng Jiang <[email protected]>
media: coda: Add check for dcoda_iram_alloc
Liang He <[email protected]>
media: c8sectpfe: Add of_node_put() when breaking out of loop
Yang Yingliang <[email protected]>
mmc: mmci: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: wbsd: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: via-sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: meson-gx: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: omap_hsmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: atmel-mci: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: wmt-sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: vub300: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: toshsd: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: pxamci: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: mxcmmc: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: moxart: fix return value check of mmc_add_host()
Yang Yingliang <[email protected]>
mmc: alcor: fix return value check of mmc_add_host()
Trond Myklebust <[email protected]>
NFSv4.x: Fail client initialisation if state manager thread can't run
Wang ShaoBo <[email protected]>
SUNRPC: Fix missing release socket in rpc_sockname()
Zhang Xiaoxu <[email protected]>
xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
Gaosheng Cui <[email protected]>
ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt
Liu Shixin <[email protected]>
media: saa7164: fix missing pci_disable_device()
Eric Dumazet <[email protected]>
bpf, sockmap: fix race in sock_map_free()
Yang Yingliang <[email protected]>
regulator: core: fix resource leak in regulator_register()
Chen Zhongjin <[email protected]>
configfs: fix possible memory leak in configfs_create_dir()
Sebastian Andrzej Siewior <[email protected]>
hsr: Avoid double remove of a node.
Christian Marangi <[email protected]>
clk: qcom: clk-krait: fix wrong div2 functions
Yang Yingliang <[email protected]>
regulator: core: fix module refcount leak in set_supply()
Chen Zhongjin <[email protected]>
wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails
Zhengchao Shao <[email protected]>
wifi: mac80211: fix memory leak in ieee80211_if_add()
Alexander Sverdlin <[email protected]>
spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE
Dan Carpenter <[email protected]>
bonding: uninitialized variable in bond_miimon_inspect()
Pengcheng Yang <[email protected]>
bpf, sockmap: Fix data loss caused by using apply_bytes on ingress redirect
Pengcheng Yang <[email protected]>
bpf, sockmap: Fix repeated calls to sock_put() when msg has more_data
Florian Westphal <[email protected]>
netfilter: conntrack: set icmpv6 redirects as RELATED
Zhang Qilong <[email protected]>
ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
Xiongfeng Wang <[email protected]>
drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
Xiongfeng Wang <[email protected]>
drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
Ricardo Ribalda <[email protected]>
ASoC: mediatek: mt8173: Enable IRQ when pdata is ready
Ben Greear <[email protected]>
wifi: iwlwifi: mvm: fix double free on tx path.
Liu Shixin <[email protected]>
ALSA: asihpi: fix missing pci_disable_device()
Trond Myklebust <[email protected]>
NFSv4: Fix a deadlock between nfs4_open_recover_helper() and delegreturn
Trond Myklebust <[email protected]>
NFSv4.2: Fix initialisation of struct nfs4_label
Trond Myklebust <[email protected]>
NFSv4.2: Fix a memory stomp in decode_attr_security_label
Trond Myklebust <[email protected]>
NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding
Jiasheng Jiang <[email protected]>
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
Dmitry Torokhov <[email protected]>
ASoC: dt-bindings: wcd9335: fix reset line polarity in example
Zhang Zekun <[email protected]>
drm/tegra: Add missing clk_disable_unprepare() in tegra_dc_probe()
Aakarsh Jain <[email protected]>
media: s5p-mfc: Add variant data for MFC v7 hardware for Exynos 3250 SoC
Baisong Zhong <[email protected]>
media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()
Chen Zhongjin <[email protected]>
media: dvb-core: Fix ignored return value in dvb_register_frontend()
ZhangPeng <[email protected]>
pinctrl: pinconf-generic: add missing of_node_put()
Dario Binacchi <[email protected]>
clk: imx: replace osc_hdmi with dummy
Li Jun <[email protected]>
clk: imx8mn: correct the usb1_ctrl parent to be usb_bus
Gautam Menghani <[email protected]>
media: imon: fix a race condition in send_packet()
Zheng Yongjun <[email protected]>
mtd: maps: pxa2xx-flash: fix memory leak in probe
Jonathan Toppins <[email protected]>
bonding: fix link recovery in mode 2 when updelay is nonzero
Maor Gottlieb <[email protected]>
bonding: Rename slave_arr to usable_slaves
Maor Gottlieb <[email protected]>
bonding: Export skip slave logic to function
Xiu Jianfeng <[email protected]>
clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
Wang ShaoBo <[email protected]>
regulator: core: use kfree_const() to free space conditionally
Baisong Zhong <[email protected]>
ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
Baisong Zhong <[email protected]>
ALSA: pcm: fix undefined behavior in bit shift for SNDRV_PCM_RATE_KNOT
Marcus Folkesson <[email protected]>
HID: hid-sensor-custom: set fixed size for custom attributes
Stanislav Fomichev <[email protected]>
bpf: Move skb->len == 0 checks into __bpf_redirect
Christoph Hellwig <[email protected]>
media: videobuf-dma-contig: use dma_mmap_coherent
Yuan Can <[email protected]>
media: platform: exynos4-is: Fix error handling in fimc_md_init()
Yang Yingliang <[email protected]>
media: solo6x10: fix possible memory leak in solo_sysfs_init()
Douglas Anderson <[email protected]>
Input: elants_i2c - properly handle the reset GPIO when power is off
Hui Tang <[email protected]>
mtd: lpddr2_nvm: Fix possible null-ptr-deref
Xiu Jianfeng <[email protected]>
wifi: ath10k: Fix return value in ath10k_pci_init()
Xiu Jianfeng <[email protected]>
ima: Fix misuse of dereference of pointer in template_desc_init_fields()
GUO Zihua <[email protected]>
integrity: Fix memory leakage in keyring allocation error path
Dan Carpenter <[email protected]>
amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()
Yang Yingliang <[email protected]>
regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
Zeng Heng <[email protected]>
ASoC: pxa: fix null-pointer dereference in filter()
Xinlei Lee <[email protected]>
drm/mediatek: Modify dpi power on/off sequence.
Hanjun Guo <[email protected]>
drm/radeon: Add the missed acpi_put_table() to fix memory leak
David Howells <[email protected]>
rxrpc: Fix ack.bufferSize to be 0 when generating an ack
David Howells <[email protected]>
net, proc: Provide PROC_FS=n fallback for proc_create_net_single_write()
Vladimir Zapolskiy <[email protected]>
media: camss: Clean up received buffers on failed start of streaming
Marek Vasut <[email protected]>
wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
Zhang Xiaoxu <[email protected]>
mtd: Fix device name leak when register device failed in add_mtd_device()
Andrii Nakryiko <[email protected]>
bpf: propagate precision in ALU/ALU64 operations
Liu Shixin <[email protected]>
media: vivid: fix compose size exceed boundary
GUO Zihua <[email protected]>
ima: Handle -ESTALE returned by ima_filter_rule_match()
Gustavo A. R. Silva <[email protected]>
ima: Fix fall-through warnings for Clang
Tyler Hicks <[email protected]>
ima: Rename internal filter rule functions
Marek Vasut <[email protected]>
drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
Jonathan Neuschäfer <[email protected]>
spi: Update reference to struct spi_controller
Marek Vasut <[email protected]>
clk: renesas: r9a06g032: Repair grave increment error
Jimmy Assarsson <[email protected]>
can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming
Jimmy Assarsson <[email protected]>
can: kvaser_usb: Add struct kvaser_usb_busparams
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix bogus restart events
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix wrong CAN state after stopping
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Fix improved state not being reported
Anssi Hannula <[email protected]>
can: kvaser_usb_leaf: Set Warning state even without bus errors
Jimmy Assarsson <[email protected]>
can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
Jimmy Assarsson <[email protected]>
can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event
Jimmy Assarsson <[email protected]>
can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
Vincent Mailhol <[email protected]>
can: kvaser_usb: do not increase tx statistics when sending error message frames
Ricardo Ribalda <[email protected]>
media: i2c: ad5820: Fix error path
Junlin Yang <[email protected]>
pata_ipx4xx_cf: Fix unsigned comparison with less than zero
Bitterblue Smith <[email protected]>
wifi: rtl8xxxu: Fix reading the vendor of combo chips
Fedor Pchelkin <[email protected]>
wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
Fedor Pchelkin <[email protected]>
wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
Cai Xinchen <[email protected]>
rapidio: devices: fix missing put_device in mport_cdev_open
ZhangPeng <[email protected]>
hfs: Fix OOB Write in hfs_asc2mac
Gavrilov Ilia <[email protected]>
relay: fix type mismatch when allocating memory in relay_create_buf()
Zhang Qilong <[email protected]>
eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
Wang Weiyang <[email protected]>
rapidio: fix possible UAF when kfifo_alloc() fails
Chen Zhongjin <[email protected]>
fs: sysv: Fix sysv_nblocks() returns wrong value
Ladislav Michl <[email protected]>
MIPS: OCTEON: warn only once if deprecated link status is being used
Anastasia Belova <[email protected]>
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Yu Liao <[email protected]>
platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
Rafael J. Wysocki <[email protected]>
PM: runtime: Do not call __rpm_callback() from rpm_idle()
Ulf Hansson <[email protected]>
PM: runtime: Improve path in rpm_idle() when no callback
Harshit Mogalapalli <[email protected]>
xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource()
Xiu Jianfeng <[email protected]>
x86/xen: Fix memory leak in xen_init_lock_cpu()
Xiu Jianfeng <[email protected]>
x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
Juergen Gross <[email protected]>
xen/events: only register debug interrupt for 2-level events
Oleg Nesterov <[email protected]>
uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
Li Zetao <[email protected]>
ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
Geert Uytterhoeven <[email protected]>
clocksource/drivers/sh_cmt: Make sure channel clock supply is enabled
Yang Yingliang <[email protected]>
rapidio: rio: fix possible name leak in rio_register_mport()
Yang Yingliang <[email protected]>
rapidio: fix possible name leaks when rio_add_device() fails
Li Zetao <[email protected]>
ocfs2: fix memory leak in ocfs2_mount_volume()
Heming Zhao via Ocfs2-devel <[email protected]>
ocfs2: rewrite error handling of ocfs2_fill_super
Heming Zhao via Ocfs2-devel <[email protected]>
ocfs2: ocfs2_mount_volume does cleanup job before return error
Akinobu Mita <[email protected]>
debugfs: fix error when writing negative value to atomic_t debugfs file
Wolfram Sang <[email protected]>
docs: fault-injection: fix non-working usage of negative values
Akinobu Mita <[email protected]>
lib/notifier-error-inject: fix error when writing -errno to debugfs file
Akinobu Mita <[email protected]>
libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
Xiongfeng Wang <[email protected]>
cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
Yang Yingliang <[email protected]>
genirq/irqdesc: Don't try to remove non-existing sysfs files
Jeff Layton <[email protected]>
nfsd: don't call nfsd_file_put from client states seqfile display
Yang Yingliang <[email protected]>
EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
Shang XiaoJing <[email protected]>
irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
Xiongfeng Wang <[email protected]>
perf/x86/intel/uncore: Fix reference count leak in hswep_has_limit_sbox()
Yang Yingliang <[email protected]>
PNP: fix name memory leak in pnp_alloc_dev()
Zhao Gongyi <[email protected]>
selftests/efivarfs: Add checking of the test return value
Yang Yingliang <[email protected]>
MIPS: vpe-cmp: fix possible memory leak while module exiting
Yang Yingliang <[email protected]>
MIPS: vpe-mt: fix possible memory leak while module exiting
Shang XiaoJing <[email protected]>
ocfs2: fix memory leak in ocfs2_stack_glue_init()
Gaosheng Cui <[email protected]>
lib/fonts: fix undefined behavior in bit shift for get_default_font
Alexey Dobriyan <[email protected]>
proc: fixup uptime selftest
Barnabás Pőcze <[email protected]>
timerqueue: Use rb_entry_safe() in timerqueue_getnext()
wuchi <[email protected]>
lib/debugobjects: fix stat count and optimize debug_objects_mem_init
Zqiang <[email protected]>
debugobjects: Free per CPU pool after CPU unplug
Chen Zhongjin <[email protected]>
perf: Fix possible memleak in pmu_dev_alloc()
Yipeng Zou <[email protected]>
selftests/ftrace: event_triggers: wait longer for test_event_enable
Ondrej Mosnacek <[email protected]>
fs: don't audit the capability check in simple_xattr_list()
xiongxin <[email protected]>
PM: hibernate: Fix mistake in kerneldoc comment
Al Viro <[email protected]>
alpha: fix syscall entry in !AUDUT_SYSCALL case
Ulf Hansson <[email protected]>
cpuidle: dt: Return the correct numbers of parsed idle states
Michael Kelley <[email protected]>
tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
Stephen Boyd <[email protected]>
pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
Doug Brown <[email protected]>
ARM: mmp: fix timer_read delay
Wang Yufen <[email protected]>
pstore/ram: Fix error return code in ramoops_probe()
Pali Rohár <[email protected]>
arm64: dts: armada-3720-turris-mox: Add missing interrupt for RTC
Pali Rohár <[email protected]>
ARM: dts: turris-omnia: Add switch port 6 node
Pali Rohár <[email protected]>
ARM: dts: turris-omnia: Add ethernet aliases
Pali Rohár <[email protected]>
ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
Pali Rohár <[email protected]>
ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mt2712-evb: Fix usb vbus regulators unit names
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mt2712-evb: Fix vproc fixed regulators unit names
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mt2712e: Fix unit address for pinctrl node
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mt2712e: Fix unit_address_vs_reg warning for oscillators
Shang XiaoJing <[email protected]>
perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
Yuan Can <[email protected]>
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
Zhang Qilong <[email protected]>
soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
Zhang Qilong <[email protected]>
soc: ti: knav_qmss_queue: Fix PM disable depth imbalance in knav_queue_probe
Minghao Chi <[email protected]>
soc: ti: knav_qmss_queue: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
Kory Maincent <[email protected]>
arm: dts: spear600: Fix clcd interrupt
Luca Weiss <[email protected]>
soc: qcom: llcc: make irq truly optional
Vivek Gautam <[email protected]>
soc: qcom: Rename llcc-slice to llcc-qcom
Vivek Gautam <[email protected]>
soc: qcom: llcc cleanup to get rid of sdm845 specific driver file
Chen Jiahao <[email protected]>
drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-cheza: fix AP suspend pin bias
Luca Weiss <[email protected]>
ARM: dts: qcom: apq8064: fix coresight compatible
Ivaylo Dimitrov <[email protected]>
usb: musb: remove extra check in musb_gadget_vbus_draw
Rasmus Villemoes <[email protected]>
net: loopback: use NET_NAME_PREDICTABLE for name_assign_type
Sungwoo Kim <[email protected]>
Bluetooth: L2CAP: Fix u8 overflow
José Expósito <[email protected]>
HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk
Hans de Goede <[email protected]>
HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10
Hans de Goede <[email protected]>
HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch 10E
Hans de Goede <[email protected]>
HID: ite: Add support for Acer S1002 keyboard-dock
Pratyush Yadav <[email protected]>
xen-netback: move removal of "hotplug-status" to the right place
Tony Nguyen <[email protected]>
igb: Initialize mailbox message for VF reset
Johan Hovold <[email protected]>
USB: serial: f81534: fix division by zero on line-speed change
Johan Hovold <[email protected]>
USB: serial: f81232: fix division by zero on line-speed change
Bruno Thomsen <[email protected]>
USB: serial: cp210x: add Kamstrup RF sniffer PIDs
Duke Xin <[email protected]>
USB: serial: option: add Quectel EM05-G modem
Szymon Heidrich <[email protected]>
usb: gadget: uvc: Prevent buffer overflow in setup handler
Jan Kara <[email protected]>
udf: Fix extending file within last block
Jan Kara <[email protected]>
udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size
Jan Kara <[email protected]>
udf: Fix preallocation discarding at indirect extent boundary
Jan Kara <[email protected]>
udf: Discard preallocation before extending file with a hole
Pratyush Yadav <[email protected]>
tracing/ring-buffer: Only do full wait when cpu != RING_BUFFER_ALL_CPUS
-------------
Diffstat:
.../devicetree/bindings/sound/qcom,wcd9335.txt | 2 +-
Documentation/driver-api/spi.rst | 4 +-
Documentation/fault-injection/fault-injection.rst | 16 +-
Documentation/sphinx/load_config.py | 6 +-
Makefile | 4 +-
arch/alpha/kernel/entry.S | 4 +-
arch/arm/boot/dts/armada-370.dtsi | 2 +-
arch/arm/boot/dts/armada-375.dtsi | 2 +-
arch/arm/boot/dts/armada-380.dtsi | 4 +-
arch/arm/boot/dts/armada-385-turris-omnia.dts | 18 +-
arch/arm/boot/dts/armada-385.dtsi | 6 +-
arch/arm/boot/dts/armada-39x.dtsi | 6 +-
arch/arm/boot/dts/armada-xp-mv78230.dtsi | 8 +-
arch/arm/boot/dts/armada-xp-mv78260.dtsi | 16 +-
arch/arm/boot/dts/dove.dtsi | 2 +-
arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +-
arch/arm/boot/dts/spear600.dtsi | 2 +-
arch/arm/mach-mmp/time.c | 11 +-
arch/arm/nwfpe/Makefile | 6 +
.../boot/dts/marvell/armada-3720-turris-mox.dts | 3 +
arch/arm64/boot/dts/mediatek/mt2712-evb.dts | 12 +-
arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 22 +-
arch/arm64/boot/dts/mediatek/mt6797.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 4 +-
.../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 6 +-
arch/arm64/include/asm/atomic_ll_sc.h | 114 +++---
arch/arm64/include/asm/atomic_lse.h | 16 +-
arch/arm64/include/asm/kvm_emulate.h | 22 +-
arch/mips/bcm63xx/clk.c | 2 +
.../cavium-octeon/executive/cvmx-helper-board.c | 2 +-
arch/mips/cavium-octeon/executive/cvmx-helper.c | 2 +-
arch/mips/kernel/vpe-cmp.c | 4 +-
arch/mips/kernel/vpe-mt.c | 4 +-
arch/parisc/include/uapi/asm/mman.h | 23 +-
arch/parisc/kernel/sys_parisc.c | 27 ++
arch/parisc/kernel/syscalls/syscall.tbl | 2 +-
arch/powerpc/include/asm/imc-pmu.h | 2 +-
arch/powerpc/kernel/rtas.c | 20 +-
arch/powerpc/perf/callchain.c | 1 +
arch/powerpc/perf/hv-gpci-requests.h | 4 +
arch/powerpc/perf/hv-gpci.c | 33 +-
arch/powerpc/perf/hv-gpci.h | 1 +
arch/powerpc/perf/imc-pmu.c | 136 ++++---
arch/powerpc/perf/req-gen/perf.h | 20 +
arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | 1 +
arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 +-
arch/powerpc/platforms/pseries/eeh_pseries.c | 323 +++++++++------
arch/powerpc/sysdev/xive/spapr.c | 1 +
arch/riscv/include/asm/uaccess.h | 2 +-
arch/riscv/kernel/stacktrace.c | 12 +-
arch/s390/include/asm/percpu.h | 2 +-
arch/s390/kernel/machine_kexec_file.c | 5 +-
arch/x86/boot/bioscall.S | 4 +-
arch/x86/events/intel/uncore_snbep.c | 1 +
arch/x86/ia32/ia32_aout.c | 3 +-
arch/x86/include/asm/vmx.h | 6 +-
arch/x86/include/uapi/asm/vmx.h | 4 +-
arch/x86/kernel/cpu/bugs.c | 2 +
arch/x86/kernel/cpu/microcode/intel.c | 8 +-
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 26 +-
arch/x86/kernel/uprobes.c | 4 +-
arch/x86/kvm/vmx/nested.c | 31 +-
arch/x86/kvm/vmx/vmx.c | 66 ++--
arch/x86/xen/smp.c | 41 +-
arch/x86/xen/smp_pv.c | 12 +-
arch/x86/xen/spinlock.c | 6 +-
arch/x86/xen/xen-ops.h | 2 +
block/blk-mq-sysfs.c | 11 +-
crypto/tcrypt.c | 9 -
drivers/acpi/acpica/dsmethod.c | 10 +-
drivers/acpi/acpica/utcopy.c | 7 -
drivers/ata/ahci.c | 32 +-
drivers/ata/pata_ixp4xx_cf.c | 2 +-
drivers/base/class.c | 5 +
drivers/base/dd.c | 8 +-
drivers/base/platform.c | 22 ++
drivers/base/power/runtime.c | 18 +-
drivers/bluetooth/btusb.c | 6 +-
drivers/bluetooth/hci_bcsp.c | 2 +-
drivers/bluetooth/hci_h5.c | 2 +-
drivers/bluetooth/hci_ll.c | 2 +-
drivers/bluetooth/hci_qca.c | 2 +-
drivers/char/hw_random/amd-rng.c | 18 +-
drivers/char/hw_random/geode-rng.c | 36 +-
drivers/char/ipmi/ipmi_msghandler.c | 12 +-
drivers/char/ipmi/ipmi_si_intf.c | 27 +-
drivers/char/tpm/tpm_crb.c | 31 +-
drivers/char/tpm/tpm_tis.c | 9 +-
drivers/clk/imx/clk-imx8mn.c | 14 +-
drivers/clk/qcom/clk-krait.c | 2 +
drivers/clk/renesas/r9a06g032-clocks.c | 3 +-
drivers/clk/rockchip/clk-pll.c | 1 +
drivers/clk/samsung/clk-pll.c | 1 +
drivers/clk/socfpga/clk-gate.c | 16 +-
drivers/clk/socfpga/clk-periph.c | 8 +-
drivers/clk/socfpga/clk-pll.c | 17 +-
drivers/clk/st/clkgen-fsyn.c | 5 +-
drivers/clocksource/sh_cmt.c | 16 +-
drivers/counter/stm32-lptimer-cnt.c | 2 +-
drivers/cpufreq/amd_freq_sensitivity.c | 2 +
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpuidle/dt_idle_states.c | 2 +-
drivers/crypto/ccree/cc_debugfs.c | 2 +-
drivers/crypto/ccree/cc_driver.c | 11 +-
drivers/crypto/ccree/cc_hash.c | 49 +--
drivers/crypto/ccree/cc_hash.h | 2 -
drivers/crypto/img-hash.c | 8 +-
drivers/crypto/n2_core.c | 6 +
drivers/crypto/omap-sham.c | 2 +-
drivers/devfreq/devfreq.c | 6 +-
drivers/devfreq/governor_userspace.c | 12 +-
drivers/dio/dio.c | 8 +
drivers/edac/edac_device.c | 17 +-
drivers/edac/edac_module.h | 2 +-
drivers/edac/i10nm_base.c | 3 +-
drivers/firmware/efi/efi.c | 9 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 +-
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 3 +-
drivers/gpu/drm/drm_connector.c | 3 +
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 11 +-
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 5 +-
drivers/gpu/drm/i915/gvt/scheduler.c | 1 +
drivers/gpu/drm/mediatek/mtk_dpi.c | 12 +-
drivers/gpu/drm/msm/adreno/adreno_gpu.h | 10 +-
drivers/gpu/drm/panel/panel-sitronix-st7701.c | 10 +-
drivers/gpu/drm/radeon/radeon_bios.c | 19 +-
drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +-
drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +-
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 +-
drivers/gpu/drm/sti/sti_dvo.c | 7 +-
drivers/gpu/drm/sti/sti_hda.c | 7 +-
drivers/gpu/drm/sti/sti_hdmi.c | 7 +-
drivers/gpu/drm/tegra/dc.c | 4 +-
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 10 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-
drivers/hid/hid-ids.h | 5 +
drivers/hid/hid-ite.c | 26 +-
drivers/hid/hid-multitouch.c | 4 +
drivers/hid/hid-plantronics.c | 9 +
drivers/hid/hid-sensor-custom.c | 2 +-
drivers/hid/hid-uclogic-core.c | 1 +
drivers/hid/wacom_sys.c | 8 +
drivers/hid/wacom_wac.c | 4 +
drivers/hid/wacom_wac.h | 1 +
drivers/hsi/controllers/omap_ssi_core.c | 14 +-
drivers/i2c/busses/i2c-ismt.c | 3 +
drivers/i2c/busses/i2c-pxa-pci.c | 10 +-
drivers/i2c/muxes/i2c-mux-reg.c | 5 +-
drivers/iio/adc/ad_sigma_delta.c | 8 +-
drivers/iio/adc/ti-adc128s052.c | 14 +-
drivers/infiniband/core/device.c | 2 +-
drivers/infiniband/core/nldev.c | 4 +-
drivers/infiniband/core/uverbs_cmd.c | 2 +-
drivers/infiniband/hw/hfi1/affinity.c | 2 +
drivers/infiniband/hw/hfi1/firmware.c | 6 +
drivers/infiniband/hw/mlx5/qp.c | 49 ++-
drivers/infiniband/sw/rxe/rxe_qp.c | 6 +-
drivers/infiniband/sw/siw/siw_cq.c | 24 +-
drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
drivers/infiniband/sw/siw/siw_verbs.c | 40 +-
drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 7 +
drivers/input/touchscreen/elants_i2c.c | 9 +-
drivers/iommu/amd_iommu_init.c | 7 +
drivers/iommu/amd_iommu_v2.c | 1 +
drivers/iommu/fsl_pamu.c | 2 +-
drivers/iommu/mtk_iommu_v1.c | 26 +-
drivers/irqchip/irq-gic-pm.c | 2 +-
drivers/isdn/hardware/mISDN/hfcmulti.c | 19 +-
drivers/isdn/hardware/mISDN/hfcpci.c | 13 +-
drivers/isdn/hardware/mISDN/hfcsusb.c | 12 +-
drivers/macintosh/macio-adb.c | 4 +
drivers/macintosh/macio_asic.c | 2 +-
drivers/mailbox/zynqmp-ipi-mailbox.c | 4 +-
drivers/mcb/mcb-core.c | 4 +-
drivers/mcb/mcb-parse.c | 2 +-
drivers/md/dm-cache-metadata.c | 54 ++-
drivers/md/dm-cache-target.c | 11 +-
drivers/md/dm-clone-target.c | 1 +
drivers/md/dm-integrity.c | 2 +
drivers/md/dm-thin-metadata.c | 60 ++-
drivers/md/dm-thin.c | 18 +-
drivers/md/md-bitmap.c | 47 ++-
drivers/md/md.c | 9 +-
drivers/md/raid1.c | 1 +
drivers/media/dvb-core/dmxdev.c | 8 +
drivers/media/dvb-core/dvb_ca_en50221.c | 2 +-
drivers/media/dvb-core/dvb_frontend.c | 10 +-
drivers/media/dvb-core/dvbdev.c | 33 +-
drivers/media/dvb-frontends/bcm3510.c | 1 +
drivers/media/dvb-frontends/stv0288.c | 5 +-
drivers/media/i2c/ad5820.c | 10 +-
drivers/media/pci/saa7164/saa7164-core.c | 4 +-
drivers/media/pci/solo6x10/solo6x10-core.c | 1 +
drivers/media/platform/coda/coda-bit.c | 14 +-
drivers/media/platform/exynos4-is/fimc-core.c | 2 +-
drivers/media/platform/exynos4-is/media-dev.c | 6 +-
drivers/media/platform/qcom/camss/camss-video.c | 3 +-
drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 +-
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 4 +-
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 12 +-
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 14 +-
.../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 1 +
drivers/media/platform/vivid/vivid-vid-cap.c | 1 +
drivers/media/radio/si470x/radio-si470x-usb.c | 4 +-
drivers/media/rc/imon.c | 6 +-
drivers/media/usb/dvb-usb/az6027.c | 4 +
drivers/media/usb/dvb-usb/dvb-usb-init.c | 4 +-
drivers/media/v4l2-core/videobuf-dma-contig.c | 22 +-
drivers/misc/cxl/guest.c | 24 +-
drivers/misc/cxl/pci.c | 21 +-
drivers/misc/ocxl/file.c | 7 +-
drivers/misc/sgi-gru/grufault.c | 13 +-
drivers/misc/sgi-gru/grumain.c | 22 +-
drivers/misc/sgi-gru/grutables.h | 2 +-
drivers/misc/tifm_7xx1.c | 2 +-
drivers/mmc/host/alcor.c | 5 +-
drivers/mmc/host/atmel-mci.c | 9 +-
drivers/mmc/host/meson-gx-mmc.c | 4 +-
drivers/mmc/host/mmci.c | 4 +-
drivers/mmc/host/moxart-mmc.c | 4 +-
drivers/mmc/host/mxcmmc.c | 4 +-
drivers/mmc/host/omap_hsmmc.c | 4 +-
drivers/mmc/host/pxamci.c | 7 +-
drivers/mmc/host/rtsx_usb_sdmmc.c | 11 +-
drivers/mmc/host/sdhci-sprd.c | 16 +-
drivers/mmc/host/sdhci_f_sdh30.c | 3 +
drivers/mmc/host/toshsd.c | 6 +-
drivers/mmc/host/via-sdmmc.c | 4 +-
drivers/mmc/host/vub300.c | 13 +-
drivers/mmc/host/wbsd.c | 12 +-
drivers/mmc/host/wmt-sdmmc.c | 6 +-
drivers/mtd/lpddr/lpddr2_nvm.c | 2 +
drivers/mtd/maps/pxa2xx-flash.c | 2 +
drivers/mtd/mtdcore.c | 4 +-
drivers/mtd/spi-nor/spi-nor.c | 2 +
drivers/net/bonding/bond_3ad.c | 1 +
drivers/net/bonding/bond_alb.c | 4 +-
drivers/net/bonding/bond_main.c | 98 +++--
drivers/net/can/m_can/tcan4x5x.c | 5 -
drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 30 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 115 +++++-
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 167 ++++++--
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 437 ++++++++++++++++++---
drivers/net/dsa/lan9303-core.c | 4 +-
drivers/net/ethernet/amd/atarilance.c | 2 +-
drivers/net/ethernet/amd/lance.c | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 4 +-
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 4 +-
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 23 +-
drivers/net/ethernet/apple/bmac.c | 2 +-
drivers/net/ethernet/apple/mace.c | 2 +-
drivers/net/ethernet/dnet.c | 4 +-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +-
drivers/net/ethernet/intel/igb/igb_main.c | 10 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 14 +-
.../net/ethernet/mellanox/mlx5/core/lib/clock.c | 4 +-
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 1 +
drivers/net/ethernet/neterion/s2io.c | 2 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 8 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 10 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 8 +-
.../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 +
drivers/net/ethernet/rdc/r6040.c | 5 +-
drivers/net/ethernet/renesas/ravb_main.c | 2 +-
.../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 3 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h | 2 +-
.../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 8 +-
drivers/net/ethernet/ti/netcp_core.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +-
drivers/net/fddi/defxx.c | 22 +-
drivers/net/hamradio/baycom_epp.c | 2 +-
drivers/net/hamradio/scc.c | 6 +-
drivers/net/loopback.c | 2 +-
drivers/net/ntb_netdev.c | 4 +-
drivers/net/phy/xilinx_gmii2rgmii.c | 1 +
drivers/net/ppp/ppp_generic.c | 2 +
drivers/net/usb/rndis_host.c | 3 +-
drivers/net/wan/farsync.c | 2 +
drivers/net/wireless/ath/ar5523/ar5523.c | 6 +
drivers/net/wireless/ath/ath10k/pci.c | 20 +-
drivers/net/wireless/ath/ath9k/hif_usb.c | 46 ++-
.../broadcom/brcm80211/brcmfmac/firmware.c | 5 +
.../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +-
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +-
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 16 +-
drivers/net/wireless/rsi/rsi_91x_core.c | 4 +-
drivers/net/wireless/rsi/rsi_91x_hal.c | 6 +-
drivers/net/xen-netback/xenbus.c | 3 +-
drivers/nfc/pn533/pn533.c | 4 +
drivers/nfc/pn533/usb.c | 44 ++-
drivers/nvme/host/pci.c | 31 +-
drivers/of/overlay.c | 4 +-
drivers/parisc/led.c | 3 +
drivers/pci/irq.c | 2 +
drivers/pci/pci-sysfs.c | 13 +-
drivers/pci/pci.c | 2 +
drivers/perf/arm_dsu_pmu.c | 6 +-
drivers/perf/arm_smmuv3_pmu.c | 8 +-
drivers/pinctrl/pinconf-generic.c | 4 +-
drivers/platform/x86/mxm-wmi.c | 8 +-
drivers/platform/x86/sony-laptop.c | 21 +-
drivers/pnp/core.c | 4 +-
drivers/power/avs/smartreflex.c | 1 +
drivers/power/supply/power_supply_core.c | 7 +-
drivers/pwm/pwm-sifive.c | 5 +-
drivers/rapidio/devices/rio_mport_cdev.c | 15 +-
drivers/rapidio/rio-scan.c | 8 +-
drivers/rapidio/rio.c | 9 +-
drivers/regulator/core.c | 15 +-
drivers/regulator/da9211-regulator.c | 11 +-
drivers/remoteproc/qcom_q6v5_pas.c | 1 +
drivers/remoteproc/qcom_sysmon.c | 5 +-
drivers/rtc/rtc-cmos.c | 366 ++++++++---------
drivers/rtc/rtc-mxc_v2.c | 4 +-
drivers/rtc/rtc-pcf85063.c | 8 +-
drivers/rtc/rtc-pic32.c | 8 +-
drivers/rtc/rtc-snvs.c | 16 +-
drivers/rtc/rtc-st-lpc.c | 1 +
drivers/s390/net/ctcm_main.c | 11 +-
drivers/s390/net/lcs.c | 8 +-
drivers/s390/net/netiucv.c | 9 +-
drivers/scsi/fcoe/fcoe.c | 1 +
drivers/scsi/fcoe/fcoe_sysfs.c | 19 +-
drivers/scsi/hpsa.c | 9 +-
drivers/scsi/ipr.c | 10 +-
drivers/scsi/mpt3sas/mpt3sas_transport.c | 2 +
drivers/scsi/scsi_debug.c | 2 +-
drivers/scsi/snic/snic_disc.c | 3 +
drivers/soc/qcom/Kconfig | 15 +-
drivers/soc/qcom/Makefile | 3 +-
drivers/soc/qcom/{llcc-slice.c => llcc-qcom.c} | 62 ++-
drivers/soc/qcom/llcc-sdm845.c | 100 -----
drivers/soc/ti/knav_qmss_queue.c | 6 +-
drivers/soc/ux500/ux500-soc-id.c | 10 +-
drivers/spi/spi-gpio.c | 16 +-
drivers/spi/spidev.c | 21 +-
drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 +-
drivers/staging/wilc1000/wilc_sdio.c | 1 +
drivers/tty/hvc/hvc_xen.c | 46 ++-
drivers/tty/serial/altera_uart.c | 21 +-
drivers/tty/serial/amba-pl011.c | 14 +-
drivers/tty/serial/pch_uart.c | 4 +
drivers/tty/serial/serial-tegra.c | 115 +++---
drivers/tty/serial/sunsab.c | 8 +-
drivers/uio/uio_dmem_genirq.c | 13 +-
drivers/usb/dwc3/core.c | 7 +-
drivers/usb/gadget/function/f_hid.c | 271 ++++++++++---
drivers/usb/gadget/function/f_uvc.c | 5 +-
drivers/usb/gadget/function/u_hid.h | 1 +
drivers/usb/gadget/udc/fotg210-udc.c | 12 +-
drivers/usb/musb/musb_gadget.c | 2 -
drivers/usb/roles/class.c | 5 +-
drivers/usb/serial/cp210x.c | 2 +
drivers/usb/serial/f81232.c | 12 +-
drivers/usb/serial/f81534.c | 12 +-
drivers/usb/serial/option.c | 3 +
drivers/usb/storage/alauda.c | 2 +
drivers/usb/typec/bus.c | 2 +-
drivers/usb/typec/tcpm/tcpci.c | 5 +-
drivers/vfio/platform/vfio_platform_common.c | 3 +-
drivers/vhost/vhost.c | 4 +-
drivers/video/fbdev/Kconfig | 1 -
drivers/video/fbdev/pm2fb.c | 9 +-
drivers/video/fbdev/uvesafb.c | 1 +
drivers/video/fbdev/vermilion/vermilion.c | 4 +-
drivers/video/fbdev/via/via-core.c | 9 +-
drivers/vme/bridges/vme_fake.c | 2 +
drivers/vme/bridges/vme_tsi148.c | 1 +
drivers/xen/events/events_base.c | 10 +-
drivers/xen/privcmd.c | 2 +-
fs/binfmt_aout.c | 2 +-
fs/binfmt_elf_fdpic.c | 7 +-
fs/binfmt_flat.c | 3 +-
fs/binfmt_misc.c | 8 +-
fs/btrfs/backref.c | 4 +
fs/btrfs/ioctl.c | 9 +-
fs/btrfs/rcu-string.h | 6 +-
fs/char_dev.c | 2 +-
fs/cifs/cifsfs.c | 8 +-
fs/cifs/cifsglob.h | 70 ++++
fs/cifs/cifsproto.h | 4 +-
fs/cifs/connect.c | 4 +-
fs/cifs/link.c | 1 +
fs/cifs/misc.c | 4 +-
fs/cifs/smb2ops.c | 143 ++++---
fs/configfs/dir.c | 2 +
fs/debugfs/file.c | 28 +-
fs/ext4/ext4.h | 9 +-
fs/ext4/ext4_jbd2.c | 20 +-
fs/ext4/ext4_jbd2.h | 55 ++-
fs/ext4/extents.c | 76 ++--
fs/ext4/extents_status.c | 3 +-
fs/ext4/indirect.c | 102 +++--
fs/ext4/inode.c | 74 ++--
fs/ext4/ioctl.c | 13 +-
fs/ext4/migrate.c | 95 ++---
fs/ext4/namei.c | 3 +
fs/ext4/resize.c | 52 +--
fs/ext4/super.c | 50 ++-
fs/ext4/verity.c | 7 +-
fs/ext4/xattr.c | 274 ++++++-------
fs/ext4/xattr.h | 1 +
fs/f2fs/gc.c | 6 +-
fs/f2fs/segment.c | 2 +-
fs/hfs/inode.c | 13 +-
fs/hfs/trans.c | 2 +-
fs/hfsplus/hfsplus_fs.h | 2 +
fs/hfsplus/inode.c | 16 +-
fs/hfsplus/options.c | 4 +
fs/hugetlbfs/inode.c | 6 +-
fs/jbd2/transaction.c | 135 +++----
fs/jfs/jfs_dmap.c | 27 +-
fs/libfs.c | 22 +-
fs/mbcache.c | 121 ++++--
fs/nfs/nfs4proc.c | 34 +-
fs/nfs/nfs4state.c | 2 +
fs/nfs/nfs4xdr.c | 12 +-
fs/nfsd/nfs4callback.c | 4 +-
fs/nfsd/nfs4state.c | 51 ++-
fs/nfsd/nfs4xdr.c | 11 +
fs/nfsd/nfscache.c | 57 +--
fs/nfsd/nfssvc.c | 2 +-
fs/nfsd/trace.h | 65 +++
fs/nilfs2/the_nilfs.c | 31 +-
fs/ocfs2/alloc.c | 32 +-
fs/ocfs2/dlmglue.c | 8 +-
fs/ocfs2/journal.c | 6 +-
fs/ocfs2/journal.h | 1 +
fs/ocfs2/stackglue.c | 8 +-
fs/ocfs2/super.c | 108 ++---
fs/orangefs/orangefs-debugfs.c | 29 +-
fs/orangefs/orangefs-mod.c | 8 +-
fs/overlayfs/dir.c | 46 ++-
fs/pnode.c | 2 +-
fs/pstore/Kconfig | 1 +
fs/pstore/pmsg.c | 7 +-
fs/pstore/ram.c | 2 +
fs/pstore/ram_core.c | 6 +-
fs/quota/dquot.c | 110 ++++--
fs/reiserfs/namei.c | 4 +
fs/reiserfs/xattr_security.c | 2 +-
fs/sysv/itree.c | 2 +-
fs/udf/inode.c | 76 ++--
fs/udf/namei.c | 8 +-
fs/udf/truncate.c | 48 +--
fs/xattr.c | 2 +-
include/linux/cpuhotplug.h | 1 +
include/linux/debugfs.h | 19 +-
include/linux/devfreq.h | 11 +-
include/linux/eventfd.h | 2 +-
include/linux/fs.h | 12 +-
include/linux/highmem.h | 18 +
include/linux/jbd2.h | 6 +
include/linux/mbcache.h | 41 +-
include/linux/netdevice.h | 58 +--
include/linux/nvme.h | 56 ++-
include/linux/platform_device.h | 3 +
include/linux/proc_fs.h | 2 +
include/linux/quotaops.h | 2 +
include/linux/soc/qcom/llcc-qcom.h | 57 +--
include/linux/sunrpc/rpc_pipe_fs.h | 5 +
include/linux/timerqueue.h | 2 +-
include/linux/tpm_eventlog.h | 4 +-
include/media/dvbdev.h | 32 +-
include/net/bonding.h | 2 +-
include/net/dst.h | 5 +-
include/net/mrp.h | 1 +
include/sound/hdaudio.h | 2 +
include/sound/hdaudio_ext.h | 1 -
include/sound/pcm.h | 36 +-
include/trace/events/jbd2.h | 40 +-
include/uapi/linux/swab.h | 2 +-
include/uapi/sound/asequencer.h | 8 +-
kernel/acct.c | 2 +
kernel/bpf/btf.c | 5 +
kernel/bpf/verifier.c | 5 +
kernel/events/core.c | 8 +-
kernel/gcov/gcc_4_7.c | 5 +
kernel/irq/internals.h | 2 +
kernel/irq/irqdesc.c | 15 +-
kernel/power/snapshot.c | 4 +-
kernel/rcu/tree.c | 2 +-
kernel/relay.c | 4 +-
kernel/trace/blktrace.c | 3 +-
kernel/trace/ring_buffer.c | 1 +
kernel/trace/trace.c | 15 +-
kernel/trace/trace_events_hist.c | 13 +-
lib/debugobjects.c | 35 ++
lib/fonts/fonts.c | 4 +-
lib/iov_iter.c | 14 -
lib/notifier-error-inject.c | 2 +-
lib/test_firmware.c | 1 +
mm/compaction.c | 18 +-
mm/memblock.c | 8 +-
net/802/mrp.c | 18 +-
net/bluetooth/hci_core.c | 2 +-
net/bluetooth/l2cap_core.c | 3 +-
net/bluetooth/rfcomm/core.c | 2 +-
net/bpf/test_run.c | 3 -
net/caif/cfctrl.c | 6 +-
net/core/dev.c | 14 +-
net/core/filter.c | 18 +-
net/core/skbuff.c | 3 +
net/core/sock_map.c | 2 +
net/core/stream.c | 6 +
net/hsr/hsr_framereg.c | 16 +-
net/hsr/hsr_framereg.h | 1 +
net/ipv4/inet_connection_sock.c | 16 +-
net/ipv4/tcp_bpf.c | 8 +-
net/ipv4/udp_tunnel.c | 1 +
net/ipv6/raw.c | 4 +
net/mac80211/iface.c | 1 +
net/netfilter/ipset/ip_set_bitmap_ip.c | 4 +-
net/netfilter/nf_conntrack_proto_icmpv6.c | 53 +++
net/nfc/netlink.c | 52 ++-
net/openvswitch/datapath.c | 25 +-
net/packet/af_packet.c | 20 +-
net/rxrpc/output.c | 2 +-
net/rxrpc/sendmsg.c | 2 +-
net/sched/act_mpls.c | 8 +-
net/sched/cls_tcindex.c | 12 +-
net/sched/ematch.c | 2 +
net/sched/sch_api.c | 5 +
net/sched/sch_atm.c | 5 +-
net/sched/sch_cbq.c | 5 +-
net/sunrpc/auth_gss/auth_gss.c | 19 +-
net/sunrpc/auth_gss/svcauth_gss.c | 9 +-
net/sunrpc/clnt.c | 2 +-
net/sunrpc/xprtrdma/verbs.c | 1 +
net/tipc/core.c | 16 +
net/tipc/core.h | 6 +
net/tipc/discover.c | 4 +-
net/tipc/msg.h | 19 +
net/tipc/name_distr.c | 2 +-
net/tipc/node.c | 172 +++++++-
net/tipc/node.h | 5 +-
net/tipc/socket.c | 6 +-
net/vmw_vsock/vmci_transport.c | 6 +-
net/wireless/reg.c | 4 +-
samples/vfio-mdev/mdpy-fb.c | 8 +-
security/apparmor/apparmorfs.c | 4 +-
security/apparmor/lsm.c | 4 +-
security/apparmor/policy.c | 2 +-
security/apparmor/policy_unpack.c | 2 +-
security/device_cgroup.c | 33 +-
security/integrity/digsig.c | 6 +-
security/integrity/ima/ima.h | 16 +-
security/integrity/ima/ima_main.c | 1 +
security/integrity/ima/ima_policy.c | 65 +--
security/integrity/ima/ima_template.c | 9 +-
security/integrity/platform_certs/load_uefi.c | 1 +
sound/core/control_compat.c | 4 +
sound/drivers/mts64.c | 3 +
sound/hda/ext/hdac_ext_stream.c | 17 -
sound/hda/hdac_stream.c | 27 ++
sound/pci/asihpi/hpioctl.c | 2 +-
sound/pci/hda/hda_controller.c | 4 +-
sound/pci/hda/patch_hdmi.c | 2 +
sound/pci/hda/patch_realtek.c | 27 ++
sound/soc/codecs/pcm512x.c | 8 +-
sound/soc/codecs/rt298.c | 7 +
sound/soc/codecs/rt5670.c | 2 -
sound/soc/codecs/wm8994.c | 5 +
sound/soc/generic/audio-graph-card.c | 4 +-
sound/soc/intel/boards/bytcr_rt5640.c | 15 +
sound/soc/intel/skylake/skl.c | 7 +-
sound/soc/mediatek/common/mtk-btcvsd.c | 6 +-
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 20 +-
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 7 +-
sound/soc/pxa/mmp-pcm.c | 2 +-
sound/soc/rockchip/rockchip_pdm.c | 1 +
sound/soc/rockchip/rockchip_spdif.c | 1 +
sound/usb/line6/driver.c | 3 +-
sound/usb/line6/midi.c | 6 +-
sound/usb/line6/midibuf.c | 25 +-
sound/usb/line6/midibuf.h | 5 +-
sound/usb/line6/pod.c | 3 +-
tools/arch/parisc/include/uapi/asm/mman.h | 12 +-
tools/arch/x86/include/uapi/asm/vmx.h | 4 +-
tools/objtool/check.c | 2 +-
tools/perf/bench/bench.h | 12 -
tools/perf/builtin-trace.c | 135 +++++--
tools/perf/trace/beauty/beauty.h | 3 +
tools/perf/util/auxtrace.c | 2 +-
tools/perf/util/data.c | 2 +
tools/perf/util/debug.c | 4 +
tools/perf/util/dwarf-aux.c | 23 +-
tools/perf/util/symbol-elf.c | 2 +-
tools/testing/ktest/ktest.pl | 23 +-
tools/testing/selftests/Makefile | 28 +-
tools/testing/selftests/efivarfs/efivarfs.sh | 5 +
.../ftrace/test.d/ftrace/func_event_triggers.tc | 15 +-
tools/testing/selftests/kvm/include/x86_64/vmx.h | 8 +-
.../selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 2 +-
tools/testing/selftests/lib.mk | 5 +
.../selftests/netfilter/conntrack_icmp_related.sh | 36 +-
.../selftests/powerpc/dscr/dscr_sysfs_test.c | 5 +-
tools/testing/selftests/proc/proc-uptime-002.c | 3 +-
603 files changed, 6390 insertions(+), 3248 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/658 tracing/ring-buffer: Only do full wait when cpu != RING_BUFFER_ALL_CPUS
From: Pratyush Yadav <[email protected]>
full_hit() directly uses cpu as an array index. Since RING_BUFFER_ALL_CPUS == -1, calling full_hit() with cpu == RING_BUFFER_ALL_CPUS will cause an invalid memory access.
The upstream commit 42fb0a1e84ff ("tracing/ring-buffer: Have polling block on watermark") already does this. This was missed when backporting to v5.4.y.
This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc.
--- kernel/trace/ring_buffer.c | 1 + 1 file changed, 1 insertion(+)
kernel/trace/ring_buffer.c +1 -0
@@ -727,6 +727,7 @@ __poll_t ring_buffer_poll_wait(struct riif (cpu ==RING_BUFFER_ALL_CPUS ) { work = &buffer->irq_work; + full =0 ; }else {if (!cpumask_test_cpu (cpu, buffer->cpumask))return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 2/658 udf: Discard preallocation before extending file with a hole
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 16d0556568148bdcaa45d077cac9f8f7077cf70a upstream.
When extending file with a hole, we tried to preserve existing preallocation for the file. However that is not very useful and complicates code because the previous extent may need to be rounded to block boundary as well (which we forgot to do thus causing data corruption for sequence like:
xfs_io -f -c "pwrite 0x75e63 11008" -c "truncate 0x7b24b" \
-c "truncate 0xabaa3" -c "pwrite 0xac70b 22954" \
-c "pwrite 0x93a43 11358" -c "pwrite 0xb8e65 52211" file
with 512-byte block size. Just discard preallocation before extending file to simplify things and also fix this data corruption.
--- fs/udf/inode.c | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-)
fs/udf/inode.c +18 -28
@@ -441,6 +441,12 @@ static int udf_get_block(struct inode *i iinfo->i_next_alloc_goal++; } +/* +* Block beyond EOF and prealloc extents? Just discard preallocation +* as it is not useful and complicates things. +*/ +if (((loff_t )block) << inode->i_blkbits > iinfo->i_lenExtents) +udf_discard_prealloc (inode);udf_clear_extent_cache (inode); phys =inode_getblk (inode, block, &err, &new);if (!phys)
@@ -490,8 +496,6 @@ static int udf_do_extend_file(struct inouint32_t add;int count =0 , fake = !(last_ext->extLength &UDF_EXTENT_LENGTH_MASK );struct super_block *sb = inode->i_sb; -struct kernel_lb_addr prealloc_loc = {}; -uint32_t prealloc_len =0 ;struct udf_inode_info *iinfo;int err;
@@ -512,19 +516,6 @@ static int udf_do_extend_file(struct ino ~(sb->s_blocksize -1 ); } -/* Last extent are just preallocated blocks? */ -if ((last_ext->extLength &UDF_EXTENT_FLAG_MASK ) == -EXT_NOT_RECORDED_ALLOCATED ) { -/* Save the extent so that we can reattach it to the end */ - prealloc_loc = last_ext->extLocation; - prealloc_len = last_ext->extLength; -/* Mark the extent as a hole */ - last_ext->extLength =EXT_NOT_RECORDED_NOT_ALLOCATED | - (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ); - last_ext->extLocation.logicalBlockNum =0 ; - last_ext->extLocation.partitionReferenceNum =0 ; - } -/* Can we merge with the previous extent? */ if ((last_ext->extLength &UDF_EXTENT_FLAG_MASK ) ==EXT_NOT_RECORDED_NOT_ALLOCATED ) {
@@ -552,7 +543,7 @@ static int udf_do_extend_file(struct ino* more extents, we may need to enter possible following * empty indirect extent. */ -if (new_block_bytes || prealloc_len) +if (new_block_bytes)udf_next_aext (inode, last_pos, &tmploc, &tmplen,0 ); }
@@ -586,17 +577,6 @@ static int udf_do_extend_file(struct ino } out: -/* Do we have some preallocated blocks saved? */ -if (prealloc_len) { - err =udf_add_aext (inode, last_pos, &prealloc_loc, - prealloc_len,1 ); -if (err) -return err; - last_ext->extLocation = prealloc_loc; - last_ext->extLength = prealloc_len; - count++; - } -/* last_pos should point to the last written extent... */ if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) last_pos->offset -=sizeof (struct short_ad );
@@ -649,8 +629,17 @@ static int udf_extend_file(struct inodeelse BUG (); +/* +* When creating hole in file, just don't bother with preserving +* preallocation. It likely won't be very useful anyway. +*/ +udf_discard_prealloc (inode); + etype =inode_bmap (inode, first_block, &epos, &eloc, &elen, &offset); within_final_block = (etype !=-1 ); +/* We don't expect extents past EOF... */ +WARN_ON_ONCE (etype !=-1 && + elen > ((loff_t )offset +1 ) << inode->i_blkbits);if ((!epos.bh && epos.offset ==udf_file_entry_alloc_offset (inode)) || (epos.bh && epos.offset ==sizeof (struct allocExtDesc ))) {
@@ -779,10 +768,11 @@ static sector_t inode_getblk(struct inod goto out_free; } -/* Are we beyond EOF? */ +/* Are we beyond EOF and preallocated extent? */ if (etype ==-1 ) {int ret;loff_t hole_len; + isBeyondEOF = true;if (count) {if (c)
Greg Kroah-Hartman
maintainerPATCH 3/658 udf: Fix preallocation discarding at indirect extent boundary
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit cfe4c1b25dd6d2f056afc00b7c98bcb3dd0b1fc3 upstream.
When preallocation extent is the first one in the extent block, the code would corrupt extent tree header instead. Fix the problem and use udf_delete_aext() for deleting extent to avoid some code duplication.
--- fs/udf/truncate.c | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-)
fs/udf/truncate.c +13 -32
@@ -120,60 +120,41 @@ void udf_truncate_tail_extent(struct inovoid udf_discard_prealloc (struct inode *inode) { -struct extent_position epos = {NULL ,0 , {0 ,0 } }; +struct extent_position epos = {}; +struct extent_position prev_epos = {};struct kernel_lb_addr eloc;uint32_t elen;uint64_t lbcount =0 ;int8_t etype =-1 , netype; -int adsize;struct udf_inode_info *iinfo =UDF_I (inode);if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB || inode->i_size == iinfo->i_lenExtents)return ; -if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) - adsize =sizeof (struct short_ad ); -else if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_LONG ) - adsize =sizeof (struct long_ad ); -else - adsize =0 ; - epos.block = iinfo->i_location;/* Find the last extent in the file */ -while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,1 )) !=-1 ) { - etype = netype; +while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,0 )) !=-1 ) { +brelse (prev_epos.bh); + prev_epos = epos; +if (prev_epos.bh) +get_bh (prev_epos.bh); + + etype =udf_next_aext (inode, &epos, &eloc, &elen,1 ); lbcount += elen; }if (etype == (EXT_NOT_RECORDED_ALLOCATED >>30 )) { - epos.offset -= adsize; lbcount -= elen; -extent_trunc (inode, &epos, &eloc, etype, elen,0 ); -if (!epos.bh) { - iinfo->i_lenAlloc = - epos.offset - -udf_file_entry_alloc_offset (inode); -mark_inode_dirty (inode); - }else { -struct allocExtDesc *aed = - (struct allocExtDesc *)(epos.bh->b_data); - aed->lengthAllocDescs = -cpu_to_le32 (epos.offset - -sizeof (struct allocExtDesc )); -if (!UDF_QUERY_FLAG (inode->i_sb,UDF_FLAG_STRICT ) || -UDF_SB (inode->i_sb)->s_udfrev >=0x0201 ) -udf_update_tag (epos.bh->b_data, epos.offset); -else -udf_update_tag (epos.bh->b_data, -sizeof (struct allocExtDesc )); -mark_buffer_dirty_inode (epos.bh, inode); - } +udf_delete_aext (inode, prev_epos); +udf_free_blocks (inode->i_sb, inode, &eloc,0 , +DIV_ROUND_UP (elen,1 << inode->i_blkbits)); }/* This inode entry is in-memory only and thus we don't have to mark * the inode dirty */ iinfo->i_lenExtents = lbcount;brelse (epos.bh); +brelse (prev_epos.bh); } static void udf_update_alloc_ext_desc(struct inode *inode,
Greg Kroah-Hartman
maintainerPATCH 4/658 udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 6ad53f0f71c52871202a7bf096feb2c59db33fc5 upstream.
If rounded block-rounded i_lenExtents matches block rounded i_size, there are no preallocation extents. Do not bother walking extent linked list.
--- fs/udf/truncate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/udf/truncate.c +2 -1
@@ -127,9 +127,10 @@ void udf_discard_prealloc(struct inode *uint64_t lbcount =0 ;int8_t etype =-1 , netype;struct udf_inode_info *iinfo =UDF_I (inode); +int bsize =1 << inode->i_blkbits;if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_IN_ICB || - inode->i_size == iinfo->i_lenExtents) +ALIGN (inode->i_size, bsize) ==ALIGN (iinfo->i_lenExtents, bsize))return ; epos.block = iinfo->i_location;
Greg Kroah-Hartman
maintainerPATCH 5/658 udf: Fix extending file within last block
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 1f3868f06855c97a4954c99b36f3fc9eb8f60326 upstream.
When extending file within last block it can happen that the extent is already rounded to the blocksize and thus contains the offset we want to grow up to. In such case we would mistakenly expand the last extent and make it one block longer than it should be, exposing unallocated block in a file and causing data corruption. Fix the problem by properly detecting this case and bailing out.
--- fs/udf/inode.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-)
fs/udf/inode.c +17 -15
@@ -592,13 +592,17 @@ out:static void udf_do_extend_final_block (struct inode *inode,struct extent_position *last_pos,struct kernel_long_ad *last_ext, -uint32_t final_block_len) +uint32_t new_elen) { -struct super_block *sb = inode->i_sb;uint32_t added_bytes; - added_bytes = final_block_len - - (last_ext->extLength & (sb->s_blocksize -1 )); +/* +* Extent already large enough? It may be already rounded up to block +* size... +*/ +if (new_elen <= (last_ext->extLength &UDF_EXTENT_LENGTH_MASK )) +return ; + added_bytes = (last_ext->extLength &UDF_EXTENT_LENGTH_MASK ) - new_elen; last_ext->extLength += added_bytes;UDF_I (inode)->i_lenExtents += added_bytes;
@@ -615,12 +619,12 @@ static int udf_extend_file(struct inodeint8_t etype;struct super_block *sb = inode->i_sb;sector_t first_block = newsize >> sb->s_blocksize_bits, offset; -unsigned long partial_final_block; +loff_t new_elen;int adsize;struct udf_inode_info *iinfo =UDF_I (inode);struct kernel_long_ad extent;int err =0 ; -int within_final_block; +bool within_last_ext;if (iinfo->i_alloc_type ==ICBTAG_FLAG_AD_SHORT ) adsize =sizeof (struct short_ad );
@@ -636,9 +640,9 @@ static int udf_extend_file(struct inodeudf_discard_prealloc (inode); etype =inode_bmap (inode, first_block, &epos, &eloc, &elen, &offset); - within_final_block = (etype !=-1 ); + within_last_ext = (etype !=-1 );/* We don't expect extents past EOF... */ -WARN_ON_ONCE (etype !=-1 && +WARN_ON_ONCE (within_last_ext && elen > ((loff_t )offset +1 ) << inode->i_blkbits); if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) ||
@@ -655,19 +659,17 @@ static int udf_extend_file(struct inode extent.extLength |= etype <<30 ; } - partial_final_block = newsize & (sb->s_blocksize -1 ); + new_elen = ((loff_t )offset << inode->i_blkbits) | + (newsize & (sb->s_blocksize -1 ));/* File has extent covering the new size (could happen when extending * inside a block)? */ -if (within_final_block) { +if (within_last_ext) {/* Extending file within the last file block */ -udf_do_extend_final_block (inode, &epos, &extent, - partial_final_block); +udf_do_extend_final_block (inode, &epos, &extent, new_elen); }else { -loff_t add = ((loff_t )offset << sb->s_blocksize_bits) | - partial_final_block; - err =udf_do_extend_file (inode, &epos, &extent, add); + err =udf_do_extend_file (inode, &epos, &extent, new_elen); }if (err <0 )
Greg Kroah-Hartman
maintainerPATCH 6/658 usb: gadget: uvc: Prevent buffer overflow in setup handler
In reply to Greg Kroah-HartmanFrom: Szymon Heidrich <[email protected]>
commit 4c92670b16727365699fe4b19ed32013bab2c107 upstream.
Setup function uvc_function_setup permits control transfer requests with up to 64 bytes of payload (UVC_MAX_REQUEST_SIZE), data stage handler for OUT transfer uses memcpy to copy req->actual bytes to uvc_event->data.data array of size 60. This may result in an overflow of 4 bytes.
--- drivers/usb/gadget/function/f_uvc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_uvc.c +3 -2
@@ -213,8 +213,9 @@ uvc_function_ep0_complete(struct usb_epmemset (&v4l2_event,0 ,sizeof (v4l2_event)); v4l2_event.type =UVC_EVENT_DATA ; - uvc_event->data.length = req->actual; -memcpy (&uvc_event->data.data, req->buf, req->actual); + uvc_event->data.length = min_t(unsigned int, req->actual, +sizeof (uvc_event->data.data)); +memcpy (&uvc_event->data.data, req->buf, uvc_event->data.length);v4l2_event_queue (&uvc->vdev, &v4l2_event); } }
Greg Kroah-Hartman
maintainerPATCH 7/658 USB: serial: option: add Quectel EM05-G modem
In reply to Greg Kroah-HartmanFrom: Duke Xin <[email protected]>
commit f0052d7a1edb3d8921b4e154aa8c46c4845b3714 upstream.
The EM05-G modem has 2 USB configurations that are configurable via the AT command AT+QCFG="usbnet",[ 0 | 2 ] which make the modem enumerate with the following interfaces, respectively:
"RMNET" : AT + DIAG + NMEA + Modem + QMI
"MBIM" : MBIM + AT + DIAG + NMEA + Modem
The detailed description of the USB configuration for each mode as follows:
RMNET Mode
--------------
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 21 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0311 Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
MBIM Mode
--------------
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0311 Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/serial/option.c +3 -0
@@ -255,6 +255,7 @@ static void option_instat_callback(struc#define QUECTEL_PRODUCT_EP06 0x0306#define QUECTEL_PRODUCT_EM05G 0x030a#define QUECTEL_PRODUCT_EM060K 0x030b +#define QUECTEL_PRODUCT_EM05G_SG 0x0311#define QUECTEL_PRODUCT_EM12 0x0512#define QUECTEL_PRODUCT_RM500Q 0x0800#define QUECTEL_PRODUCT_RM520N 0x0801
@@ -1160,6 +1161,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), .driver_info = RSVD(6) | ZLP }, + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff), + .driver_info = RSVD(6) | ZLP }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) }, { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
Greg Kroah-Hartman
maintainerPATCH 8/658 USB: serial: cp210x: add Kamstrup RF sniffer PIDs
In reply to Greg Kroah-HartmanFrom: Bruno Thomsen <[email protected]>
commit e88906b169ebcb8046e8f0ad76edd09ab41cfdfe upstream.
The RF sniffers are based on cp210x where the RF frontends are based on a different USB stack.
RF sniffers can analyze packets meta data including power level and perform packet injection.
Can be used to perform RF frontend self-test when connected to a concentrator, ex. arch/arm/boot/dts/imx7d-flex-concentrator.dts
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -196,6 +196,8 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ + { USB_DEVICE(0x17A8, 0x0011) }, /* Kamstrup 444 MHz RF sniffer */ + { USB_DEVICE(0x17A8, 0x0013) }, /* Kamstrup 870 MHz RF sniffer */ { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */ { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
Greg Kroah-Hartman
maintainerPATCH 9/658 USB: serial: f81232: fix division by zero on line-speed change
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit a08ca6ebafe615c9028c53fc4c9e6c9b2b1f2888 upstream.
The driver leaves the line speed unchanged in case a requested speed is not supported. Make sure to handle the case where the current speed is B0 (hangup) without dividing by zero when determining the clock source.
--- drivers/usb/serial/f81232.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/usb/serial/f81232.c +7 -5
@@ -78,9 +78,6 @@ static u8 const clock_table[] = { F81232static int calc_baud_divisor (speed_t baudrate,speed_t clockrate) { -if (!baudrate) -return 0 ; -return DIV_ROUND_CLOSEST (clockrate, baudrate); }
@@ -423,9 +420,14 @@ static void f81232_set_baudrate(struct tspeed_t baud_list[] = { baudrate, old_baudrate,F81232_DEF_BAUDRATE };for (i =0 ; i <ARRAY_SIZE (baud_list); ++i) { - idx =f81232_find_clk (baud_list[i]); + baudrate = baud_list[i]; +if (baudrate ==0 ) { +tty_encode_baud_rate (tty,0 ,0 ); +return ; + } + + idx =f81232_find_clk (baudrate);if (idx >=0 ) { - baudrate = baud_list[i];tty_encode_baud_rate (tty, baudrate, baudrate);break ; }
Greg Kroah-Hartman
maintainerPATCH 10/658 USB: serial: f81534: fix division by zero on line-speed change
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 188c9c2e0c7f4ae864113f80c40bafb394062271 upstream.
The driver leaves the line speed unchanged in case a requested speed is not supported. Make sure to handle the case where the current speed is B0 (hangup) without dividing by zero when determining the clock source.
--- drivers/usb/serial/f81534.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/usb/serial/f81534.c +7 -5
@@ -538,9 +538,6 @@ static int f81534_submit_writer(struct ustatic u32 f81534_calc_baud_divisor (u32 baudrate,u32 clockrate) { -if (!baudrate) -return 0 ; -/* Round to nearest divisor */ return DIV_ROUND_CLOSEST (clockrate, baudrate); }
@@ -570,9 +567,14 @@ static int f81534_set_port_config(structu32 baud_list[] = {baudrate, old_baudrate,F81534_DEFAULT_BAUD_RATE };for (i =0 ; i <ARRAY_SIZE (baud_list); ++i) { - idx =f81534_find_clk (baud_list[i]); + baudrate = baud_list[i]; +if (baudrate ==0 ) { +tty_encode_baud_rate (tty,0 ,0 ); +return 0 ; + } + + idx =f81534_find_clk (baudrate);if (idx >=0 ) { - baudrate = baud_list[i];tty_encode_baud_rate (tty, baudrate, baudrate);break ; }
Greg Kroah-Hartman
maintainerPATCH 11/658 igb: Initialize mailbox message for VF reset
In reply to Greg Kroah-HartmanFrom: Tony Nguyen <[email protected]>
commit de5dc44370fbd6b46bd7f1a1e00369be54a041c8 upstream.
When a MAC address is not assigned to the VF, that portion of the message sent to the VF is not set. The memory, however, is allocated from the stack meaning that information may be leaked to the VM. Initialize the message buffer to 0 so that no information is passed to the VM in this case.
--- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
@@ -7133,7 +7133,7 @@ static void igb_vf_reset_msg(struct igb_ {struct e1000_hw *hw = &adapter->hw;unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses; -u32 reg, msgbuf[3 ]; +u32 reg, msgbuf[3 ] = {};u8 *addr = (u8 *)(&msgbuf[1 ]);/* process all the same items cleared in a function level reset */
Greg Kroah-Hartman
maintainerPATCH 12/658 xen-netback: move removal of "hotplug-status" to the right place
In reply to Greg Kroah-HartmanFrom: Pratyush Yadav <[email protected]>
The removal of "hotplug-status" has moved around a bit. First it was moved from netback_remove() to hotplug_status_changed() in upstream commit 1f2565780e9b ("xen-netback: remove 'hotplug-status' once it has served its purpose"). Then the change was reverted in upstream commit 0f4558ae9187 ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose""), but it moved the removal to backend_disconnect(). Then the upstream commit c55f34b6aec2 ("xen-netback: only remove 'hotplug-status' when the vif is actually destroyed") moved it finally back to netback_remove(). The thing to note being it is removed unconditionally this time around.
The story on v5.4.y adds to this confusion. Commit 60e4e3198ce8 ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"") is backported to v5.4.y but the original commit that it tries to revert was never present on 5.4. So the backport incorrectly ends up just adding another xenbus_rm() of "hotplug-status" in backend_disconnect().
Now in v5.4.y it is removed in both backend_disconnect() and netback_remove(). But it should only be removed in netback_remove(), as the upstream version does.
Removing "hotplug-status" in backend_disconnect() causes problems when the frontend unilaterally disconnects, as explained in c55f34b6aec2 ("xen-netback: only remove 'hotplug-status' when the vif is actually destroyed").
Remove "hotplug-status" in the same place as it is done on the upstream version to ensure unilateral re-connection of frontend continues to work.
--- drivers/net/xen-netback/xenbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/xen-netback/xenbus.c +1 -2
@@ -202,10 +202,10 @@ static int netback_remove(struct xenbus_set_backend_state (be, XenbusStateClosed);unregister_hotplug_status_watch (be); +xenbus_rm (XBT_NIL , dev->nodename,"hotplug-status" );if (be->vif) {kobject_uevent (&dev->dev.kobj,KOBJ_OFFLINE );xen_unregister_watchers (be->vif); -xenbus_rm (XBT_NIL , dev->nodename,"hotplug-status" );xenvif_free (be->vif); be->vif =NULL ; }
@@ -435,7 +435,6 @@ static void backend_disconnect(struct baunsigned int queue_index;xen_unregister_watchers (vif); -xenbus_rm (XBT_NIL , be->dev->nodename,"hotplug-status" );#ifdef CONFIG_DEBUG_FS xenvif_debugfs_delif (vif);#endif /* CONFIG_DEBUG_FS */
Greg Kroah-Hartman
maintainerPATCH 13/658 HID: ite: Add support for Acer S1002 keyboard-dock
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit c961facb5b19634eee5bcdd91fc5bf3f1c545bc5 ]
Make the hid-ite driver handle the Acer S1002 keyboard-dock, this leads to 2 improvements:
1. The non working wifi-toggle hotkey now works.
2. Toggling the touchpad on of with the hotkey will no show OSD notifications in e.g. GNOME3. The actual toggling is handled inside the keyboard, this adds support for notifying evdev listeners about this.
Stable-dep-of: 9ad6645a9dce ("HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10")
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-ite.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/hid/hid-ids.h +1 -0
@@ -1140,6 +1140,7 @@#define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710 +#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1002 0x73f4#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003 0x73f5#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
drivers/hid/hid-ite.c +12 -1
@@ -18,10 +18,16 @@ static __u8 *ite_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned intunsigned long quirks = (unsigned long )hid_get_drvdata (hdev);if (quirks &QUIRK_TOUCHPAD_ON_OFF_REPORT ) { +/* For Acer Aspire Switch 10 SW5-012 keyboard-dock */ if (*rsize ==188 && rdesc[162 ] ==0x81 && rdesc[163 ] ==0x02 ) { -hid_info (hdev,"Fixing up ITE keyboard report descriptor\n" ); +hid_info (hdev,"Fixing up Acer Sw5-012 ITE keyboard report descriptor\n" ); rdesc[163 ] =HID_MAIN_ITEM_RELATIVE ; } +/* For Acer One S1002 keyboard-dock */ +if (*rsize ==188 && rdesc[185 ] ==0x81 && rdesc[186 ] ==0x02 ) { +hid_info (hdev,"Fixing up Acer S1002 ITE keyboard report descriptor\n" ); + rdesc[186 ] =HID_MAIN_ITEM_RELATIVE ; + } }return rdesc;
@@ -101,6 +107,11 @@ static const struct hid_device_id ite_devices[] = { USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012), .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT },/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */ + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, +USB_VENDOR_ID_SYNAPTICS , +USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1002 ), + .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT }, +/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,USB_VENDOR_ID_SYNAPTICS , USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003) },
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 14/658 HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch 10E
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit b7c20f3815985570ac71c39b1a3e68c201109578 ]
The Acer Aspire Switch 10E (SW3-016)'s keyboard-dock uses the same USB-ids as the Acer One S1003 keyboard-dock. Yet they are not entirely the same:
1. The S1003 keyboard-dock has the same report descriptors as the S1002 keyboard-dock (which has different USB-ids)
2. The Acer Aspire Switch 10E's keyboard-dock has different report descriptors from the S1002/S1003 keyboard docks and it sends 0x00880078 / 0x00880079 usage events when the touchpad is toggled on/off (which is handled internally).
This means that all Acer kbd-docks handled by the hid-ite.c drivers report their touchpad being toggled on/off through these custom usage-codes with the exception of the S1003 dock, which likely is a bug of that dock.
Add a QUIRK_TOUCHPAD_ON_OFF_REPORT quirk for the Aspire Switch 10E / S1003 usb-id so that the touchpad toggling will get reported to userspace on the Aspire Switch 10E.
Since the Aspire Switch 10E's kbd-dock has different report-descriptors, this also requires adding support for fixing those to ite_report_fixup().
Setting the quirk will also cause ite_report_fixup() to hit the S1002/S1003 descriptors path on the S1003. Since the S1003 kbd-dock never generates any input-reports for the fixed up part of the descriptors this does not matter; and if there are versions out there which do actually send input-reports for the touchpad-toggle then the fixup should actually help to make things work.
This was tested on both an Acer Aspire Switch 10E and on an Acer One S1003.
Stable-dep-of: 9ad6645a9dce ("HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10")
--- drivers/hid/hid-ite.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/hid/hid-ite.c +9 -3
@@ -23,11 +23,16 @@ static __u8 *ite_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned inthid_info (hdev,"Fixing up Acer Sw5-012 ITE keyboard report descriptor\n" ); rdesc[163 ] =HID_MAIN_ITEM_RELATIVE ; } -/* For Acer One S1002 keyboard-dock */ +/* For Acer One S1002/S1003 keyboard-dock */ if (*rsize ==188 && rdesc[185 ] ==0x81 && rdesc[186 ] ==0x02 ) { -hid_info (hdev,"Fixing up Acer S1002 ITE keyboard report descriptor\n" ); +hid_info (hdev,"Fixing up Acer S1002/S1003 ITE keyboard report descriptor\n" ); rdesc[186 ] =HID_MAIN_ITEM_RELATIVE ; } +/* For Acer Aspire Switch 10E (SW3-016) keyboard-dock */ +if (*rsize ==210 && rdesc[184 ] ==0x81 && rdesc[185 ] ==0x02 ) { +hid_info (hdev,"Fixing up Acer Aspire Switch 10E (SW3-016) ITE keyboard report descriptor\n" ); + rdesc[185 ] =HID_MAIN_ITEM_RELATIVE ; + } }return rdesc;
@@ -114,7 +119,8 @@ static const struct hid_device_id ite_devices[] = {/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */ {HID_DEVICE (BUS_USB ,HID_GROUP_GENERIC ,USB_VENDOR_ID_SYNAPTICS , - USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003) }, + USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003), + .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT }, { } };MODULE_DEVICE_TABLE (hid, ite_devices);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 15/658 HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 9ad6645a9dce4d0e42daca6ebf32a154401c59d3 ]
The Acer Aspire Switch V 10 (SW5-017)'s keyboard-dock uses the same ITE controller setup as other Acer Switch 2-in-1's.
This needs special handling for the wifi on/off toggle hotkey as well as to properly report touchpad on/off keypresses.
Add the USB-ids for the SW5-017's keyboard-dock with a quirk setting of QUIRK_TOUCHPAD_ON_OFF_REPORT to fix both issues.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-ite.c | 5 +++++ 2 files changed, 6 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -1142,6 +1142,7 @@#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1002 0x73f4#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003 0x73f5 +#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_017 0x73f6#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7#define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047
drivers/hid/hid-ite.c +5 -0
@@ -121,6 +121,11 @@ static const struct hid_device_id ite_devices[] = { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003), .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT }, +/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */ + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, +USB_VENDOR_ID_SYNAPTICS , +USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_017 ), + .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT }, { } };MODULE_DEVICE_TABLE (hid, ite_devices);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 16/658 HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk
In reply to Greg Kroah-HartmanFrom: José Expósito <[email protected]>
[ Upstream commit 3405a4beaaa852f3ed2a5eb3b5149932d5c3779b ]
Commit f7d8e387d9ae ("HID: uclogic: Switch to Digitizer usage for styluses") changed the usage used in UCLogic from "Pen" to "Digitizer".
However, the IS_INPUT_APPLICATION() macro evaluates to false for HID_DG_DIGITIZER causing issues with the XP-Pen Star G640 tablet.
Add the HID_QUIRK_HIDINPUT_FORCE quirk to bypass the IS_INPUT_APPLICATION() check.
--- drivers/hid/hid-uclogic-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/hid-uclogic-core.c +1 -0
@@ -172,6 +172,7 @@ static int uclogic_probe(struct hid_device *hdev,* than the pen, so use QUIRK_MULTI_INPUT for all tablets. */ hdev->quirks |=HID_QUIRK_MULTI_INPUT ; + hdev->quirks |=HID_QUIRK_HIDINPUT_FORCE ;/* Allocate and assign driver data */ drvdata =devm_kzalloc (&hdev->dev,sizeof (*drvdata),GFP_KERNEL );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 17/658 Bluetooth: L2CAP: Fix u8 overflow
In reply to Greg Kroah-HartmanFrom: Sungwoo Kim <[email protected]>
[ Upstream commit bcd70260ef56e0aee8a4fc6cd214a419900b0765 ]
By keep sending L2CAP_CONF_REQ packets, chan->num_conf_rsp increases multiple times and eventually it will wrap around the maximum number (i.e., 255).
This patch prevents this by adding a boundary check with L2CAP_MAX_CONF_RSP
Btmon log:
Bluetooth monitor ver 5.64
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
= Note: Bluetooth subsystem version 2.22 0.264636
@ MGMT Open: btmon (privileged) version 1.22 {0x0001} 0.272191
= New Index: 00:00:00:00:00:00 (Primary,Virtual,hci0) [hci0] 13.877604
@ RAW Open: 9496 (privileged) version 2.22 {0x0002} 13.890741
= Open Index: 00:00:00:00:00:00 [hci0] 13.900426
(...)
Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1033 #32 [hci0] 14.273106
invalid packet size (12 != 1033)
08 00 01 00 02 01 04 00 01 10 ff ff ............Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1547 #33 [hci0] 14.273561
invalid packet size (14 != 1547)
0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@.....Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 2061 #34 [hci0] 14.274390
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 00 00 00 04 ........@.......Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 2061 #35 [hci0] 14.274932
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 07 00 03 00 ........@.......= bluetoothd: Bluetooth daemon 5.43 14.401828
Quoted 1 line
ACL Data RX: Handle 200 flags
0x00dlen 1033 #36 [hci0] 14.275753
invalid packet size (12 != 1033)
08 00 01 00 04 01 04 00 40 00 00 00 ........@...--- net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +2 -1
@@ -4210,7 +4210,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, chan->ident = cmd->ident;l2cap_send_cmd (conn, cmd->ident,L2CAP_CONF_RSP , len, rsp); - chan->num_conf_rsp++; +if (chan->num_conf_rsp <L2CAP_CONF_MAX_CONF_RSP ) + chan->num_conf_rsp++;/* Reset config buffer. */ chan->conf_len =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 18/658 net: loopback: use NET_NAME_PREDICTABLE for name_assign_type
In reply to Greg Kroah-HartmanFrom: Rasmus Villemoes <[email protected]>
[ Upstream commit 31d929de5a112ee1b977a89c57de74710894bbbf ]
When the name_assign_type attribute was introduced (commit 685343fc3ba6, "net: add name_assign_type netdev attribute"), the loopback device was explicitly mentioned as one which would make use of NET_NAME_PREDICTABLE:
The name_assign_type attribute gives hints where the interface name of a given net-device comes from. These values are currently defined:
...
NET_NAME_PREDICTABLE:
The ifname has been assigned by the kernel in a predictable way that is guaranteed to avoid reuse and always be the same for a given device. Examples include statically created devices like the loopback device [...]
Switch to that so that reading /sys/class/net/lo/name_assign_type produces something sensible instead of returning -EINVAL.
--- drivers/net/loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/loopback.c +1 -1
@@ -206,7 +206,7 @@ static __net_init int loopback_net_init(struct net *net)int err; err = -ENOMEM ; - dev =alloc_netdev (0 ,"lo" ,NET_NAME_UNKNOWN , loopback_setup); + dev =alloc_netdev (0 ,"lo" ,NET_NAME_PREDICTABLE , loopback_setup);if (!dev) goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 19/658 usb: musb: remove extra check in musb_gadget_vbus_draw
In reply to Greg Kroah-HartmanFrom: Ivaylo Dimitrov <[email protected]>
[ Upstream commit ecec4b20d29c3d6922dafe7d2555254a454272d2 ]
The checks for musb->xceiv and musb->xceiv->set_power duplicate those in usb_phy_set_power(), so there is no need of them. Moreover, not calling usb_phy_set_power() results in usb_phy_set_charger_current() not being called, so current USB config max current is not propagated through USB charger framework and charger drivers may try to draw more current than allowed or possible.
Fix that by removing those extra checks and calling usb_phy_set_power() directly.
Tested on Motorola Droid4 and Nokia N900
--- drivers/usb/musb/musb_gadget.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/musb/musb_gadget.c +0 -2
@@ -1629,8 +1629,6 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) {struct musb *musb =gadget_to_musb (gadget); -if (!musb->xceiv->set_power) -return -EOPNOTSUPP ;return usb_phy_set_power (musb->xceiv, mA); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 20/658 ARM: dts: qcom: apq8064: fix coresight compatible
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit a42b1ee868361f1cb0492f1bdaefb43e0751e468 ]
There's a typo missing the arm, prefix of arm,coresight-etb10. Fix it to make devicetree validation happier.
--- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +1 -1
@@ -1570,7 +1570,7 @@ wifi { }; etb@1a01000 { - compatible = "coresight-etb10", "arm,primecell"; + compatible = "arm,coresight-etb10", "arm,primecell"; reg = <0x1a01000 0x1000>; clocks = <&rpmcc RPM_QDSS_CLK>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 21/658 arm64: dts: qcom: sdm845-cheza: fix AP suspend pin bias
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 9bce41fab14da8f21027dc9847535ef5e22cbe8b ]
There is no "bias-no-pull" property. Assume intentions were disabling bias.
--- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi +2 -2
@@ -1310,7 +1310,7 @@ ap_suspend_l_assert: ap_suspend_l_assert { config { pins = "gpio126"; function = "gpio"; - bias-no-pull; + bias-disable; drive-strength = <2>; output-low; };
@@ -1320,7 +1320,7 @@ ap_suspend_l_deassert: ap_suspend_l_deassert { config { pins = "gpio126"; function = "gpio"; - bias-no-pull; + bias-disable; drive-strength = <2>; output-high; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 22/658 drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
In reply to Greg Kroah-HartmanFrom: Chen Jiahao <[email protected]>
[ Upstream commit adf85adc2a7199b41e7a4da083bd17274a3d6969 ]
There is a sparse warning shown below:
drivers/soc/ti/knav_qmss_queue.c:70:12: warning: symbol 'knav_acc_firmwares' was not declared. Should it be static?
Since 'knav_acc_firmwares' is only called within knav_qmss_queue.c, mark it as static to fix the warning.
--- drivers/soc/ti/knav_qmss_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ti/knav_qmss_queue.c +1 -1
@@ -64,7 +64,7 @@ static DEFINE_MUTEX(knav_dev_lock);* Newest followed by older ones. Search is done from start of the array * until a firmware file is found. */ -const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin" }; +static const char *const knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin" };static bool device_ready;bool knav_qmss_device_ready (void )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 23/658 soc: qcom: llcc cleanup to get rid of sdm845 specific driver file
In reply to Greg Kroah-HartmanFrom: Vivek Gautam <[email protected]>
[ Upstream commit a14b820316e84310b1bad3701a8d4c9159377633 ]
A single file should suffice the need to program the llcc for various platforms. Get rid of sdm845 specific driver file to make way for a more generic driver.
Stable-dep-of: c882c899ead3 ("soc: qcom: llcc: make irq truly optional")
--- drivers/soc/qcom/Kconfig | 14 +--- drivers/soc/qcom/Makefile | 1 - drivers/soc/qcom/llcc-sdm845.c | 100 ----------------------------- drivers/soc/qcom/llcc-slice.c | 60 +++++++++++++++-- include/linux/soc/qcom/llcc-qcom.h | 57 ++++++---------- 5 files changed, 77 insertions(+), 155 deletions(-) delete mode 100644 drivers/soc/qcom/llcc-sdm845.c
drivers/soc/qcom/Kconfig +3 -11
@@ -58,17 +58,9 @@ config QCOM_LLCC depends on ARCH_QCOM || COMPILE_TEST help Qualcomm Technologies, Inc. platform specific - Last Level Cache Controller(LLCC) driver. This provides interfaces - to clients that use the LLCC. Say yes here to enable LLCC slice - driver. - -config QCOM_SDM845_LLCC - tristate "Qualcomm Technologies, Inc. SDM845 LLCC driver" - depends on QCOM_LLCC - help - Say yes here to enable the LLCC driver for SDM845. This provides - data required to configure LLCC so that clients can start using the - LLCC slices. + Last Level Cache Controller(LLCC) driver for platforms such as, + SDM845. This provides interfaces to clients that use the LLCC. + Say yes here to enable LLCC slice driver. config QCOM_MDT_LOADER tristate
drivers/soc/qcom/Makefile +0 -1
@@ -22,6 +22,5 @@ obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o obj-$(CONFIG_QCOM_APR) += apr.o obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o -obj-$(CONFIG_QCOM_SDM845_LLCC) += llcc-sdm845.o obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o
drivers/soc/qcom/llcc-sdm845.c deleted +0 -100
100 lines not on this page · raw message
drivers/soc/qcom/llcc-slice.c +53 -7
98 lines not on this page · raw message
include/linux/soc/qcom/llcc-qcom.h +21 -36
75 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 24/658 soc: qcom: Rename llcc-slice to llcc-qcom
In reply to Greg Kroah-HartmanFrom: Vivek Gautam <[email protected]>
[ Upstream commit a0e72a5ba48ae9c6449a32130d74506a854b79d2 ]
The cleaning up was done without changing the driver file name to ensure a cleaner bisect. Change the file name now to facilitate making the driver generic in subsequent patch.
Stable-dep-of: c882c899ead3 ("soc: qcom: llcc: make irq truly optional")
---
drivers/soc/qcom/Makefile | 2 +-
drivers/soc/qcom/{llcc-slice.c => llcc-qcom.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename drivers/soc/qcom/{llcc-slice.c => llcc-qcom.c} (100%)drivers/soc/qcom/Makefile +1 -1
@@ -21,6 +21,6 @@ obj-$(CONFIG_QCOM_SMSM) += smsm.o obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o obj-$(CONFIG_QCOM_WCNSS_CTRL) += wcnss_ctrl.o obj-$(CONFIG_QCOM_APR) += apr.o -obj-$(CONFIG_QCOM_LLCC) += llcc-slice.o +obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o
drivers/soc/qcom/llcc-qcom.c renamed from drivers/soc/qcom/llcc-slice.c +0 -0
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 25/658 soc: qcom: llcc: make irq truly optional
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit c882c899ead3545102a4d71b5fbe73b9e4bc2657 ]
The function platform_get_irq prints an error message into the kernel log when the irq isn't found.
Since the interrupt is actually optional and not provided by some SoCs, use platform_get_irq_optional which does not print an error message.
--- drivers/soc/qcom/llcc-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/llcc-qcom.c +1 -1
@@ -415,7 +415,7 @@ static int qcom_llcc_probe(struct platform_device *pdev,if (ret) goto err; - drv_data->ecc_irq =platform_get_irq (pdev,0 ); + drv_data->ecc_irq =platform_get_irq_optional (pdev,0 );if (drv_data->ecc_irq >=0 ) { llcc_edac = platform_device_register_data(&pdev->dev, "qcom_llcc_edac", -1, drv_data,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 26/658 arm: dts: spear600: Fix clcd interrupt
In reply to Greg Kroah-HartmanFrom: Kory Maincent <[email protected]>
[ Upstream commit 0336e2ce34e7a89832b6c214f924eb7bc58940be ]
Interrupt 12 of the Interrupt controller belongs to the SMI controller, the right one for the display controller is the interrupt 13.
--- arch/arm/boot/dts/spear600.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/spear600.dtsi +1 -1
@@ -47,7 +47,7 @@ clcd: clcd@fc200000 { compatible = "arm,pl110", "arm,primecell"; reg = <0xfc200000 0x1000>; interrupt-parent = <&vic1>; - interrupts = <12>; + interrupts = <13>; status = "disabled"; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 27/658 soc: ti: knav_qmss_queue: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
In reply to Greg Kroah-HartmanFrom: Minghao Chi <[email protected]>
[ Upstream commit 12eeb74925da70eb39d90abead9de9793be3d4c8 ]
Using pm_runtime_resume_and_get is more appropriate for simplifying code.
Stable-dep-of: e961c0f19450 ("soc: ti: knav_qmss_queue: Fix PM disable depth imbalance in knav_queue_probe")
--- drivers/soc/ti/knav_qmss_queue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/soc/ti/knav_qmss_queue.c +1 -2
@@ -1789,9 +1789,8 @@ static int knav_queue_probe(struct platform_device *pdev)INIT_LIST_HEAD (&kdev->pdsps);pm_runtime_enable (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev); + ret =pm_runtime_resume_and_get (&pdev->dev);if (ret <0 ) { -pm_runtime_put_noidle (&pdev->dev);dev_err (dev,"Failed to enable QMSS\n" );return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 28/658 soc: ti: knav_qmss_queue: Fix PM disable depth imbalance in knav_queue_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit e961c0f19450fd4a26bd043dd2979990bf12caf6 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- drivers/soc/ti/knav_qmss_queue.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/ti/knav_qmss_queue.c +1 -0
@@ -1791,6 +1791,7 @@ static int knav_queue_probe(struct platform_device *pdev)pm_runtime_enable (&pdev->dev); ret =pm_runtime_resume_and_get (&pdev->dev);if (ret <0 ) { +pm_runtime_disable (&pdev->dev);dev_err (dev,"Failed to enable QMSS\n" );return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 29/658 soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit 69460e68eb662064ab4188d4e129ff31c1f23ed9 ]
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context.
--- drivers/power/avs/smartreflex.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/avs/smartreflex.c +1 -0
@@ -942,6 +942,7 @@ static int omap_sr_probe(struct platform_device *pdev) err_debugfs:debugfs_remove_recursive (sr_info->dbg_dir); err_list_del: +pm_runtime_disable (&pdev->dev);list_del (&sr_info->node);pm_runtime_put_sync (&pdev->dev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 30/658 perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit facafab7611f7b872c6b9eeaff53461ef11f482e ]
dsu_pmu_init() won't remove the callback added by cpuhp_setup_state_multi() when platform_driver_register() failed. Remove the callback by cpuhp_remove_multi_state() in fail path.
Similar to the handling of arm_ccn_init() in commit 26242b330093 ("bus:
arm-ccn: Prevent hotplug callback leak")
--- drivers/perf/arm_dsu_pmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/perf/arm_dsu_pmu.c +5 -1
@@ -816,7 +816,11 @@ static int __init dsu_pmu_init(void)if (ret <0 )return ret; dsu_pmu_cpuhp_state = ret; -return platform_driver_register (&dsu_pmu_driver); + ret =platform_driver_register (&dsu_pmu_driver); +if (ret) +cpuhp_remove_multi_state (dsu_pmu_cpuhp_state); + +return ret; } static void __exit dsu_pmu_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 31/658 perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit 6f2d566b46436a50a80d6445e82879686b89588c ]
arm_smmu_pmu_init() won't remove the callback added by cpuhp_setup_state_multi() when platform_driver_register() failed. Remove the callback by cpuhp_remove_multi_state() in fail path.
Similar to the handling of arm_ccn_init() in commit 26242b330093 ("bus:
arm-ccn: Prevent hotplug callback leak")
--- drivers/perf/arm_smmuv3_pmu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/perf/arm_smmuv3_pmu.c +7 -1
@@ -872,6 +872,8 @@ static struct platform_driver smmu_pmu_driver = {static int __init arm_smmu_pmu_init (void ) { +int ret; + cpuhp_state_num = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "perf/arm/pmcg:online", NULL,
@@ -879,7 +881,11 @@ static int __init arm_smmu_pmu_init(void)if (cpuhp_state_num <0 )return cpuhp_state_num; -return platform_driver_register (&smmu_pmu_driver); + ret =platform_driver_register (&smmu_pmu_driver); +if (ret) +cpuhp_remove_multi_state (cpuhp_state_num); + +return ret; }module_init (arm_smmu_pmu_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 32/658 arm64: dts: mt2712e: Fix unit_address_vs_reg warning for oscillators
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit e4495a0a8b3d84816c9a46edf3ce060bbf267475 ]
Rename the fixed-clock oscillators to remove the unit address.
This solves unit_address_vs_reg warnings.
--- arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/mediatek/mt2712e.dtsi +10 -10
@@ -160,70 +160,70 @@ sys_clk: dummyclk { #clock-cells = <0>; }; - clk26m: oscillator@0 { + clk26m: oscillator-26m { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>; clock-output-names = "clk26m"; }; - clk32k: oscillator@1 { + clk32k: oscillator-32k { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <32768>; clock-output-names = "clk32k"; }; - clkfpc: oscillator@2 { + clkfpc: oscillator-50m { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <50000000>; clock-output-names = "clkfpc"; }; - clkaud_ext_i_0: oscillator@3 { + clkaud_ext_i_0: oscillator-aud0 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <6500000>; clock-output-names = "clkaud_ext_i_0"; }; - clkaud_ext_i_1: oscillator@4 { + clkaud_ext_i_1: oscillator-aud1 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <196608000>; clock-output-names = "clkaud_ext_i_1"; }; - clkaud_ext_i_2: oscillator@5 { + clkaud_ext_i_2: oscillator-aud2 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <180633600>; clock-output-names = "clkaud_ext_i_2"; }; - clki2si0_mck_i: oscillator@6 { + clki2si0_mck_i: oscillator-i2s0 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <30000000>; clock-output-names = "clki2si0_mck_i"; }; - clki2si1_mck_i: oscillator@7 { + clki2si1_mck_i: oscillator-i2s1 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <30000000>; clock-output-names = "clki2si1_mck_i"; }; - clki2si2_mck_i: oscillator@8 { + clki2si2_mck_i: oscillator-i2s2 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <30000000>; clock-output-names = "clki2si2_mck_i"; }; - clktdmin_mclk_i: oscillator@9 { + clktdmin_mclk_i: oscillator-mclk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <30000000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 33/658 arm64: dts: mt2712e: Fix unit address for pinctrl node
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 1d4516f53a611b362db7ba7a8889923d469f57e1 ]
The unit address for the pinctrl node is (0x)1000b000 and not (0x)10005000, which is the syscfg_pctl_a address instead.
This fixes the following warning:
arch/arm64/boot/dts/mediatek/mt2712e.dtsi:264.40-267.4: Warning (unique_unit_address): /syscfg_pctl_a@10005000: duplicate unit-address (also used in node /pinctrl@10005000)
--- arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt2712e.dtsi +1 -1
@@ -266,7 +266,7 @@ syscfg_pctl_a: syscfg_pctl_a@10005000 { reg = <0 0x10005000 0 0x1000>; }; - pio: pinctrl@10005000 { + pio: pinctrl@1000b000 { compatible = "mediatek,mt2712-pinctrl"; reg = <0 0x1000b000 0 0x1000>; mediatek,pctl-regmap = <&syscfg_pctl_a>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 34/658 arm64: dts: mt2712-evb: Fix vproc fixed regulators unit names
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 377063156893bf6c088309ac799fe5c6dce2822d ]
Update the names to regulator-vproc-buck{0,1} to fix unit_addres_vs_reg warnings for those.
--- arch/arm64/boot/dts/mediatek/mt2712-evb.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt2712-evb.dts +2 -2
@@ -26,14 +26,14 @@ chosen { stdout-path = "serial0:921600n8"; }; - cpus_fixed_vproc0: fixedregulator@0 { + cpus_fixed_vproc0: regulator-vproc-buck0 { compatible = "regulator-fixed"; regulator-name = "vproc_buck0"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; }; - cpus_fixed_vproc1: fixedregulator@1 { + cpus_fixed_vproc1: regulator-vproc-buck1 { compatible = "regulator-fixed"; regulator-name = "vproc_buck1"; regulator-min-microvolt = <1000000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 35/658 arm64: dts: mt2712-evb: Fix usb vbus regulators unit names
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit ec1ae39a8d25cfb067b5459fac7c5b7b9bce6f6a ]
Update the names to regulator-usb-p{0-3}-vbus to fix unit_address_vs_reg warnings for those.
--- arch/arm64/boot/dts/mediatek/mt2712-evb.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt2712-evb.dts +4 -4
@@ -50,7 +50,7 @@ extcon_usb1: extcon_iddig1 { id-gpio = <&pio 14 GPIO_ACTIVE_HIGH>; }; - usb_p0_vbus: regulator@2 { + usb_p0_vbus: regulator-usb-p0-vbus { compatible = "regulator-fixed"; regulator-name = "p0_vbus"; regulator-min-microvolt = <5000000>;
@@ -59,7 +59,7 @@ usb_p0_vbus: regulator@2 { enable-active-high; }; - usb_p1_vbus: regulator@3 { + usb_p1_vbus: regulator-usb-p1-vbus { compatible = "regulator-fixed"; regulator-name = "p1_vbus"; regulator-min-microvolt = <5000000>;
@@ -68,7 +68,7 @@ usb_p1_vbus: regulator@3 { enable-active-high; }; - usb_p2_vbus: regulator@4 { + usb_p2_vbus: regulator-usb-p2-vbus { compatible = "regulator-fixed"; regulator-name = "p2_vbus"; regulator-min-microvolt = <5000000>;
@@ -77,7 +77,7 @@ usb_p2_vbus: regulator@4 { enable-active-high; }; - usb_p3_vbus: regulator@5 { + usb_p3_vbus: regulator-usb-p3-vbus { compatible = "regulator-fixed"; regulator-name = "p3_vbus"; regulator-min-microvolt = <5000000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 36/658 arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 5f535cc583759c9c60d4cc9b8d221762e2d75387 ]
Update its unit name to oscillator-26m and remove the unneeded unit address to fix a unit_address_vs_reg warning.
--- arch/arm64/boot/dts/mediatek/mt6797.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt6797.dtsi +1 -1
@@ -102,7 +102,7 @@ cpu9: cpu@201 { }; }; - clk26m: oscillator@0 { + clk26m: oscillator-26m { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 37/658 ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit dcc7d8c72b64a479b8017e4332d99179deb8802d ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/dove.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/dove.dtsi +1 -1
@@ -129,7 +129,7 @@ pcie0: pcie@1 { pcie1: pcie@2 { device_type = "pci"; status = "disabled"; - assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x80000 0 0x2000>; reg = <0x1000 0 0 0 0>; clocks = <&gate_clk 5>; marvell,pcie-port = <1>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 38/658 ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit d9208b0fa2e803d16b28d91bf1d46b7ee9ea13c6 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-370.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-370.dtsi +1 -1
@@ -74,7 +74,7 @@ pcie0: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x80000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 39/658 ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit eab276787f456cbea89fabea110fe0728673d308 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-xp-mv78230.dtsi | 8 ++++---- arch/arm/boot/dts/armada-xp-mv78260.dtsi | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/armada-xp-mv78230.dtsi +4 -4
@@ -97,7 +97,7 @@ pcie1: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -115,7 +115,7 @@ pcie2: pcie@2,0 { pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -133,7 +133,7 @@ pcie3: pcie@3,0 { pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -151,7 +151,7 @@ pcie4: pcie@4,0 { pcie5: pcie@5,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
arch/arm/boot/dts/armada-xp-mv78260.dtsi +8 -8
@@ -112,7 +112,7 @@ pcie1: pcie@1,0 { pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -130,7 +130,7 @@ pcie2: pcie@2,0 { pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x48000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -148,7 +148,7 @@ pcie3: pcie@3,0 { pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -166,7 +166,7 @@ pcie4: pcie@4,0 { pcie5: pcie@5,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x80000 0 0x2000>; + assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; reg = <0x2800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -184,7 +184,7 @@ pcie5: pcie@5,0 { pcie6: pcie@6,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x84000 0 0x2000>; + assigned-addresses = <0x82003000 0 0x84000 0 0x2000>; reg = <0x3000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -202,7 +202,7 @@ pcie6: pcie@6,0 { pcie7: pcie@7,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x88000 0 0x2000>; + assigned-addresses = <0x82003800 0 0x88000 0 0x2000>; reg = <0x3800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -220,7 +220,7 @@ pcie7: pcie@7,0 { pcie8: pcie@8,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x8c000 0 0x2000>; + assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>; reg = <0x4000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -238,7 +238,7 @@ pcie8: pcie@8,0 { pcie9: pcie@9,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x42000 0 0x2000>; + assigned-addresses = <0x82004800 0 0x42000 0 0x2000>; reg = <0x4800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 40/658 ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 823956d2436f70ced74c0fe8ab99facd8abfc060 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-375.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-375.dtsi +1 -1
@@ -584,7 +584,7 @@ pcie0: pcie@1,0 { pcie1: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x44000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 41/658 ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 44f47b7a8fa4678ce4c38ea74837e4996b9df6d6 ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-380.dtsi | 4 ++-- arch/arm/boot/dts/armada-385.dtsi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/armada-380.dtsi +2 -2
@@ -79,7 +79,7 @@ pcie@1,0 { /* x1 port */ pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -98,7 +98,7 @@ pcie@2,0 { /* x1 port */ pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
arch/arm/boot/dts/armada-385.dtsi +3 -3
@@ -84,7 +84,7 @@ pcie1: pcie@1,0 { /* x1 port */ pcie2: pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -103,7 +103,7 @@ pcie2: pcie@2,0 { /* x1 port */ pcie3: pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -125,7 +125,7 @@ pcie3: pcie@3,0 { */ pcie4: pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x48000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 42/658 ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 69236d2391b4d7324b11c3252921571577892e7b ]
BDF of resource in DT assigned-addresses property of Marvell PCIe Root Port (PCI-to-PCI bridge) should match BDF in address part in that DT node name as specified resource belongs to Marvell PCIe Root Port itself.
--- arch/arm/boot/dts/armada-39x.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/armada-39x.dtsi +3 -3
@@ -457,7 +457,7 @@ pcie@1,0 { /* x1 port */ pcie@2,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; + assigned-addresses = <0x82001000 0 0x40000 0 0x2000>; reg = <0x1000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -476,7 +476,7 @@ pcie@2,0 { /* x1 port */ pcie@3,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; + assigned-addresses = <0x82001800 0 0x44000 0 0x2000>; reg = <0x1800 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
@@ -498,7 +498,7 @@ pcie@3,0 { */ pcie@4,0 { device_type = "pci"; - assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; + assigned-addresses = <0x82002000 0 0x48000 0 0x2000>; reg = <0x2000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 43/658 ARM: dts: turris-omnia: Add ethernet aliases
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit f1f3e530c59a7e8c5f06172f4c28b945a6b4bfb8 ]
This allows bootloader to correctly pass MAC addresses used by bootloader to individual interfaces into kernel device tree.
--- arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/armada-385-turris-omnia.dts +6 -0
@@ -22,6 +22,12 @@ chosen { stdout-path = &uart0; }; + aliases { + ethernet0 = ð0; + ethernet1 = ð1; + ethernet2 = ð2; + }; + memory { device_type = "memory"; reg = <0x00000000 0x40000000>; /* 1024 MB */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 44/658 ARM: dts: turris-omnia: Add switch port 6 node
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit f87db2005f73876602211af0ee156817019b6bda ]
Switch port 6 is connected to eth0, so add appropriate device tree node for it.
--- arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/boot/dts/armada-385-turris-omnia.dts +11 -1
@@ -297,7 +297,17 @@ fixed-link { }; }; - /* port 6 is connected to eth0 */ + ports@6 { + reg = <6>; + label = "cpu"; + ethernet = <ð0>; + phy-mode = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; }; }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 45/658 arm64: dts: armada-3720-turris-mox: Add missing interrupt for RTC
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
[ Upstream commit 21aad8ba615e9c39cee6c5d0b76726f63791926c ]
MCP7940MT-I/MNY RTC has connected interrupt line to GPIO2_5.
--- arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +3 -0
@@ -122,9 +122,12 @@ &i2c0 { /delete-property/ mrvl,i2c-fast-mode; status = "okay"; + /* MCP7940MT-I/MNY RTC */ rtc@6f { compatible = "microchip,mcp7940x"; reg = <0x6f>; + interrupt-parent = <&gpiosb>; + interrupts = <5 0>; /* GPIO2_5 */ }; };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 46/658 pstore/ram: Fix error return code in ramoops_probe()
In reply to Greg Kroah-HartmanFrom: Wang Yufen <[email protected]>
[ Upstream commit e1fce564900f8734edf15b87f028c57e14f6e28d ]
In the if (dev_of_node(dev) && !pdata) path, the "err" may be assigned a value of 0, so the error return code -EINVAL may be incorrectly set to 0. To fix set valid return code before calling to goto.
--- fs/pstore/ram.c | 2 ++ 1 file changed, 2 insertions(+)
fs/pstore/ram.c +2 -0
@@ -759,6 +759,7 @@ static int ramoops_probe(struct platform_device *pdev)/* Make sure we didn't get bogus platform data pointer. */ if (!pdata) {pr_err ("NULL platform data\n" ); + err = -EINVAL ; goto fail_out; }
@@ -766,6 +767,7 @@ static int ramoops_probe(struct platform_device *pdev) !pdata->ftrace_size && !pdata->pmsg_size)) {pr_err ("The memory size and the record/console size must be " "non-zero\n" ); + err = -EINVAL ; goto fail_out; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 47/658 ARM: mmp: fix timer_read delay
In reply to Greg Kroah-HartmanFrom: Doug Brown <[email protected]>
[ Upstream commit e348b4014c31041e13ff370669ba3348c4d385e3 ]
timer_read() was using an empty 100-iteration loop to wait for the TMR_CVWR register to capture the latest timer counter value. The delay wasn't long enough. This resulted in CPU idle time being extremely underreported on PXA168 with CONFIG_NO_HZ_IDLE=y.
Switch to the approach used in the vendor kernel, which implements the capture delay by reading TMR_CVWR a few times instead.
--- arch/arm/mach-mmp/time.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/arm/mach-mmp/time.c +7 -4
@@ -44,18 +44,21 @@static void __iomem *mmp_timer_base =TIMERS_VIRT_BASE ;/* -* FIXME: the timer needs some delay to stablize the counter capture +* Read the timer through the CVWR register. Delay is required after requesting +* a read. The CR register cannot be directly read due to metastability issues +* documented in the PXA168 software manual. */ static inline uint32_t timer_read (void ) { -int delay =100 ; +uint32_t val; +int delay =3 ;__raw_writel (1 , mmp_timer_base +TMR_CVWR (1 ));while (delay--) -cpu_relax (); + val =__raw_readl (mmp_timer_base +TMR_CVWR (1 )); -return __raw_readl (mmp_timer_base +TMR_CVWR (1 )); +return val; } static u64 notrace mmp_read_sched_clock(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 48/658 pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit e6b842741b4f39007215fd7e545cb55aa3d358a2 ]
An oops can be induced by running 'cat /proc/kcore > /dev/null' on devices using pstore with the ram backend because kmap_atomic() assumes lowmem pages are accessible with __va().
Unable to handle kernel paging request at virtual address ffffff807ff2b000 Mem abort info: ESR = 0x96000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000081d87000 [ffffff807ff2b000] pgd=180000017fe18003, p4d=180000017fe18003, pud=180000017fe18003, pmd=0000000000000000 Internal error: Oops: 96000006 [#1] PREEMPT SMP Modules linked in: dm_integrity CPU: 7 PID: 21179 Comm: perf Not tainted 5.15.67-10882-ge4eb2eb988cd #1 baa443fb8e8477896a370b31a821eb2009f9bfba Hardware name: Google Lazor (rev3 - 8) (DT) pstate: a0400009 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __memcpy+0x110/0x260 lr : vread+0x194/0x294 sp : ffffffc013ee39d0 x29: ffffffc013ee39f0 x28: 0000000000001000 x27: ffffff807ff2b000 x26: 0000000000001000 x25: ffffffc0085a2000 x24: ffffff802d4b3000 x23: ffffff80f8a60000 x22: ffffff802d4b3000 x21: ffffffc0085a2000 x20: ffffff8080b7bc68 x19: 0000000000001000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: ffffffd3073f2e60 x14: ffffffffad588000 x13: 0000000000000000 x12: 0000000000000001 x11: 00000000000001a2 x10: 00680000fff2bf0b x9 : 03fffffff807ff2b x8 : 0000000000000001 x7 : 0000000000000000 x6 : 0000000000000000 x5 : ffffff802d4b4000 x4 : ffffff807ff2c000 x3 : ffffffc013ee3a78 x2 : 0000000000001000 x1 : ffffff807ff2b000 x0 : ffffff802d4b3000 Call trace: __memcpy+0x110/0x260 read_kcore+0x584/0x778 proc_reg_read+0xb4/0xe4
During early boot, memblock reserves the pages for the ramoops reserved memory node in DT that would otherwise be part of the direct lowmem mapping. Pstore's ram backend reuses those reserved pages to change the memory type (writeback or non-cached) by passing the pages to vmap() (see pfn_to_page() usage in persistent_ram_vmap() for more details) with specific flags. When read_kcore() starts iterating over the vmalloc region, it runs over the virtual address that vmap() returned for ramoops. In aligned_vread() the virtual address is passed to vmalloc_to_page() which returns the page struct for the reserved lowmem area. That lowmem page is passed to kmap_atomic(), which effectively calls page_to_virt() that assumes a lowmem page struct must be directly accessible with __va() and friends. These pages are mapped via vmap() though, and the lowmem mapping was never made, so accessing them via the lowmem virtual address oopses like above.
Let's side-step this problem by passing VM_IOREMAP to vmap(). This will tell vread() to not include the ramoops region in the kcore. Instead the area will look like a bunch of zeros. The alternative is to teach kmap() about vmalloc areas that intersect with lowmem. Presumably such a change isn't a one-liner, and there isn't much interest in inspecting the ramoops region in kcore files anyway, so the most expedient route is taken for now.
--- fs/pstore/ram_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/pstore/ram_core.c +5 -1
@@ -427,7 +427,11 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,phys_addr_t addr = page_start + i *PAGE_SIZE ; pages[i] =pfn_to_page (addr >>PAGE_SHIFT ); } - vaddr =vmap (pages, page_count,VM_MAP , prot); +/* +* VM_IOREMAP used here to bypass this region during vread() +* and kmap_atomic() (i.e. kcore) to avoid __va() failures. +*/ + vaddr =vmap (pages, page_count,VM_MAP |VM_IOREMAP , prot);kfree (pages);/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 49/658 tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
In reply to Greg Kroah-HartmanFrom: Michael Kelley <[email protected]>
[ Upstream commit f5264068071964b56dc02c9dab3d11574aaca6ff ]
The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.
--- drivers/char/tpm/tpm_crb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,iowrite32 (CRB_LOC_CTRL_RELINQUISH , &priv->regs_h->loc_ctrl);if (!crb_wait_for_reg_32 (&priv->regs_h->loc_state, mask, value,TPM2_TIMEOUT_C )) { -dev_warn (dev,"TPM_LOC_STATE_x.requestAccess timed out\n" ); +dev_warn (dev,"TPM_LOC_STATE_x.Relinquish timed out\n" );return -ETIME ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 50/658 cpuidle: dt: Return the correct numbers of parsed idle states
In reply to Greg Kroah-HartmanFrom: Ulf Hansson <[email protected]>
[ Upstream commit ee3c2c8ad6ba6785f14a60e4081d7c82e88162a2 ]
While we correctly skips to initialize an idle state from a disabled idle state node in DT, the returned value from dt_init_idle_driver() don't get adjusted accordingly. Instead the number of found idle state nodes are returned, while the callers are expecting the number of successfully initialized idle states from DT.
This leads to cpuidle drivers unnecessarily continues to initialize their idle state specific data. Moreover, in the case when all idle states have been disabled in DT, we would end up registering a cpuidle driver, rather than relying on the default arch specific idle call.
--- drivers/cpuidle/dt_idle_states.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/dt_idle_states.c +1 -1
@@ -224,6 +224,6 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,* also be 0 on platforms with missing DT idle states or legacy DT * configuration predating the DT idle states bindings. */ -return i; +return state_idx - start_idx; }EXPORT_SYMBOL_GPL (dt_init_idle_driver);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 51/658 alpha: fix syscall entry in !AUDUT_SYSCALL case
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit f7b2431a6d22f7a91c567708e071dfcd6d66db14 ]
We only want to take the slow path if SYSCALL_TRACE or SYSCALL_AUDIT is set; on !AUDIT_SYSCALL configs the current tree hits it whenever _any_ thread flag (including NEED_RESCHED, NOTIFY_SIGNAL, etc.) happens to be set.
--- arch/alpha/kernel/entry.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/alpha/kernel/entry.S +3 -1
@@ -469,8 +469,10 @@ entSys: #ifdef CONFIG_AUDITSYSCALL lda $6, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT and $3, $6, $3 -#endif bne $3, strace +#else + blbs $3, strace /* check for SYSCALL_TRACE in disguise */ +#endif beq $4, 1f ldq $27, 0($5) 1: jsr $26, ($27), sys_ni_syscall
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 52/658 PM: hibernate: Fix mistake in kerneldoc comment
In reply to Greg Kroah-HartmanFrom: xiongxin <[email protected]>
[ Upstream commit 6e5d7300cbe7c3541bc31f16db3e9266e6027b4b ]
The actual maximum image size formula in hibernate_preallocate_memory() is as follows:
max_size = (count - (size + PAGES_FOR_IO)) / 2
- 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE);
but the one in the kerneldoc comment of the function is different and incorrect.
--- kernel/power/snapshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/power/snapshot.c +2 -2
@@ -1680,8 +1680,8 @@ static unsigned long minimum_image_size(unsigned long saveable)* /sys/power/reserved_size, respectively). To make this happen, we compute the * total number of available page frames and allocate at least * -* ([page frames total] + PAGES_FOR_IO + [metadata pages]) / 2 -* + 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE) +* ([page frames total] - PAGES_FOR_IO - [metadata pages]) / 2 +* - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE) * * of them, which corresponds to the maximum size of a hibernation image. *
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 53/658 fs: dont audit the capability check in simple_xattr_list()
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit e7eda157c4071cd1e69f4b1687b0fbe1ae5e6f46 ]
The check being unconditional may lead to unwanted denials reported by LSMs when a process has the capability granted by DAC, but denied by an LSM. In the case of SELinux such denials are a problem, since they can't be effectively filtered out via the policy and when not silenced, they produce noise that may hide a true problem or an attack.
Checking for the capability only if any trusted xattr is actually present wouldn't really address the issue, since calling listxattr(2) on such node on its own doesn't indicate an explicit attempt to see the trusted xattrs. Additionally, it could potentially leak the presence of trusted xattrs to an unprivileged user if they can check for the denials (e.g. through dmesg).
Therefore, it's best (and simplest) to keep the check unconditional and instead use ns_capable_noaudit() that will silence any associated LSM denials.
--- fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xattr.c +1 -1
@@ -1013,7 +1013,7 @@ static int xattr_list_one(char **buffer, ssize_t *remaining_size,ssize_t simple_xattr_list (struct inode *inode,struct simple_xattrs *xattrs,char *buffer,size_t size) { -bool trusted =capable (CAP_SYS_ADMIN ); +bool trusted =ns_capable_noaudit (&init_user_ns,CAP_SYS_ADMIN );struct simple_xattr *xattr;ssize_t remaining_size = size;int err =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 54/658 selftests/ftrace: event_triggers: wait longer for test_event_enable
In reply to Greg Kroah-HartmanFrom: Yipeng Zou <[email protected]>
[ Upstream commit a1d6cd88c8973cfb08ee85722488b1d6d5d16327 ]
In some platform, the schedule event may came slowly, delay 100ms can't cover it.
I was notice that on my board which running in low cpu_freq,and this selftests allways gose fail.
So maybe we can check more times here to wait longer.
--- .../ftrace/test.d/ftrace/func_event_triggers.tc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc +11 -4
@@ -42,11 +42,18 @@ cnt_trace() { test_event_enabled() { val=$1 + check_times=10 # wait for 10 * SLEEP_TIME at most - e=`cat $EVENT_ENABLE` - if [ "$e" != $val ]; then - fail "Expected $val but found $e" - fi + while [ $check_times -ne 0 ]; do + e=`cat $EVENT_ENABLE` + if [ "$e" == $val ]; then + return 0 + fi + sleep $SLEEP_TIME + check_times=$((check_times - 1)) + done + + fail "Expected $val but found $e" } run_enable_disable() {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 55/658 perf: Fix possible memleak in pmu_dev_alloc()
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit e8d7a90c08ce963c592fb49845f2ccc606a2ac21 ]
In pmu_dev_alloc(), when dev_set_name() failed, it will goto free_dev and call put_device(pmu->dev) to release it.
However pmu->dev->release is assigned after this, which makes warning and memleak.
Call dev_set_name() after pmu->dev->release = pmu_dev_release to fix it.
Device '(null)' does not have a release() function...
WARNING: CPU: 2 PID: 441 at drivers/base/core.c:2332 device_release+0x1b9/0x240
...
Call Trace:
<TASK>
kobject_put+0x17f/0x460
put_device+0x20/0x30
pmu_dev_alloc+0x152/0x400
perf_pmu_register+0x96b/0xee0
...
kmemleak: 1 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
unreferenced object 0xffff888014759000 (size 2048):
comm "modprobe", pid 441, jiffies 4294931444 (age 38.332s)
backtrace:
[<0000000005aed3b4>] kmalloc_trace+0x27/0x110
[<000000006b38f9b8>] pmu_dev_alloc+0x50/0x400
[<00000000735f17be>] perf_pmu_register+0x96b/0xee0
[<00000000e38477f1>] 0xffffffffc0ad8603
[<000000004e162216>] do_one_initcall+0xd0/0x4e0
...--- kernel/events/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
kernel/events/core.c +5 -3
@@ -10035,13 +10035,15 @@ static int pmu_dev_alloc(struct pmu *pmu) pmu->dev->groups = pmu->attr_groups;device_initialize (pmu->dev); - ret =dev_set_name (pmu->dev,"%s" , pmu->name); -if (ret) - goto free_dev;dev_set_drvdata (pmu->dev, pmu); pmu->dev->bus = &pmu_bus; pmu->dev->release = pmu_dev_release; + + ret =dev_set_name (pmu->dev,"%s" , pmu->name); +if (ret) + goto free_dev; + ret =device_add (pmu->dev);if (ret) goto free_dev;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 56/658 debugobjects: Free per CPU pool after CPU unplug
In reply to Greg Kroah-HartmanFrom: Zqiang <[email protected]>
[ Upstream commit 88451f2cd3cec2abc30debdf129422d2699d1eba ]
If a CPU is offlined the debug objects per CPU pool is not cleaned up. If the CPU is never onlined again then the objects in the pool are wasted.
Add a CPU hotplug callback which is invoked after the CPU is dead to free the pool.
[ tglx: Massaged changelog and added comment about remote access safety ]
Stable-dep-of: eabb7f1ace53 ("lib/debugobjects: fix stat count and optimize debug_objects_mem_init")
--- include/linux/cpuhotplug.h | 1 + lib/debugobjects.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
include/linux/cpuhotplug.h +1 -0
@@ -36,6 +36,7 @@ enum cpuhp_state {CPUHP_X86_MCE_DEAD ,CPUHP_VIRT_NET_DEAD ,CPUHP_SLUB_DEAD , +CPUHP_DEBUG_OBJ_DEAD ,CPUHP_MM_WRITEBACK_DEAD ,CPUHP_MM_VMSTAT_DEAD , CPUHP_SOFTIRQ_DEAD,
lib/debugobjects.c +25 -0
@@ -19,6 +19,7 @@#include <linux/slab.h> #include <linux/hash.h> #include <linux/kmemleak.h> +#include <linux/cpu.h> #define ODEBUG_HASH_BITS 14#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)
@@ -433,6 +434,25 @@ static void free_object(struct debug_obj *obj) } } +#ifdef CONFIG_HOTPLUG_CPU +static int object_cpu_offline (unsigned int cpu) +{ +struct debug_percpu_free *percpu_pool; +struct hlist_node *tmp; +struct debug_obj *obj; + +/* Remote access is safe as the CPU is dead already */ + percpu_pool =per_cpu_ptr (&percpu_obj_pool, cpu); +hlist_for_each_entry_safe (obj, tmp, &percpu_pool->free_objs, node) { +hlist_del (&obj->node); +kmem_cache_free (obj_cache, obj); + } + percpu_pool->obj_free =0 ; + +return 0 ; +} +#endif +/* * We run out of memory. That means we probably have tons of objects * allocated.
@@ -1378,6 +1398,11 @@ void __init debug_objects_mem_init(void) }else debug_objects_selftest (); +#ifdef CONFIG_HOTPLUG_CPU +cpuhp_setup_state_nocalls (CPUHP_DEBUG_OBJ_DEAD ,"object:offline" ,NULL , + object_cpu_offline); +#endif +/* * Increase the thresholds for allocating and freeing objects * according to the number of possible CPUs available in the system.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 57/658 lib/debugobjects: fix stat count and optimize debug_objects_mem_init
In reply to Greg Kroah-HartmanFrom: wuchi <[email protected]>
[ Upstream commit eabb7f1ace53e127309407b2b5e74e8199e85270 ]
1. Var debug_objects_allocated tracks valid kmem_cache_alloc calls, so track it in debug_objects_replace_static_objects. Do similar things in object_cpu_offline.
2. In debug_objects_mem_init, there is no need to call function cpuhp_setup_state_nocalls when debug_objects_enabled = 0 (out of memory).
--- lib/debugobjects.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
lib/debugobjects.c +10 -0
@@ -440,6 +440,7 @@ static int object_cpu_offline(unsigned int cpu)struct debug_percpu_free *percpu_pool;struct hlist_node *tmp;struct debug_obj *obj; +unsigned long flags;/* Remote access is safe as the CPU is dead already */ percpu_pool =per_cpu_ptr (&percpu_obj_pool, cpu);
@@ -447,6 +448,12 @@ static int object_cpu_offline(unsigned int cpu)hlist_del (&obj->node);kmem_cache_free (obj_cache, obj); } + +raw_spin_lock_irqsave (&pool_lock, flags); + obj_pool_used -= percpu_pool->obj_free; + debug_objects_freed += percpu_pool->obj_free; +raw_spin_unlock_irqrestore (&pool_lock, flags); + percpu_pool->obj_free =0 ;return 0 ;
@@ -1327,6 +1334,8 @@ static int __init debug_objects_replace_static_objects(void)hlist_add_head (&obj->node, &objects); } + debug_objects_allocated += i; +/* * debug_objects_mem_init() is now called early that only one CPU is up * and interrupts have been disabled, so it is safe to replace the
@@ -1395,6 +1404,7 @@ void __init debug_objects_mem_init(void) debug_objects_enabled =0 ;kmem_cache_destroy (obj_cache);pr_warn ("out of memory.\n" ); +return ; }else debug_objects_selftest ();
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 58/658 timerqueue: Use rb_entry_safe() in timerqueue_getnext()
In reply to Greg Kroah-HartmanFrom: Barnabás Pőcze <[email protected]>
[ Upstream commit 2f117484329b233455ee278f2d9b0a4356835060 ]
When timerqueue_getnext() is called on an empty timer queue, it will use rb_entry() on a NULL pointer, which is invalid. Fix that by using rb_entry_safe() which handles NULL pointers.
This has not caused any issues so far because the offset of the rb_node member in timerqueue_node is 0, so rb_entry() is essentially a no-op.
--- include/linux/timerqueue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/timerqueue.h +1 -1
@@ -35,7 +35,7 @@ struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) {struct rb_node *leftmost =rb_first_cached (&head->rb_root); - return rb_entry(leftmost, struct timerqueue_node, node); + return rb_entry_safe(leftmost, struct timerqueue_node, node); }static inline void timerqueue_init (struct timerqueue_node *node)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 59/658 proc: fixup uptime selftest
In reply to Greg Kroah-HartmanFrom: Alexey Dobriyan <[email protected]>
[ Upstream commit 5cc81d5c81af0dee54da9a67a3ebe4be076a13db ]
syscall(3) returns -1 and sets errno on error, unlike "syscall" instruction.
Systems which have <= 32/64 CPUs are unaffected. Test won't bounce to all CPUs before completing if there are more of them.
--- tools/testing/selftests/proc/proc-uptime-002.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/proc/proc-uptime-002.c +2 -1
@@ -17,6 +17,7 @@// while shifting across CPUs. #undef NDEBUG#include <assert.h> +#include <errno.h> #include <unistd.h> #include <sys/syscall.h> #include <stdlib.h>
@@ -54,7 +55,7 @@ int main(void) len +=sizeof (unsigned long );free (m); m =malloc (len); - }while (sys_sched_getaffinity (0 , len, m) == -EINVAL ); + }while (sys_sched_getaffinity (0 , len, m) ==-1 && errno ==EINVAL ); fd =open ("/proc/uptime" ,O_RDONLY );assert (fd >=0 );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 60/658 lib/fonts: fix undefined behavior in bit shift for get_default_font
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit 6fe888c4d2fb174408e4540bb2d5602b9f507f90 ]
Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below:
UBSAN: shift-out-of-bounds in lib/fonts/fonts.c:139:20 left shift of 1 by 31 places cannot be represented in type 'int' <TASK> dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c get_default_font+0x1c7/0x1f0 fbcon_startup+0x347/0x3a0 do_take_over_console+0xce/0x270 do_fbcon_takeover+0xa1/0x170 do_fb_registered+0x2a8/0x340 fbcon_fb_registered+0x47/0xe0 register_framebuffer+0x294/0x4a0 __drm_fb_helper_initial_config_and_unlock+0x43c/0x880 [drm_kms_helper] drm_fb_helper_initial_config+0x52/0x80 [drm_kms_helper] drm_fbdev_client_hotplug+0x156/0x1b0 [drm_kms_helper] drm_fbdev_generic_setup+0xfc/0x290 [drm_kms_helper] bochs_pci_probe+0x6ca/0x772 [bochs] local_pci_probe+0x4d/0xb0 pci_device_probe+0x119/0x320 really_probe+0x181/0x550 __driver_probe_device+0xc6/0x220 driver_probe_device+0x32/0x100 __driver_attach+0x195/0x200 bus_for_each_dev+0xbb/0x120 driver_attach+0x27/0x30 bus_add_driver+0x22e/0x2f0 driver_register+0xa9/0x190 __pci_register_driver+0x90/0xa0 bochs_pci_driver_init+0x52/0x1000 [bochs] do_one_initcall+0x76/0x430 do_init_module+0x61/0x28a load_module+0x1f82/0x2e50 __do_sys_finit_module+0xf8/0x190 __x64_sys_finit_module+0x23/0x30 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK>
--- lib/fonts/fonts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/fonts/fonts.c +2 -2
@@ -132,8 +132,8 @@ const struct font_desc *get_default_font(int xres, int yres, u32 font_w,if (res >20 ) c +=20 - res; -if ((font_w & (1 << (f->width -1 ))) && - (font_h & (1 << (f->height -1 )))) +if ((font_w & (1U << (f->width -1 ))) && + (font_h & (1U << (f->height -1 )))) c +=1000 ;if (c > cc) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 61/658 ocfs2: fix memory leak in ocfs2_stack_glue_init()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit 13b6269dd022aaa69ca8d1df374ab327504121cf ]
ocfs2_table_header should be free in ocfs2_stack_glue_init() if ocfs2_sysfs_init() failed, otherwise kmemleak will report memleak.
BUG: memory leak
unreferenced object 0xffff88810eeb5800 (size 128):
comm "modprobe", pid 4507, jiffies 4296182506 (age 55.888s)
hex dump (first 32 bytes):
c0 40 14 a0 ff ff ff ff 00 00 00 00 01 00 00 00 .@..............
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000001e59e1cd>] __register_sysctl_table+0xca/0xef0
[<00000000c04f70f7>] 0xffffffffa0050037
[<000000001bd12912>] do_one_initcall+0xdb/0x480
[<0000000064f766c9>] do_init_module+0x1cf/0x680
[<000000002ba52db0>] load_module+0x6441/0x6f20
[<000000009772580d>] __do_sys_finit_module+0x12f/0x1c0
[<00000000380c1f22>] do_syscall_64+0x3f/0x90
[<000000004cf473bc>] entry_SYSCALL_64_after_hwframe+0x63/0xcd--- fs/ocfs2/stackglue.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
fs/ocfs2/stackglue.c +7 -1
@@ -707,6 +707,8 @@ static struct ctl_table_header *ocfs2_table_header;static int __init ocfs2_stack_glue_init (void ) { +int ret; +strcpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); ocfs2_table_header =register_sysctl_table (ocfs2_root_table);
@@ -716,7 +718,11 @@ static int __init ocfs2_stack_glue_init(void)return -ENOMEM ;/* or something. */ } -return ocfs2_sysfs_init (); + ret =ocfs2_sysfs_init (); +if (ret) +unregister_sysctl_table (ocfs2_table_header); + +return ret; } static void __exit ocfs2_stack_glue_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 62/658 MIPS: vpe-mt: fix possible memory leak while module exiting
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 5822e8cc84ee37338ab0bdc3124f6eec04dc232d ]
Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, it need be freed when module exiting, call put_device() to give up reference, so that it can be freed in kobject_cleanup() when the refcount hit to 0. The vpe_device is static, so remove kfree() from vpe_device_release().
--- arch/mips/kernel/vpe-mt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/vpe-mt.c +2 -2
@@ -313,7 +313,6 @@ ATTRIBUTE_GROUPS(vpe);static void vpe_device_release (struct device *cd) { -kfree (cd); }static struct class vpe_class = {
@@ -497,6 +496,7 @@ int __init vpe_module_init(void)device_del (&vpe_device); out_class: +put_device (&vpe_device);class_unregister (&vpe_class); out_chrdev:
@@ -509,7 +509,7 @@ void __exit vpe_module_exit(void) {struct vpe *v, *n; -device_del (&vpe_device); +device_unregister (&vpe_device);class_unregister (&vpe_class);unregister_chrdev (major,VPE_MODULE_NAME );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 63/658 MIPS: vpe-cmp: fix possible memory leak while module exiting
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit c5ed1fe0801f0c66b0fbce2785239a5664629057 ]
dev_set_name() allocates memory for name, it need be freed when module exiting, call put_device() to give up reference, so that it can be freed in kobject_cleanup() when the refcount hit to 0. The vpe_device is static, so remove kfree() from vpe_device_release().
--- arch/mips/kernel/vpe-cmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/vpe-cmp.c +2 -2
@@ -75,7 +75,6 @@ ATTRIBUTE_GROUPS(vpe);static void vpe_device_release (struct device *cd) { -kfree (cd); }static struct class vpe_class = {
@@ -157,6 +156,7 @@ int __init vpe_module_init(void)device_del (&vpe_device); out_class: +put_device (&vpe_device);class_unregister (&vpe_class); out_chrdev:
@@ -169,7 +169,7 @@ void __exit vpe_module_exit(void) {struct vpe *v, *n; -device_del (&vpe_device); +device_unregister (&vpe_device);class_unregister (&vpe_class);unregister_chrdev (major,VPE_MODULE_NAME );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 64/658 selftests/efivarfs: Add checking of the test return value
In reply to Greg Kroah-HartmanFrom: Zhao Gongyi <[email protected]>
[ Upstream commit c93924267fe6f2b44af1849f714ae9cd8117a9cd ]
Add checking of the test return value, otherwise it will report success forever for test_create_read().
--- tools/testing/selftests/efivarfs/efivarfs.sh | 5 +++++ 1 file changed, 5 insertions(+)
tools/testing/selftests/efivarfs/efivarfs.sh +5 -0
@@ -87,6 +87,11 @@ test_create_read() { local file=$efivarfs_mount/$FUNCNAME-$test_guid ./create-read $file + if [ $? -ne 0 ]; then + echo "create and read $file failed" + file_cleanup $file + exit 1 + fi file_cleanup $file }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 65/658 PNP: fix name memory leak in pnp_alloc_dev()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 110d7b0325c55ff3620073ba4201845f59e22ebf ]
After commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically, move dev_set_name() after pnp_add_id() to avoid memory leak.
--- drivers/pnp/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pnp/core.c +2 -2
@@ -160,14 +160,14 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, dev->dev.coherent_dma_mask = dev->dma_mask; dev->dev.release = &pnp_release_device; -dev_set_name (&dev->dev,"%02x:%02x" , dev->protocol->number, dev->number); - dev_id =pnp_add_id (dev, pnpid);if (!dev_id) {kfree (dev);return NULL ; } +dev_set_name (&dev->dev,"%02x:%02x" , dev->protocol->number, dev->number); +return dev; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 66/658 perf/x86/intel/uncore: Fix reference count leak in hswep_has_limit_sbox()
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 1ff9dd6e7071a561f803135c1d684b13c7a7d01d ]
pci_get_device() will increase the reference count for the returned 'dev'. We need to call pci_dev_put() to decrease the reference count. Since 'dev' is only used in pci_read_config_dword(), let's add pci_dev_put() right after it.
--- arch/x86/events/intel/uncore_snbep.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/events/intel/uncore_snbep.c +1 -0
@@ -2762,6 +2762,7 @@ static bool hswep_has_limit_sbox(unsigned int device)return false;pci_read_config_dword (dev,HSWEP_PCU_CAPID4_OFFET , &capid4); +pci_dev_put (dev);if (!hswep_get_chop (capid4))return true;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 67/658 irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
In reply to Greg Kroah-HartmanFrom: Shang XiaoJing <[email protected]>
[ Upstream commit f9ee20c85b3a3ba0afd3672630ec4f93d339f015 ]
gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced.
--- drivers/irqchip/irq-gic-pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-pm.c +1 -1
@@ -104,7 +104,7 @@ static int gic_probe(struct platform_device *pdev)pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); + ret =pm_runtime_resume_and_get (dev);if (ret <0 ) goto rpm_disable;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 68/658 EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 9c8921555907f4d723f01ed2d859b66f2d14f08e ]
As the comment of pci_get_domain_bus_and_slot() says, it returns a PCI device with refcount incremented, so it doesn't need to call an extra pci_dev_get() in pci_get_dev_wrapper(), and the PCI device needs to be put in the error path.
--- drivers/edac/i10nm_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/edac/i10nm_base.c +1 -2
@@ -53,11 +53,10 @@ static struct pci_dev *pci_get_dev_wrapper(int dom, unsigned int bus,if (unlikely (pci_enable_device (pdev) <0 )) {edac_dbg (2 ,"Failed to enable device %02x:%02x.%x\n" , bus, dev, fun); +pci_dev_put (pdev);return NULL ; } -pci_dev_get (pdev); -return pdev; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 69/658 nfsd: dont call nfsd_file_put from client states seqfile display
In reply to Greg Kroah-HartmanFrom: Jeff Layton <[email protected]>
[ Upstream commit e0aa651068bfd520afcd357af8ecd2de005fc83d ]
We had a report of this:
BUG: sleeping function called from invalid context at fs/nfsd/filecache.c:440
...with a stack trace showing nfsd_file_put being called from nfs4_show_open. This code has always tried to call fput while holding a spinlock, but we recently changed this to use the filecache, and that started triggering the might_sleep() in nfsd_file_put.
states_start takes and holds the cl_lock while iterating over the client's states, and we can't sleep with that held.
Have the various nfs4_show_* functions instead hold the fi_lock instead of taking a nfsd_file reference.
--- fs/nfsd/nfs4state.c | 51 +++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 18 deletions(-)
fs/nfsd/nfs4state.c +33 -18
@@ -508,15 +508,26 @@ find_any_file(struct nfs4_file *f)return ret; } -static struct nfsd_file *find_deleg_file (struct nfs4_file *f) +static struct nfsd_file *find_any_file_locked (struct nfs4_file *f) { -struct nfsd_file *ret =NULL ; +lockdep_assert_held (&f->fi_lock); + +if (f->fi_fds[O_RDWR ]) +return f->fi_fds[O_RDWR ]; +if (f->fi_fds[O_WRONLY ]) +return f->fi_fds[O_WRONLY ]; +if (f->fi_fds[O_RDONLY ]) +return f->fi_fds[O_RDONLY ]; +return NULL ; +} + +static struct nfsd_file *find_deleg_file_locked (struct nfs4_file *f) +{ +lockdep_assert_held (&f->fi_lock); -spin_lock (&f->fi_lock);if (f->fi_deleg_file) - ret =nfsd_file_get (f->fi_deleg_file); -spin_unlock (&f->fi_lock); -return ret; +return f->fi_deleg_file; +return NULL ; }static atomic_long_t num_delegations;
@@ -2402,9 +2413,11 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) ols =openlockstateid (st); oo = ols->st_stateowner; nf = st->sc_file; - file =find_any_file (nf); + +spin_lock (&nf->fi_lock); + file =find_any_file_locked (nf);if (!file) -return 0 ; + goto out;seq_printf (s,"- 0x%16phN: { type: open, " , &st->sc_stateid);
@@ -2422,8 +2435,8 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st)seq_printf (s,", " );nfs4_show_owner (s, oo);seq_printf (s," }\n" ); -nfsd_file_put (file); - +out: +spin_unlock (&nf->fi_lock);return 0 ; }
@@ -2437,9 +2450,10 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st) ols =openlockstateid (st); oo = ols->st_stateowner; nf = st->sc_file; - file =find_any_file (nf); +spin_lock (&nf->fi_lock); + file =find_any_file_locked (nf);if (!file) -return 0 ; + goto out;seq_printf (s,"- 0x%16phN: { type: lock, " , &st->sc_stateid);
@@ -2455,8 +2469,8 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st)seq_printf (s,", " );nfs4_show_owner (s, oo);seq_printf (s," }\n" ); -nfsd_file_put (file); - +out: +spin_unlock (&nf->fi_lock);return 0 ; }
@@ -2468,9 +2482,10 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st) ds =delegstateid (st); nf = st->sc_file; - file =find_deleg_file (nf); +spin_lock (&nf->fi_lock); + file =find_deleg_file_locked (nf);if (!file) -return 0 ; + goto out;seq_printf (s,"- 0x%16phN: { type: deleg, " , &st->sc_stateid);
@@ -2482,8 +2497,8 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st)nfs4_show_superblock (s, file);seq_printf (s," }\n" ); -nfsd_file_put (file); - +out: +spin_unlock (&nf->fi_lock);return 0 ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 70/658 genirq/irqdesc: Dont try to remove non-existing sysfs files
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 9049e1ca41983ab773d7ea244bee86d7835ec9f5 ]
Fault injection tests trigger warnings like this:
kernfs: can not remove 'chip_name', no directory
WARNING: CPU: 0 PID: 253 at fs/kernfs/dir.c:1616 kernfs_remove_by_name_ns+0xce/0xe0 RIP: 0010:kernfs_remove_by_name_ns+0xce/0xe0 Call Trace: <TASK> remove_files.isra.1+0x3f/0xb0 sysfs_remove_group+0x68/0xe0 sysfs_remove_groups+0x41/0x70 __kobject_del+0x45/0xc0 kobject_del+0x29/0x40 free_desc+0x42/0x70 irq_free_descs+0x5e/0x90
The reason is that the interrupt descriptor sysfs handling does not roll back on a failing kobject_add() during allocation. If the descriptor is freed later on, kobject_del() is invoked with a not added kobject resulting in the above warnings.
A proper rollback in case of a kobject_add() failure would be the straight forward solution. But this is not possible due to the way how interrupt descriptor sysfs handling works.
Interrupt descriptors are allocated before sysfs becomes available. So the sysfs files for the early allocated descriptors are added later in the boot process. At this point there can be nothing useful done about a failing kobject_add(). For consistency the interrupt descriptor allocation always treats kobject_add() failures as non-critical and just emits a warning.
To solve this problem, keep track in the interrupt descriptor whether kobject_add() was successful or not and make the invocation of kobject_del() conditional on that.
[ tglx: Massage changelog, comments and use a state bit. ]
--- kernel/irq/internals.h | 2 ++ kernel/irq/irqdesc.c | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-)
kernel/irq/internals.h +2 -0
@@ -52,6 +52,7 @@ enum {* IRQS_PENDING - irq is pending and replayed later * IRQS_SUSPENDED - irq is suspended * IRQS_NMI - irq line is used to deliver NMIs +* IRQS_SYSFS - descriptor has been added to sysfs */ enum {IRQS_AUTODETECT =0x00000001 ,
@@ -64,6 +65,7 @@ enum {IRQS_SUSPENDED =0x00000800 ,IRQS_TIMINGS =0x00001000 ,IRQS_NMI =0x00002000 , + IRQS_SYSFS = 0x00004000, };#include "debug.h"
kernel/irq/irqdesc.c +9 -6
@@ -288,22 +288,25 @@ static void irq_sysfs_add(int irq, struct irq_desc *desc)if (irq_kobj_base) {/* * Continue even in case of failure as this is nothing -* crucial. +* crucial and failures in the late irq_sysfs_init() +* cannot be rolled back. */ if (kobject_add (&desc->kobj, irq_kobj_base,"%d" , irq))pr_warn ("Failed to add kobject for irq %d\n" , irq); +else + desc->istate |=IRQS_SYSFS ; } }static void irq_sysfs_del (struct irq_desc *desc) {/* -* If irq_sysfs_init() has not yet been invoked (early boot), then -* irq_kobj_base is NULL and the descriptor was never added. -* kobject_del() complains about a object with no parent, so make -* it conditional. +* Only invoke kobject_del() when kobject_add() was successfully +* invoked for the descriptor. This covers both early boot, where +* sysfs is not initialized yet, and the case of a failed +* kobject_add() invocation. */ -if (irq_kobj_base) +if (desc->istate &IRQS_SYSFS )kobject_del (&desc->kobj); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 71/658 cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
In reply to Greg Kroah-HartmanFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 91fda1f88c0968f1491ab150bb01690525af150a ]
pci_get_device() will increase the reference count for the returned pci_dev. We need to use pci_dev_put() to decrease the reference count after using pci_get_device(). Let's add it.
--- drivers/cpufreq/amd_freq_sensitivity.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/amd_freq_sensitivity.c +2 -0
@@ -124,6 +124,8 @@ static int __init amd_freq_sensitivity_init(void)if (!pcidev) {if (!boot_cpu_has (X86_FEATURE_PROC_FEEDBACK ))return -ENODEV ; + }else { +pci_dev_put (pcidev); }if (rdmsrl_safe (MSR_AMD64_FREQ_SENSITIVITY_ACTUAL , &val))
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 72/658 libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
In reply to Greg Kroah-HartmanFrom: Akinobu Mita <[email protected]>
[ Upstream commit 2e41f274f9aa71cdcc69dc1f26a3f9304a651804 ]
Patch series "fix error when writing negative value to simple attribute files".
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()"), but some attribute files want to accept a negative value.
This patch (of 3):
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()"), so we have to use a 64-bit value to write a negative value.
This adds DEFINE_SIMPLE_ATTRIBUTE_SIGNED for a signed value.
--- fs/libfs.c | 22 +++++++++++++++++++--- include/linux/fs.h | 12 ++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-)
fs/libfs.c +19 -3
@@ -883,8 +883,8 @@ ssize_t simple_attr_read(struct file *file, char __user *buf,EXPORT_SYMBOL_GPL (simple_attr_read);/* interpret the buffer as a number to call the set function with */ -ssize_t simple_attr_write (struct file *file,const char __user *buf, -size_t len,loff_t *ppos) +static ssize_t simple_attr_write_xsigned (struct file *file,const char __user *buf, +size_t len,loff_t *ppos,bool is_signed) {struct simple_attr *attr;unsigned long long val;
@@ -905,7 +905,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, goto out; attr->set_buf[size] ='\0' ; - ret =kstrtoull (attr->set_buf,0 , &val); +if (is_signed) + ret =kstrtoll (attr->set_buf,0 , &val); +else + ret =kstrtoull (attr->set_buf,0 , &val);if (ret) goto out; ret = attr->set (attr->data, val);
@@ -915,8 +918,21 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,mutex_unlock (&attr->mutex);return ret; } + +ssize_t simple_attr_write (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return simple_attr_write_xsigned (file, buf, len, ppos, false); +}EXPORT_SYMBOL_GPL (simple_attr_write); +ssize_t simple_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return simple_attr_write_xsigned (file, buf, len, ppos, true); +} +EXPORT_SYMBOL_GPL (simple_attr_write_signed); +/** * generic_fh_to_dentry - generic helper for the fh_to_dentry export operation * @sb: filesystem to do the file handle conversion on
include/linux/fs.h +10 -2
@@ -3477,7 +3477,7 @@ void simple_transaction_set(struct file *file, size_t n);* All attributes contain a text representation of a numeric value * that are accessed with the get() and set() functions. */ -#define DEFINE_SIMPLE_ATTRIBUTE (__fops, __get, __set, __fmt) \ +#define DEFINE_SIMPLE_ATTRIBUTE_XSIGNED (__fops, __get, __set, __fmt, __is_signed) \ static int __fops ## _open(struct inode *inode, struct file *file) \ { \ __simple_attr_check_format(__fmt, 0ull); \
@@ -3488,10 +3488,16 @@ static const struct file_operations __fops = { \ .open = __fops ## _open, \ .release = simple_attr_release, \ .read = simple_attr_read, \ - .write = simple_attr_write, \ + .write = (__is_signed) ? simple_attr_write_signed : simple_attr_write, \ .llseek = generic_file_llseek, \ } +#define DEFINE_SIMPLE_ATTRIBUTE (__fops, __get, __set, __fmt) \ + DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, false) + +#define DEFINE_SIMPLE_ATTRIBUTE_SIGNED (__fops, __get, __set, __fmt) \ + DEFINE_SIMPLE_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, true) + static inline __printf(1, 2) void __simple_attr_check_format(const char *fmt, ...) {
@@ -3506,6 +3512,8 @@ ssize_t simple_attr_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);ssize_t simple_attr_write (struct file *file,const char __user *buf,size_t len,loff_t *ppos); +ssize_t simple_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos);struct ctl_table ; int proc_nr_files(struct ctl_table *table, int write,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 73/658 lib/notifier-error-inject: fix error when writing -errno to debugfs file
In reply to Greg Kroah-HartmanFrom: Akinobu Mita <[email protected]>
[ Upstream commit f883c3edd2c432a2931ec8773c70a570115a50fe ]
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()").
This restores the previous behaviour by using newly introduced DEFINE_SIMPLE_ATTRIBUTE_SIGNED instead of DEFINE_SIMPLE_ATTRIBUTE.
--- lib/notifier-error-inject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/notifier-error-inject.c +1 -1
@@ -15,7 +15,7 @@ static int debugfs_errno_get(void *data, u64 *val)return 0 ; } -DEFINE_SIMPLE_ATTRIBUTE (fops_errno, debugfs_errno_get, debugfs_errno_set, +DEFINE_SIMPLE_ATTRIBUTE_SIGNED (fops_errno, debugfs_errno_get, debugfs_errno_set,"%lld\n" ); static struct dentry *debugfs_create_errno(const char *name, umode_t mode,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 74/658 docs: fault-injection: fix non-working usage of negative values
In reply to Greg Kroah-HartmanFrom: Wolfram Sang <[email protected]>
[ Upstream commit 005747526d4f3c2ec995891e95cb7625161022f9 ]
Fault injection uses debugfs in a way that the provided values via sysfs are interpreted as u64. Providing negative numbers results in an error:
/sys/kernel/debug/fail_function# echo -1 > times
sh: write error: Invalid argument
Update the docs and examples to use "printf %#x <val>" in these cases. For "retval", reword the paragraph a little and fix a typo.
Stable-dep-of: d472cf797c4e ("debugfs: fix error when writing negative value to atomic_t debugfs file")
--- .../fault-injection/fault-injection.rst | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-)
Documentation/fault-injection/fault-injection.rst +14 -10
@@ -74,8 +74,10 @@ configuration of fault-injection capabilities. - /sys/kernel/debug/fail*/times: - specifies how many times failures may happen at most. - A value of -1 means "no limit". + specifies how many times failures may happen at most. A value of -1 + means "no limit". Note, though, that this file only accepts unsigned + values. So, if you want to specify -1, you better use 'printf' instead + of 'echo', e.g.: $ printf %#x -1 > times - /sys/kernel/debug/fail*/space:
@@ -163,11 +165,13 @@ configuration of fault-injection capabilities. - ERRNO: retval must be -1 to -MAX_ERRNO (-4096). - ERR_NULL: retval must be 0 or -1 to -MAX_ERRNO (-4096). -- /sys/kernel/debug/fail_function/<functiuon-name>/retval: +- /sys/kernel/debug/fail_function/<function-name>/retval: - specifies the "error" return value to inject to the given - function for given function. This will be created when - user specifies new injection entry. + specifies the "error" return value to inject to the given function. + This will be created when the user specifies a new injection entry. + Note that this file only accepts unsigned values. So, if you want to + use a negative errno, you better use 'printf' instead of 'echo', e.g.: + $ printf %#x -12 > retval Boot option ^^^^^^^^^^^
@@ -250,7 +254,7 @@ Application Examples echo Y > /sys/kernel/debug/$FAILTYPE/task-filter echo 10 > /sys/kernel/debug/$FAILTYPE/probability echo 100 > /sys/kernel/debug/$FAILTYPE/interval - echo -1 > /sys/kernel/debug/$FAILTYPE/times + printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 2 > /sys/kernel/debug/$FAILTYPE/verbose echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -304,7 +308,7 @@ Application Examples echo N > /sys/kernel/debug/$FAILTYPE/task-filter echo 10 > /sys/kernel/debug/$FAILTYPE/probability echo 100 > /sys/kernel/debug/$FAILTYPE/interval - echo -1 > /sys/kernel/debug/$FAILTYPE/times + printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 2 > /sys/kernel/debug/$FAILTYPE/verbose echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -331,11 +335,11 @@ Application Examples FAILTYPE=fail_function FAILFUNC=open_ctree echo $FAILFUNC > /sys/kernel/debug/$FAILTYPE/inject - echo -12 > /sys/kernel/debug/$FAILTYPE/$FAILFUNC/retval + printf %#x -12 > /sys/kernel/debug/$FAILTYPE/$FAILFUNC/retval echo N > /sys/kernel/debug/$FAILTYPE/task-filter echo 100 > /sys/kernel/debug/$FAILTYPE/probability echo 0 > /sys/kernel/debug/$FAILTYPE/interval - echo -1 > /sys/kernel/debug/$FAILTYPE/times + printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 1 > /sys/kernel/debug/$FAILTYPE/verbose
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 75/658 debugfs: fix error when writing negative value to atomic_t debugfs file
In reply to Greg Kroah-HartmanFrom: Akinobu Mita <[email protected]>
[ Upstream commit d472cf797c4e268613dbce5ec9b95d0bcae19ecb ]
The simple attribute files do not accept a negative value since the commit 488dac0c9237 ("libfs: fix error cast of negative value in simple_attr_write()"), so we have to use a 64-bit value to write a negative value for a debugfs file created by debugfs_create_atomic_t().
This restores the previous behaviour by introducing DEFINE_DEBUGFS_ATTRIBUTE_SIGNED for a signed value.
--- .../fault-injection/fault-injection.rst | 10 +++---- fs/debugfs/file.c | 28 +++++++++++++++---- include/linux/debugfs.h | 19 +++++++++++-- 3 files changed, 43 insertions(+), 14 deletions(-)
Documentation/fault-injection/fault-injection.rst +4 -6
@@ -75,9 +75,7 @@ configuration of fault-injection capabilities. - /sys/kernel/debug/fail*/times: specifies how many times failures may happen at most. A value of -1 - means "no limit". Note, though, that this file only accepts unsigned - values. So, if you want to specify -1, you better use 'printf' instead - of 'echo', e.g.: $ printf %#x -1 > times + means "no limit". - /sys/kernel/debug/fail*/space:
@@ -254,7 +252,7 @@ Application Examples echo Y > /sys/kernel/debug/$FAILTYPE/task-filter echo 10 > /sys/kernel/debug/$FAILTYPE/probability echo 100 > /sys/kernel/debug/$FAILTYPE/interval - printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times + echo -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 2 > /sys/kernel/debug/$FAILTYPE/verbose echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -308,7 +306,7 @@ Application Examples echo N > /sys/kernel/debug/$FAILTYPE/task-filter echo 10 > /sys/kernel/debug/$FAILTYPE/probability echo 100 > /sys/kernel/debug/$FAILTYPE/interval - printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times + echo -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 2 > /sys/kernel/debug/$FAILTYPE/verbose echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait
@@ -339,7 +337,7 @@ Application Examples echo N > /sys/kernel/debug/$FAILTYPE/task-filter echo 100 > /sys/kernel/debug/$FAILTYPE/probability echo 0 > /sys/kernel/debug/$FAILTYPE/interval - printf %#x -1 > /sys/kernel/debug/$FAILTYPE/times + echo -1 > /sys/kernel/debug/$FAILTYPE/times echo 0 > /sys/kernel/debug/$FAILTYPE/space echo 1 > /sys/kernel/debug/$FAILTYPE/verbose
fs/debugfs/file.c +22 -6
@@ -377,8 +377,8 @@ ssize_t debugfs_attr_read(struct file *file, char __user *buf, }EXPORT_SYMBOL_GPL (debugfs_attr_read); -ssize_t debugfs_attr_write (struct file *file,const char __user *buf, -size_t len,loff_t *ppos) +static ssize_t debugfs_attr_write_xsigned (struct file *file,const char __user *buf, +size_t len,loff_t *ppos,bool is_signed) {struct dentry *dentry =F_DENTRY (file);ssize_t ret;
@@ -386,12 +386,28 @@ ssize_t debugfs_attr_write(struct file *file, const char __user *buf, ret =debugfs_file_get (dentry);if (unlikely (ret))return ret; - ret =simple_attr_write (file, buf, len, ppos); +if (is_signed) + ret =simple_attr_write_signed (file, buf, len, ppos); +else + ret =simple_attr_write (file, buf, len, ppos);debugfs_file_put (dentry);return ret; } + +ssize_t debugfs_attr_write (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return debugfs_attr_write_xsigned (file, buf, len, ppos, false); +}EXPORT_SYMBOL_GPL (debugfs_attr_write); +ssize_t debugfs_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos) +{ +return debugfs_attr_write_xsigned (file, buf, len, ppos, true); +} +EXPORT_SYMBOL_GPL (debugfs_attr_write_signed); + static struct dentry *debugfs_create_mode_unsafe(const char *name, umode_t mode, struct dentry *parent, void *value, const struct file_operations *fops,
@@ -784,11 +800,11 @@ static int debugfs_atomic_t_get(void *data, u64 *val) *val =atomic_read ((atomic_t *)data);return 0 ; } -DEFINE_DEBUGFS_ATTRIBUTE (fops_atomic_t, debugfs_atomic_t_get, +DEFINE_DEBUGFS_ATTRIBUTE_SIGNED (fops_atomic_t, debugfs_atomic_t_get, debugfs_atomic_t_set,"%lld\n" ); -DEFINE_DEBUGFS_ATTRIBUTE (fops_atomic_t_ro, debugfs_atomic_t_get,NULL , +DEFINE_DEBUGFS_ATTRIBUTE_SIGNED (fops_atomic_t_ro, debugfs_atomic_t_get,NULL ,"%lld\n" ); -DEFINE_DEBUGFS_ATTRIBUTE (fops_atomic_t_wo,NULL , debugfs_atomic_t_set, +DEFINE_DEBUGFS_ATTRIBUTE_SIGNED (fops_atomic_t_wo,NULL , debugfs_atomic_t_set,"%lld\n" );/**
include/linux/debugfs.h +17 -2
@@ -39,7 +39,7 @@ struct debugfs_regset32 {extern struct dentry *arch_debugfs_dir; -#define DEFINE_DEBUGFS_ATTRIBUTE (__fops, __get, __set, __fmt) \ +#define DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED (__fops, __get, __set, __fmt, __is_signed) \ static int __fops ## _open(struct inode *inode, struct file *file) \ { \ __simple_attr_check_format(__fmt, 0ull); \
@@ -50,10 +50,16 @@ static const struct file_operations __fops = { \ .open = __fops ## _open, \ .release = simple_attr_release, \ .read = debugfs_attr_read, \ - .write = debugfs_attr_write, \ + .write = (__is_signed) ? debugfs_attr_write_signed : debugfs_attr_write, \ .llseek = no_llseek, \ } +#define DEFINE_DEBUGFS_ATTRIBUTE (__fops, __get, __set, __fmt) \ + DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, false) + +#define DEFINE_DEBUGFS_ATTRIBUTE_SIGNED (__fops, __get, __set, __fmt) \ + DEFINE_DEBUGFS_ATTRIBUTE_XSIGNED(__fops, __get, __set, __fmt, true) +typedef struct vfsmount *(*debugfs_automount_t )(struct dentry *,void *);#if defined(CONFIG_DEBUG_FS )
@@ -96,6 +102,8 @@ ssize_t debugfs_attr_read(struct file *file, char __user *buf, size_t len, loff_t *ppos);ssize_t debugfs_attr_write (struct file *file,const char __user *buf,size_t len,loff_t *ppos); +ssize_t debugfs_attr_write_signed (struct file *file,const char __user *buf, +size_t len,loff_t *ppos);struct dentry *debugfs_rename (struct dentry *old_dir,struct dentry *old_dentry,struct dentry *new_dir,const char *new_name);
@@ -245,6 +253,13 @@ static inline ssize_t debugfs_attr_write(struct file *file,return -ENODEV ; } +static inline ssize_t debugfs_attr_write_signed (struct file *file, +const char __user *buf, +size_t len,loff_t *ppos) +{ +return -ENODEV ; +} +static inline struct dentry *debugfs_rename (struct dentry *old_dir,struct dentry *old_dentry,struct dentry *new_dir,char *new_name) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 76/658 ocfs2: ocfs2_mount_volume does cleanup job before return error
In reply to Greg Kroah-HartmanFrom: Heming Zhao via Ocfs2-devel <[email protected]>
[ Upstream commit 0737e01de9c411e4db87dcedf4a9789d41b1c5c1 ]
After this patch, when error, ocfs2_fill_super doesn't take care to release resources which are allocated in ocfs2_mount_volume.
Stable-dep-of: ce2fcf1516d6 ("ocfs2: fix memory leak in ocfs2_mount_volume()")
--- fs/ocfs2/super.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-)
fs/ocfs2/super.c +23 -12
@@ -1787,11 +1787,10 @@ static int ocfs2_get_sector(struct super_block *sb,static int ocfs2_mount_volume (struct super_block *sb) {int status =0 ; -int unlock_super =0 ;struct ocfs2_super *osb =OCFS2_SB (sb);if (ocfs2_is_hard_readonly (osb)) - goto leave; + goto out;mutex_init (&osb->obs_trim_fs_mutex);
@@ -1801,44 +1800,56 @@ static int ocfs2_mount_volume(struct super_block *sb)if (status == -EBADR &&ocfs2_userspace_stack (osb))mlog (ML_ERROR ,"couldn't mount because cluster name on" " disk does not match the running cluster name.\n" ); - goto leave; + goto out; } status =ocfs2_super_lock (osb,1 );if (status <0 ) {mlog_errno (status); - goto leave; + goto out_dlm; } - unlock_super =1 ;/* This will load up the node map and add ourselves to it. */ status =ocfs2_find_slot (osb);if (status <0 ) {mlog_errno (status); - goto leave; + goto out_super_lock; }/* load all node-local system inodes */ status =ocfs2_init_local_system_inodes (osb);if (status <0 ) {mlog_errno (status); - goto leave; + goto out_super_lock; } status =ocfs2_check_volume (osb);if (status <0 ) {mlog_errno (status); - goto leave; + goto out_system_inodes; } status =ocfs2_truncate_log_init (osb); -if (status <0 ) +if (status <0 ) {mlog_errno (status); + goto out_system_inodes; + } -leave: -if (unlock_super) -ocfs2_super_unlock (osb,1 ); +ocfs2_super_unlock (osb,1 ); +return 0 ; +out_system_inodes: +if (osb->local_alloc_state ==OCFS2_LA_ENABLED ) +ocfs2_shutdown_local_alloc (osb); +ocfs2_release_system_inodes (osb); +/* before journal shutdown, we should release slot_info */ +ocfs2_free_slot_info (osb); +ocfs2_journal_shutdown (osb); +out_super_lock: +ocfs2_super_unlock (osb,1 ); +out_dlm: +ocfs2_dlm_shutdown (osb,0 ); +out:return status; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 77/658 ocfs2: rewrite error handling of ocfs2_fill_super
In reply to Greg Kroah-HartmanFrom: Heming Zhao via Ocfs2-devel <[email protected]>
[ Upstream commit f1e75d128b46e3b066e7b2e7cfca10491109d44d ]
Current ocfs2_fill_super() uses one goto label "read_super_error" to handle all error cases. And with previous serial patches, the error handling should fork more branches to handle different error cases. This patch rewrite the error handling of ocfs2_fill_super.
Stable-dep-of: ce2fcf1516d6 ("ocfs2: fix memory leak in ocfs2_mount_volume()")
--- fs/ocfs2/super.c | 67 +++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 35 deletions(-)
fs/ocfs2/super.c +32 -35
@@ -984,28 +984,27 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)if (!ocfs2_parse_options (sb, data, &parsed_options,0 )) { status = -EINVAL ; - goto read_super_error; + goto out; }/* probe for superblock */ status =ocfs2_sb_probe (sb, &bh, §or_size, &stats);if (status <0 ) {mlog (ML_ERROR ,"superblock probe failed!\n" ); - goto read_super_error; + goto out; } status =ocfs2_initialize_super (sb, bh, sector_size, &stats); - osb =OCFS2_SB (sb); -if (status <0 ) { -mlog_errno (status); - goto read_super_error; - }brelse (bh); bh =NULL ; +if (status <0 ) + goto out; + + osb =OCFS2_SB (sb);if (!ocfs2_check_set_options (sb, &parsed_options)) { status = -EINVAL ; - goto read_super_error; + goto out_super; } osb->s_mount_opt = parsed_options.mount_opt; osb->s_atime_quantum = parsed_options.atime_quantum;
@@ -1022,7 +1021,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) status =ocfs2_verify_userspace_stack (osb, &parsed_options);if (status) - goto read_super_error; + goto out_super; sb->s_magic =OCFS2_SUPER_MAGIC ;
@@ -1036,7 +1035,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) status = -EACCES ;mlog (ML_ERROR ,"Readonly device detected but readonly " "mount was not specified.\n" ); - goto read_super_error; + goto out_super; }/* You should not be able to start a local heartbeat
@@ -1045,7 +1044,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) status = -EROFS ;mlog (ML_ERROR ,"Local heartbeat specified on readonly " "device.\n" ); - goto read_super_error; + goto out_super; } status =ocfs2_check_journals_nolocks (osb);
@@ -1054,9 +1053,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)mlog (ML_ERROR ,"Recovery required on readonly " "file system, but write access is " "unavailable.\n" ); - else -mlog_errno (status ); - goto read_super_error; + goto out_super; }ocfs2_set_ro_flag (osb,1 );
@@ -1072,10 +1069,8 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) } status =ocfs2_verify_heartbeat (osb); -if (status <0 ) { -mlog_errno (status); - goto read_super_error; - } +if (status <0 ) + goto out_super; osb->osb_debug_root =debugfs_create_dir (osb->uuid_str, ocfs2_debugfs_root);
@@ -1089,15 +1084,14 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) status =ocfs2_mount_volume (sb);if (status <0 ) - goto read_super_error; + goto out_debugfs;if (osb->root_inode) inode =igrab (osb->root_inode);if (!inode) { status = -EIO ; -mlog_errno (status); - goto read_super_error; + goto out_dismount; } osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
@@ -1105,7 +1099,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)if (!osb->osb_dev_kset) { status = -ENOMEM ;mlog (ML_ERROR ,"Unable to create device kset %s.\n" , sb->s_id); - goto read_super_error; + goto out_dismount; }/* Create filecheck sysfs related directories/files at
@@ -1114,14 +1108,13 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) status = -ENOMEM ;mlog (ML_ERROR ,"Unable to create filecheck sysfs directory at " "/sys/fs/ocfs2/%s/filecheck.\n" , sb->s_id); - goto read_super_error; + goto out_dismount; } root =d_make_root (inode);if (!root) { status = -ENOMEM ; -mlog_errno (status); - goto read_super_error; + goto out_dismount; } sb->s_root = root;
@@ -1168,17 +1161,21 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)return status; -read_super_error: -brelse (bh); - -if (status) -mlog_errno (status); +out_dismount: +atomic_set (&osb->vol_state,VOLUME_DISABLED ); +wake_up (&osb->osb_mount_event); +ocfs2_dismount_volume (sb,1 ); + goto out; -if (osb) { -atomic_set (&osb->vol_state,VOLUME_DISABLED ); -wake_up (&osb->osb_mount_event); -ocfs2_dismount_volume (sb,1 ); - } +out_debugfs: +debugfs_remove_recursive (osb->osb_debug_root); +out_super: +ocfs2_release_system_inodes (osb); +kfree (osb->recovery_map); +ocfs2_delete_osb (osb); +kfree (osb); +out: +mlog_errno (status);return status; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 78/658 ocfs2: fix memory leak in ocfs2_mount_volume()
In reply to Greg Kroah-HartmanFrom: Li Zetao <[email protected]>
[ Upstream commit ce2fcf1516d674a174d9b34d1e1024d64de9fba3 ]
There is a memory leak reported by kmemleak:
unreferenced object 0xffff88810cc65e60 (size 32):
comm "mount.ocfs2", pid 23753, jiffies 4302528942 (age 34735.105s)
hex dump (first 32 bytes):
10 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01 ................
01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8170f73d>] __kmalloc+0x4d/0x150
[<ffffffffa0ac3f51>] ocfs2_compute_replay_slots+0x121/0x330 [ocfs2]
[<ffffffffa0b65165>] ocfs2_check_volume+0x485/0x900 [ocfs2]
[<ffffffffa0b68129>] ocfs2_mount_volume.isra.0+0x1e9/0x650 [ocfs2]
[<ffffffffa0b7160b>] ocfs2_fill_super+0xe0b/0x1740 [ocfs2]
[<ffffffff818e1fe2>] mount_bdev+0x312/0x400
[<ffffffff819a086d>] legacy_get_tree+0xed/0x1d0
[<ffffffff818de82d>] vfs_get_tree+0x7d/0x230
[<ffffffff81957f92>] path_mount+0xd62/0x1760
[<ffffffff81958a5a>] do_mount+0xca/0xe0
[<ffffffff81958d3c>] __x64_sys_mount+0x12c/0x1a0
[<ffffffff82f26f15>] do_syscall_64+0x35/0x80
[<ffffffff8300006a>] entry_SYSCALL_64_after_hwframe+0x46/0xb0This call stack is related to two problems. Firstly, the ocfs2 super uses "replay_map" to trace online/offline slots, in order to recover offline slots during recovery and mount. But when ocfs2_truncate_log_init() returns an error in ocfs2_mount_volume(), the memory of "replay_map" will not be freed in error handling path. Secondly, the memory of "replay_map" will not be freed if d_make_root() returns an error in ocfs2_fill_super(). But the memory of "replay_map" will be freed normally when completing recovery and mount in ocfs2_complete_mount_recovery().
Fix the first problem by adding error handling path to free "replay_map" when ocfs2_truncate_log_init() fails. And fix the second problem by calling ocfs2_free_replay_slots(osb) in the error handling path "out_dismount". In addition, since ocfs2_free_replay_slots() is static, it is necessary to remove its static attribute and declare it in header file.
--- fs/ocfs2/journal.c | 2 +- fs/ocfs2/journal.h | 1 + fs/ocfs2/super.c | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-)
fs/ocfs2/journal.c +1 -1
@@ -159,7 +159,7 @@ static void ocfs2_queue_replay_slots(struct ocfs2_super *osb, replay_map->rm_state =REPLAY_DONE ; } -static void ocfs2_free_replay_slots (struct ocfs2_super *osb) +void ocfs2_free_replay_slots (struct ocfs2_super *osb) {struct ocfs2_replay_map *replay_map = osb->replay_map;
fs/ocfs2/journal.h +1 -0
@@ -152,6 +152,7 @@ int ocfs2_recovery_init(struct ocfs2_super *osb);void ocfs2_recovery_exit (struct ocfs2_super *osb);int ocfs2_compute_replay_slots (struct ocfs2_super *osb); +void ocfs2_free_replay_slots (struct ocfs2_super *osb);/* * Journal Control: * Initialize, Load, Shutdown, Wipe a journal.
fs/ocfs2/super.c +4 -1
@@ -1164,6 +1164,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) out_dismount:atomic_set (&osb->vol_state,VOLUME_DISABLED );wake_up (&osb->osb_mount_event); +ocfs2_free_replay_slots (osb);ocfs2_dismount_volume (sb,1 ); goto out;
@@ -1829,12 +1830,14 @@ static int ocfs2_mount_volume(struct super_block *sb) status =ocfs2_truncate_log_init (osb);if (status <0 ) {mlog_errno (status); - goto out_system_inodes; + goto out_check_volume; }ocfs2_super_unlock (osb,1 );return 0 ; +out_check_volume: +ocfs2_free_replay_slots (osb); out_system_inodes:if (osb->local_alloc_state ==OCFS2_LA_ENABLED )ocfs2_shutdown_local_alloc (osb);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 79/658 rapidio: fix possible name leaks when rio_add_device() fails
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f9574cd48679926e2a569e1957a5a1bcc8a719ac ]
Patch series "rapidio: fix three possible memory leaks".
This patchset fixes three name leaks in error handling.
- patch #1 fixes two name leaks while rio_add_device() fails.
- patch #2 fixes a name leak while rio_register_mport() fails.
This patch (of 2):
If rio_add_device() returns error, the name allocated by dev_set_name() need be freed. It should use put_device() to give up the reference in the error path, so that the name can be freed in kobject_cleanup(), and the 'rdev' can be freed in rio_release_dev().
--- drivers/rapidio/devices/rio_mport_cdev.c | 7 +++++-- drivers/rapidio/rio-scan.c | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/rapidio/devices/rio_mport_cdev.c +5 -2
@@ -1807,8 +1807,11 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,rio_init_dbell_res (&rdev->riores[RIO_DOORBELL_RESOURCE ],0 ,0xffff ); err =rio_add_device (rdev); -if (err) - goto cleanup; +if (err) { +put_device (&rdev->dev); +return err; + } +rio_dev_get (rdev);return 0 ;
drivers/rapidio/rio-scan.c +6 -2
@@ -456,8 +456,12 @@ static struct rio_dev *rio_setup_device(struct rio_net *net, 0, 0xffff); ret =rio_add_device (rdev); -if (ret) - goto cleanup; +if (ret) { +if (rswitch) +kfree (rswitch->route_table); +put_device (&rdev->dev); +return NULL ; + }rio_dev_get (rdev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 80/658 rapidio: rio: fix possible name leak in rio_register_mport()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit e92a216d16bde65d21a3227e0fb2aa0794576525 ]
If device_register() returns error, the name allocated by dev_set_name() need be freed. It should use put_device() to give up the reference in the error path, so that the name can be freed in kobject_cleanup(), and list_del() is called to delete the port from rio_mports.
--- drivers/rapidio/rio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/rapidio/rio.c +7 -2
@@ -2267,11 +2267,16 @@ int rio_register_mport(struct rio_mport *port)atomic_set (&port->state,RIO_DEVICE_RUNNING ); res =device_register (&port->dev); -if (res) +if (res) {dev_err (&port->dev,"RIO: mport%d registration failed ERR=%d\n" , port->id, res); -else +mutex_lock (&rio_mport_list_lock); +list_del (&port->node); +mutex_unlock (&rio_mport_list_lock); +put_device (&port->dev); + }else {dev_dbg (&port->dev,"RIO: registered mport%d\n" , port->id); + }return res; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 81/658 clocksource/drivers/sh_cmt: Make sure channel clock supply is enabled
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 2a97d55333e4299f32c98cca6dc5c4db1c5855fc ]
The Renesas Compare Match Timer 0 and 1 (CMT0/1) variants have a register to control the clock supply to the individual channels. Currently the driver does not touch this register, and relies on the documented initial value, which has the clock supply enabled for all channels present.
However, when Linux starts on the APE6-EVM development board, only the clock supply to the first CMT1 channel is enabled. Hence the first channel (used as a clockevent) works, while the second channel (used as a clocksource) does not. Note that the default system clocksource is the Cortex-A15 architectured timer, and the user needs to manually switch to the CMT1 clocksource to trigger the broken behavior.
Fix this by removing the fragile dependency on implicit reset and/or boot loader state, and by enabling the clock supply explicitly for all channels used instead. This requires postponing the clk_disable() call, else the timer's registers cannot be accessed in sh_cmt_setup_channel().
--- drivers/clocksource/sh_cmt.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/clocksource/sh_cmt.c +13 -3
@@ -231,6 +231,8 @@ static const struct sh_cmt_info sh_cmt_info[] = {#define CMCNT 1/* channel register */ #define CMCOR 2/* channel register */ +#define CMCLKE 0x1000/* CLK Enable Register (R-Car Gen2) */ +static inline u32 sh_cmt_read_cmstr (struct sh_cmt_channel *ch) {if (ch->iostart)
@@ -845,6 +847,7 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index, unsigned int hwidx, bool clockevent, bool clocksource, struct sh_cmt_device *cmt) { + u32 value;int ret;/* Skip unused channels. */
@@ -874,6 +877,11 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index, ch->iostart = cmt->mapbase + ch->hwidx *0x100 ; ch->ioctrl = ch->iostart +0x10 ; ch->timer_bit =0 ; + +/* Enable the clock supply to the channel */ + value =ioread32 (cmt->mapbase +CMCLKE ); + value |=BIT (hwidx); +iowrite32 (value, cmt->mapbase +CMCLKE );break ; }
@@ -1006,12 +1014,10 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)else cmt->rate =clk_get_rate (cmt->clk) /8 ; -clk_disable (cmt->clk); -/* Map the memory resource(s). */ ret =sh_cmt_map_memory (cmt);if (ret <0 ) - goto err_clk_unprepare; + goto err_clk_disable;/* Allocate and setup the channels. */ cmt->num_channels =hweight8 (cmt->hw_channels);
@@ -1039,6 +1045,8 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) mask &= ~(1 << hwidx); } +clk_disable (cmt->clk); +platform_set_drvdata (pdev, cmt);return 0 ;
@@ -1046,6 +1054,8 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) err_unmap:kfree (cmt->channels);iounmap (cmt->mapbase); +err_clk_disable: +clk_disable (cmt->clk); err_clk_unprepare:clk_unprepare (cmt->clk); err_clk_put:
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 82/658 ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
In reply to Greg Kroah-HartmanFrom: Li Zetao <[email protected]>
[ Upstream commit 470188b09e92d83c5a997f25f0e8fb8cd2bc3469 ]
There is an use-after-free reported by KASAN:
BUG: KASAN: use-after-free in acpi_ut_remove_reference+0x3b/0x82 Read of size 1 at addr ffff888112afc460 by task modprobe/2111 CPU: 0 PID: 2111 Comm: modprobe Not tainted 6.1.0-rc7-dirty Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), Call Trace: <TASK> kasan_report+0xae/0xe0 acpi_ut_remove_reference+0x3b/0x82 acpi_ut_copy_iobject_to_iobject+0x3be/0x3d5 acpi_ds_store_object_to_local+0x15d/0x3a0 acpi_ex_store+0x78d/0x7fd acpi_ex_opcode_1A_1T_1R+0xbe4/0xf9b acpi_ps_parse_aml+0x217/0x8d5 ... </TASK>
The root cause of the problem is that the acpi_operand_object is freed when acpi_ut_walk_package_tree() fails in acpi_ut_copy_ipackage_to_ipackage(), lead to repeated release in acpi_ut_copy_iobject_to_iobject(). The problem was introduced by "8aa5e56eeb61" commit, this commit is to fix memory leak in acpi_ut_copy_iobject_to_iobject(), repeatedly adding remove operation, lead to "acpi_operand_object" used after free.
Fix it by removing acpi_ut_remove_reference() in acpi_ut_copy_ipackage_to_ipackage(). acpi_ut_copy_ipackage_to_ipackage() is called to copy an internal package object into another internal package object, when it fails, the memory of acpi_operand_object should be freed by the caller.
--- drivers/acpi/acpica/utcopy.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/acpi/acpica/utcopy.c +0 -7
@@ -916,13 +916,6 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, status =acpi_ut_walk_package_tree (source_obj, dest_obj, acpi_ut_copy_ielement_to_ielement, walk_state); -if (ACPI_FAILURE (status)) { - -/* On failure, delete the destination package object */ - -acpi_ut_remove_reference (dest_obj); - } -return_ACPI_STATUS (status); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 83/658 uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
In reply to Greg Kroah-HartmanFrom: Oleg Nesterov <[email protected]>
[ Upstream commit cefa72129e45313655d53a065b8055aaeb01a0c9 ]
Intel ICC -hotpatch inserts 2-byte "0x66 0x90" NOP at the start of each function to reserve extra space for hot-patching, and currently it is not possible to probe these functions because branch_setup_xol_ops() wrongly rejects NOP with REP prefix as it treats them like word-sized branch instructions.
--- arch/x86/kernel/uprobes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/uprobes.c +3 -1
@@ -722,8 +722,9 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)switch (opc1) {case 0xeb :/* jmp 8 */ case 0xe9 :/* jmp 32 */ -case 0x90 :/* prefix* + nop; same as jmp with .offs = 0 */ break ; +case 0x90 :/* prefix* + nop; same as jmp with .offs = 0 */ + goto setup;case 0xe8 :/* call relative */ branch_clear_offset (auprobe, insn);
@@ -753,6 +754,7 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)return -ENOTSUPP ; } +setup: auprobe->branch.opc1 = opc1; auprobe->branch.ilen = insn->length; auprobe->branch.offs = insn->immediate.value;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 84/658 xen/events: only register debug interrupt for 2-level events
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit d04b1ae5a9b0c868dda8b4b34175ef08f3cb9e93 ]
xen_debug_interrupt() is specific to 2-level event handling. So don't register it with fifo event handling being active.
Stable-dep-of: 69143f60868b ("x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()")
--- arch/x86/xen/smp.c | 19 +++++++++++-------- arch/x86/xen/xen-ops.h | 2 ++ drivers/xen/events/events_base.c | 10 ++++++---- 3 files changed, 19 insertions(+), 12 deletions(-)
arch/x86/xen/smp.c +11 -8
@@ -88,14 +88,17 @@ int xen_smp_intr_init(unsigned int cpu)per_cpu (xen_callfunc_irq, cpu).irq = rc;per_cpu (xen_callfunc_irq, cpu).name = callfunc_name; - debug_name =kasprintf (GFP_KERNEL ,"debug%d" , cpu); - rc =bind_virq_to_irqhandler (VIRQ_DEBUG , cpu, xen_debug_interrupt, -IRQF_PERCPU |IRQF_NOBALANCING , - debug_name,NULL ); -if (rc <0 ) - goto fail; -per_cpu (xen_debug_irq, cpu).irq = rc; -per_cpu (xen_debug_irq, cpu).name = debug_name; +if (!xen_fifo_events) { + debug_name =kasprintf (GFP_KERNEL ,"debug%d" , cpu); + rc =bind_virq_to_irqhandler (VIRQ_DEBUG , cpu, + xen_debug_interrupt, +IRQF_PERCPU |IRQF_NOBALANCING , + debug_name,NULL ); +if (rc <0 ) + goto fail; +per_cpu (xen_debug_irq, cpu).irq = rc; +per_cpu (xen_debug_irq, cpu).name = debug_name; + } callfunc_name =kasprintf (GFP_KERNEL ,"callfuncsingle%d" , cpu); rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR,
arch/x86/xen/xen-ops.h +2 -0
@@ -30,6 +30,8 @@ extern struct start_info *xen_start_info;extern struct shared_info xen_dummy_shared_info;extern struct shared_info *HYPERVISOR_shared_info; +extern bool xen_fifo_events; +void xen_setup_mfn_list_list (void );void xen_build_mfn_list_list (void );void xen_setup_machphys_mapping (void );
drivers/xen/events/events_base.c +6 -4
@@ -2101,8 +2101,8 @@ void xen_callback_vector(void)void xen_callback_vector (void ) {}#endif -static bool fifo_events = true; -module_param (fifo_events, bool,0 ); +bool xen_fifo_events = true; +module_param_named (fifo_events, xen_fifo_events, bool,0 );static int xen_evtchn_cpu_prepare (unsigned int cpu) {
@@ -2131,10 +2131,12 @@ void __init xen_init_IRQ(void)int ret = -EINVAL ;unsigned int evtchn; -if (fifo_events) +if (xen_fifo_events) ret =xen_evtchn_fifo_init (); -if (ret <0 ) +if (ret <0 ) {xen_evtchn_2l_init (); + xen_fifo_events = false; + }xen_cpu_init_eoi (smp_processor_id ());
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 85/658 x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 69143f60868b3939ddc89289b29db593b647295e ]
These local variables @{resched|pmu|callfunc...}_name saves the new string allocated by kasprintf(), and when bind_{v}ipi_to_irqhandler() fails, it goes to the @fail tag, and calls xen_smp_intr_free{_pv}() to free resource, however the new string is not saved, which cause a memory leak issue. fix it.
--- arch/x86/xen/smp.c | 24 ++++++++++++------------ arch/x86/xen/smp_pv.c | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-)
arch/x86/xen/smp.c +12 -12
@@ -32,30 +32,30 @@ static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id)void xen_smp_intr_free (unsigned int cpu) { +kfree (per_cpu (xen_resched_irq, cpu).name); +per_cpu (xen_resched_irq, cpu).name =NULL ;if (per_cpu (xen_resched_irq, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_resched_irq, cpu).irq,NULL );per_cpu (xen_resched_irq, cpu).irq =-1 ; -kfree (per_cpu (xen_resched_irq, cpu).name); -per_cpu (xen_resched_irq, cpu).name =NULL ; } +kfree (per_cpu (xen_callfunc_irq, cpu).name); +per_cpu (xen_callfunc_irq, cpu).name =NULL ;if (per_cpu (xen_callfunc_irq, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_callfunc_irq, cpu).irq,NULL );per_cpu (xen_callfunc_irq, cpu).irq =-1 ; -kfree (per_cpu (xen_callfunc_irq, cpu).name); -per_cpu (xen_callfunc_irq, cpu).name =NULL ; } +kfree (per_cpu (xen_debug_irq, cpu).name); +per_cpu (xen_debug_irq, cpu).name =NULL ;if (per_cpu (xen_debug_irq, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_debug_irq, cpu).irq,NULL );per_cpu (xen_debug_irq, cpu).irq =-1 ; -kfree (per_cpu (xen_debug_irq, cpu).name); -per_cpu (xen_debug_irq, cpu).name =NULL ; } +kfree (per_cpu (xen_callfuncsingle_irq, cpu).name); +per_cpu (xen_callfuncsingle_irq, cpu).name =NULL ;if (per_cpu (xen_callfuncsingle_irq, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_callfuncsingle_irq, cpu).irq,NULL );per_cpu (xen_callfuncsingle_irq, cpu).irq =-1 ; -kfree (per_cpu (xen_callfuncsingle_irq, cpu).name); -per_cpu (xen_callfuncsingle_irq, cpu).name =NULL ; } }
@@ -65,6 +65,7 @@ int xen_smp_intr_init(unsigned int cpu)char *resched_name, *callfunc_name, *debug_name; resched_name =kasprintf (GFP_KERNEL ,"resched%d" , cpu); +per_cpu (xen_resched_irq, cpu).name = resched_name; rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, cpu, xen_reschedule_interrupt,
@@ -74,9 +75,9 @@ int xen_smp_intr_init(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_resched_irq, cpu).irq = rc; -per_cpu (xen_resched_irq, cpu).name = resched_name; callfunc_name =kasprintf (GFP_KERNEL ,"callfunc%d" , cpu); +per_cpu (xen_callfunc_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, cpu, xen_call_function_interrupt,
@@ -86,10 +87,10 @@ int xen_smp_intr_init(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_callfunc_irq, cpu).irq = rc; -per_cpu (xen_callfunc_irq, cpu).name = callfunc_name;if (!xen_fifo_events) { debug_name =kasprintf (GFP_KERNEL ,"debug%d" , cpu); +per_cpu (xen_debug_irq, cpu).name = debug_name; rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt, IRQF_PERCPU | IRQF_NOBALANCING,
@@ -97,10 +98,10 @@ int xen_smp_intr_init(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_debug_irq, cpu).irq = rc; -per_cpu (xen_debug_irq, cpu).name = debug_name; } callfunc_name =kasprintf (GFP_KERNEL ,"callfuncsingle%d" , cpu); +per_cpu (xen_callfuncsingle_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, cpu, xen_call_function_single_interrupt,
@@ -110,7 +111,6 @@ int xen_smp_intr_init(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_callfuncsingle_irq, cpu).irq = rc; -per_cpu (xen_callfuncsingle_irq, cpu).name = callfunc_name;return 0 ;
arch/x86/xen/smp_pv.c +6 -6
@@ -98,18 +98,18 @@ asmlinkage __visible void cpu_bringup_and_idle(void)void xen_smp_intr_free_pv (unsigned int cpu) { +kfree (per_cpu (xen_irq_work, cpu).name); +per_cpu (xen_irq_work, cpu).name =NULL ;if (per_cpu (xen_irq_work, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_irq_work, cpu).irq,NULL );per_cpu (xen_irq_work, cpu).irq =-1 ; -kfree (per_cpu (xen_irq_work, cpu).name); -per_cpu (xen_irq_work, cpu).name =NULL ; } +kfree (per_cpu (xen_pmu_irq, cpu).name); +per_cpu (xen_pmu_irq, cpu).name =NULL ;if (per_cpu (xen_pmu_irq, cpu).irq >=0 ) {unbind_from_irqhandler (per_cpu (xen_pmu_irq, cpu).irq,NULL );per_cpu (xen_pmu_irq, cpu).irq =-1 ; -kfree (per_cpu (xen_pmu_irq, cpu).name); -per_cpu (xen_pmu_irq, cpu).name =NULL ; } }
@@ -119,6 +119,7 @@ int xen_smp_intr_init_pv(unsigned int cpu)char *callfunc_name, *pmu_name; callfunc_name =kasprintf (GFP_KERNEL ,"irqwork%d" , cpu); +per_cpu (xen_irq_work, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_IRQ_WORK_VECTOR, cpu, xen_irq_work_interrupt,
@@ -128,10 +129,10 @@ int xen_smp_intr_init_pv(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_irq_work, cpu).irq = rc; -per_cpu (xen_irq_work, cpu).name = callfunc_name;if (is_xen_pmu) { pmu_name =kasprintf (GFP_KERNEL ,"pmu%d" , cpu); +per_cpu (xen_pmu_irq, cpu).name = pmu_name; rc = bind_virq_to_irqhandler(VIRQ_XENPMU, cpu, xen_pmu_irq_handler, IRQF_PERCPU|IRQF_NOBALANCING,
@@ -139,7 +140,6 @@ int xen_smp_intr_init_pv(unsigned int cpu)if (rc <0 ) goto fail;per_cpu (xen_pmu_irq, cpu).irq = rc; -per_cpu (xen_pmu_irq, cpu).name = pmu_name; }return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 86/658 x86/xen: Fix memory leak in xen_init_lock_cpu()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit ca84ce153d887b1dc8b118029976cc9faf2a9b40 ]
In xen_init_lock_cpu(), the @name has allocated new string by kasprintf(), if bind_ipi_to_irqhandler() fails, it should be freed, otherwise may lead to a memory leak issue, fix it.
--- arch/x86/xen/spinlock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/xen/spinlock.c +3 -3
@@ -75,6 +75,7 @@ void xen_init_lock_cpu(int cpu) cpu, per_cpu(lock_kicker_irq, cpu)); name =kasprintf (GFP_KERNEL ,"spinlock%d" , cpu); +per_cpu (irq_name, cpu) = name; irq = bind_ipi_to_irqhandler(XEN_SPIN_UNLOCK_VECTOR, cpu, dummy_handler,
@@ -85,7 +86,6 @@ void xen_init_lock_cpu(int cpu)if (irq >=0 ) {disable_irq (irq);/* make sure it's never delivered */ per_cpu (lock_kicker_irq, cpu) = irq; -per_cpu (irq_name, cpu) = name; }printk ("cpu %d spinlock event irq %d\n" , cpu, irq);
@@ -98,6 +98,8 @@ void xen_uninit_lock_cpu(int cpu)if (!xen_pvspin)return ; +kfree (per_cpu (irq_name, cpu)); +per_cpu (irq_name, cpu) =NULL ;/* * When booting the kernel with 'mitigations=auto,nosmt', the secondary * CPUs are not activated, and lock_kicker_irq is not initialized.
@@ -108,8 +110,6 @@ void xen_uninit_lock_cpu(int cpu)unbind_from_irqhandler (irq,NULL );per_cpu (lock_kicker_irq, cpu) =-1 ; -kfree (per_cpu (irq_name, cpu)); -per_cpu (irq_name, cpu) =NULL ; }PV_CALLEE_SAVE_REGS_THUNK (xen_vcpu_stolen);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 87/658 xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit 8b997b2bb2c53b76a6db6c195930e9ab8e4b0c79 ]
As 'kdata.num' is user-controlled data, if user tries to allocate memory larger than(>=) MAX_ORDER, then kcalloc() will fail, it creates a stack trace and messes up dmesg with a warning.
Call trace:
-> privcmd_ioctl
--> privcmd_ioctl_mmap_resource
Add __GFP_NOWARN in order to avoid too large allocation warning. This is detected by static analysis using smatch.
--- drivers/xen/privcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/privcmd.c +1 -1
@@ -766,7 +766,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file, goto out; } - pfns =kcalloc (kdata.num,sizeof (*pfns),GFP_KERNEL ); + pfns =kcalloc (kdata.num,sizeof (*pfns),GFP_KERNEL | __GFP_NOWARN);if (!pfns) { rc = -ENOMEM ; goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 88/658 PM: runtime: Improve path in rpm_idle() when no callback
In reply to Greg Kroah-HartmanFrom: Ulf Hansson <[email protected]>
[ Upstream commit 5a2bd1b1c64e1ac5627db3767ac465f18606315c ]
When pm_runtime_no_callbacks() has been called for a struct device to set the dev->power.no_callbacks flag for it, it enables rpm_idle() to take a slightly quicker path by assuming that a ->runtime_idle() callback would have returned 0 to indicate success.
A device that does not have the dev->power.no_callbacks flag set for it, may still be missing a corresponding ->runtime_idle() callback, in which case the slower path in rpm_idle() is taken. Let's improve the behaviour for this case, by aligning code to the quicker path.
Stable-dep-of: bc80c2e438dc ("PM: runtime: Do not call __rpm_callback() from rpm_idle()")
--- drivers/base/power/runtime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/base/power/runtime.c +5 -5
@@ -446,7 +446,10 @@ static int rpm_idle(struct device *dev, int rpmflags)/* Pending requests need to be canceled. */ dev->power.request =RPM_REQ_NONE ; -if (dev->power.no_callbacks) + callback =RPM_GET_CALLBACK (dev, runtime_idle); + +/* If no callback assume success. */ +if (!callback || dev->power.no_callbacks) goto out;/* Carry out an asynchronous or a synchronous idle notification. */
@@ -462,10 +465,7 @@ static int rpm_idle(struct device *dev, int rpmflags) dev->power.idle_notification = true; - callback =RPM_GET_CALLBACK (dev, runtime_idle); - -if (callback) - retval =__rpm_callback (callback, dev); + retval =__rpm_callback (callback, dev); dev->power.idle_notification = false;wake_up_all (&dev->power.wait_queue);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 89/658 PM: runtime: Do not call __rpm_callback() from rpm_idle()
In reply to Greg Kroah-HartmanFrom: Rafael J. Wysocki <[email protected]>
[ Upstream commit bc80c2e438dcbfcf748452ec0f7ad5b79ff3ad88 ]
Calling __rpm_callback() from rpm_idle() after adding device links support to the former is a clear mistake.
Not only it causes rpm_idle() to carry out unnecessary actions, but it is also against the assumption regarding the stability of PM-runtime status across __rpm_callback() invocations, because rpm_suspend() and rpm_resume() may run in parallel with __rpm_callback() when it is called by rpm_idle() and the device's PM-runtime status can be updated by any of them.
--- drivers/base/power/runtime.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/base/power/runtime.c +11 -1
@@ -465,7 +465,17 @@ static int rpm_idle(struct device *dev, int rpmflags) dev->power.idle_notification = true; - retval =__rpm_callback (callback, dev); +if (dev->power.irq_safe) +spin_unlock (&dev->power.lock); +else +spin_unlock_irq (&dev->power.lock); + + retval =callback (dev); + +if (dev->power.irq_safe) +spin_lock (&dev->power.lock); +else +spin_lock_irq (&dev->power.lock); dev->power.idle_notification = false;wake_up_all (&dev->power.wait_queue);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 90/658 platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
In reply to Greg Kroah-HartmanFrom: Yu Liao <[email protected]>
[ Upstream commit 727cc0147f5066e359aca65cc6cc5e6d64cc15d8 ]
The ACPI buffer memory (out.pointer) returned by wmi_evaluate_method() is not freed after the call, so it leads to memory leak.
The method results in ACPI buffer is not used, so just pass NULL to wmi_evaluate_method() which fixes the memory leak.
--- drivers/platform/x86/mxm-wmi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/platform/x86/mxm-wmi.c +2 -6
@@ -35,13 +35,11 @@ int mxm_wmi_call_mxds(int adapter) .xarg = 1, };struct acpi_buffer input = { (acpi_size )sizeof (args), &args }; -struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL };acpi_status status;printk ("calling mux switch %d\n" , adapter); - status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input, - &output); + status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input,NULL );if (ACPI_FAILURE (status))return status;
@@ -60,13 +58,11 @@ int mxm_wmi_call_mxmx(int adapter) .xarg = 1, };struct acpi_buffer input = { (acpi_size )sizeof (args), &args }; -struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL };acpi_status status;printk ("calling mux switch %d\n" , adapter); - status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input, - &output); + status =wmi_evaluate_method (MXM_WMMX_GUID ,0x0 , adapter, &input,NULL );if (ACPI_FAILURE (status))return status;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 91/658 MIPS: BCM63xx: Add check for NULL for clk in clk_enable
In reply to Greg Kroah-HartmanFrom: Anastasia Belova <[email protected]>
[ Upstream commit ee9ef11bd2a59c2fefaa0959e5efcdf040d7c654 ]
Check clk for NULL before calling clk_enable_unlocked where clk is dereferenced. There is such check in other implementations of clk_enable.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- arch/mips/bcm63xx/clk.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/bcm63xx/clk.c +2 -0
@@ -361,6 +361,8 @@ static struct clk clk_periph = {*/ int clk_enable (struct clk *clk) { +if (!clk) +return 0 ;mutex_lock (&clocks_mutex);clk_enable_unlocked (clk);mutex_unlock (&clocks_mutex);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 92/658 MIPS: OCTEON: warn only once if deprecated link status is being used
In reply to Greg Kroah-HartmanFrom: Ladislav Michl <[email protected]>
[ Upstream commit 4c587a982603d7e7e751b4925809a1512099a690 ]
Avoid flooding kernel log with warnings.
--- arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 2 +- arch/mips/cavium-octeon/executive/cvmx-helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-helper-board.c +1 -1
@@ -211,7 +211,7 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port) {cvmx_helper_link_info_t result; -WARN (!octeon_is_simulation (), +WARN_ONCE (!octeon_is_simulation (),"Using deprecated link status - please update your DT" );/* Unless we fix it later, all links are defaulted to down */
arch/mips/cavium-octeon/executive/cvmx-helper.c +1 -1
@@ -1100,7 +1100,7 @@ cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port)if (index ==0 ) result =__cvmx_helper_rgmii_link_get (ipd_port);else { -WARN (1 ,"Using deprecated link status - please update your DT" ); +WARN_ONCE (1 ,"Using deprecated link status - please update your DT" ); result.s.full_duplex =1 ; result.s.link_up =1 ; result.s.speed =1000 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 93/658 fs: sysv: Fix sysv_nblocks() returns wrong value
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit e0c49bd2b4d3cd1751491eb2d940bce968ac65e9 ]
sysv_nblocks() returns 'blocks' rather than 'res', which only counting the number of triple-indirect blocks and causing sysv_getattr() gets a wrong result.
[AV: this is actually a sysv counterpart of minixfs fix - 0fcd426de9d0 "[PATCH] minix block usage counting fix" in historical tree; mea culpa, should've thought to check fs/sysv back then...]
--- fs/sysv/itree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/sysv/itree.c +1 -1
@@ -438,7 +438,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size) res += blocks; direct =1 ; } -return blocks; +return res; } int sysv_getattr(const struct path *path, struct kstat *stat,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 94/658 rapidio: fix possible UAF when kfifo_alloc() fails
In reply to Greg Kroah-HartmanFrom: Wang Weiyang <[email protected]>
[ Upstream commit 02d7d89f816951e0862147d751b1150d67aaebdd ]
If kfifo_alloc() fails in mport_cdev_open(), goto err_fifo and just free priv. But priv is still in the chdev->file_list, then list traversal may cause UAF. This fixes the following smatch warning:
drivers/rapidio/devices/rio_mport_cdev.c:1930 mport_cdev_open() warn: '&priv->list' not removed from list
--- drivers/rapidio/devices/rio_mport_cdev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/rapidio/devices/rio_mport_cdev.c +3 -4
@@ -1907,10 +1907,6 @@ static int mport_cdev_open(struct inode *inode, struct file *filp) priv->md = chdev; -mutex_lock (&chdev->file_mutex); -list_add_tail (&priv->list, &chdev->file_list); -mutex_unlock (&chdev->file_mutex); -INIT_LIST_HEAD (&priv->db_filters);INIT_LIST_HEAD (&priv->pw_filters);spin_lock_init (&priv->fifo_lock);
@@ -1929,6 +1925,9 @@ static int mport_cdev_open(struct inode *inode, struct file *filp)spin_lock_init (&priv->req_lock);mutex_init (&priv->dma_lock);#endif +mutex_lock (&chdev->file_mutex); +list_add_tail (&priv->list, &chdev->file_list); +mutex_unlock (&chdev->file_mutex); filp->private_data = priv; goto out;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 95/658 eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
In reply to Greg Kroah-HartmanFrom: Zhang Qilong <[email protected]>
[ Upstream commit fd4e60bf0ef8eb9edcfa12dda39e8b6ee9060492 ]
Commit ee62c6b2dc93 ("eventfd: change int to __u64 in eventfd_signal()") forgot to change int to __u64 in the CONFIG_EVENTFD=n stub function.
--- include/linux/eventfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/eventfd.h +1 -1
@@ -61,7 +61,7 @@ static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)return ERR_PTR (-ENOSYS ); } -static inline int eventfd_signal (struct eventfd_ctx *ctx,int n) +static inline int eventfd_signal (struct eventfd_ctx *ctx,__u64 n) {return -ENOSYS ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 96/658 relay: fix type mismatch when allocating memory in relay_create_buf()
In reply to Greg Kroah-HartmanFrom: Gavrilov Ilia <[email protected]>
[ Upstream commit 4d8586e04602fe42f0a782d2005956f8b6302678 ]
The 'padding' field of the 'rchan_buf' structure is an array of 'size_t' elements, but the memory is allocated for an array of 'size_t *' elements.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- kernel/relay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/relay.c +2 -2
@@ -163,13 +163,13 @@ static struct rchan_buf *relay_create_buf(struct rchan *chan) {struct rchan_buf *buf; -if (chan->n_subbufs >KMALLOC_MAX_SIZE /sizeof (size_t *)) +if (chan->n_subbufs >KMALLOC_MAX_SIZE /sizeof (size_t ))return NULL ; buf =kzalloc (sizeof (struct rchan_buf ),GFP_KERNEL );if (!buf)return NULL ; - buf->padding =kmalloc_array (chan->n_subbufs,sizeof (size_t *), + buf->padding =kmalloc_array (chan->n_subbufs,sizeof (size_t ),GFP_KERNEL );if (!buf->padding) goto free_buf;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 97/658 hfs: Fix OOB Write in hfs_asc2mac
In reply to Greg Kroah-HartmanFrom: ZhangPeng <[email protected]>
[ Upstream commit c53ed55cb275344086e32a7080a6b19cb183650b ]
Syzbot reported a OOB Write bug:
loop0: detected capacity change from 0 to 64
==================================================================
BUG: KASAN: slab-out-of-bounds in hfs_asc2mac+0x467/0x9a0 fs/hfs/trans.c:133 Write of size 1 at addr ffff88801848314e by task syz-executor391/3632 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 hfs_asc2mac+0x467/0x9a0 fs/hfs/trans.c:133 hfs_cat_build_key+0x92/0x170 fs/hfs/catalog.c:28 hfs_lookup+0x1ab/0x2c0 fs/hfs/dir.c:31 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740
If in->len is much larger than HFS_NAMELEN(31) which is the maximum length of an HFS filename, a OOB write could occur in hfs_asc2mac(). In that case, when the dst reaches the boundary, the srclen is still greater than 0, which causes a OOB write.
Fix this by adding a check on dstlen in while() before writing to dst address.
--- fs/hfs/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfs/trans.c +1 -1
@@ -109,7 +109,7 @@ void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, const struct qstrif (nls_io) {wchar_t ch; -while (srclen >0 ) { +while (srclen >0 && dstlen >0 ) { size = nls_io->char2uni (src, srclen, &ch);if (size <0 ) { ch ='?' ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 98/658 rapidio: devices: fix missing put_device in mport_cdev_open
In reply to Greg Kroah-HartmanFrom: Cai Xinchen <[email protected]>
[ Upstream commit d5b6e6eba3af11cb2a2791fa36a2524990fcde1a ]
When kfifo_alloc fails, the refcount of chdev->dev is left incremental. We should use put_device(&chdev->dev) to decrease the ref count of chdev->dev to avoid refcount leak.
--- drivers/rapidio/devices/rio_mport_cdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/rapidio/devices/rio_mport_cdev.c +1 -0
@@ -1915,6 +1915,7 @@ static int mport_cdev_open(struct inode *inode, struct file *filp)sizeof (struct rio_event ) *MPORT_EVENT_DEPTH , GFP_KERNEL);if (ret <0 ) { +put_device (&chdev->dev);dev_err (&chdev->dev,DRV_NAME ": kfifo_alloc failed\n" ); ret = -ENOMEM ; goto err_fifo;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 99/658 wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit c2a94de38c74e86f49124ac14f093d6a5c377a90 ]
Syzkaller reports a long-known leak of urbs inath9k_hif_usb_dealloc_tx_urbs().
The cause of the leak is that usb_get_urb() is called but usb_free_urb() (or usb_put_urb()) is not called inside usb_kill_urb() as urb->dev or urb->ep fields have not been initialized and usb_kill_urb() returns immediately.
The patch removes trying to kill urbs located in hif_dev->tx.tx_buf because hif_dev->tx.tx_buf is not supposed to contain urbs which are in pending state (the pending urbs are stored in hif_dev->tx.tx_pending). The tx.tx_lock is acquired so there should not be any changes in the list.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +0 -4
@@ -781,14 +781,10 @@ static void ath9k_hif_usb_dealloc_tx_urbs(struct hif_device_usb *hif_dev)spin_lock_irqsave (&hif_dev->tx.tx_lock, flags);list_for_each_entry_safe (tx_buf, tx_buf_tmp, &hif_dev->tx.tx_buf, list) { -usb_get_urb (tx_buf->urb); -spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags); -usb_kill_urb (tx_buf->urb);list_del (&tx_buf->list);usb_free_urb (tx_buf->urb);kfree (tx_buf->buf);kfree (tx_buf); -spin_lock_irqsave (&hif_dev->tx.tx_lock, flags); }spin_unlock_irqrestore (&hif_dev->tx.tx_lock, flags);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 100/658 wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
In reply to Greg Kroah-HartmanFrom: Fedor Pchelkin <[email protected]>
[ Upstream commit dd95f2239fc846795fc926787c3ae0ca701c9840 ]
It is possible that skb is freed in ath9k_htc_rx_msg(), then usb_submit_urb() fails and we try to free skb again. It causes use-after-free bug. Moreover, if alloc_skb() fails, urb->context becomes NULL but rx_buf is not freed and there can be a memory leak.
The patch removes unnecessary nskb and makes skb processing more clear: it is supposed that ath9k_htc_rx_msg() either frees old skb or passes its managing to another callback function.
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
--- drivers/net/wireless/ath/ath9k/hif_usb.c | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +15 -13
@@ -709,14 +709,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)struct rx_buf *rx_buf = (struct rx_buf *)urb->context;struct hif_device_usb *hif_dev = rx_buf->hif_dev;struct sk_buff *skb = rx_buf->skb; -struct sk_buff *nskb;int ret;if (!skb)return ;if (!hif_dev) - goto free; + goto free_skb;switch (urb->status) {case 0 :
@@ -725,7 +724,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)case -ECONNRESET :case -ENODEV :case -ESHUTDOWN : - goto free; + goto free_skb;default :skb_reset_tail_pointer (skb);skb_trim (skb,0 );
@@ -736,25 +735,27 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)if (likely (urb->actual_length !=0 )) {skb_put (skb, urb->actual_length); -/* Process the command first */ +/* +* Process the command first. +* skb is either freed here or passed to be +* managed to another callback function. +*/ ath9k_htc_rx_msg (hif_dev->htc_handle, skb, skb->len,USB_REG_IN_PIPE ); - - nskb =alloc_skb (MAX_REG_IN_BUF_SIZE ,GFP_ATOMIC ); -if (!nskb) { + skb =alloc_skb (MAX_REG_IN_BUF_SIZE ,GFP_ATOMIC ); +if (!skb) {dev_err (&hif_dev->udev->dev,"ath9k_htc: REG_IN memory allocation failure\n" ); - urb->context =NULL ; -return ; + goto free_rx_buf; } - rx_buf->skb = nskb; + rx_buf->skb = skb;usb_fill_int_urb (urb, hif_dev->udev,usb_rcvintpipe (hif_dev->udev,USB_REG_IN_PIPE ), - nskb->data,MAX_REG_IN_BUF_SIZE , + skb->data,MAX_REG_IN_BUF_SIZE , ath9k_hif_usb_reg_in_cb, rx_buf,1 ); }
@@ -763,12 +764,13 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb) ret =usb_submit_urb (urb,GFP_ATOMIC );if (ret) {usb_unanchor_urb (urb); - goto free; + goto free_skb; }return ; -free: +free_skb:kfree_skb (skb); +free_rx_buf:kfree (rx_buf); urb->context =NULL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 101/658 wifi: rtl8xxxu: Fix reading the vendor of combo chips
In reply to Greg Kroah-HartmanFrom: Bitterblue Smith <[email protected]>
[ Upstream commit 6f103aeb5e985ac08f3a4a049a2c17294f40cff9 ]
The wifi + bluetooth combo chips (RTL8723AU and RTL8723BU) read the chip vendor from the wrong register because the val32 variable gets overwritten. Add one more variable to avoid this.
This had no real effect on RTL8723BU. It may have had an effect on RTL8723AU.
--- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +8 -8
@@ -1608,18 +1608,18 @@ static void rtl8xxxu_print_chipinfo(struct rtl8xxxu_priv *priv)static int rtl8xxxu_identify_chip (struct rtl8xxxu_priv *priv) {struct device *dev = &priv->udev->dev; -u32 val32, bonding; +u32 val32, bonding, sys_cfg;u16 val16; - val32 =rtl8xxxu_read32 (priv,REG_SYS_CFG ); - priv->chip_cut = (val32 &SYS_CFG_CHIP_VERSION_MASK ) >> + sys_cfg =rtl8xxxu_read32 (priv,REG_SYS_CFG ); + priv->chip_cut = (sys_cfg &SYS_CFG_CHIP_VERSION_MASK ) >>SYS_CFG_CHIP_VERSION_SHIFT ; -if (val32 &SYS_CFG_TRP_VAUX_EN ) { +if (sys_cfg &SYS_CFG_TRP_VAUX_EN ) {dev_info (dev,"Unsupported test chip\n" );return -ENOTSUPP ; } -if (val32 &SYS_CFG_BT_FUNC ) { +if (sys_cfg &SYS_CFG_BT_FUNC ) {if (priv->chip_cut >=3 ) {sprintf (priv->chip_name,"8723BU" ); priv->rtl_chip =RTL8723B ;
@@ -1641,7 +1641,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)if (val32 &MULTI_GPS_FUNC_EN ) priv->has_gps =1 ; priv->is_multi_func =1 ; - }else if (val32 &SYS_CFG_TYPE_ID ) { + }else if (sys_cfg &SYS_CFG_TYPE_ID ) { bonding =rtl8xxxu_read32 (priv,REG_HPON_FSM ); bonding &=HPON_FSM_BONDING_MASK ; if (priv->fops->tx_desc_size ==
@@ -1689,7 +1689,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)case RTL8188E :case RTL8192E :case RTL8723B : -switch (val32 &SYS_CFG_VENDOR_EXT_MASK ) { +switch (sys_cfg &SYS_CFG_VENDOR_EXT_MASK ) {case SYS_CFG_VENDOR_ID_TSMC :sprintf (priv->chip_vendor,"TSMC" );break ;
@@ -1706,7 +1706,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv) }break ;default : -if (val32 &SYS_CFG_VENDOR_ID ) { +if (sys_cfg &SYS_CFG_VENDOR_ID ) {sprintf (priv->chip_vendor,"UMC" ); priv->vendor_umc =1 ; }else {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 102/658 pata_ipx4xx_cf: Fix unsigned comparison with less than zero
In reply to Greg Kroah-HartmanFrom: Junlin Yang <[email protected]>
[ Upstream commit c38ae56ee034623c59e39c0130ca0dec086c1a39 ]
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irq', so making 'irq' an int, and change the position to keep the code format.
./drivers/ata/pata_ixp4xx_cf.c:168:5-8:
WARNING: Unsigned expression compared with zero: irq > 0
--- drivers/ata/pata_ixp4xx_cf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_ixp4xx_cf.c +1 -1
@@ -135,12 +135,12 @@ static void ixp4xx_setup_port(struct ata_port *ap,static int ixp4xx_pata_probe (struct platform_device *pdev) { -unsigned int irq;struct resource *cs0, *cs1;struct ata_host *host;struct ata_port *ap;struct ixp4xx_pata_data *data =dev_get_platdata (&pdev->dev);int ret; +int irq; cs0 =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); cs1 =platform_get_resource (pdev,IORESOURCE_MEM ,1 );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 103/658 media: i2c: ad5820: Fix error path
In reply to Greg Kroah-HartmanFrom: Ricardo Ribalda <[email protected]>
[ Upstream commit 9fce241660f37d9e95e93c0ae6fba8cfefa5797b ]
Error path seems to be swaped. Fix the order and provide some meaningful names.
--- drivers/media/i2c/ad5820.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/i2c/ad5820.c +5 -5
@@ -314,18 +314,18 @@ static int ad5820_probe(struct i2c_client *client, ret =media_entity_pads_init (&coil->subdev.entity,0 ,NULL );if (ret <0 ) - goto cleanup2; + goto clean_mutex; ret =v4l2_async_register_subdev (&coil->subdev);if (ret <0 ) - goto cleanup; + goto clean_entity;return ret; -cleanup2: -mutex_destroy (&coil->power_lock); -cleanup: +clean_entity:media_entity_cleanup (&coil->subdev.entity); +clean_mutex: +mutex_destroy (&coil->power_lock);return ret; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 104/658 can: kvaser_usb: do not increase tx statistics when sending error message frames
In reply to Greg Kroah-HartmanFrom: Vincent Mailhol <[email protected]>
[ Upstream commit 0b0ce2c67795672115ac6ca28351a78799cd114b ]
The CAN error message frames (i.e. error skb) are an interface specific to socket CAN. The payload of the CAN error message frames does not correspond to any actual data sent on the wire. Only an error flag and a delimiter are transmitted when an error occurs (c.f. ISO 11898-1 section 10.4.4.2 "Error flag").
For this reason, it makes no sense to increment the tx_packets and tx_bytes fields of struct net_device_stats when sending an error message frame because no actual payload will be transmitted on the wire.
N.B. Sending error message frames is a very specific feature which, at the moment, is only supported by the Kvaser Hydra hardware. Please refer to [1] for more details on the topic.
Stable-dep-of: 35364f5b41a4 ("can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device")
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +6 -1
@@ -293,6 +293,7 @@ struct kvaser_cmd {#define KVASER_USB_HYDRA_CF_FLAG_OVERRUN BIT(1)#define KVASER_USB_HYDRA_CF_FLAG_REMOTE_FRAME BIT(4)#define KVASER_USB_HYDRA_CF_FLAG_EXTENDED_ID BIT(5) +#define KVASER_USB_HYDRA_CF_FLAG_TX_ACK BIT(6)/* CAN frame flags. Used in ext_rx_can and ext_tx_can */ #define KVASER_USB_HYDRA_CF_FLAG_OSM_NACK BIT(12)#define KVASER_USB_HYDRA_CF_FLAG_ABL BIT(13)
@@ -1099,6 +1100,7 @@ static void kvaser_usb_hydra_tx_acknowledge(const struct kvaser_usb *dev,struct kvaser_usb_net_priv *priv;unsigned long irq_flags;bool one_shot_fail = false; +bool is_err_frame = false;u16 transid =kvaser_usb_hydra_get_cmd_transid (cmd); priv =kvaser_usb_hydra_net_priv_from_cmd (dev, cmd);
@@ -1117,10 +1119,13 @@ static void kvaser_usb_hydra_tx_acknowledge(const struct kvaser_usb *dev,kvaser_usb_hydra_one_shot_fail (priv, cmd_ext); one_shot_fail = true; } + + is_err_frame = flags &KVASER_USB_HYDRA_CF_FLAG_TX_ACK && + flags &KVASER_USB_HYDRA_CF_FLAG_ERROR_FRAME ; } context = &priv->tx_contexts[transid % dev->max_tx_urbs]; -if (!one_shot_fail) { +if (!one_shot_fail && !is_err_frame) {struct net_device_stats *stats = &priv->netdev->stats; stats->tx_packets++;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 105/658 can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit 35364f5b41a4917fe94a3f393d149b63ec583297 ]
Use the CMD_GET_CAPABILITIES_REQ command to query the device for certain capabilities. We are only interested in LISTENONLY mode and wither the device reports CAN error counters.
--- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 144 +++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +143 -1
@@ -73,6 +73,8 @@#define CMD_TX_ACKNOWLEDGE 50#define CMD_CAN_ERROR_EVENT 51#define CMD_FLUSH_QUEUE_REPLY 68 +#define CMD_GET_CAPABILITIES_REQ 95 +#define CMD_GET_CAPABILITIES_RESP 96#define CMD_LEAF_LOG_MESSAGE 106
@@ -82,6 +84,8 @@#define KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK BIT(5)#define KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK BIT(6) +#define KVASER_USB_LEAF_SWOPTION_EXT_CAP BIT(12) +/* error factors */ #define M16C_EF_ACKE BIT(0)#define M16C_EF_CRCE BIT(1)
@@ -277,6 +281,28 @@ struct leaf_cmd_log_message {u8 data[8 ]; } __packed; +/* Sub commands for cap_req and cap_res */ +#define KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE 0x02 +#define KVASER_USB_LEAF_CAP_CMD_ERR_REPORT 0x05 +struct kvaser_cmd_cap_req { +__le16 padding0; +__le16 cap_cmd; +__le16 padding1; +__le16 channel; +} __packed; + +/* Status codes for cap_res */ +#define KVASER_USB_LEAF_CAP_STAT_OK 0x00 +#define KVASER_USB_LEAF_CAP_STAT_NOT_IMPL 0x01 +#define KVASER_USB_LEAF_CAP_STAT_UNAVAIL 0x02 +struct kvaser_cmd_cap_res { +__le16 padding; +__le16 cap_cmd; +__le16 status; +__le32 mask; +__le32 value; +} __packed; +struct kvaser_cmd {u8 len;u8 id;
@@ -294,6 +320,8 @@ struct kvaser_cmd {struct leaf_cmd_chip_state_event chip_state_event;struct leaf_cmd_error_event error_event;struct leaf_cmd_log_message log_message; +struct kvaser_cmd_cap_req cap_req; +struct kvaser_cmd_cap_res cap_res; }__packed leaf;union {
@@ -323,6 +351,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = { [CMD_LEAF_LOG_MESSAGE] = kvaser_fsize(u.leaf.log_message), [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event), [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event), + [CMD_GET_CAPABILITIES_RESP] = kvaser_fsize(u.leaf.cap_res),/* ignored events: */ [CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY, };
@@ -607,6 +636,9 @@ static void kvaser_usb_leaf_get_software_info_leaf(struct kvaser_usb *dev, dev->fw_version =le32_to_cpu (softinfo->fw_version); dev->max_tx_urbs =le16_to_cpu (softinfo->max_outstanding_tx); +if (sw_options &KVASER_USB_LEAF_SWOPTION_EXT_CAP ) + dev->card_data.capabilities |=KVASER_USB_CAP_EXT_CAP ; +if (dev->driver_info->quirks &KVASER_USB_QUIRK_IGNORE_CLK_FREQ ) {/* Firmware expects bittiming parameters calculated for 16MHz * clock, regardless of the actual clock
@@ -694,6 +726,116 @@ static int kvaser_usb_leaf_get_card_info(struct kvaser_usb *dev)return 0 ; } +static int kvaser_usb_leaf_get_single_capability (struct kvaser_usb *dev, +u16 cap_cmd_req,u16 *status) +{ +struct kvaser_usb_dev_card_data *card_data = &dev->card_data; +struct kvaser_cmd *cmd; +u32 value =0 ; +u32 mask =0 ; +u16 cap_cmd_res; +int err; +int i; + + cmd =kzalloc (sizeof (*cmd),GFP_KERNEL ); +if (!cmd) +return -ENOMEM ; + + cmd->id =CMD_GET_CAPABILITIES_REQ ; + cmd->u.leaf.cap_req.cap_cmd =cpu_to_le16 (cap_cmd_req); + cmd->len =CMD_HEADER_LEN +sizeof (struct kvaser_cmd_cap_req ); + + err =kvaser_usb_send_cmd (dev, cmd, cmd->len); +if (err) + goto end; + + err =kvaser_usb_leaf_wait_cmd (dev,CMD_GET_CAPABILITIES_RESP , cmd); +if (err) + goto end; + + *status =le16_to_cpu (cmd->u.leaf.cap_res.status); + +if (*status !=KVASER_USB_LEAF_CAP_STAT_OK ) + goto end; + + cap_cmd_res =le16_to_cpu (cmd->u.leaf.cap_res.cap_cmd); +switch (cap_cmd_res) { +case KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE : +case KVASER_USB_LEAF_CAP_CMD_ERR_REPORT : + value =le32_to_cpu (cmd->u.leaf.cap_res.value); + mask =le32_to_cpu (cmd->u.leaf.cap_res.mask); +break ; +default : +dev_warn (&dev->intf->dev,"Unknown capability command %u\n" , + cap_cmd_res); +break ; + } + +for (i =0 ; i < dev->nchannels; i++) { +if (BIT (i) & (value & mask)) { +switch (cap_cmd_res) { +case KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE : + card_data->ctrlmode_supported |= +CAN_CTRLMODE_LISTENONLY ; +break ; +case KVASER_USB_LEAF_CAP_CMD_ERR_REPORT : + card_data->capabilities |= +KVASER_USB_CAP_BERR_CAP ; +break ; + } + } + } + +end: +kfree (cmd); + +return err; +} + +static int kvaser_usb_leaf_get_capabilities_leaf (struct kvaser_usb *dev) +{ +int err; +u16 status; + +if (!(dev->card_data.capabilities &KVASER_USB_CAP_EXT_CAP )) { +dev_info (&dev->intf->dev, +"No extended capability support. Upgrade device firmware.\n" ); +return 0 ; + } + + err =kvaser_usb_leaf_get_single_capability (dev, +KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE , + &status); +if (err) +return err; +if (status) +dev_info (&dev->intf->dev, +"KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE failed %u\n" , + status); + + err =kvaser_usb_leaf_get_single_capability (dev, +KVASER_USB_LEAF_CAP_CMD_ERR_REPORT , + &status); +if (err) +return err; +if (status) +dev_info (&dev->intf->dev, +"KVASER_USB_LEAF_CAP_CMD_ERR_REPORT failed %u\n" , + status); + +return 0 ; +} + +static int kvaser_usb_leaf_get_capabilities (struct kvaser_usb *dev) +{ +int err =0 ; + +if (dev->driver_info->family ==KVASER_LEAF ) + err =kvaser_usb_leaf_get_capabilities_leaf (dev); + +return err; +} +static void kvaser_usb_leaf_tx_acknowledge (const struct kvaser_usb *dev,const struct kvaser_cmd *cmd) {
@@ -1490,7 +1632,7 @@ const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops = { .dev_get_software_info = kvaser_usb_leaf_get_software_info, .dev_get_software_details = NULL, .dev_get_card_info = kvaser_usb_leaf_get_card_info, - .dev_get_capabilities = NULL, + .dev_get_capabilities = kvaser_usb_leaf_get_capabilities, .dev_set_opt_mode = kvaser_usb_leaf_set_opt_mode, .dev_start_chip = kvaser_usb_leaf_start_chip, .dev_stop_chip = kvaser_usb_leaf_stop_chip,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 106/658 can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit 7ea56128dbf904a3359bcf9289cccdfa3c85c7e8 ]
Prepare for handling CMD_ERROR_EVENT. Rename struct {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event.
--- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +19 -19
@@ -233,7 +233,7 @@ struct kvaser_cmd_tx_acknowledge_header {u8 tid; } __packed; -struct leaf_cmd_error_event { +struct leaf_cmd_can_error_event {u8 tid;u8 flags;__le16 time[3 ];
@@ -245,7 +245,7 @@ struct leaf_cmd_error_event {u8 error_factor; } __packed; -struct usbcan_cmd_error_event { +struct usbcan_cmd_can_error_event {u8 tid;u8 padding;u8 tx_errors_count_ch0;
@@ -318,7 +318,7 @@ struct kvaser_cmd {struct leaf_cmd_softinfo softinfo;struct leaf_cmd_rx_can rx_can;struct leaf_cmd_chip_state_event chip_state_event; -struct leaf_cmd_error_event error_event; +struct leaf_cmd_can_error_event can_error_event;struct leaf_cmd_log_message log_message;struct kvaser_cmd_cap_req cap_req;struct kvaser_cmd_cap_res cap_res;
@@ -328,7 +328,7 @@ struct kvaser_cmd {struct usbcan_cmd_softinfo softinfo;struct usbcan_cmd_rx_can rx_can;struct usbcan_cmd_chip_state_event chip_state_event; -struct usbcan_cmd_error_event error_event; +struct usbcan_cmd_can_error_event can_error_event; }__packed usbcan;struct kvaser_cmd_tx_can tx_can;
@@ -350,7 +350,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = { [CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.leaf.rx_can), [CMD_LEAF_LOG_MESSAGE] = kvaser_fsize(u.leaf.log_message), [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event), - [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event), + [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.can_error_event), [CMD_GET_CAPABILITIES_RESP] = kvaser_fsize(u.leaf.cap_res),/* ignored events: */ [CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY,
@@ -365,7 +365,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = { [CMD_RX_STD_MESSAGE] = kvaser_fsize(u.usbcan.rx_can), [CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.usbcan.rx_can), [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.usbcan.chip_state_event), - [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event), + [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.can_error_event),/* ignored events: */ [CMD_USBCAN_CLOCK_OVERFLOW_EVENT] = CMD_SIZE_ANY, };
@@ -1137,11 +1137,11 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev,case CMD_CAN_ERROR_EVENT : es.channel =0 ; - es.status = cmd->u.usbcan.error_event.status_ch0; - es.txerr = cmd->u.usbcan.error_event.tx_errors_count_ch0; - es.rxerr = cmd->u.usbcan.error_event.rx_errors_count_ch0; + es.status = cmd->u.usbcan.can_error_event.status_ch0; + es.txerr = cmd->u.usbcan.can_error_event.tx_errors_count_ch0; + es.rxerr = cmd->u.usbcan.can_error_event.rx_errors_count_ch0; es.usbcan.other_ch_status = - cmd->u.usbcan.error_event.status_ch1; + cmd->u.usbcan.can_error_event.status_ch1;kvaser_usb_leaf_usbcan_conditionally_rx_error (dev, &es);/* The USBCAN firmware supports up to 2 channels.
@@ -1149,13 +1149,13 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev,*/ if (dev->nchannels ==MAX_USBCAN_NET_DEVICES ) { es.channel =1 ; - es.status = cmd->u.usbcan.error_event.status_ch1; + es.status = cmd->u.usbcan.can_error_event.status_ch1; es.txerr = - cmd->u.usbcan.error_event.tx_errors_count_ch1; + cmd->u.usbcan.can_error_event.tx_errors_count_ch1; es.rxerr = - cmd->u.usbcan.error_event.rx_errors_count_ch1; + cmd->u.usbcan.can_error_event.rx_errors_count_ch1; es.usbcan.other_ch_status = - cmd->u.usbcan.error_event.status_ch0; + cmd->u.usbcan.can_error_event.status_ch0;kvaser_usb_leaf_usbcan_conditionally_rx_error (dev, &es); }break ;
@@ -1172,11 +1172,11 @@ static void kvaser_usb_leaf_leaf_rx_error(const struct kvaser_usb *dev,switch (cmd->id) {case CMD_CAN_ERROR_EVENT : - es.channel = cmd->u.leaf.error_event.channel; - es.status = cmd->u.leaf.error_event.status; - es.txerr = cmd->u.leaf.error_event.tx_errors_count; - es.rxerr = cmd->u.leaf.error_event.rx_errors_count; - es.leaf.error_factor = cmd->u.leaf.error_event.error_factor; + es.channel = cmd->u.leaf.can_error_event.channel; + es.status = cmd->u.leaf.can_error_event.status; + es.txerr = cmd->u.leaf.can_error_event.tx_errors_count; + es.rxerr = cmd->u.leaf.can_error_event.rx_errors_count; + es.leaf.error_factor = cmd->u.leaf.can_error_event.error_factor;break ;case CMD_LEAF_LOG_MESSAGE : es.channel = cmd->u.leaf.log_message.channel;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 107/658 can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit b24cb2d169e0c9dce664a959e1f2aa9781285dc9 ]
The device will send an error event command, to indicate certain errors. This indicates a misbehaving driver, and should never occur.
--- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +99 -0
@@ -69,6 +69,7 @@#define CMD_GET_CARD_INFO_REPLY 35#define CMD_GET_SOFTWARE_INFO 38#define CMD_GET_SOFTWARE_INFO_REPLY 39 +#define CMD_ERROR_EVENT 45#define CMD_FLUSH_QUEUE 48#define CMD_TX_ACKNOWLEDGE 50#define CMD_CAN_ERROR_EVENT 51
@@ -257,6 +258,28 @@ struct usbcan_cmd_can_error_event {__le16 time; } __packed; +/* CMD_ERROR_EVENT error codes */ +#define KVASER_USB_LEAF_ERROR_EVENT_TX_QUEUE_FULL 0x8 +#define KVASER_USB_LEAF_ERROR_EVENT_PARAM 0x9 + +struct leaf_cmd_error_event { +u8 tid; +u8 error_code; +__le16 timestamp[3 ]; +__le16 padding; +__le16 info1; +__le16 info2; +} __packed; + +struct usbcan_cmd_error_event { +u8 tid; +u8 error_code; +__le16 info1; +__le16 info2; +__le16 timestamp; +__le16 padding; +} __packed; +struct kvaser_cmd_ctrl_mode {u8 tid;u8 channel;
@@ -320,6 +343,7 @@ struct kvaser_cmd {struct leaf_cmd_chip_state_event chip_state_event;struct leaf_cmd_can_error_event can_error_event;struct leaf_cmd_log_message log_message; +struct leaf_cmd_error_event error_event;struct kvaser_cmd_cap_req cap_req;struct kvaser_cmd_cap_res cap_res; }__packed leaf;
@@ -329,6 +353,7 @@ struct kvaser_cmd {struct usbcan_cmd_rx_can rx_can;struct usbcan_cmd_chip_state_event chip_state_event;struct usbcan_cmd_can_error_event can_error_event; +struct usbcan_cmd_error_event error_event; }__packed usbcan;struct kvaser_cmd_tx_can tx_can;
@@ -352,6 +377,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = { [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event), [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.can_error_event), [CMD_GET_CAPABILITIES_RESP] = kvaser_fsize(u.leaf.cap_res), + [CMD_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event),/* ignored events: */ [CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY, };
@@ -366,6 +392,7 @@ static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = { [CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.usbcan.rx_can), [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.usbcan.chip_state_event), [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.can_error_event), + [CMD_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event),/* ignored events: */ [CMD_USBCAN_CLOCK_OVERFLOW_EVENT] = CMD_SIZE_ANY, };
@@ -1308,6 +1335,74 @@ static void kvaser_usb_leaf_rx_can_msg(const struct kvaser_usb *dev,netif_rx (skb); } +static void kvaser_usb_leaf_error_event_parameter (const struct kvaser_usb *dev, +const struct kvaser_cmd *cmd) +{ +u16 info1 =0 ; + +switch (dev->driver_info->family) { +case KVASER_LEAF : + info1 =le16_to_cpu (cmd->u.leaf.error_event.info1); +break ; +case KVASER_USBCAN : + info1 =le16_to_cpu (cmd->u.usbcan.error_event.info1); +break ; + } + +/* info1 will contain the offending cmd_no */ +switch (info1) { +case CMD_SET_CTRL_MODE : +dev_warn (&dev->intf->dev, +"CMD_SET_CTRL_MODE error in parameter\n" ); +break ; + +case CMD_SET_BUS_PARAMS : +dev_warn (&dev->intf->dev, +"CMD_SET_BUS_PARAMS error in parameter\n" ); +break ; + +default : +dev_warn (&dev->intf->dev, +"Unhandled parameter error event cmd_no (%u)\n" , + info1); +break ; + } +} + +static void kvaser_usb_leaf_error_event (const struct kvaser_usb *dev, +const struct kvaser_cmd *cmd) +{ +u8 error_code =0 ; + +switch (dev->driver_info->family) { +case KVASER_LEAF : + error_code = cmd->u.leaf.error_event.error_code; +break ; +case KVASER_USBCAN : + error_code = cmd->u.usbcan.error_event.error_code; +break ; + } + +switch (error_code) { +case KVASER_USB_LEAF_ERROR_EVENT_TX_QUEUE_FULL : +/* Received additional CAN message, when firmware TX queue is +* already full. Something is wrong with the driver. +* This should never happen! +*/ +dev_err (&dev->intf->dev, +"Received error event TX_QUEUE_FULL\n" ); +break ; +case KVASER_USB_LEAF_ERROR_EVENT_PARAM : +kvaser_usb_leaf_error_event_parameter (dev, cmd); +break ; + +default : +dev_warn (&dev->intf->dev, +"Unhandled error event (%d)\n" , error_code); +break ; + } +} +static void kvaser_usb_leaf_start_chip_reply (const struct kvaser_usb *dev,const struct kvaser_cmd *cmd) {
@@ -1386,6 +1481,10 @@ static void kvaser_usb_leaf_handle_command(const struct kvaser_usb *dev,kvaser_usb_leaf_tx_acknowledge (dev, cmd);break ; +case CMD_ERROR_EVENT : +kvaser_usb_leaf_error_event (dev, cmd); +break ; +/* Ignored commands */ case CMD_USBCAN_CLOCK_OVERFLOW_EVENT :if (dev->driver_info->family !=KVASER_USBCAN )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 108/658 can: kvaser_usb_leaf: Set Warning state even without bus errors
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
[ Upstream commit df1b7af2761b935f63b4a53e789d41ed859edf61 ]
kvaser_usb_leaf_rx_error_update_can_state() sets error state according to error counters when the hardware does not indicate a specific state directly.
However, this is currently gated behind a check for M16C_STATE_BUS_ERROR which does not always seem to be set when error counters are increasing, and may not be set when error counters are decreasing.
This causes the CAN_STATE_ERROR_WARNING state to not be set in some cases even when appropriate.
Change the code to set error state from counters even without M16C_STATE_BUS_ERROR.
The Error-Passive case seems superfluous as it is already set via M16C_STATE_BUS_PASSIVE flag above, but it is kept for now.
Tested with 0bfd:0124 Kvaser Mini PCI Express 2xHS FW 4.18.778.
--- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +8 -12
@@ -965,20 +965,16 @@ kvaser_usb_leaf_rx_error_update_can_state(struct kvaser_usb_net_priv *priv, new_state =CAN_STATE_BUS_OFF ; }else if (es->status &M16C_STATE_BUS_PASSIVE ) { new_state =CAN_STATE_ERROR_PASSIVE ; - }else if (es->status &M16C_STATE_BUS_ERROR ) { + }else if ((es->status &M16C_STATE_BUS_ERROR ) && + cur_state >=CAN_STATE_BUS_OFF ) {/* Guard against spurious error events after a busoff */ -if (cur_state <CAN_STATE_BUS_OFF ) { -if (es->txerr >=128 || es->rxerr >=128 ) - new_state =CAN_STATE_ERROR_PASSIVE ; -else if (es->txerr >=96 || es->rxerr >=96 ) - new_state =CAN_STATE_ERROR_WARNING ; -else if (cur_state >CAN_STATE_ERROR_ACTIVE ) - new_state =CAN_STATE_ERROR_ACTIVE ; - } - } - -if (!es->status) + }else if (es->txerr >=128 || es->rxerr >=128 ) { + new_state =CAN_STATE_ERROR_PASSIVE ; + }else if (es->txerr >=96 || es->rxerr >=96 ) { + new_state =CAN_STATE_ERROR_WARNING ; + }else { new_state =CAN_STATE_ERROR_ACTIVE ; + }if (new_state != cur_state) { tx_state = (es->txerr >= es->rxerr) ? new_state :0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 109/658 can: kvaser_usb_leaf: Fix improved state not being reported
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
[ Upstream commit 8d21f5927ae604881f98587fabf6753f88730968 ]
The tested 0bfd:0017 Kvaser Memorator Professional HS/HS FW 2.0.50 and 0bfd:0124 Kvaser Mini PCI Express 2xHS FW 4.18.778 do not seem to send any unsolicited events when error counters decrease or when the device transitions from ERROR_PASSIVE to ERROR_ACTIVE (or WARNING).
This causes the interface to e.g. indefinitely stay in the ERROR_PASSIVE state.
Fix that by asking for chip state (inc. counters) event every 0.5 secs when error counters are non-zero.
Since there are non-error-counter devices, also always poll in ERROR_PASSIVE even if the counters show zero.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 7 +++ .../net/can/usb/kvaser_usb/kvaser_usb_core.c | 19 +++++- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 58 +++++++++++++++++++ 3 files changed, 81 insertions(+), 3 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb.h +7 -0
@@ -104,6 +104,9 @@ struct kvaser_usb_net_priv {struct can_priv can;struct can_berr_counter bec; +/* subdriver-specific data */ +void *sub_priv; +struct kvaser_usb *dev;struct net_device *netdev;int channel;
@@ -125,6 +128,8 @@ struct kvaser_usb_net_priv {* * @dev_setup_endpoints: setup USB in and out endpoints * @dev_init_card: initialize card +* @dev_init_channel: initialize channel +* @dev_remove_channel: uninitialize channel * @dev_get_software_info: get software info * @dev_get_software_details: get software details * @dev_get_card_info: get card info
@@ -146,6 +151,8 @@ struct kvaser_usb_dev_ops { struct can_berr_counter *bec);int (*dev_setup_endpoints)(struct kvaser_usb *dev);int (*dev_init_card)(struct kvaser_usb *dev); +int (*dev_init_channel)(struct kvaser_usb_net_priv *priv); +void (*dev_remove_channel)(struct kvaser_usb_net_priv *priv);int (*dev_get_software_info)(struct kvaser_usb *dev);int (*dev_get_software_details)(struct kvaser_usb *dev);int (*dev_get_card_info)(struct kvaser_usb *dev);
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +16 -3
@@ -645,6 +645,7 @@ static const struct net_device_ops kvaser_usb_netdev_ops = {static void kvaser_usb_remove_interfaces (struct kvaser_usb *dev) { +const struct kvaser_usb_dev_ops *ops = dev->driver_info->ops;int i;for (i =0 ; i < dev->nchannels; i++) {
@@ -660,6 +661,9 @@ static void kvaser_usb_remove_interfaces(struct kvaser_usb *dev)if (!dev->nets[i])continue ; +if (ops->dev_remove_channel) + ops->dev_remove_channel (dev->nets[i]); +free_candev (dev->nets[i]->netdev); } }
@@ -727,17 +731,26 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) dev->nets[channel] = priv; +if (ops->dev_init_channel) { + err = ops->dev_init_channel (priv); +if (err) + goto err; + } + err =register_candev (netdev);if (err) {dev_err (&dev->intf->dev,"Failed to register CAN device\n" ); -free_candev (netdev); - dev->nets[channel] =NULL ; -return err; + goto err; }netdev_dbg (netdev,"device registered\n" );return 0 ; + +err: +free_candev (netdev); + dev->nets[channel] =NULL ; +return err; } static int kvaser_usb_probe(struct usb_interface *intf,
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +58 -0
122 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 110/658 can: kvaser_usb_leaf: Fix wrong CAN state after stopping
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
[ Upstream commit a11249acf802341294557895d8e5f6aef080253f ]
0bfd:0124 Kvaser Mini PCI Express 2xHS FW 4.18.778 sends a CMD_CHIP_STATE_EVENT indicating bus-off after stopping the device, causing a stopped device to appear as CAN_STATE_BUS_OFF instead of CAN_STATE_STOPPED.
Fix that by not handling error events on stopped devices.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +4 -0
@@ -1049,6 +1049,10 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, leaf = priv->sub_priv; stats = &priv->netdev->stats; +/* Ignore e.g. state change to bus-off reported just after stopping */ +if (!netif_running (priv->netdev)) +return ; +/* Update all of the CAN interface's state and error counters before * trying any memory allocation that can actually fail with -ENOMEM. *
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 111/658 can: kvaser_usb_leaf: Fix bogus restart events
In reply to Greg Kroah-HartmanFrom: Anssi Hannula <[email protected]>
[ Upstream commit 90904d326269a38fe5dd895fb2db7c03199654c4 ]
When auto-restart is enabled, the kvaser_usb_leaf driver considers transition from any state >= CAN_STATE_BUS_OFF as a bus-off recovery event (restart).
However, these events may occur at interface startup time before kvaser_usb_open() has set the state to CAN_STATE_ERROR_ACTIVE, causing restarts counter to increase and CAN_ERR_RESTARTED to be sent despite no actual restart having occurred.
Fix that by making the auto-restart condition checks more strict so that they only trigger when the interface was actually in the BUS_OFF state.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +3 -3
@@ -899,7 +899,7 @@ static void kvaser_usb_leaf_tx_acknowledge(const struct kvaser_usb *dev, context = &priv->tx_contexts[tid % dev->max_tx_urbs];/* Sometimes the state change doesn't come after a bus-off event */ -if (priv->can.restart_ms && priv->can.state >=CAN_STATE_BUS_OFF ) { +if (priv->can.restart_ms && priv->can.state ==CAN_STATE_BUS_OFF ) {struct sk_buff *skb;struct can_frame *cf;
@@ -1002,7 +1002,7 @@ kvaser_usb_leaf_rx_error_update_can_state(struct kvaser_usb_net_priv *priv, }if (priv->can.restart_ms && - cur_state >=CAN_STATE_BUS_OFF && + cur_state ==CAN_STATE_BUS_OFF && new_state <CAN_STATE_BUS_OFF ) priv->can.can_stats.restarts++;
@@ -1092,7 +1092,7 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, }if (priv->can.restart_ms && - old_state >=CAN_STATE_BUS_OFF && + old_state ==CAN_STATE_BUS_OFF && new_state <CAN_STATE_BUS_OFF ) { cf->can_id |=CAN_ERR_RESTARTED ;netif_carrier_on (priv->netdev);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 112/658 can: kvaser_usb: Add struct kvaser_usb_busparams
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit 00e5786177649c1e3110f9454fdd34e336597265 ]
Add struct kvaser_usb_busparams containing the busparameters used in CMD_{SET,GET}_BUSPARAMS* commands.
Stable-dep-of: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming")
--- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 8 +++++ .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 32 +++++++------------ .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 18 ++++------- 3 files changed, 27 insertions(+), 31 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb.h +8 -0
@@ -76,6 +76,14 @@ struct kvaser_usb_tx_urb_context {int dlc; }; +struct kvaser_usb_busparams { +__le32 bitrate; +u8 tseg1; +u8 tseg2; +u8 sjw; +u8 nsamples; +} __packed; +struct kvaser_usb {struct usb_device *udev;struct usb_interface *intf;
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +12 -20
@@ -193,17 +193,9 @@ struct kvaser_cmd_chip_state_event {#define KVASER_USB_HYDRA_BUS_MODE_CANFD_ISO 0x01#define KVASER_USB_HYDRA_BUS_MODE_NONISO 0x02struct kvaser_cmd_set_busparams { -__le32 bitrate; -u8 tseg1; -u8 tseg2; -u8 sjw; -u8 nsamples; +struct kvaser_usb_busparams busparams_arb;u8 reserved0[4 ]; -__le32 bitrate_d; -u8 tseg1_d; -u8 tseg2_d; -u8 sjw_d; -u8 nsamples_d; +struct kvaser_usb_busparams busparams_data;u8 canfd_mode;u8 reserved1[7 ]; } __packed;
@@ -1515,11 +1507,11 @@ static int kvaser_usb_hydra_set_bittiming(struct net_device *netdev)return -ENOMEM ; cmd->header.cmd_no =CMD_SET_BUSPARAMS_REQ ; - cmd->set_busparams_req.bitrate =cpu_to_le32 (bt->bitrate); - cmd->set_busparams_req.sjw = (u8 )sjw; - cmd->set_busparams_req.tseg1 = (u8 )tseg1; - cmd->set_busparams_req.tseg2 = (u8 )tseg2; - cmd->set_busparams_req.nsamples =1 ; + cmd->set_busparams_req.busparams_arb.bitrate =cpu_to_le32 (bt->bitrate); + cmd->set_busparams_req.busparams_arb.sjw = (u8 )sjw; + cmd->set_busparams_req.busparams_arb.tseg1 = (u8 )tseg1; + cmd->set_busparams_req.busparams_arb.tseg2 = (u8 )tseg2; + cmd->set_busparams_req.busparams_arb.nsamples =1 ;kvaser_usb_hydra_set_cmd_dest_he (cmd, dev->card_data.hydra.channel_to_he[priv->channel]);
@@ -1549,11 +1541,11 @@ static int kvaser_usb_hydra_set_data_bittiming(struct net_device *netdev)return -ENOMEM ; cmd->header.cmd_no =CMD_SET_BUSPARAMS_FD_REQ ; - cmd->set_busparams_req.bitrate_d =cpu_to_le32 (dbt->bitrate); - cmd->set_busparams_req.sjw_d = (u8 )sjw; - cmd->set_busparams_req.tseg1_d = (u8 )tseg1; - cmd->set_busparams_req.tseg2_d = (u8 )tseg2; - cmd->set_busparams_req.nsamples_d =1 ; + cmd->set_busparams_req.busparams_data.bitrate =cpu_to_le32 (dbt->bitrate); + cmd->set_busparams_req.busparams_data.sjw = (u8 )sjw; + cmd->set_busparams_req.busparams_data.tseg1 = (u8 )tseg1; + cmd->set_busparams_req.busparams_data.tseg2 = (u8 )tseg2; + cmd->set_busparams_req.busparams_data.nsamples =1 ;if (priv->can.ctrlmode &CAN_CTRLMODE_FD ) {if (priv->can.ctrlmode &CAN_CTRLMODE_FD_NON_ISO )
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +7 -11
@@ -163,11 +163,7 @@ struct usbcan_cmd_softinfo {struct kvaser_cmd_busparams {u8 tid;u8 channel; -__le32 bitrate; -u8 tseg1; -u8 tseg2; -u8 sjw; -u8 no_samp; +struct kvaser_usb_busparams busparams; } __packed;struct kvaser_cmd_tx_can {
@@ -1703,15 +1699,15 @@ static int kvaser_usb_leaf_set_bittiming(struct net_device *netdev) cmd->len =CMD_HEADER_LEN +sizeof (struct kvaser_cmd_busparams ); cmd->u.busparams.channel = priv->channel; cmd->u.busparams.tid =0xff ; - cmd->u.busparams.bitrate =cpu_to_le32 (bt->bitrate); - cmd->u.busparams.sjw = bt->sjw; - cmd->u.busparams.tseg1 = bt->prop_seg + bt->phase_seg1; - cmd->u.busparams.tseg2 = bt->phase_seg2; + cmd->u.busparams.busparams.bitrate =cpu_to_le32 (bt->bitrate); + cmd->u.busparams.busparams.sjw = bt->sjw; + cmd->u.busparams.busparams.tseg1 = bt->prop_seg + bt->phase_seg1; + cmd->u.busparams.busparams.tseg2 = bt->phase_seg2;if (priv->can.ctrlmode &CAN_CTRLMODE_3_SAMPLES ) - cmd->u.busparams.no_samp =3 ; + cmd->u.busparams.busparams.nsamples =3 ;else - cmd->u.busparams.no_samp =1 ; + cmd->u.busparams.busparams.nsamples =1 ; rc =kvaser_usb_send_cmd (dev, cmd, cmd->len);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 113/658 can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit 39d3df6b0ea80f9b515c632ca07b39b1c156edee ]
The device will respond with a CMD_ERROR_EVENT command, with error_code KVASER_USB_{LEAF,HYDRA}_ERROR_EVENT_PARAM, if the CMD_SET_BUSPARAMS_REQ contains invalid bittiming parameters.
However, this command does not contain any channel reference.
To check if the CMD_SET_BUSPARAMS_REQ was successful, redback and compare the requested bittiming parameters with the device reported parameters.
--- drivers/net/can/usb/kvaser_usb/kvaser_usb.h | 15 +- .../net/can/usb/kvaser_usb/kvaser_usb_core.c | 96 ++++++++++- .../net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 150 +++++++++++++++--- .../net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 64 ++++++-- 4 files changed, 284 insertions(+), 41 deletions(-)
drivers/net/can/usb/kvaser_usb/kvaser_usb.h +12 -3
@@ -119,9 +119,12 @@ struct kvaser_usb_net_priv {struct net_device *netdev;int channel; -struct completion start_comp, stop_comp, flush_comp; +struct completion start_comp, stop_comp, flush_comp, + get_busparams_comp;struct usb_anchor tx_submitted; +struct kvaser_usb_busparams busparams_nominal, busparams_data; +spinlock_t tx_contexts_lock;/* lock for active_tx_contexts */ int active_tx_contexts;struct kvaser_usb_tx_urb_context tx_contexts[];
@@ -131,7 +134,9 @@ struct kvaser_usb_net_priv {* struct kvaser_usb_dev_ops - Device specific functions * @dev_set_mode: used for can.do_set_mode * @dev_set_bittiming: used for can.do_set_bittiming +* @dev_get_busparams: readback arbitration busparams * @dev_set_data_bittiming: used for can.do_set_data_bittiming +* @dev_get_data_busparams: readback data busparams * @dev_get_berr_counter: used for can.do_get_berr_counter * * @dev_setup_endpoints: setup USB in and out endpoints
@@ -153,8 +158,12 @@ struct kvaser_usb_net_priv {*/ struct kvaser_usb_dev_ops {int (*dev_set_mode)(struct net_device *netdev,enum can_mode mode); -int (*dev_set_bittiming)(struct net_device *netdev); -int (*dev_set_data_bittiming)(struct net_device *netdev); +int (*dev_set_bittiming)(const struct net_device *netdev, +const struct kvaser_usb_busparams *busparams); +int (*dev_get_busparams)(struct kvaser_usb_net_priv *priv); +int (*dev_set_data_bittiming)(const struct net_device *netdev, +const struct kvaser_usb_busparams *busparams); +int (*dev_get_data_busparams)(struct kvaser_usb_net_priv *priv);int (*dev_get_berr_counter)(const struct net_device *netdev,struct can_berr_counter *bec);int (*dev_setup_endpoints)(struct kvaser_usb *dev);
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +90 -6
126 lines not on this page · raw message
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +129 -21
240 lines not on this page · raw message
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +53 -11
115 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 114/658 clk: renesas: r9a06g032: Repair grave increment error
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 02693e11611e082e3c4d8653e8af028e43d31164 ]
If condition (clkspec.np != pd->dev.of_node) is true, then the driver ends up in an endless loop, forever, locking up the machine.
--- drivers/clk/renesas/r9a06g032-clocks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/renesas/r9a06g032-clocks.c +1 -2
@@ -386,7 +386,7 @@ static int r9a06g032_attach_dev(struct generic_pm_domain *pd,int error;int index; -while (!of_parse_phandle_with_args (np,"clocks" ,"#clock-cells" , i, +while (!of_parse_phandle_with_args (np,"clocks" ,"#clock-cells" , i++, &clkspec)) {if (clkspec.np != pd->dev.of_node)continue ;
@@ -399,7 +399,6 @@ static int r9a06g032_attach_dev(struct generic_pm_domain *pd,if (error)return error; } - i++; }return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 115/658 spi: Update reference to struct spi_controller
In reply to Greg Kroah-HartmanFrom: Jonathan Neuschäfer <[email protected]>
[ Upstream commit bf585ccee22faf469d82727cf375868105b362f7 ]
struct spi_master has been renamed to struct spi_controller. Update the reference in spi.rst to make it clickable again.
--- Documentation/driver-api/spi.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/driver-api/spi.rst +2 -2
@@ -25,8 +25,8 @@ hardware, which may be as simple as a set of GPIO pins or as complex as a pair of FIFOs connected to dual DMA engines on the other side of the SPI shift register (maximizing throughput). Such drivers bridge between whatever bus they sit on (often the platform bus) and SPI, and expose -the SPI side of their device as a :c:type:`struct spi_master -<spi_master>`. SPI devices are children of that master, +the SPI side of their device as a :c:type:`struct spi_controller +<spi_controller>`. SPI devices are children of that master, represented as a :c:type:`struct spi_device <spi_device>` and manufactured from :c:type:`struct spi_board_info <spi_board_info>` descriptors which are usually provided by
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 116/658 drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit c62102165dd79284d42383d2f7ed17301bd8e629 ]
In case mipi_dsi_attach() fails, call drm_panel_remove() to avoid memory leak.
--- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-sitronix-st7701.c +9 -1
@@ -392,7 +392,15 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) st7701->dsi = dsi; st7701->desc = desc; -return mipi_dsi_attach (dsi); + ret =mipi_dsi_attach (dsi); +if (ret) + goto err_attach; + +return 0 ; + +err_attach: +drm_panel_remove (&st7701->panel); +return ret; }static int st7701_dsi_remove (struct mipi_dsi_device *dsi)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 117/658 ima: Rename internal filter rule functions
In reply to Greg Kroah-HartmanFrom: Tyler Hicks <[email protected]>
[ Upstream commit b8867eedcf76caef8ae6412da97cd9abfd092ff8 ]
Rename IMA's internal filter rule functions from security_filter_rule_*() to ima_filter_rule_*(). This avoids polluting the security_* namespace, which is typically reserved for general security subsystem infrastructure.
Stable-dep-of: c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()")
--- security/integrity/ima/ima.h | 16 +++++++-------- security/integrity/ima/ima_policy.c | 30 +++++++++++++---------------- 2 files changed, 21 insertions(+), 25 deletions(-)
security/integrity/ima/ima.h +8 -8
@@ -361,24 +361,24 @@ static inline void ima_free_modsig(struct modsig *modsig)/* LSM based policy rules require audit */ #ifdef CONFIG_IMA_LSM_RULES -#define security_filter_rule_init security_audit_rule_init -#define security_filter_rule_free security_audit_rule_free -#define security_filter_rule_match security_audit_rule_match +#define ima_filter_rule_init security_audit_rule_init +#define ima_filter_rule_free security_audit_rule_free +#define ima_filter_rule_match security_audit_rule_match#else -static inline int security_filter_rule_init (u32 field,u32 op,char *rulestr, -void **lsmrule) +static inline int ima_filter_rule_init (u32 field,u32 op,char *rulestr, +void **lsmrule) {return -EINVAL ; } -static inline void security_filter_rule_free (void *lsmrule) +static inline void ima_filter_rule_free (void *lsmrule) { } -static inline int security_filter_rule_match (u32 secid,u32 field,u32 op, -void *lsmrule) +static inline int ima_filter_rule_match (u32 secid,u32 field,u32 op, +void *lsmrule) {return -EINVAL ; }
security/integrity/ima/ima_policy.c +13 -17
@@ -254,7 +254,7 @@ static void ima_lsm_free_rule(struct ima_rule_entry *entry)int i;for (i =0 ; i <MAX_LSM_RULES ; i++) { -security_filter_rule_free (entry->lsm[i].rule); +ima_filter_rule_free (entry->lsm[i].rule);kfree (entry->lsm[i].args_p); }kfree (entry);
@@ -286,10 +286,9 @@ static struct ima_rule_entry *ima_lsm_copy_rule(struct ima_rule_entry *entry)if (!nentry->lsm[i].args_p) goto out_err; -security_filter_rule_init (nentry->lsm[i].type, - Audit_equal, - nentry->lsm[i].args_p, - &nentry->lsm[i].rule); +ima_filter_rule_init (nentry->lsm[i].type, Audit_equal, + nentry->lsm[i].args_p, + &nentry->lsm[i].rule);if (!nentry->lsm[i].rule)pr_warn ("rule for LSM \'%s\' is undefined\n" , (char *)entry->lsm[i].args_p);
@@ -425,18 +424,16 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,case LSM_OBJ_ROLE :case LSM_OBJ_TYPE :security_inode_getsecid (inode, &osid); - rc =security_filter_rule_match (osid, - rule->lsm[i].type, - Audit_equal, - rule->lsm[i].rule); + rc =ima_filter_rule_match (osid, rule->lsm[i].type, + Audit_equal, + rule->lsm[i].rule);break ;case LSM_SUBJ_USER :case LSM_SUBJ_ROLE :case LSM_SUBJ_TYPE : - rc =security_filter_rule_match (secid, - rule->lsm[i].type, - Audit_equal, - rule->lsm[i].rule); + rc =ima_filter_rule_match (secid, rule->lsm[i].type, + Audit_equal, + rule->lsm[i].rule);default :break ; }
@@ -821,10 +818,9 @@ static int ima_lsm_rule_init(struct ima_rule_entry *entry,return -ENOMEM ; entry->lsm[lsm_rule].type = audit_type; - result =security_filter_rule_init (entry->lsm[lsm_rule].type, - Audit_equal, - entry->lsm[lsm_rule].args_p, - &entry->lsm[lsm_rule].rule); + result =ima_filter_rule_init (entry->lsm[lsm_rule].type, Audit_equal, + entry->lsm[lsm_rule].args_p, + &entry->lsm[lsm_rule].rule);if (!entry->lsm[lsm_rule].rule) {pr_warn ("rule for LSM \'%s\' is undefined\n" , (char *)entry->lsm[lsm_rule].args_p);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 118/658 ima: Fix fall-through warnings for Clang
In reply to Greg Kroah-HartmanFrom: Gustavo A. R. Silva <[email protected]>
[ Upstream commit 28073eb09c5aa29e879490edb88cfd3e7073821e ]
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple warnings by explicitly adding multiple break statements instead of just letting the code fall through to the next case.
Stable-dep-of: c7423dbdbc9e ("ima: Handle -ESTALE returned by ima_filter_rule_match()")
--- security/integrity/ima/ima_main.c | 1 + security/integrity/ima/ima_policy.c | 2 ++ 2 files changed, 3 insertions(+)
security/integrity/ima/ima_main.c +1 -0
@@ -615,6 +615,7 @@ int ima_load_data(enum kernel_load_data_id id)pr_err ("impossible to appraise a module without a file descriptor. sig_enforce kernel parameter might help\n" );return -EACCES ;/* INTEGRITY_UNKNOWN */ } +break ;default :break ; }
security/integrity/ima/ima_policy.c +2 -0
@@ -434,6 +434,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, rc =ima_filter_rule_match (secid, rule->lsm[i].type, Audit_equal, rule->lsm[i].rule); +break ;default :break ; }
@@ -666,6 +667,7 @@ void __init ima_init_policy(void)add_rules (default_measurement_rules,ARRAY_SIZE (default_measurement_rules),IMA_DEFAULT_POLICY ); +break ;default :break ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 119/658 ima: Handle -ESTALE returned by ima_filter_rule_match()
In reply to Greg Kroah-HartmanFrom: GUO Zihua <[email protected]>
[ Upstream commit c7423dbdbc9ecef7fff5239d144cad4b9887f4de ]
IMA relies on the blocking LSM policy notifier callback to update the LSM based IMA policy rules.
When SELinux update its policies, IMA would be notified and starts updating all its lsm rules one-by-one. During this time, -ESTALE would be returned by ima_filter_rule_match() if it is called with a LSM rule that has not yet been updated. In ima_match_rules(), -ESTALE is not handled, and the LSM rule is considered a match, causing extra files to be measured by IMA.
Fix it by re-initializing a temporary rule if -ESTALE is returned by ima_filter_rule_match(). The origin rule in the rule list would be updated by the LSM policy notifier callback.
--- security/integrity/ima/ima_policy.c | 41 ++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 9 deletions(-)
security/integrity/ima/ima_policy.c +32 -9
@@ -370,6 +370,9 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, enum ima_hooks func, int mask) { int i; +bool result = false; +struct ima_rule_entry *lsm_rule = rule; +bool rule_reinitialized = false;if (func ==KEXEC_CMDLINE ) {if ((rule->flags &IMA_FUNC ) && (rule->func == func))
@@ -413,35 +416,55 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode,int rc =0 ;u32 osid; -if (!rule->lsm[i].rule) { -if (!rule->lsm[i].args_p) +if (!lsm_rule->lsm[i].rule) { +if (!lsm_rule->lsm[i].args_p)continue ;else return false; } + +retry:switch (i) {case LSM_OBJ_USER :case LSM_OBJ_ROLE :case LSM_OBJ_TYPE :security_inode_getsecid (inode, &osid); - rc =ima_filter_rule_match (osid, rule->lsm[i].type, + rc =ima_filter_rule_match (osid, lsm_rule->lsm[i].type, Audit_equal, - rule->lsm[i].rule); + lsm_rule->lsm[i].rule);break ;case LSM_SUBJ_USER :case LSM_SUBJ_ROLE :case LSM_SUBJ_TYPE : - rc =ima_filter_rule_match (secid, rule->lsm[i].type, + rc =ima_filter_rule_match (secid, lsm_rule->lsm[i].type, Audit_equal, - rule->lsm[i].rule); + lsm_rule->lsm[i].rule);break ;default :break ; } -if (!rc) -return false; + +if (rc == -ESTALE && !rule_reinitialized) { + lsm_rule =ima_lsm_copy_rule (rule); +if (lsm_rule) { + rule_reinitialized = true; + goto retry; + } + } +if (!rc) { + result = false; + goto out; + } } -return true; + result = true; + +out: +if (rule_reinitialized) { +for (i =0 ; i <MAX_LSM_RULES ; i++) +ima_filter_rule_free (lsm_rule->lsm[i].rule); +kfree (lsm_rule); + } +return result; }/*
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 120/658 media: vivid: fix compose size exceed boundary
In reply to Greg Kroah-HartmanFrom: Liu Shixin <[email protected]>
[ Upstream commit 94a7ad9283464b75b12516c5512541d467cefcf8 ]
syzkaller found a bug:
BUG: unable to handle page fault for address: ffffc9000a3b1000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 100000067 P4D 100000067 PUD 10015f067 PMD 1121ca067 PTE 0 Oops: 0002 [#1] PREEMPT SMP CPU: 0 PID: 23489 Comm: vivid-000-vid-c Not tainted 6.1.0-rc1+ #512 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:memcpy_erms+0x6/0x10 [...] Call Trace: <TASK> ? tpg_fill_plane_buffer+0x856/0x15b0 vivid_fillbuff+0x8ac/0x1110 vivid_thread_vid_cap_tick+0x361/0xc90 vivid_thread_vid_cap+0x21a/0x3a0 kthread+0x143/0x180 ret_from_fork+0x1f/0x30 </TASK>
This is because we forget to check boundary after adjust compose->height int V4L2_SEL_TGT_CROP case. Add v4l2_rect_map_inside() to fix this problem for this case.
--- drivers/media/platform/vivid/vivid-vid-cap.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/vivid/vivid-vid-cap.c +1 -0
@@ -935,6 +935,7 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selectionif (dev->has_compose_cap) {v4l2_rect_set_min_size (compose, &min_rect);v4l2_rect_set_max_size (compose, &max_rect); +v4l2_rect_map_inside (compose, &fmt); } dev->fmt_cap_rect = fmt;tpg_s_buf_height (&dev->tpg, fmt.height);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 121/658 bpf: propagate precision in ALU/ALU64 operations
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit a3b666bfa9c9edc05bca62a87abafe0936bd7f97 ]
When processing ALU/ALU64 operations (apart from BPF_MOV, which is handled correctly already; and BPF_NEG and BPF_END are special and don't have source register), if destination register is already marked precise, this causes problem with potentially missing precision tracking for the source register. E.g., when we have r1 >>= r5 and r1 is marked precise, but r5 isn't, this will lead to r5 staying as imprecise. This is due to the precision backtracking logic stopping early when it sees r1 is already marked precise. If r1 wasn't precise, we'd keep backtracking and would add r5 to the set of registers that need to be marked precise. So there is a discrepancy here which can lead to invalid and incompatible states matched due to lack of precision marking on r5. If r1 wasn't precise, precision backtracking would correctly mark both r1 and r5 as precise.
This is simple to fix, though. During the forward instruction simulation pass, for arithmetic operations of scalar <op>= scalar form (where <op> is ALU or ALU64 operations), if destination register is already precise, mark source register as precise. This applies only when both involved registers are SCALARs. ptr += scalar and scalar += ptr cases are already handled correctly.
This does have (negative) effect on some selftest programs and few Cilium programs. ~/baseline-tmp-results.csv are veristat results with this patch, while ~/baseline-results.csv is without it. See post scriptum for instructions on how to make Cilium programs testable with veristat. Correctness has a price.
$ ./veristat -C -e file,prog,insns,states ~/baseline-results.csv ~/baseline-tmp-results.csv | grep -v '+0' File Program Total insns (A) Total insns (B) Total insns (DIFF) Total states (A) Total states (B) Total states (DIFF) ----------------------- -------------------- --------------- --------------- ------------------ ---------------- ---------------- ------------------- bpf_cubic.bpf.linked1.o bpf_cubic_cong_avoid 997 1700 +703 (+70.51%) 62 90 +28 (+45.16%) test_l4lb.bpf.linked1.o balancer_ingress 4559 5469 +910 (+19.96%) 118 126 +8 (+6.78%) ----------------------- -------------------- --------------- --------------- ------------------ ---------------- ---------------- -------------------
$ ./veristat -C -e file,prog,verdict,insns,states ~/baseline-results-cilium.csv ~/baseline-tmp-results-cilium.csv | grep -v '+0' File Program Total insns (A) Total insns (B) Total insns (DIFF) Total states (A) Total states (B) Total states (DIFF) ------------- ------------------------------ --------------- --------------- ------------------ ---------------- ---------------- ------------------- bpf_host.o tail_nodeport_nat_ingress_ipv6 4448 5261 +813 (+18.28%) 234 247 +13 (+5.56%) bpf_host.o tail_nodeport_nat_ipv6_egress 3396 3446 +50 (+1.47%) 201 203 +2 (+1.00%) bpf_lxc.o tail_nodeport_nat_ingress_ipv6 4448 5261 +813 (+18.28%) 234 247 +13 (+5.56%) bpf_overlay.o tail_nodeport_nat_ingress_ipv6 4448 5261 +813 (+18.28%) 234 247 +13 (+5.56%) bpf_xdp.o tail_lb_ipv4 71736 73442 +1706 (+2.38%) 4295 4370 +75 (+1.75%) ------------- ------------------------------ --------------- --------------- ------------------ ---------------- ---------------- -------------------
P.S. To make Cilium ([0]) programs libbpf-compatible and thus veristat-loadable, apply changes from topmost commit in [1], which does minimal changes to Cilium source code, mostly around SEC() annotations and BPF map definitions.
[0] https://github.com/cilium/cilium/
[1] https://github.com/anakryiko/cilium/commits/libbpf-friendliness
--- kernel/bpf/verifier.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/bpf/verifier.c +5 -0
@@ -5140,6 +5140,11 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env,return err;return adjust_ptr_min_max_vals (env, insn, dst_reg, src_reg); + }else if (dst_reg->precise) { +/* if dst_reg is precise, src_reg should be precise as well */ + err =mark_chain_precision (env, insn->src_reg); +if (err) +return err; } }else {/* Pretend the src is a reg with a known value, since we only
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 122/658 mtd: Fix device name leak when register device failed in add_mtd_device()
In reply to Greg Kroah-HartmanFrom: Zhang Xiaoxu <[email protected]>
[ Upstream commit 895d68a39481a75c680aa421546931fb11942fa6 ]
There is a kmemleak when register device failed:
unreferenced object 0xffff888101aab550 (size 8):
comm "insmod", pid 3922, jiffies 4295277753 (age 925.408s)
hex dump (first 8 bytes):
6d 74 64 30 00 88 ff ff mtd0....
backtrace:
[<00000000bde26724>] __kmalloc_node_track_caller+0x4e/0x150
[<000000003c32b416>] kvasprintf+0xb0/0x130
[<000000001f7a8f15>] kobject_set_name_vargs+0x2f/0xb0
[<000000006e781163>] dev_set_name+0xab/0xe0
[<00000000e30d0c78>] add_mtd_device+0x4bb/0x700
[<00000000f3d34de7>] mtd_device_parse_register+0x2ac/0x3f0
[<00000000c0d88488>] 0xffffffffa0238457
[<00000000b40d0922>] 0xffffffffa02a008f
[<0000000023d17b9d>] do_one_initcall+0x87/0x2a0
[<00000000770f6ca6>] do_init_module+0xdf/0x320
[<000000007b6768fe>] load_module+0x2f98/0x3330
[<00000000346bed5a>] __do_sys_finit_module+0x113/0x1b0
[<00000000674c2290>] do_syscall_64+0x35/0x80
[<000000004c6a8d97>] entry_SYSCALL_64_after_hwframe+0x46/0xb0If register device failed, should call put_device() to give up the reference.
--- drivers/mtd/mtdcore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/mtdcore.c +3 -1
@@ -673,8 +673,10 @@ int add_mtd_device(struct mtd_info *mtd)dev_set_drvdata (&mtd->dev, mtd);of_node_get (mtd_get_of_node (mtd)); error =device_register (&mtd->dev); -if (error) +if (error) { +put_device (&mtd->dev); goto fail_added; + }/* Add the nvmem provider */ error =mtd_nvmem_add (mtd);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 123/658 wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit b8f6efccbb9dc0ff5dee7e20d69a4747298ee603 ]
When using wpa_supplicant v2.10, this driver is no longer able to associate with any AP and fails in the EAPOL 4-way handshake while sending the 2/4 message to the AP. The problem is not present in wpa_supplicant v2.9 or older. The problem stems from HostAP commit 144314eaa ("wpa_supplicant: Send EAPOL frames over nl80211 where available") which changes the way EAPOL frames are sent, from them being send at L2 frames to them being sent via nl80211 control port.
An EAPOL frame sent as L2 frame is passed to the WiFi driver with skb->protocol ETH_P_PAE, while EAPOL frame sent via nl80211 control port has skb->protocol set to ETH_P_802_3 . The later happens in ieee80211_tx_control_port(), where the EAPOL frame is encapsulated into 802.3 frame.
The rsi_91x driver handles ETH_P_PAE EAPOL frames as high-priority frames and sends them via highest-priority transmit queue, while the ETH_P_802_3 frames are sent as regular frames. The EAPOL 4-way handshake frames must be sent as highest-priority, otherwise the 4-way handshake times out.
Therefore, to fix this problem, inspect the skb control flags and if flag IEEE80211_TX_CTRL_PORT_CTRL_PROTO is set, assume this is an EAPOL frame and transmit the frame via high-priority queue just like other ETH_P_PAE frames.
--- drivers/net/wireless/rsi/rsi_91x_core.c | 4 +++- drivers/net/wireless/rsi/rsi_91x_hal.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/rsi/rsi_91x_core.c +3 -1
@@ -466,7 +466,9 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb) tid, 0); } } -if (skb->protocol ==cpu_to_be16 (ETH_P_PAE )) { + +if (IEEE80211_SKB_CB (skb)->control.flags & +IEEE80211_TX_CTRL_PORT_CTRL_PROTO ) { q_num =MGMT_SOFT_Q ; skb->priority = q_num; }
drivers/net/wireless/rsi/rsi_91x_hal.c +5 -1
@@ -162,12 +162,16 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)u8 header_size;u8 vap_id =0 ;u8 dword_align_bytes; +bool tx_eapol;u16 seq_num; info =IEEE80211_SKB_CB (skb); vif = info->control.vif; tx_params = (struct skb_info *)info->driver_data; + tx_eapol =IEEE80211_SKB_CB (skb)->control.flags & +IEEE80211_TX_CTRL_PORT_CTRL_PROTO ; + header_size =FRAME_DESC_SZ +sizeof (struct rsi_xtended_desc );if (header_size >skb_headroom (skb)) {rsi_dbg (ERR_ZONE ,"%s: Unable to send pkt\n" , __func__);
@@ -231,7 +235,7 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb) } } -if (skb->protocol ==cpu_to_be16 (ETH_P_PAE )) { +if (tx_eapol) {rsi_dbg (INFO_ZONE ,"*** Tx EAPOL ***\n" ); data_desc->frame_info =cpu_to_le16 (RATE_INFO_ENABLE );
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 124/658 media: camss: Clean up received buffers on failed start of streaming
In reply to Greg Kroah-HartmanFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit c8f3582345e6a69da65ab588f7c4c2d1685b0e80 ]
It is required to return the received buffers, if streaming can not be started. For instance media_pipeline_start() may fail with EPIPE, if a link validation between entities is not passed, and in such a case a user gets a kernel warning:
WARNING: CPU: 1 PID: 520 at drivers/media/common/videobuf2/videobuf2-core.c:1592 vb2_start_streaming+0xec/0x160 <snip> Call trace: vb2_start_streaming+0xec/0x160 vb2_core_streamon+0x9c/0x1a0 vb2_ioctl_streamon+0x68/0xbc v4l_streamon+0x30/0x3c __video_do_ioctl+0x184/0x3e0 video_usercopy+0x37c/0x7b0 video_ioctl2+0x24/0x40 v4l2_ioctl+0x4c/0x70
The fix is to correct the error path in video_start_streaming() of camss.
--- drivers/media/platform/qcom/camss/camss-video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/qcom/camss/camss-video.c +2 -1
@@ -438,7 +438,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) ret =media_pipeline_start (&vdev->entity, &video->pipe);if (ret <0 ) -return ret; + goto flush_buffers; ret =video_check_format (video);if (ret <0 )
@@ -467,6 +467,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count) error:media_pipeline_stop (&vdev->entity); +flush_buffers: video->ops->flush_buffers (video,VB2_BUF_STATE_QUEUED );return ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 125/658 net, proc: Provide PROC_FS=n fallback for proc_create_net_single_write()
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit c3d96f690a790074b508fe183a41e36a00cd7ddd ]
Provide a CONFIG_PROC_FS=n fallback for proc_create_net_single_write().
Also provide a fallback for proc_create_net_data_write().
--- include/linux/proc_fs.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/proc_fs.h +2 -0
@@ -127,8 +127,10 @@ static inline void proc_remove(struct proc_dir_entry *de) {}static inline int remove_proc_subtree (const char *name,struct proc_dir_entry *parent) {return 0 ; }#define proc_create_net_data (name, mode, parent, ops, state_size, data) ({NULL;}) +#define proc_create_net_data_write (name, mode, parent, ops, write, state_size, data) ({NULL;})#define proc_create_net (name, mode, parent, state_size, ops) ({NULL;})#define proc_create_net_single (name, mode, parent, show, data) ({NULL;}) +#define proc_create_net_single_write (name, mode, parent, show, write, data) ({NULL;})static inline struct pid *tgid_pidfd_to_pid (const struct file *file) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 126/658 rxrpc: Fix ack.bufferSize to be 0 when generating an ack
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit 8889a711f9b4dcf4dd1330fa493081beebd118c9 ]
ack.bufferSize should be set to 0 when generating an ack.
--- net/rxrpc/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/rxrpc/output.c +1 -1
@@ -93,7 +93,7 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_connection *conn, *_hard_ack = hard_ack; *_top = top; - pkt->ack.bufferSpace =htons (8 ); + pkt->ack.bufferSpace =htons (0 ); pkt->ack.maxSkew =htons (0 ); pkt->ack.firstPacket =htonl (hard_ack +1 ); pkt->ack.previousPacket =htonl (call->ackr_highest_seq);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 127/658 drm/radeon: Add the missed acpi_put_table() to fix memory leak
In reply to Greg Kroah-HartmanFrom: Hanjun Guo <[email protected]>
[ Upstream commit 10276a20be1115e1f76c189330da2992df980eee ]
When the radeon driver reads the bios information from ACPI table in radeon_acpi_vfct_bios(), it misses to call acpi_put_table() to release the ACPI memory after the init, so add acpi_put_table() properly to fix the memory leak.
v2: fix text formatting (Alex)
--- drivers/gpu/drm/radeon/radeon_bios.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_bios.c +11 -7
@@ -612,13 +612,14 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)acpi_size tbl_size;UEFI_ACPI_VFCT *vfct;unsigned offset; +bool r = false;if (!ACPI_SUCCESS (acpi_get_table ("VFCT" ,1 , &hdr)))return false; tbl_size = hdr->length;if (tbl_size <sizeof (UEFI_ACPI_VFCT )) {DRM_ERROR ("ACPI VFCT table present but broken (too short #1)\n" ); -return false; + goto out; } vfct = (UEFI_ACPI_VFCT *)hdr;
@@ -631,13 +632,13 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) offset +=sizeof (VFCT_IMAGE_HEADER );if (offset > tbl_size) {DRM_ERROR ("ACPI VFCT image header truncated\n" ); -return false; + goto out; } offset += vhdr->ImageLength;if (offset > tbl_size) {DRM_ERROR ("ACPI VFCT image truncated\n" ); -return false; + goto out; } if (vhdr->ImageLength &&
@@ -649,15 +650,18 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) rdev->bios =kmemdup (&vbios->VbiosContent, vhdr->ImageLength,GFP_KERNEL ); +if (rdev->bios) + r = true; -if (!rdev->bios) -return false; - return true; + goto out; } }DRM_ERROR ("ACPI VFCT table present but broken (too short #2)\n" ); -return false; + +out: +acpi_put_table (hdr); +return r; }#else static inline bool radeon_acpi_vfct_bios (struct radeon_device *rdev)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 128/658 drm/mediatek: Modify dpi power on/off sequence.
In reply to Greg Kroah-HartmanFrom: Xinlei Lee <[email protected]>
[ Upstream commit ff446c0f6290185cefafe3b376bb86063a3a9f6a ]
Modify dpi power on/off sequence so that the first gpio operation will take effect.
--- drivers/gpu/drm/mediatek/mtk_dpi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/mediatek/mtk_dpi.c +6 -6
@@ -364,9 +364,6 @@ static void mtk_dpi_power_off(struct mtk_dpi *dpi)if (--dpi->refcount !=0 )return ; -if (dpi->pinctrl && dpi->pins_gpio) -pinctrl_select_state (dpi->pinctrl, dpi->pins_gpio); -mtk_dpi_disable (dpi);clk_disable_unprepare (dpi->pixel_clk);clk_disable_unprepare (dpi->engine_clk);
@@ -391,9 +388,6 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi) goto err_pixel; } -if (dpi->pinctrl && dpi->pins_dpi) -pinctrl_select_state (dpi->pinctrl, dpi->pins_dpi); -return 0 ; err_pixel:
@@ -529,12 +523,18 @@ static void mtk_dpi_encoder_disable(struct drm_encoder *encoder)struct mtk_dpi *dpi =mtk_dpi_from_encoder (encoder);mtk_dpi_power_off (dpi); + +if (dpi->pinctrl && dpi->pins_gpio) +pinctrl_select_state (dpi->pinctrl, dpi->pins_gpio); }static void mtk_dpi_encoder_enable (struct drm_encoder *encoder) {struct mtk_dpi *dpi =mtk_dpi_from_encoder (encoder); +if (dpi->pinctrl && dpi->pins_dpi) +pinctrl_select_state (dpi->pinctrl, dpi->pins_dpi); +mtk_dpi_power_on (dpi);mtk_dpi_set_display_mode (dpi, &dpi->mode);mtk_dpi_enable (dpi);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 129/658 ASoC: pxa: fix null-pointer dereference in filter()
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit ec7bf231aaa1bdbcb69d23bc50c753c80fb22429 ]
kasprintf() would return NULL pointer when kmalloc() fail to allocate. Need to check the return pointer before calling strcmp().
--- sound/soc/pxa/mmp-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/pxa/mmp-pcm.c +1 -1
@@ -85,7 +85,7 @@ static bool filter(struct dma_chan *chan, void *param) devname =kasprintf (GFP_KERNEL ,"%s.%d" , dma_data->dma_res->name, dma_data->ssp_id); -if ((strcmp (dev_name (chan->device->dev), devname) ==0 ) && +if (devname && (strcmp (dev_name (chan->device->dev), devname) ==0 ) && (chan->chan_id == dma_data->dma_res->start)) { found = true; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 130/658 regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f2b41b748c19962b82709d9f23c6b2b0ce9d2f91 ]
I got the the following report:
OF: ERROR: memory leak, expected refcount 1 instead of 2, of_node_get()/of_node_put() unbalanced - destroy cset entry:
attach overlay node /i2c/pmic@62/regulators/exten
In of_get_regulator(), the node is returned from of_parse_phandle() with refcount incremented, after using it, of_node_put() need be called.
--- drivers/regulator/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/core.c +1 -0
@@ -1734,6 +1734,7 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev, node =of_get_regulator (dev, supply);if (node) { r =of_find_regulator_by_node (node); +of_node_put (node);if (r)return r;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 131/658 amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit d27252b5706e51188aed7647126e44dcf9e940c1 ]
In the PP_OD_EDIT_VDDC_CURVE case the "input_index" variable is capped at 2 but not checked for negative values so it results in an out of bounds read. This value comes from the user via sysfs.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +2 -1
@@ -2894,7 +2894,8 @@ static int vega20_odn_edit_dpm_table(struct pp_hwmgr *hwmgr, data->od8_settings.od8_settings_array;OverDriveTable_t *od_table = &(data->smc_state_table.overdrive_table); -int32_t input_index, input_clk, input_vol, i; +int32_t input_clk, input_vol, i; +uint32_t input_index;int od8_id;int ret;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 132/658 integrity: Fix memory leakage in keyring allocation error path
In reply to Greg Kroah-HartmanFrom: GUO Zihua <[email protected]>
[ Upstream commit 39419ef7af0916cc3620ecf1ed42d29659109bf3 ]
Key restriction is allocated in integrity_init_keyring(). However, if keyring allocation failed, it is not freed, causing memory leaks.
--- security/integrity/digsig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
security/integrity/digsig.c +5 -1
@@ -121,6 +121,7 @@ int __init integrity_init_keyring(const unsigned int id) {struct key_restriction *restriction;key_perm_t perm; +int ret; perm = (KEY_POS_ALL & ~KEY_POS_SETATTR ) |KEY_USR_VIEW |KEY_USR_READ |KEY_USR_SEARCH ;
@@ -141,7 +142,10 @@ int __init integrity_init_keyring(const unsigned int id) perm |=KEY_USR_WRITE ; out: -return __integrity_init_keyring (id, perm, restriction); + ret =__integrity_init_keyring (id, perm, restriction); +if (ret) +kfree (restriction); +return ret; } int __init integrity_add_key(const unsigned int id, const void *data,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 133/658 ima: Fix misuse of dereference of pointer in template_desc_init_fields()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 25369175ce84813dd99d6604e710dc2491f68523 ]
The input parameter @fields is type of struct ima_template_field ***, so when allocates array memory for @fields, the size of element should be sizeof(**field) instead of sizeof(*field).
Actually the original code would not cause any runtime error, but it's better to make it logically right.
--- security/integrity/ima/ima_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/integrity/ima/ima_template.c +2 -2
@@ -222,11 +222,11 @@ int template_desc_init_fields(const char *template_fmt, }if (fields && num_fields) { - *fields =kmalloc_array (i,sizeof (*fields),GFP_KERNEL ); + *fields =kmalloc_array (i,sizeof (**fields),GFP_KERNEL );if (*fields ==NULL )return -ENOMEM ; -memcpy (*fields, found_fields, i *sizeof (*fields)); +memcpy (*fields, found_fields, i *sizeof (**fields)); *num_fields = i; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 134/658 wifi: ath10k: Fix return value in ath10k_pci_init()
In reply to Greg Kroah-HartmanFrom: Xiu Jianfeng <[email protected]>
[ Upstream commit 2af7749047d8d6ad43feff69f555a13a6a6c2831 ]
This driver is attempting to register to support two different buses. if either of these is successful then ath10k_pci_init() should return 0 so that hardware attached to the successful bus can be probed and supported. only if both of these are unsuccessful should ath10k_pci_init() return an errno.
--- drivers/net/wireless/ath/ath10k/pci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +12 -8
@@ -3769,18 +3769,22 @@ static struct pci_driver ath10k_pci_driver = {static int __init ath10k_pci_init (void ) { -int ret; +int ret1, ret2; - ret =pci_register_driver (&ath10k_pci_driver); -if (ret) + ret1 =pci_register_driver (&ath10k_pci_driver); +if (ret1)printk (KERN_ERR "failed to register ath10k pci driver: %d\n" , - ret); + ret1); - ret =ath10k_ahb_init (); -if (ret) -printk (KERN_ERR "ahb init failed: %d\n" , ret); + ret2 =ath10k_ahb_init (); +if (ret2) +printk (KERN_ERR "ahb init failed: %d\n" , ret2); -return ret; +if (ret1 && ret2) +return ret1; + +/* registered to at least one bus */ +return 0 ; }module_init (ath10k_pci_init);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 135/658 mtd: lpddr2_nvm: Fix possible null-ptr-deref
In reply to Greg Kroah-HartmanFrom: Hui Tang <[email protected]>
[ Upstream commit 6bdd45d795adf9e73b38ced5e7f750cd199499ff ]
It will cause null-ptr-deref when resource_size(add_range) invoked, if platform_get_resource() returns NULL.
--- drivers/mtd/lpddr/lpddr2_nvm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mtd/lpddr/lpddr2_nvm.c +2 -0
@@ -433,6 +433,8 @@ static int lpddr2_nvm_probe(struct platform_device *pdev)/* lpddr2_nvm address range */ add_range =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!add_range) +return -ENODEV ;/* Populate map_info data structure */ *map = (struct map_info ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 136/658 Input: elants_i2c - properly handle the reset GPIO when power is off
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit a85fbd6498441694475716a4d5c65f9d3e073faf ]
As can be seen in elants_i2c_power_off(), we want the reset GPIO asserted when power is off. The reset GPIO is active low so we need the reset line logic low when power is off to avoid leakage.
We have a problem, though, at probe time. At probe time we haven't powered the regulators on yet but we have:
devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_LOW);
While that _looks_ right, it turns out that it's not. The GPIOD_OUT_LOW doesn't mean to init the GPIO to low. It means init the GPIO to "not asserted". Since this is an active low GPIO that inits it to be high.
Let's fix this to properly init the GPIO. Now after both probe and power off the state of the GPIO is consistent (it's "asserted" or level low).
Once we fix this, we can see that at power on time we no longer to assert the reset GPIO as the first thing. The reset GPIO is _always_ asserted before powering on. Let's fix powering on to account for this.
--- drivers/input/touchscreen/elants_i2c.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/input/touchscreen/elants_i2c.c +3 -6
@@ -1078,14 +1078,12 @@ static int elants_i2c_power_on(struct elants_data *ts)if (IS_ERR_OR_NULL (ts->reset_gpio))return 0 ; -gpiod_set_value_cansleep (ts->reset_gpio,1 ); - error =regulator_enable (ts->vcc33);if (error) {dev_err (&ts->client->dev,"failed to enable vcc33 regulator: %d\n" , error); - goto release_reset_gpio; +return error; } error =regulator_enable (ts->vccio);
@@ -1094,7 +1092,7 @@ static int elants_i2c_power_on(struct elants_data *ts)"failed to enable vccio regulator: %d\n" , error);regulator_disable (ts->vcc33); - goto release_reset_gpio; +return error; }/*
@@ -1103,7 +1101,6 @@ static int elants_i2c_power_on(struct elants_data *ts)*/ udelay (ELAN_POWERON_DELAY_USEC ); -release_reset_gpio:gpiod_set_value_cansleep (ts->reset_gpio,0 );if (error)return error;
@@ -1211,7 +1208,7 @@ static int elants_i2c_probe(struct i2c_client *client,return error; } - ts->reset_gpio =devm_gpiod_get (&client->dev,"reset" ,GPIOD_OUT_LOW ); + ts->reset_gpio =devm_gpiod_get (&client->dev,"reset" ,GPIOD_OUT_HIGH );if (IS_ERR (ts->reset_gpio)) { error =PTR_ERR (ts->reset_gpio);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 137/658 media: solo6x10: fix possible memory leak in solo_sysfs_init()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 7f5866dd96d95b74e439f6ee17b8abd8195179fb ]
If device_register() returns error in solo_sysfs_init(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject_cleanup().
--- drivers/media/pci/solo6x10/solo6x10-core.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/pci/solo6x10/solo6x10-core.c +1 -0
@@ -420,6 +420,7 @@ static int solo_sysfs_init(struct solo_dev *solo_dev) solo_dev->nr_chans);if (device_register (dev)) { +put_device (dev); dev->parent =NULL ;return -ENOMEM ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 138/658 media: platform: exynos4-is: Fix error handling in fimc_md_init()
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit b434422c45282a0573d8123239abc41fa72665d4 ]
A problem about modprobe s5p_fimc failed is triggered with the following log given:
[ 272.075275] Error: Driver 'exynos4-fimc' is already registered, aborting... modprobe: ERROR: could not insert 's5p_fimc': Device or resource busy
The reason is that fimc_md_init() returns platform_driver_register() directly without checking its return value, if platform_driver_register() failed, it returns without unregister fimc_driver, resulting the s5p_fimc can never be installed later.
A simple call graph is shown as below:
fimc_md_init()
fimc_register_driver() # register fimc_driver
platform_driver_register()
platform_driver_register()
driver_register()
bus_add_driver()
dev = kzalloc(...) # OOM happened
# return without unregister fimc_driver
Fix by unregister fimc_driver when platform_driver_register() returns error.
--- drivers/media/platform/exynos4-is/fimc-core.c | 2 +- drivers/media/platform/exynos4-is/media-dev.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/exynos4-is/fimc-core.c +1 -1
@@ -1231,7 +1231,7 @@ int __init fimc_register_driver(void)return platform_driver_register (&fimc_driver); } -void __exit fimc_unregister_driver(void) +void fimc_unregister_driver (void ) {platform_driver_unregister (&fimc_driver); }
drivers/media/platform/exynos4-is/media-dev.c +5 -1
@@ -1581,7 +1581,11 @@ static int __init fimc_md_init(void)if (ret)return ret; -return platform_driver_register (&fimc_md_driver); + ret =platform_driver_register (&fimc_md_driver); +if (ret) +fimc_unregister_driver (); + +return ret; } static void __exit fimc_md_exit(void)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 139/658 media: videobuf-dma-contig: use dma_mmap_coherent
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit b3dc3f8e49577840dc8ac8a365c5b3da4edb10b8 ]
dma_alloc_coherent does not return a physical address, but a DMA address, which might be remapped or have an offset. Passing the DMA address to vm_iomap_memory is thus broken.
Use the proper dma_mmap_coherent helper instead, and stop passing __GFP_COMP to dma_alloc_coherent, as the memory management inside the DMA allocator is hidden from the callers and does not require it.
With this the gfp_t argument to __videobuf_dc_alloc can be removed and hard coded to GFP_KERNEL.
--- drivers/media/v4l2-core/videobuf-dma-contig.c | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-)
drivers/media/v4l2-core/videobuf-dma-contig.c +8 -14
@@ -36,12 +36,11 @@ struct videobuf_dma_contig_memory {static int __videobuf_dc_alloc (struct device *dev,struct videobuf_dma_contig_memory *mem, -unsigned long size,gfp_t flags) +unsigned long size) { mem->size = size; - mem->vaddr =dma_alloc_coherent (dev, mem->size, - &mem->dma_handle, flags); - + mem->vaddr =dma_alloc_coherent (dev, mem->size, &mem->dma_handle, +GFP_KERNEL );if (!mem->vaddr) {dev_err (dev,"memory alloc size %ld failed\n" , mem->size);return -ENOMEM ;
@@ -258,8 +257,7 @@ static int __videobuf_iolock(struct videobuf_queue *q,return videobuf_dma_contig_user_get (mem, vb);/* allocate memory for the read() method */ -if (__videobuf_dc_alloc (q->dev, mem,PAGE_ALIGN (vb->size), -GFP_KERNEL )) +if (__videobuf_dc_alloc (q->dev, mem,PAGE_ALIGN (vb->size)))return -ENOMEM ;break ;case V4L2_MEMORY_OVERLAY :
@@ -295,22 +293,18 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,BUG_ON (!mem);MAGIC_CHECK (mem->magic,MAGIC_DC_MEM ); -if (__videobuf_dc_alloc (q->dev, mem,PAGE_ALIGN (buf->bsize), -GFP_KERNEL | __GFP_COMP)) +if (__videobuf_dc_alloc (q->dev, mem,PAGE_ALIGN (buf->bsize))) goto error; -/* Try to remap memory */ - vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); -/* the "vm_pgoff" is just used in v4l2 to find the * corresponding buffer data structure which is allocated * earlier and it does not mean the offset from the physical * buffer start address as usual. So set it to 0 to pass -* the sanity check in vm_iomap_memory(). +* the sanity check in dma_mmap_coherent(). */ vma->vm_pgoff =0 ; - - retval =vm_iomap_memory (vma, mem->dma_handle, mem->size); + retval =dma_mmap_coherent (q->dev, vma, mem->vaddr, mem->dma_handle, + mem->size);if (retval) {dev_err (q->dev,"mmap: remap failed with error %d. " , retval);
Signature · 1 line
2.35.1