Commit Graph

862781 Commits

Author SHA1 Message Date
Sugar Zhang
6f048a072e fiq_debugger_arm: Print real address instead of hashed address
This patch replaces %p with %px to print real address for debugging.

Refer to:
Documentation/core-api/printk-formats.rst: Unmodified Addresses

Before:

debug> bt
pid: 0  comm: swapper/0
 r0 00000000  r1 b0d08cb0  r2 00000008  r3 00000001
 r4 b0c50008  r5 00000000  r6 00000000  r7 b0d01ef0
 r8 f0803000  r9 b0d00000 r10 00000000 r11 b0d01f68  mode SVC
 ip 00000000  sp b0d01ec0  lr b010e308  pc b010e314 cpsr 600001d3
  pc: 319691eb (handle_IPI+0x11c/0x18c), lr 3029134f (handle_IPI+0x110/0x18c)
  pc: d0f03ab2 (gic_handle_irq+0x74/0x78), lr d0f03ab2 (gic_handle_irq+0x74/0x78)
  pc: 86ca801d (__irq_svc+0x58/0x8c), lr 86ca801d (__irq_svc+0x58/0x8c)

After this patch:

debug> bt
pid: 0  comm: swapper/0
 r0 00000000  r1 b0d08cb0  r2 0000000c  r3 00000001
 r4 b0c50008  r5 00000000  r6 00000000  r7 b0d01ef0
 r8 f0803000  r9 b0d00000 r10 00000000 r11 b0d01f68  mode SVC
 ip 00000000  sp b0d01ec0  lr b010e308  pc b010e314 cpsr 600d01d3
  pc: b010e314 (handle_IPI+0x11c/0x18c), lr b010e308 (handle_IPI+0x110/0x18c)
  pc: b03b347c (gic_handle_irq+0x74/0x78), lr b03b347c (gic_handle_irq+0x74/0x78)
  pc: b0101a78 (__irq_svc+0x58/0x8c), lr b0101a78 (__irq_svc+0x58/0x8c)

Change-Id: I9ef798f30531c654ef18ff59d56bb85facccb79d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:57 +08:00
Yifeng Zhao
d1dd426374 drivers: rk_nand: support rk3568
1. add compatible "rockchip,rk-nandc-v9"
2. support samsung ss14 8GB MLC NAND FLASH

Change-Id: I0508ac1d7249b40eac5d5b88bbf0695b7e2ba6f3
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2021-01-22 20:12:57 +08:00
Andy Yan
107a0619dd drm/rockchip: vop2: Move window from inactive video port to active vide port
Set all windows to activated video port at init,
try to avoid change port_mux when display on.

Change-Id: I29b7b0b0a610580ac6e07cc1d8ef35b51d86b8b0
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:57 +08:00
Andy Yan
e3fd547c39 drm/rockchip: vop2: Update date port_mux for all vp when one of them changed
Change-Id: I364b19b94d00ee95fad6ccf25f769f7d123e106c
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:57 +08:00
Andy Yan
9d1bc38156 drm/rockchip: vop2: Init window and video port map.
Read port_mux register to get the window and vp map.

Change-Id: If18c55754592df2e9bb8e3fe93e66624cd2cedb9
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:57 +08:00
Andy Yan
e40785303b drm/rockchip: vop2: Fix start mixer_id find for vp
Change-Id: I08107a9ffb5eb719809d76a6a0d9efe16c92543b
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:56 +08:00
Andy Yan
4719c4e177 drm/rockchip: vop2: wait for next frame when close to frame start of previous vp
Only config done the current vp at the first 3/4 frame time
if there is another vp waiting for config done.

Change-Id: I0ee33182cf11cd6d502e0bf02684c8b09f3df26b
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:56 +08:00
Andy Yan
2fc439df49 drm/rockchip: vop2: Read vp config done bits before change it
The config done bits of VP0, VP1, VP2 on RK3568 stands on
the first three bits on REG_CFG_DONE register without mask bit.

If two or three config done events happens one after
another in a very shot time, the flowing config done
write may override the previous config done bit before
it take effect:
 1: config done 0x8001 for VP0
 2: config done 0x8002 for VP1

 0x8002 may override 0x8001 before it take effect.

So we do a read | write here.

Change-Id: I35ad380b1c2751542697c9c7cdacea12dd08d924
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-01-22 20:12:56 +08:00
Weixin Zhou
ceaaf760e6 arm64: dts: rockchip: rk3566-rk817-eink-w6: add charger leds
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: Id2edd426c626b8cc9e3d86626f9e9dc766f91ff6
2021-01-22 20:12:56 +08:00
Yifeng Zhao
2810efc860 soc: rockchip: mtd_vendor_storage: fix write issue
The page offset is need point to empty page. And also need to deal
case with ECC error.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I459345f18823b63cc5084be63c9a64c36838a151
2021-01-22 20:12:56 +08:00
Cai YiWei
a2eee96da1 media: rockchip: isp/ispp get vaddr in buf queue
avoid to map vaddr when vb2_plane_vaddr at interrupt

Change-Id: Id391a405973a9838fbc97065e4e27f6b88c07b8c
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-01-22 20:12:56 +08:00
Tao Huang
2711475ad6 input: touchscreen: tp_suspend: Remove set but unused variable 'ret'
drivers/input/touchscreen/tp_suspend.h:77:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Fixes: ef0b86754e ("driver: input: touchscreen: gt9xx: add ebc suspend notify support")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1fd66d6b8664e6f09cc4aad1544bfef424565dc0
2021-01-22 20:12:56 +08:00
Steven Liu
ca67e68942 ARM: dts: rockchip: Fix UART pull-ups on rv1108
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I46de2a34695075956d66de140c20f3d1b63a18be
2021-01-22 20:12:56 +08:00
Steven Liu
6e0dd2d946 ARM: dts: rockchip: Fix UART pull-ups on rk3288
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I6ab6f53c76b2dc72b9656080e7231f98e1d75ab3
2021-01-22 20:12:56 +08:00
Steven Liu
c599250109 ARM: dts: rockchip: Fix UART pull-ups on rk322x
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I3e57d7c8646c4df6a24c94dcecc774acbd0a2c20
2021-01-22 20:12:56 +08:00
Steven Liu
31acfe769e ARM: dts: rockchip: Fix UART pull-ups on rk3188
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I660b0c7732305d73d4255be877aa48fa9c9afb01
2021-01-22 20:12:56 +08:00
Steven Liu
026248a29f ARM: dts: rockchip: Fix UART pull-ups on rk312x
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I42c00d7e7777cd8ef1012f78aef049b39045b311
2021-01-22 20:12:56 +08:00
Steven Liu
dd2f0befb2 ARM: dts: rockchip: Fix UART pull-ups on rk3066a
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I7466ab47baa86c81bf1f2fe47556aa03fbe67671
2021-01-22 20:12:56 +08:00
Steven Liu
eb04688f6f ARM: dts: rockchip: Fix UART pull-ups on rk3036
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I01e1effcc185fec6207cebb38b7f12701a7ebd35
2021-01-22 20:12:56 +08:00
Zorro Liu
a01e6dba20 drm/rockchip/ebc-dev: dsp output low when power off
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I34b11e07f2dd34262a9b7730e8251af9209b0d8e
2021-01-22 20:12:56 +08:00
Sugar Zhang
452ebfb0a2 power: reset: reboot-mode: Register callback for kernel pre restart
This patch register boot mode into kernel pre restart call chain
to support 'reset [cmd]'

e.g.

/# fiq
Welcome to fiq debugger mode
Enter ? to get command help
debug> help
FIQ Debugger commands:
 reset [<c>]   Hard reset with command <c>
debug>
debug> reset loader
DDR Version V1.04 20201030
DDR4, 328MHz
BW=32 Col=10 Bk=4 BG=2 CS0 Row=16 CS=1 Die BW=16 Size=2048MB
...
boot mode: loader
...
RKUSB: LUN 0, dev 0, hwpart 0, sector 0x0, count 0x1d1f000

Change-Id: Ic1792bdd0262c77a09fd780c7ac3e6d912b09008
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:56 +08:00
Sugar Zhang
e656a9a56a reboot: Introduce kernel pre restart handler call chain
This patch renames kernel_i2c_restart to kernel_pre_restart
for general purpose.

This call chain is expected to be executed before kernel_restart
to do something before reset system. such as, i2c restart,
boot mode config.

Change-Id: I67c80c297ca5de83deb4736b5dab0f2c9c8543a6
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:56 +08:00
Sugar Zhang
385f6d70a7 ASoC: rockchip: i2s: Add support for clk compensation
This patch introduces a method to handle clk drift and compensation.

e.g:

/# amixer contents
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=0

/# arecord -D hw:0,0 --period-size=1024 --buffer-size=4096 -r
16000 -c 2 -f s16_le /dev/zero &

/# amixer -- cset numid=1 -10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=-10

/# amixer -- cset numid=1 10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=10

Change-Id: I6be8d7275ccf985f43ebc2980ce284c83504ddbc
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:56 +08:00
Sugar Zhang
8634d871e4 dt-bindings: sound: rockchip: i2s: Document property 'mclk-calibrate'
Change-Id: I05fa565ba77d77704f82e473ee3b35d6fcc8a6ec
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:56 +08:00
Sugar Zhang
70838da2b1 ASoC: rockchip: pdm: Add support for clk compensation
This patch introduces a method to handle clk drift and compensation.

e.g:

/# amixer contents
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=0

/# arecord -D hw:0,0 --period-size=1024 --buffer-size=4096 -r
16000 -c 2 -f s16_le /dev/zero &

/# amixer -- cset numid=1 -10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=-10

/# amixer -- cset numid=1 10
numid=1,iface=PCM,name='PCM Clk Compensation In PPM'
; type=INTEGER,access=rw------,values=1,min=-1000,max=1000,step=1
: values=10

Change-Id: Ibc70ce8ccec6dddb082161fa544d066c706c37bc
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:55 +08:00
Sugar Zhang
ef3def055b dt-bindings: sound: rockchip: pdm: Document property 'mclk-calibrate'
Change-Id: I64f010b9876fdf736ac6778c7bac52c47e9d905f
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-01-22 20:12:55 +08:00
Liang Chen
8b764766dc arm64: dts: rockchip: rk3568: add opp-table for npu
Change-Id: Ia2e7aadda6c0049003d3c715c0217b3731ffa6a1
Signed-off-by: Liang Chen <cl@rock-chips.com>
2021-01-22 20:12:55 +08:00
YouMin Chen
7441599a38 arm64: dts: rockchip: rk3568: reduce the size of sram
Change-Id: I3ba4273cb4730080a3512551126392a6e3343a05
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-01-22 11:21:10 +08:00
Will McVicker
1fd210f0a5 ANDROID: GKI: Update the ABI xml and symbol list
Leaf changes summary: 14 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 10 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 4 Added variables

10 Added functions:

  [A] 'function void __irq_set_handler(unsigned int, irq_flow_handler_t, int, const char*)'
  [A] 'function int __srcu_read_lock(srcu_struct*)'
  [A] 'function void __srcu_read_unlock(srcu_struct*, int)'
  [A] 'function int init_srcu_struct(srcu_struct*)'
  [A] 'function int irq_set_handler_data(unsigned int, void*)'
  [A] 'function unsigned int kstat_irqs_usr(unsigned int)'
  [A] 'function page* shmem_read_mapping_page_gfp(address_space*, unsigned long int, unsigned int)'
  [A] 'function snd_soc_component* soc_find_component_locked(const device_node*, const char*)'
  [A] 'function void synchronize_srcu(srcu_struct*)'
  [A] 'function void* vmemdup_user(void*, size_t)'

4 Added variables:

  [A] 'unsigned long int* irq_stack_ptr'
  [A] 'irq_cpustat_t irq_stat'
  [A] 'kernel_stat kstat'
  [A] 'int nr_irqs'

Bug: 172988823
Bug: 176525217
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I66c9168f9f0325877454d2e5da628ab0674230ce
2021-01-20 06:01:27 +00:00
Lucas Wei
1b1579096b ANDROID: GKI: genirq: export kstat_irqs_usr for watchdog
Export `kstat_irqs_usr` for vendor irq tracking statistics.

Bug: 172988823
Bug: 176525217
Signed-off-by: Lucas Wei <lucaswei@google.com>
Change-Id: Ib3bddbbe9d252be79f3222e941e1cde1625b793a
Signed-off-by: Will McVicker <willmcvicker@google.com>
2021-01-20 06:01:16 +00:00
Lucas Wei
42b8c0cb3c ANDROID: GKI: soc: qcom: export irq_stack_ptr
The Qualcomm minidump feature needs irq_stack_ptr for debugging with
ramdumps. Export it.

Bug: 172988823
Bug: 176525217
Change-Id: I3e3de735f017a17b912ae10e1153ae5fd27636ef
Signed-off-by: Lucas Wei <lucaswei@google.com>
Signed-off-by: Will McVicker <willmcvicker@google.com>
2021-01-20 06:01:03 +00:00
Aditya Bavanari
75fe91933b ANDROID: ASoC: core: add locked version of soc_find_component
Add a locked version of the API to use from clients
to ensure accessing component list safely.

Change-Id: I73c7f2ed03b7e76f6816b62ba0974bc05bdbb4b4
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
(cherry picked from commit 99b4176aaa40d18f46ae637a41578842e6c85abe)
Signed-off-by: Will McVicker <willmcvicker@google.com>
2021-01-20 06:00:52 +00:00
Palmer Dabbelt
9bd91249d2 ANDROID: dm-user: Fix the list walk-and-delete code
This needs list_for_each_safe, without which we have a use-after-free
bug when updating the next pointer.

Fixes: 83bf345abc ("ANDROID: dm: dm-user: New target that proxies BIOs to userspace")
Suggested-by: Akilesh Kailash <akailash@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Change-Id: I510ac12e2206a836ae6659bd7d96c0542960b26a
(cherry picked from commit 35f9e6bee1)
2021-01-20 04:16:05 +00:00
Greg Kroah-Hartman
ea0aa59740 Merge 4.19.169 into android-4.19-stable
Changes in 4.19.169
	ASoC: dapm: remove widget from dirty list on free
	x86/hyperv: check cpu mask after interrupt has been disabled
	tracing/kprobes: Do the notrace functions check without kprobes on ftrace
	MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB
	MIPS: relocatable: fix possible boot hangup with KASLR enabled
	ACPI: scan: Harden acpi_device_add() against device ID overflows
	mm/hugetlb: fix potential missing huge page size info
	dm snapshot: flush merged data before committing metadata
	dm integrity: fix the maximum number of arguments
	r8152: Add Lenovo Powered USB-C Travel Hub
	ext4: fix bug for rename with RENAME_WHITEOUT
	ARC: build: remove non-existing bootpImage from KBUILD_IMAGE
	ARC: build: add uImage.lzma to the top-level target
	ARC: build: add boot_targets to PHONY
	btrfs: fix transaction leak and crash after RO remount caused by qgroup rescan
	ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram
	bfq: Fix computation of shallow depth
	arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC
	misdn: dsp: select CONFIG_BITREVERSE
	net: ethernet: fs_enet: Add missing MODULE_LICENSE
	ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI
	drm/msm: Call msm_init_vram before binding the gpu
	ARM: picoxcell: fix missing interrupt-parent properties
	ima: Remove __init annotation from ima_pcrread()
	dump_common_audit_data(): fix racy accesses to ->d_name
	ASoC: meson: axg-tdm-interface: fix loopback
	ASoC: Intel: fix error code cnl_set_dsp_D0()
	NFS4: Fix use-after-free in trace_event_raw_event_nfs4_set_lock
	pNFS: Mark layout for return if return-on-close was not sent
	NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
	NFS: nfs_igrab_and_active must first reference the superblock
	ext4: fix superblock checksum failure when setting password salt
	RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp
	RDMA/mlx5: Fix wrong free of blue flame register on error
	mm, slub: consider rest of partial list if acquire_slab() fails
	net: sunrpc: interpret the return value of kstrtou32 correctly
	dm: eliminate potential source of excessive kernel log noise
	ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
	ALSA: fireface: Fix integer overflow in transmit_midi_msg()
	netfilter: conntrack: fix reading nf_conntrack_buckets
	netfilter: nf_nat: Fix memleak in nf_nat_init
	kbuild: enforce -Werror=return-type
	Linux 4.19.169

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I74309249e2b6a77421acd7f8d19f60cc48c328db
2021-01-19 18:49:37 +01:00
Greg Kroah-Hartman
43d555d83c Linux 4.19.169
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Pavel Machek (CIP) <pavel@denx.de>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210118152502.441191888@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:39 +01:00
Olaf Hering
47b5fc2504 kbuild: enforce -Werror=return-type
commit 172aad81a8 upstream.

Catch errors which at least gcc tolerates by default:
 warning: 'return' with no value, in function returning non-void [-Wreturn-type]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:39 +01:00
Dinghao Liu
1921060a11 netfilter: nf_nat: Fix memleak in nf_nat_init
commit 869f4fdaf4 upstream.

When register_pernet_subsys() fails, nf_nat_bysource
should be freed just like when nf_ct_extend_register()
fails.

Fixes: 1cd472bf03 ("netfilter: nf_nat: add nat hook register functions to nf_nat")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Jesper Dangaard Brouer
b69a79c62c netfilter: conntrack: fix reading nf_conntrack_buckets
commit f6351c3f1c upstream.

The old way of changing the conntrack hashsize runtime was through changing
the module param via file /sys/module/nf_conntrack/parameters/hashsize. This
was extended to sysctl change in commit 3183ab8997 ("netfilter: conntrack:
allow increasing bucket size via sysctl too").

The commit introduced second "user" variable nf_conntrack_htable_size_user
which shadow actual variable nf_conntrack_htable_size. When hashsize is
changed via module param this "user" variable isn't updated. This results in
sysctl net/netfilter/nf_conntrack_buckets shows the wrong value when users
update via the old way.

This patch fix the issue by always updating "user" variable when reading the
proc file. This will take care of changes to the actual variable without
sysctl need to be aware.

Fixes: 3183ab8997 ("netfilter: conntrack: allow increasing bucket size via sysctl too")
Reported-by: Yoel Caspersen <yoel@kviknet.dk>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Geert Uytterhoeven
f1bf14dab4 ALSA: fireface: Fix integer overflow in transmit_midi_msg()
commit e7c22eeaff upstream.

As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 1000000000L,
the second multiplication in

    ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes ff->rx_bytes[port] <= 16777.

Fixes: 1917429578 ("ALSA: fireface: add transaction support")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-2-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Geert Uytterhoeven
ab2c8bb661 ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
commit 9f65df9c58 upstream.

As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 1000000000L, the second multiplication in

    port->consume_bytes * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes port->consume_bytes <= 16777.

Fixes: 531f471834 ("ALSA: firewire-lib/firewire-tascam: localize async midi port")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-3-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Mike Snitzer
a4cc93ec99 dm: eliminate potential source of excessive kernel log noise
commit 0378c625af upstream.

There wasn't ever a real need to log an error in the kernel log for
ioctls issued with insufficient permissions. Simply return an error
and if an admin/user is sufficiently motivated they can enable DM's
dynamic debugging to see an explanation for why the ioctls were
disallowed.

Reported-by: Nir Soffer <nsoffer@redhat.com>
Fixes: e980f62353 ("dm: don't allow ioctls to targets that don't map to whole devices")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
j.nixdorf@avm.de
f6ced16ce5 net: sunrpc: interpret the return value of kstrtou32 correctly
commit 86b53fbf08 upstream.

A return value of 0 means success. This is documented in lib/kstrtox.c.

This was found by trying to mount an NFS share from a link-local IPv6
address with the interface specified by its index:

  mount("[fe80::1%1]:/srv/nfs", "/mnt", "nfs", 0, "nolock,addr=fe80::1%1")

Before this commit this failed with EINVAL and also caused the following
message in dmesg:

  [...] NFS: bad IP address specified: addr=fe80::1%1

The syscall using the same address based on the interface name instead
of its index succeeds.

Credits for this patch go to my colleague Christian Speich, who traced
the origin of this bug to this line of code.

Signed-off-by: Johannes Nixdorf <j.nixdorf@avm.de>
Fixes: 00cfaa943e ("replace strict_strto calls")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Jann Horn
21a466aed7 mm, slub: consider rest of partial list if acquire_slab() fails
commit 8ff60eb052 upstream.

acquire_slab() fails if there is contention on the freelist of the page
(probably because some other CPU is concurrently freeing an object from
the page).  In that case, it might make sense to look for a different page
(since there might be more remote frees to the page from other CPUs, and
we don't want contention on struct page).

However, the current code accidentally stops looking at the partial list
completely in that case.  Especially on kernels without CONFIG_NUMA set,
this means that get_partial() fails and new_slab_objects() falls back to
new_slab(), allocating new pages.  This could lead to an unnecessary
increase in memory fragmentation.

Link: https://lkml.kernel.org/r/20201228130853.1871516-1-jannh@google.com
Fixes: 7ced371971 ("slub: Acquire_slab() avoid loop")
Signed-off-by: Jann Horn <jannh@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Mark Bloch
b1f2d446fd RDMA/mlx5: Fix wrong free of blue flame register on error
commit 1c3aa6bd0b upstream.

If the allocation of the fast path blue flame register fails, the driver
should free the regular blue flame register allocated a statement above,
not the one that it just failed to allocate.

Fixes: 16c1975f10 ("IB/mlx5: Create profile infrastructure to add and remove stages")
Link: https://lore.kernel.org/r/20210113121703.559778-6-leon@kernel.org
Reported-by: Hans Petter Selasky <hanss@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Dinghao Liu
25469b2e85 RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp
commit a306aba9c8 upstream.

If usnic_ib_qp_grp_create() fails at the first call, dev_list
will not be freed on error, which leads to memleak.

Fixes: e3cf00d0a8 ("IB/usnic: Add Cisco VIC low-level hardware driver")
Link: https://lore.kernel.org/r/20201226074248.2893-1-dinghao.liu@zju.edu.cn
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Jan Kara
8e45768d6a ext4: fix superblock checksum failure when setting password salt
commit dfd56c2c0c upstream.

When setting password salt in the superblock, we forget to recompute the
superblock checksum so it will not match until the next superblock
modification which recomputes the checksum. Fix it.

CC: Michael Halcrow <mhalcrow@google.com>
Reported-by: Andreas Dilger <adilger@dilger.ca>
Fixes: 9bd8212f98 ("ext4 crypto: add encryption policy and password salt support")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20201216101844.22917-8-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:38 +01:00
Trond Myklebust
df7adeee74 NFS: nfs_igrab_and_active must first reference the superblock
commit 896567ee7f upstream.

Before referencing the inode, we must ensure that the superblock can be
referenced. Otherwise, we can end up with iput() calling superblock
operations that are no longer valid or accessible.

Fixes: ea7c38fef0 ("NFSv4: Ensure we reference the inode for return-on-close in delegreturn")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:37 +01:00
Trond Myklebust
b2f9fbbc3f NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
commit cb2856c597 upstream.

If we exit _lgopen_prepare_attached() without setting a layout, we will
currently leak the plh_outstanding counter.

Fixes: 411ae722d1 ("pNFS: Wait for stale layoutget calls to complete in pnfs_update_layout()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:37 +01:00
Trond Myklebust
87396ce3b5 pNFS: Mark layout for return if return-on-close was not sent
commit 67bbceedc9 upstream.

If the layout return-on-close failed because the layoutreturn was never
sent, then we should mark the layout for return again.

Fixes: 9c47b18cf7 ("pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:37 +01:00
Dave Wysochanski
825e0ffaad NFS4: Fix use-after-free in trace_event_raw_event_nfs4_set_lock
commit 3d1a90ab0e upstream.

It is only safe to call the tracepoint before rpc_put_task() because
'data' is freed inside nfs4_lock_release (rpc_release).

Fixes: 48c9579a1a ("Adding stateid information to tracepoints")
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-19 18:22:37 +01:00