5.4.15-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 5.4.15-stable review
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +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.15-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.15-rc1
Sumit Garg <[email protected]>
optee: Fix multi page dynamic shm pool alloc
Jonas Karlman <[email protected]>
phy/rockchip: inno-hdmi: round clock rate down to closest 1000 Hz
Arnd Bergmann <[email protected]>
gpio: aspeed: avoid return type warning
Jouni Hogander <[email protected]>
net-sysfs: Call dev_hold always in netdev_queue_add_kobject
Julian Wiedmann <[email protected]>
s390/qeth: fix dangling IO buffers after halt/clear
Justin Tee <[email protected]>
block: fix memleak of bio integrity data
Wen Yang <[email protected]>
platform/chrome: wilco_ec: fix use after free issue
Toke Høiland-Jørgensen <[email protected]>
xdp: Fix cleanup on map free for devmap_hash map type
Sam Bobroff <[email protected]>
drm/radeon: fix bad DMA from INTERRUPT_CNTL2
Chuhong Yuan <[email protected]>
dmaengine: ti: edma: fix missed failure handling
zhengbin <[email protected]>
afs: Remove set but not used variables 'before', 'after'
Christoph Hellwig <[email protected]>
dma-direct: don't check swiotlb=force in dma_direct_map_resource
Lorenzo Bianconi <[email protected]>
mt76: mt76u: rely on usb_interface instead of usb_dev
Vincent Guittot <[email protected]>
sched/cpufreq: Move the cfs_rq_util_change() call to cpufreq_update_util()
Chuck Lever <[email protected]>
SUNRPC: Fix another issue with MIC buffer space
Sebastian Andrzej Siewior <[email protected]>
workqueue: Add RCU annotation for pwq list walk
Jens Wiklander <[email protected]>
tee: optee: fix device enumeration error handling
Sumit Garg <[email protected]>
tee: optee: Fix dynamic shm pool allocations
H. Nikolaus Schaller <[email protected]>
mmc: core: fix wl1251 sdio quirks
H. Nikolaus Schaller <[email protected]>
mmc: sdio: fix wl1251 vendor id
Sudeep Holla <[email protected]>
firmware: arm_scmi: Fix doorbell ring logic for !CONFIG_64BIT
Hewenliang <[email protected]>
kselftests: cgroup: Avoid the reuse of fd after it is deallocated
Alain Volmat <[email protected]>
i2c: stm32f7: report dma error during probe
Eric Dumazet <[email protected]>
packet: fix data-race in fanout_flow_is_huge()
Colin Ian King <[email protected]>
rtc: bd70528: fix module alias to autoload module
Kees Cook <[email protected]>
selftests: gen_kselftest_tar.sh: Do not clobber kselftest/
Wei Yongjun <[email protected]>
net: axienet: Fix error return code in axienet_probe()
Eric Dumazet <[email protected]>
net: neigh: use long type to store jiffies delta
Daniel Golle <[email protected]>
rt2800: remove errornous duplicate condition
Stephen Hemminger <[email protected]>
hv_netvsc: flag software created hash value
Tonghao Zhang <[email protected]>
net: openvswitch: don't unlock mutex when changing the user_features fails
Bean Huo <[email protected]>
scsi: ufs: delete redundant function ufshcd_def_desc_sizes()
Madalin Bucur <[email protected]>
dpaa_eth: avoid timestamp read on error paths
Madalin Bucur <[email protected]>
dpaa_eth: perform DMA unmapping before read
Dan Carpenter <[email protected]>
rcu: Fix uninitialized variable in nocb_gp_wait()
Andrii Nakryiko <[email protected]>
libbpf: Don't use kernel-side u32 type in xsk.c
Daniel Baluta <[email protected]>
firmware: imx: Remove call to devm_of_platform_populate
Matti Vaittinen <[email protected]>
power: supply: bd70528: Add MODULE_ALIAS to allow module auto loading
Dan Carpenter <[email protected]>
drm/amdgpu/vi: silence an uninitialized variable warning
Matti Vaittinen <[email protected]>
regulator: bd70528: Add MODULE_ALIAS to allow module auto loading
Ondrej Jirman <[email protected]>
pwm: sun4i: Fix incorrect calculation of duty_cycle/period
Andy Shevchenko <[email protected]>
ACPI: platform: Unregister stale platform devices
Ilias Apalodimas <[email protected]>
net: netsec: Correct dma sync for XDP_TX frames
Geert Uytterhoeven <[email protected]>
drm: rcar_lvds: Fix color mismatches on R-Car H2 ES2.0 and later
Kefeng Wang <[email protected]>
PCI: mobiveil: Fix csr_read()/write() build issue
Sakari Ailus <[email protected]>
software node: Get reference to parent swnode in get_parent op
Douglas Anderson <[email protected]>
drm/rockchip: Round up _before_ giving to the clock framework
Ioana Radulescu <[email protected]>
dpaa2-eth: Fix minor bug in ethtool stats reporting
Tony Lindgren <[email protected]>
hwrng: omap3-rom - Fix missing clock by probing with device tree
yu kuai <[email protected]>
drm/amdgpu: remove excess function parameter description
Dan Carpenter <[email protected]>
drm: panel-lvds: Potential Oops in probe error handling
Steven Price <[email protected]>
drm/panfrost: Add missing check for pfdev->regulator
Ping-Ke Shih <[email protected]>
rtw88: fix error handling when setup efuse info
Yan-Hsuan Chuang <[email protected]>
rtw88: fix beaconing mode rsvd_page memory violation issue
Andy Shevchenko <[email protected]>
gpiolib: No need to call gpiochip_remove_pin_ranges() twice
Peter Zijlstra <[email protected]>
sched/core: Further clarify sched_class::set_next_task()
Navid Emamdoost <[email protected]>
ipmi: Fix memory leak in __ipmi_bmc_register
Shuiqing Li <[email protected]>
watchdog: sprd: Fix the incorrect pointer getting from driver data
Luc Van Oostenryck <[email protected]>
soc: aspeed: Fix snoop_file_poll()'s return type
Geert Uytterhoeven <[email protected]>
soc: renesas: Add missing check for non-zero product register address
Stephen Boyd <[email protected]>
soc: qcom: llcc: Name regmaps to avoid collisions
Thierry Reding <[email protected]>
soc/tegra: pmc: Fix crashes for hierarchical interrupts
Jean-Jacques Hiblot <[email protected]>
leds: tlc591xx: update the maximum brightness
Arnaldo Carvalho de Melo <[email protected]>
perf map: No need to adjust the long name of modules
Corentin Labbe <[email protected]>
crypto: sun4i-ss - fix big endian issues
Christian Lamparter <[email protected]>
crypto: amcc - restore CRYPTO_AES dependency
Patrick Steinhardt <[email protected]>
nfsd: depend on CRYPTO_MD5 for legacy client tracking
Heiko Carstens <[email protected]>
s390/pkey: fix memory leak within _copy_apqns_from_user()
Jesse Brandeburg <[email protected]>
ice: fix stack leakage
Lorenzo Bianconi <[email protected]>
mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
Lorenzo Bianconi <[email protected]>
mt76: mt76u: fix endpoint definition order
Grygorii Strashko <[email protected]>
phy: ti: gmii-sel: fix mac tx internal delay for rgmii-rxid
Florian Fainelli <[email protected]>
net: phy: broadcom: Fix RGMII delays configuration for BCM54210E
Wei Yongjun <[email protected]>
phy: lantiq: vrx200-pcie: fix error return code in ltq_vrx200_pcie_phy_power_on()
Roi Dayan <[email protected]>
net/mlx5e: Fix free peer_flow when refcount is 0
Tung Nguyen <[email protected]>
tipc: fix wrong timeout input for tipc_wait_for_cond()
Tung Nguyen <[email protected]>
tipc: fix wrong socket reference counter after tipc_sk_timeout() returns
Tung Nguyen <[email protected]>
tipc: fix potential memory leak in __tipc_sendmsg()
Hoang Le <[email protected]>
tipc: update mon's self addr when node addr generated
Hoang Le <[email protected]>
tipc: reduce sensitive to retransmit failures
Ard Biesheuvel <[email protected]>
powerpc/archrandom: fix arch_get_random_seed_int()
Christophe Leroy <[email protected]>
powerpc/kasan: Fix boot failure with RELOCATABLE && FSL_BOOKE
Tyrel Datwyler <[email protected]>
powerpc/pseries: Enable support for ibm,drc-info property
Geert Uytterhoeven <[email protected]>
powerpc/security: Fix debugfs data leak on 32-bit
Chuck Lever <[email protected]>
SUNRPC: Fix backchannel latency metrics
Chuck Lever <[email protected]>
SUNRPC: Fix svcauth_gss_proxy_init()
Jarkko Nikula <[email protected]>
mfd: intel-lpss: Add default I2C device properties for Gemini Lake
Alain Volmat <[email protected]>
i2c: i2c-stm32f7: fix 10-bits check in slave free id search loop
Alain Volmat <[email protected]>
i2c: stm32f7: rework slave_id allocation
Jan Kara <[email protected]>
xfs: Sanity check flags of Q_XQUOTARM call
Markus Elfring <[email protected]>
ARM: OMAP2+: Add missing put_device() call in omapdss_init_of()
Adam Ford <[email protected]>
ARM: dts: logicpd-torpedo-37xx-devkit-28: Reference new DRM panel
Jesper Dangaard Brouer <[email protected]>
samples/bpf: Fix broken xdp_rxq_info due to map order assumptions
Daniel T. Lee <[email protected]>
samples: bpf: update map definition to new syntax BTF-defined map
Stanislav Fomichev <[email protected]>
bpf: Force .BTF section start to zero when dumping from vmlinux
Andrii Nakryiko <[email protected]>
libbpf: Fix call relocation offset calculation bug
Andrii Nakryiko <[email protected]>
libbpf: Make btf__resolve_size logic always check size error condition
Andrii Nakryiko <[email protected]>
libbpf: Fix another potential overflow issue in bpf_prog_linfo
Andrii Nakryiko <[email protected]>
libbpf: Fix potential overflow issue
Andrii Nakryiko <[email protected]>
libbpf: Fix memory leak/double free issue
Magnus Karlsson <[email protected]>
libbpf: Fix compatibility for kernels without need_wakeup
Tvrtko Ursulin <[email protected]>
drm/i915: Fix pid leak with banned clients
-------------
Diffstat:
.../devicetree/bindings/rng/omap3_rom_rng.txt | 27 +++++ Makefile | 4 +- .../boot/dts/logicpd-torpedo-37xx-devkit-28.dts | 20 +--- arch/arm/boot/dts/omap3-n900.dts | 6 ++ arch/arm/mach-omap2/display.c | 1 + arch/arm/mach-omap2/pdata-quirks.c | 12 +-- arch/powerpc/include/asm/archrandom.h | 2 +- arch/powerpc/include/asm/security_features.h | 8 +- arch/powerpc/kernel/head_fsl_booke.S | 6 +- arch/powerpc/kernel/prom_init.c | 2 +- arch/powerpc/kernel/security.c | 4 +- block/bio-integrity.c | 2 +- block/bio.c | 3 + block/blk.h | 4 + drivers/acpi/acpi_platform.c | 43 ++++++++ drivers/acpi/scan.c | 1 + drivers/base/swnode.c | 5 +- drivers/char/hw_random/omap3-rom-rng.c | 17 ++- drivers/char/ipmi/ipmi_msghandler.c | 5 +- drivers/crypto/Kconfig | 1 + drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 21 ++-- drivers/dma/ti/edma.c | 6 +- drivers/firmware/arm_scmi/perf.c | 2 +- drivers/firmware/imx/imx-dsp.c | 2 +- drivers/gpio/gpiolib-of.c | 5 +- drivers/gpio/gpiolib.c | 3 +- drivers/gpio/sgpio-aspeed.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 - drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 +- drivers/gpu/drm/panel/panel-lvds.c | 21 +--- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 6 +- drivers/gpu/drm/radeon/cik.c | 4 +- drivers/gpu/drm/radeon/r600.c | 4 +- drivers/gpu/drm/radeon/si.c | 4 +- drivers/gpu/drm/rcar-du/rcar_lvds.c | 28 +++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 37 ++++++- drivers/i2c/busses/i2c-stm32.c | 16 +-- drivers/i2c/busses/i2c-stm32f7.c | 13 ++- drivers/leds/leds-tlc591xx.c | 7 +- drivers/mfd/intel-lpss-pci.c | 28 +++-- drivers/mmc/core/quirks.h | 7 ++ drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 47 ++++---- .../net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 2 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 3 +- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 7 +- drivers/net/ethernet/socionext/netsec.c | 4 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 - drivers/net/hyperv/netvsc_drv.c | 7 +- drivers/net/phy/broadcom.c | 11 +- drivers/net/wireless/mediatek/mt76/mt76.h | 5 +- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 12 ++- drivers/net/wireless/mediatek/mt7601u/phy.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 +- drivers/net/wireless/realtek/rtw88/fw.c | 52 +++++++-- drivers/net/wireless/realtek/rtw88/main.c | 11 +- drivers/pci/controller/pcie-mobiveil.c | 119 +++++++++++---------- drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c | 3 +- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 4 + drivers/phy/ti/phy-gmii-sel.c | 2 +- drivers/platform/chrome/wilco_ec/telemetry.c | 2 +- drivers/power/supply/bd70528-charger.c | 1 + drivers/pwm/pwm-sun4i.c | 4 +- drivers/regulator/bd70528-regulator.c | 1 + drivers/rtc/rtc-bd70528.c | 2 +- drivers/s390/crypto/pkey_api.c | 4 +- drivers/s390/net/qeth_core.h | 3 + drivers/s390/net/qeth_core_main.c | 71 ++++++++---- drivers/s390/net/qeth_core_mpc.h | 14 --- drivers/s390/net/qeth_l2_main.c | 12 +-- drivers/s390/net/qeth_l3_main.c | 13 +-- drivers/scsi/ufs/ufshcd.c | 15 +-- drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 +- drivers/soc/qcom/llcc-slice.c | 3 +- drivers/soc/renesas/renesas-soc.c | 2 +- drivers/soc/tegra/pmc.c | 28 ++++- drivers/tee/optee/call.c | 7 ++ drivers/tee/optee/core.c | 20 ++-- drivers/tee/optee/shm_pool.c | 25 ++++- drivers/watchdog/sprd_wdt.c | 6 +- fs/afs/dir_edit.c | 12 +-- fs/nfsd/Kconfig | 1 + fs/xfs/xfs_quotaops.c | 3 + include/linux/mmc/sdio_ids.h | 2 + kernel/bpf/devmap.c | 74 ++++++++----- kernel/dma/direct.c | 2 +- kernel/rcu/tree_plugin.h | 2 +- kernel/sched/deadline.c | 7 +- kernel/sched/fair.c | 113 ++++++++++--------- kernel/sched/idle.c | 4 +- kernel/sched/rt.c | 7 +- kernel/sched/sched.h | 4 +- kernel/sched/stop_task.c | 4 +- kernel/workqueue.c | 3 +- net/core/neighbour.c | 4 +- net/core/net-sysfs.c | 7 +- net/openvswitch/datapath.c | 2 +- net/packet/af_packet.c | 12 ++- net/sunrpc/auth_gss/svcauth_gss.c | 84 +++++++++++---- net/sunrpc/xdr.c | 11 +- net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 + net/sunrpc/xprtsock.c | 3 +- net/tipc/link.c | 2 +- net/tipc/monitor.c | 15 +++ net/tipc/monitor.h | 1 + net/tipc/net.c | 2 + net/tipc/socket.c | 7 +- samples/bpf/sockex1_kern.c | 12 +-- samples/bpf/sockex2_kern.c | 12 +-- samples/bpf/xdp1_kern.c | 12 +-- samples/bpf/xdp2_kern.c | 12 +-- samples/bpf/xdp_adjust_tail_kern.c | 12 +-- samples/bpf/xdp_fwd_kern.c | 13 ++- samples/bpf/xdp_redirect_cpu_kern.c | 108 +++++++++---------- samples/bpf/xdp_redirect_kern.c | 24 ++--- samples/bpf/xdp_redirect_map_kern.c | 24 ++--- samples/bpf/xdp_router_ipv4_kern.c | 64 +++++------ samples/bpf/xdp_rxq_info_kern.c | 37 +++---- samples/bpf/xdp_rxq_info_user.c | 6 +- samples/bpf/xdp_tx_iptunnel_kern.c | 26 ++--- scripts/link-vmlinux.sh | 5 +- tools/lib/bpf/bpf.c | 2 +- tools/lib/bpf/bpf_prog_linfo.c | 14 +-- tools/lib/bpf/btf.c | 3 +- tools/lib/bpf/libbpf.c | 10 +- tools/lib/bpf/xsk.c | 83 +++++++++++--- tools/perf/util/machine.c | 27 +---- tools/testing/selftests/bpf/progs/test_btf_haskv.c | 4 +- tools/testing/selftests/bpf/progs/test_btf_newkv.c | 4 +- tools/testing/selftests/bpf/progs/test_btf_nokv.c | 4 +- tools/testing/selftests/cgroup/test_freezer.c | 1 + tools/testing/selftests/gen_kselftest_tar.sh | 21 ++-- tools/testing/selftests/kselftest_install.sh | 24 ++--- 135 files changed, 1150 insertions(+), 739 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/102 drm/i915: Fix pid leak with banned clients
From: Tvrtko Ursulin <[email protected]>
commit f0f3a6cecf3b98990985cd42f7bf5a0313894822 upstream.
Get_pid_task() needs to be paired with a put_pid or we leak a pid reference every time a banned client tries to create a context.
v2:
* task_pid_nr helper exists! (Chris)
--- drivers/gpu/drm/i915/gem/i915_gem_context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_context.c +1 -2
@@ -2094,8 +2094,7 @@ int i915_gem_context_create_ioctl(struct ext_data.fpriv = file->driver_priv;if (client_is_banned (ext_data.fpriv)) {DRM_DEBUG ("client %s[%d] banned from creating ctx\n" , - current->comm, -pid_nr (get_task_pid (current,PIDTYPE_PID ))); + current->comm,task_pid_nr (current));return -EIO ; }
Greg Kroah-Hartman
maintainerPATCH 2/102 libbpf: Fix compatibility for kernels without need_wakeup
In reply to Greg Kroah-HartmanFrom: Magnus Karlsson <[email protected]>
commit 94ff9ebb49a546b7f009ed840bafa235c96d4c4b upstream.
When the need_wakeup flag was added to AF_XDP, the format of the XDP_MMAP_OFFSETS getsockopt was extended. Code was added to the kernel to take care of compatibility issues arrising from running applications using any of the two formats. However, libbpf was not extended to take care of the case when the application/libbpf uses the new format but the kernel only supports the old format. This patch adds support in libbpf for parsing the old format, before the need_wakeup flag was added, and emulating a set of static need_wakeup flags that will always work for the application.
v2 -> v3:
* Incorporated code improvements suggested by Jonathan Lemon
v1 -> v2:
* Rebased to bpf-next
* Rewrote the code as the previous version made you blind
--- tools/lib/bpf/xsk.c | 83 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 12 deletions(-)
tools/lib/bpf/xsk.c +71 -12
@@ -73,6 +73,21 @@ struct xsk_nl_info {int fd; }; +/* Up until and including Linux 5.3 */ +struct xdp_ring_offset_v1 { +__u64 producer; +__u64 consumer; +__u64 desc; +}; + +/* Up until and including Linux 5.3 */ +struct xdp_mmap_offsets_v1 { +struct xdp_ring_offset_v1 rx; +struct xdp_ring_offset_v1 tx; +struct xdp_ring_offset_v1 fr; +struct xdp_ring_offset_v1 cr; +}; +int xsk_umem__fd (const struct xsk_umem *umem) {return umem ? umem->fd : -EINVAL ;
@@ -133,6 +148,58 @@ static int xsk_set_xdp_socket_config(strreturn 0 ; } +static void xsk_mmap_offsets_v1 (struct xdp_mmap_offsets *off) +{ +struct xdp_mmap_offsets_v1 off_v1; + +/* getsockopt on a kernel <= 5.3 has no flags fields. +* Copy over the offsets to the correct places in the >=5.4 format +* and put the flags where they would have been on that kernel. +*/ +memcpy (&off_v1, off,sizeof (off_v1)); + + off->rx.producer = off_v1.rx.producer; + off->rx.consumer = off_v1.rx.consumer; + off->rx.desc = off_v1.rx.desc; + off->rx.flags = off_v1.rx.consumer +sizeof (u32); + + off->tx.producer = off_v1.tx.producer; + off->tx.consumer = off_v1.tx.consumer; + off->tx.desc = off_v1.tx.desc; + off->tx.flags = off_v1.tx.consumer +sizeof (u32); + + off->fr.producer = off_v1.fr.producer; + off->fr.consumer = off_v1.fr.consumer; + off->fr.desc = off_v1.fr.desc; + off->fr.flags = off_v1.fr.consumer +sizeof (u32); + + off->cr.producer = off_v1.cr.producer; + off->cr.consumer = off_v1.cr.consumer; + off->cr.desc = off_v1.cr.desc; + off->cr.flags = off_v1.cr.consumer +sizeof (u32); +} + +static int xsk_get_mmap_offsets (int fd,struct xdp_mmap_offsets *off) +{ +socklen_t optlen; +int err; + + optlen =sizeof (*off); + err =getsockopt (fd,SOL_XDP ,XDP_MMAP_OFFSETS , off, &optlen); +if (err) +return err; + +if (optlen ==sizeof (*off)) +return 0 ; + +if (optlen ==sizeof (struct xdp_mmap_offsets_v1 )) { +xsk_mmap_offsets_v1 (off); +return 0 ; + } + +return -EINVAL ; +} + int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area, __u64 size, struct xsk_ring_prod *fill, struct xsk_ring_cons *comp,
@@ -141,7 +208,6 @@ int xsk_umem__create_v0_0_4(struct xsk_ustruct xdp_mmap_offsets off;struct xdp_umem_reg mr;struct xsk_umem *umem; -socklen_t optlen;void *map;int err;
@@ -190,8 +256,7 @@ int xsk_umem__create_v0_0_4(struct xsk_u goto out_socket; } - optlen =sizeof (off); - err =getsockopt (umem->fd,SOL_XDP ,XDP_MMAP_OFFSETS , &off, &optlen); + err =xsk_get_mmap_offsets (umem->fd, &off);if (err) { err = -errno; goto out_socket;
@@ -499,7 +564,6 @@ int xsk_socket__create(struct xsk_socketstruct sockaddr_xdp sxdp = {};struct xdp_mmap_offsets off;struct xsk_socket *xsk; -socklen_t optlen;int err;if (!umem || !xsk_ptr || !rx || !tx)
@@ -558,8 +622,7 @@ int xsk_socket__create(struct xsk_socket } } - optlen =sizeof (off); - err =getsockopt (xsk->fd,SOL_XDP ,XDP_MMAP_OFFSETS , &off, &optlen); + err =xsk_get_mmap_offsets (xsk->fd, &off);if (err) { err = -errno; goto out_socket;
@@ -645,7 +708,6 @@ out_xsk_alloc:int xsk_umem__delete (struct xsk_umem *umem) {struct xdp_mmap_offsets off; -socklen_t optlen;int err;if (!umem)
@@ -654,8 +716,7 @@ int xsk_umem__delete(struct xsk_umem *umif (umem->refcount)return -EBUSY ; - optlen =sizeof (off); - err =getsockopt (umem->fd,SOL_XDP ,XDP_MMAP_OFFSETS , &off, &optlen); + err =xsk_get_mmap_offsets (umem->fd, &off);if (!err) {munmap (umem->fill->ring - off.fr.desc, off.fr.desc + umem->config.fill_size *sizeof (__u64));
@@ -673,7 +734,6 @@ void xsk_socket__delete(struct xsk_socke {size_t desc_sz =sizeof (struct xdp_desc );struct xdp_mmap_offsets off; -socklen_t optlen;int err;if (!xsk)
@@ -684,8 +744,7 @@ void xsk_socket__delete(struct xsk_sockeclose (xsk->prog_fd); } - optlen =sizeof (off); - err =getsockopt (xsk->fd,SOL_XDP ,XDP_MMAP_OFFSETS , &off, &optlen); + err =xsk_get_mmap_offsets (xsk->fd, &off);if (!err) {if (xsk->rx) { munmap(xsk->rx->ring - off.rx.desc,
Greg Kroah-Hartman
maintainerPATCH 3/102 libbpf: Fix memory leak/double free issue
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit 3dc5e059821376974177cc801d377e3fcdac6712 upstream.
Coverity scan against Github libbpf code found the issue of not freeing memory and leaving already freed memory still referenced from bpf_program. Fix it by re-assigning successfully reallocated memory sooner.
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -3220,6 +3220,7 @@ bpf_program__reloc_text(struct bpf_progrpr_warning ("oom in prog realloc\n" );return -ENOMEM ; } + prog->insns = new_insn;if (obj->btf_ext) { err = bpf_program_reloc_btf_ext(prog, obj,
@@ -3231,7 +3232,6 @@ bpf_program__reloc_text(struct bpf_progrmemcpy (new_insn + prog->insns_cnt, text->insns, text->insns_cnt *sizeof (*insn)); - prog->insns = new_insn; prog->main_prog_cnt = prog->insns_cnt; prog->insns_cnt = new_cnt; pr_debug("added %zd insn from %s to prog %s\n",
Greg Kroah-Hartman
maintainerPATCH 4/102 libbpf: Fix potential overflow issue
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit 4ee1135615713387b869dfd099ffdf8656be6784 upstream.
Fix a potential overflow issue found by LGTM analysis, based on Github libbpf source code.
--- tools/lib/bpf/bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf.c +1 -1
@@ -189,7 +189,7 @@ static void * alloc_zero_tailing_info(const void *orecord, __u32 cnt, __u32 actual_rec_size, __u32 expected_rec_size) { - __u64 info_len = actual_rec_size * cnt; + __u64 info_len = (__u64)actual_rec_size * cnt;void *info, *nrecord;int i;
Greg Kroah-Hartman
maintainerPATCH 5/102 libbpf: Fix another potential overflow issue in bpf_prog_linfo
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit dd3ab126379ec040b3edab8559f9c72de6ef9d29 upstream.
Fix few issues found by Coverity and LGTM.
--- tools/lib/bpf/bpf_prog_linfo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tools/lib/bpf/bpf_prog_linfo.c +7 -7
@@ -101,6 +101,7 @@ struct bpf_prog_linfo *bpf_prog_linfo__n {struct bpf_prog_linfo *prog_linfo;__u32 nr_linfo, nr_jited_func; +__u64 data_sz; nr_linfo = info->nr_line_info;
@@ -122,11 +123,11 @@ struct bpf_prog_linfo *bpf_prog_linfo__n/* Copy xlated line_info */ prog_linfo->nr_linfo = nr_linfo; prog_linfo->rec_size = info->line_info_rec_size; - prog_linfo->raw_linfo =malloc (nr_linfo * prog_linfo->rec_size); + data_sz = (__u64 )nr_linfo * prog_linfo->rec_size; + prog_linfo->raw_linfo =malloc (data_sz);if (!prog_linfo->raw_linfo) goto err_free; -memcpy (prog_linfo->raw_linfo, (void *)(long )info->line_info, - nr_linfo * prog_linfo->rec_size); +memcpy (prog_linfo->raw_linfo, (void *)(long )info->line_info, data_sz); nr_jited_func = info->nr_jited_ksyms; if (!nr_jited_func ||
@@ -142,13 +143,12 @@ struct bpf_prog_linfo *bpf_prog_linfo__n/* Copy jited_line_info */ prog_linfo->nr_jited_func = nr_jited_func; prog_linfo->jited_rec_size = info->jited_line_info_rec_size; - prog_linfo->raw_jited_linfo =malloc (nr_linfo * - prog_linfo->jited_rec_size); + data_sz = (__u64 )nr_linfo * prog_linfo->jited_rec_size; + prog_linfo->raw_jited_linfo =malloc (data_sz);if (!prog_linfo->raw_jited_linfo) goto err_free;memcpy (prog_linfo->raw_jited_linfo, - (void *)(long )info->jited_line_info, - nr_linfo * prog_linfo->jited_rec_size); + (void *)(long )info->jited_line_info, data_sz);/* Number of jited_line_info per jited func */ prog_linfo->nr_jited_linfo_per_func = malloc(nr_jited_func *
Greg Kroah-Hartman
maintainerPATCH 6/102 libbpf: Make btf__resolve_size logic always check size error condition
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit 994021a7e08477f7e51285920aac99fc967fae8a upstream.
Perform size check always in btf__resolve_size. Makes the logic a bit more robust against corrupted BTF and silences LGTM/Coverity complaining about always true (size < 0) check.
--- tools/lib/bpf/btf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/lib/bpf/btf.c +1 -2
@@ -269,10 +269,9 @@ __s64 btf__resolve_size(const struct btf t =btf__type_by_id (btf, type_id); } +done:if (size <0 )return -EINVAL ; - -done:if (nelems && size >UINT32_MAX / nelems)return -E2BIG ;
Greg Kroah-Hartman
maintainerPATCH 7/102 libbpf: Fix call relocation offset calculation bug
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit a0d7da26ce86a25e97ae191cb90574ada6daea98 upstream.
When relocating subprogram call, libbpf doesn't take into account relo->text_off, which comes from symbol's value. This generally works fine for subprograms implemented as static functions, but breaks for global functions.
Taking a simplified test_pkt_access.c as an example:
__attribute__ ((noinline))
static int test_pkt_access_subprog1(volatile struct __sk_buff *skb)
{
return skb->len * 2;
}__attribute__ ((noinline))
static int test_pkt_access_subprog2(int val, volatile struct __sk_buff *skb)
{
return skb->len + val;
}SEC("classifier/test_pkt_access")
int test_pkt_access(struct __sk_buff *skb)
{
if (test_pkt_access_subprog1(skb) != skb->len * 2)
return TC_ACT_SHOT;
if (test_pkt_access_subprog2(2, skb) != skb->len + 2)
return TC_ACT_SHOT;
return TC_ACT_UNSPEC;
}When compiled, we get two relocations, pointing to '.text' symbol. .text has st_value set to 0 (it points to the beginning of .text section):
0000000000000008 000000050000000a R_BPF_64_32 0000000000000000 .text 0000000000000040 000000050000000a R_BPF_64_32 0000000000000000 .text
test_pkt_access_subprog1 and test_pkt_access_subprog2 offsets (targets of two calls) are encoded within call instruction's imm32 part as -1 and 2, respectively:
0000000000000000 test_pkt_access_subprog1:
0: 61 10 00 00 00 00 00 00 r0 = *(u32 *)(r1 + 0)
1: 64 00 00 00 01 00 00 00 w0 <<= 1
2: 95 00 00 00 00 00 00 00 exit0000000000000018 test_pkt_access_subprog2:
3: 61 10 00 00 00 00 00 00 r0 = *(u32 *)(r1 + 0)
4: 04 00 00 00 02 00 00 00 w0 += 2
5: 95 00 00 00 00 00 00 00 exit0000000000000000 test_pkt_access:
0: bf 16 00 00 00 00 00 00 r6 = r1
===> 1: 85 10 00 00 ff ff ff ff call -1
2: bc 01 00 00 00 00 00 00 w1 = w0
3: b4 00 00 00 02 00 00 00 w0 = 2
4: 61 62 00 00 00 00 00 00 r2 = *(u32 *)(r6 + 0)
5: 64 02 00 00 01 00 00 00 w2 <<= 1
6: 5e 21 08 00 00 00 00 00 if w1 != w2 goto +8 <LBB0_3>
7: bf 61 00 00 00 00 00 00 r1 = r6
===> 8: 85 10 00 00 02 00 00 00 call 2
9: bc 01 00 00 00 00 00 00 w1 = w0
10: 61 62 00 00 00 00 00 00 r2 = *(u32 *)(r6 + 0)
11: 04 02 00 00 02 00 00 00 w2 += 2
12: b4 00 00 00 ff ff ff ff w0 = -1
13: 1e 21 01 00 00 00 00 00 if w1 == w2 goto +1 <LBB0_3>
14: b4 00 00 00 02 00 00 00 w0 = 2
0000000000000078 LBB0_3:
15: 95 00 00 00 00 00 00 00 exitNow, if we compile example with global functions, the setup changes. Relocations are now against specifically test_pkt_access_subprog1 and test_pkt_access_subprog2 symbols, with test_pkt_access_subprog2 pointing 24 bytes into its respective section (.text), i.e., 3 instructions in:
0000000000000008 000000070000000a R_BPF_64_32 0000000000000000 test_pkt_access_subprog1 0000000000000048 000000080000000a R_BPF_64_32 0000000000000018 test_pkt_access_subprog2
Calls instructions now encode offsets relative to function symbols and are both set ot -1:
0000000000000000 test_pkt_access_subprog1:
0: 61 10 00 00 00 00 00 00 r0 = *(u32 *)(r1 + 0)
1: 64 00 00 00 01 00 00 00 w0 <<= 1
2: 95 00 00 00 00 00 00 00 exit0000000000000018 test_pkt_access_subprog2:
3: 61 20 00 00 00 00 00 00 r0 = *(u32 *)(r2 + 0)
4: 0c 10 00 00 00 00 00 00 w0 += w1
5: 95 00 00 00 00 00 00 00 exit0000000000000000 test_pkt_access:
0: bf 16 00 00 00 00 00 00 r6 = r1
===> 1: 85 10 00 00 ff ff ff ff call -1
2: bc 01 00 00 00 00 00 00 w1 = w0
3: b4 00 00 00 02 00 00 00 w0 = 2
4: 61 62 00 00 00 00 00 00 r2 = *(u32 *)(r6 + 0)
5: 64 02 00 00 01 00 00 00 w2 <<= 1
6: 5e 21 09 00 00 00 00 00 if w1 != w2 goto +9 <LBB2_3>
7: b4 01 00 00 02 00 00 00 w1 = 2
8: bf 62 00 00 00 00 00 00 r2 = r6
===> 9: 85 10 00 00 ff ff ff ff call -1
10: bc 01 00 00 00 00 00 00 w1 = w0
11: 61 62 00 00 00 00 00 00 r2 = *(u32 *)(r6 + 0)
12: 04 02 00 00 02 00 00 00 w2 += 2
13: b4 00 00 00 ff ff ff ff w0 = -1
14: 1e 21 01 00 00 00 00 00 if w1 == w2 goto +1 <LBB2_3>
15: b4 00 00 00 02 00 00 00 w0 = 2
0000000000000080 LBB2_3:
16: 95 00 00 00 00 00 00 00 exitThus the right formula to calculate target call offset after relocation should take into account relocation's target symbol value (offset within section), call instruction's imm32 offset, and (subtracting, to get relative instruction offset) instruction index of call instruction itself. All that is shifted by number of instructions in main program, given all sub-programs are copied over after main program.
Convert few selftests relying on bpf-to-bpf calls to use global functions instead of static ones.
--- tools/lib/bpf/libbpf.c | 8 ++++++-- tools/testing/selftests/bpf/progs/test_btf_haskv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_newkv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_nokv.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-)
tools/lib/bpf/libbpf.c +6 -2
@@ -1791,9 +1791,13 @@ bpf_program__collect_reloc(struct bpf_prpr_warning ("incorrect bpf_call opcode\n" );return -LIBBPF_ERRNO__RELOC ; } +if (sym.st_value %8 ) { +pr_warn ("bad call relo offset: %lu\n" , sym.st_value); +return -LIBBPF_ERRNO__RELOC ; + } prog->reloc_desc[i].type =RELO_CALL ; prog->reloc_desc[i].insn_idx = insn_idx; - prog->reloc_desc[i].text_off = sym.st_value; + prog->reloc_desc[i].text_off = sym.st_value /8 ; obj->has_pseudo_calls = true;continue ; }
@@ -3239,7 +3243,7 @@ bpf_program__reloc_text(struct bpf_progr prog->section_name); } insn = &prog->insns[relo->insn_idx]; - insn->imm += prog->main_prog_cnt - relo->insn_idx; + insn->imm += relo->text_off + prog->main_prog_cnt - relo->insn_idx;return 0 ; }
tools/testing/selftests/bpf/progs/test_btf_haskv.c +2 -2
@@ -25,7 +25,7 @@ struct dummy_tracepoint_args { }; __attribute__((noinline)) -static int test_long_fname_2 (struct dummy_tracepoint_args *arg) +int test_long_fname_2 (struct dummy_tracepoint_args *arg) {struct ipv_counts *counts;int key =0 ;
@@ -43,7 +43,7 @@ static int test_long_fname_2(struct dumm } __attribute__((noinline)) -static int test_long_fname_1 (struct dummy_tracepoint_args *arg) +int test_long_fname_1 (struct dummy_tracepoint_args *arg) {return test_long_fname_2 (arg); }
tools/testing/selftests/bpf/progs/test_btf_newkv.c +2 -2
@@ -33,7 +33,7 @@ struct dummy_tracepoint_args { }; __attribute__((noinline)) -static int test_long_fname_2 (struct dummy_tracepoint_args *arg) +int test_long_fname_2 (struct dummy_tracepoint_args *arg) {struct ipv_counts *counts;int key =0 ;
@@ -56,7 +56,7 @@ static int test_long_fname_2(struct dumm } __attribute__((noinline)) -static int test_long_fname_1 (struct dummy_tracepoint_args *arg) +int test_long_fname_1 (struct dummy_tracepoint_args *arg) {return test_long_fname_2 (arg); }
tools/testing/selftests/bpf/progs/test_btf_nokv.c +2 -2
@@ -23,7 +23,7 @@ struct dummy_tracepoint_args { }; __attribute__((noinline)) -static int test_long_fname_2 (struct dummy_tracepoint_args *arg) +int test_long_fname_2 (struct dummy_tracepoint_args *arg) {struct ipv_counts *counts;int key =0 ;
@@ -41,7 +41,7 @@ static int test_long_fname_2(struct dumm } __attribute__((noinline)) -static int test_long_fname_1 (struct dummy_tracepoint_args *arg) +int test_long_fname_1 (struct dummy_tracepoint_args *arg) {return test_long_fname_2 (arg); }
Re: [PATCH 5.4 007/102] libbpf: Fix call relocation offset calculation bug
<trim>
Quoted 18 lines
Fixes 48cca7e44f9f ("libbpf: add support for bpf_call")Reported-by Alexei Starovoitov <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>Acked-by Yonghong Song <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/lib/bpf/libbpf.c | 8 ++++++-- tools/testing/selftests/bpf/progs/test_btf_haskv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_newkv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_nokv.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-)
tools/lib/bpf/libbpf.c bpf_program__collect_reloc(struct bpf_pr · line 1795
Quoted 5 lines
tools/lib/bpf/libbpf.c +2
-0@@ -1791,9 +1791,13 @@ bpf_program__collect_reloc(struct bpf_prpr_warning ("incorrect bpf_call opcode\n" );return -LIBBPF_ERRNO__RELOC ; } +if (sym.st_value %8 ) { +pr_warn ("bad call relo offset: %lu\n" , sym.st_value);
Perf build failed on stable-rc 5.4 branch for arm, arm64, x86_64 and i386.
libbpf.c: In function 'bpf_program__collect_reloc':
libbpf.c:1795:5: error: implicit declaration of function 'pr_warn'; did you mean 'pr_warning'? [-Werror=implicit-function-declaration]
pr_warn("bad call relo offset: %lu\n", sym.st_value);
^~~~~~~
pr_warninglibbpf.c:1795:5: error: nested extern declaration of 'pr_warn' [-Werror=nested-externs]
Makefile:653: arch/arm64/Makefile: No such file or directory
cc1: all warnings being treated as errors
build links,
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=hikey,label=docker-lkft/69/consoleText
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=intel-corei7-64,label=docker-lkft/69/consoleText
Sasha Levin
maintainerRe: [PATCH 5.4 007/102] libbpf: Fix call relocation offset calculation bug
Quoted 33 lines · Naresh Kamboju
<trim>
Quoted 18 lines
Fixes 48cca7e44f9f ("libbpf: add support for bpf_call")Reported-by Alexei Starovoitov <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>Acked-by Yonghong Song <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- tools/lib/bpf/libbpf.c | 8 ++++++-- tools/testing/selftests/bpf/progs/test_btf_haskv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_newkv.c | 4 ++-- tools/testing/selftests/bpf/progs/test_btf_nokv.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-)tools/lib/bpf/libbpf.c bpf_program__collect_reloc(struct bpf_pr · line 1795
Quoted 5 lines
tools/lib/bpf/libbpf.c +2
-0@@ -1791,9 +1791,13 @@ bpf_program__collect_reloc(struct bpf_prpr_warning ("incorrect bpf_call opcode\n" );return -LIBBPF_ERRNO__RELOC ; } +if (sym.st_value %8 ) { +pr_warn ("bad call relo offset: %lu\n" , sym.st_value);Perf build failed on stable-rc 5.4 branch for arm, arm64,
x86_64and i386.
libbpf.c: In function 'bpf_program__collect_reloc':
libbpf.c:1795:5: error: implicit declaration of function 'pr_warn'; did you mean 'pr_warning'? [-Werror=implicit-function-declaration]pr_warn("bad call relo offset: %lu\n", sym.st_value); ^~~~~~~ pr_warning
Quoted 8 lines
libbpf.c:1795:5: error: nested extern declaration of '
pr_warn' [-Werror=nested-externs]
Makefile:653:arch/arm64/Makefile: No such file or directory
cc1: all warnings being treated as errorsbuild links,
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=hikey,label=docker-lkft/69/consoleText
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=intel-corei7-64,label=docker-lkft/69/consoleText
Oh, I realized I'm not testing libbpf. I'll drop this patch for now.
Signature · 2 lines
Thanks, Sasha
Greg Kroah-Hartman
maintainerPATCH 8/102 bpf: Force .BTF section start to zero when dumping from vmlinux
In reply to Greg Kroah-HartmanFrom: Stanislav Fomichev <[email protected]>
commit df786c9b947639aedbc7bb44b5dae2a7824af360 upstream.
While trying to figure out why fentry_fexit selftest doesn't pass for me (old pahole, broken BTF), I found out that my latest patch can break vmlinux .BTF generation. objcopy preserves section start when doing --only-section, so there is a chance (depending on where pahole inserts .BTF section) to have leading empty zeroes. Let's explicitly force section offset to zero.
Before:
$ objcopy --set-section-flags .BTF=alloc -O binary \ --only-section=.BTF vmlinux .btf.vmlinux.bin $ xxd .btf.vmlinux.bin | head -n1 00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
After:
$ objcopy --change-section-address .BTF=0 \
--set-section-flags .BTF=alloc -O binary \
--only-section=.BTF vmlinux .btf.vmlinux.bin
$ xxd .btf.vmlinux.bin | head -n1
00000000: 9feb 0100 1800 0000 0000 0000 80e1 1c00 ................
^BTF magicAs part of this change, I'm also dropping '2>/dev/null' from objcopy invocation to be able to catch possible other issues (objcopy doesn't produce any warnings for me anymore, it did before with --dump-section).
--- scripts/link-vmlinux.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/link-vmlinux.sh +3 -2
@@ -127,8 +127,9 @@ gen_btf() cut -d, -f1 | cut -d' ' -f2) bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \ awk '{print $4}') - ${OBJCOPY} --set-section-flags .BTF=alloc -O binary \ - --only-section=.BTF ${1} .btf.vmlinux.bin 2>/dev/null + ${OBJCOPY} --change-section-address .BTF=0 \ + --set-section-flags .BTF=alloc -O binary \ + --only-section=.BTF ${1} .btf.vmlinux.bin ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \ --rename-section .data=.BTF .btf.vmlinux.bin ${2} }
Greg Kroah-Hartman
maintainerPATCH 9/102 samples: bpf: update map definition to new syntax BTF-defined map
In reply to Greg Kroah-HartmanFrom: Daniel T. Lee <[email protected]>
commit 451d1dc886b548d6e18c933adca326c1307023c9 upstream.
Since, the new syntax of BTF-defined map has been introduced, the syntax for using maps under samples directory are mixed up. For example, some are already using the new syntax, and some are using existing syntax by calling them as 'legacy'.
As stated at commit abd29c931459 ("libbpf: allow specifying map definitions using BTF"), the BTF-defined map has more compatablility with extending supported map definition features.
The commit doesn't replace all of the map to new BTF-defined map, because some of the samples still use bpf_load instead of libbpf, which can't properly create BTF-defined map.
This will only updates the samples which uses libbpf API for loading bpf program. (ex. bpf_prog_load_xattr)
--- samples/bpf/sockex1_kern.c | 12 ++-- samples/bpf/sockex2_kern.c | 12 ++-- samples/bpf/xdp1_kern.c | 12 ++-- samples/bpf/xdp2_kern.c | 12 ++-- samples/bpf/xdp_adjust_tail_kern.c | 12 ++-- samples/bpf/xdp_fwd_kern.c | 13 ++-- samples/bpf/xdp_redirect_cpu_kern.c | 108 ++++++++++++++++++------------------ samples/bpf/xdp_redirect_kern.c | 24 ++++---- samples/bpf/xdp_redirect_map_kern.c | 24 ++++---- samples/bpf/xdp_router_ipv4_kern.c | 64 ++++++++++----------- samples/bpf/xdp_rxq_info_kern.c | 37 ++++++------ samples/bpf/xdp_tx_iptunnel_kern.c | 24 ++++---- 12 files changed, 177 insertions(+), 177 deletions(-)
samples/bpf/sockex1_kern.c +6 -6
@@ -4,12 +4,12 @@#include <uapi/linux/ip.h> #include "bpf_helpers.h" -struct bpf_map_def SEC("maps") my_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(long), - .max_entries = 256, -}; +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, u32); + __type(value, long); + __uint(max_entries, 256); +} my_map SEC(".maps"); SEC("socket1")int bpf_prog1 (struct __sk_buff *skb)
samples/bpf/sockex2_kern.c +6 -6
@@ -189,12 +189,12 @@ struct pair {long bytes; }; -struct bpf_map_def SEC("maps") hash_map = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(__be32), - .value_size = sizeof(struct pair), - .max_entries = 1024, -}; +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, __be32); + __type(value, struct pair); + __uint(max_entries, 1024); +} hash_map SEC(".maps"); SEC("socket2")int bpf_prog2 (struct __sk_buff *skb)
samples/bpf/xdp1_kern.c +6 -6
@@ -14,12 +14,12 @@#include <linux/ipv6.h> #include "bpf_helpers.h" -struct bpf_map_def SEC("maps") rxcnt = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(long), - .max_entries = 256, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, long); + __uint(max_entries, 256); +} rxcnt SEC(".maps");static int parse_ipv4 (void *data,u64 nh_off,void *data_end) {
samples/bpf/xdp2_kern.c +6 -6
@@ -14,12 +14,12 @@#include <linux/ipv6.h> #include "bpf_helpers.h" -struct bpf_map_def SEC("maps") rxcnt = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(long), - .max_entries = 256, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, long); + __uint(max_entries, 256); +} rxcnt SEC(".maps");static void swap_src_dst_mac (void *data) {
samples/bpf/xdp_adjust_tail_kern.c +6 -6
@@ -25,12 +25,12 @@#define ICMP_TOOBIG_SIZE 98#define ICMP_TOOBIG_PAYLOAD_SIZE 92 -struct bpf_map_def SEC("maps") icmpcnt = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(__u32), - .value_size = sizeof(__u64), - .max_entries = 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, __u32); + __type(value, __u64); + __uint(max_entries, 1); +} icmpcnt SEC(".maps"); static __always_inline void count_icmp(void) {
samples/bpf/xdp_fwd_kern.c +6 -7
@@ -23,13 +23,12 @@#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) -/* For TX-traffic redirect requires net_device ifindex to be in this devmap */ -struct bpf_map_def SEC("maps") xdp_tx_ports = { - .type = BPF_MAP_TYPE_DEVMAP, - .key_size = sizeof(int), - .value_size = sizeof(int), - .max_entries = 64, -}; +struct { + __uint(type, BPF_MAP_TYPE_DEVMAP); + __uint(key_size, sizeof(int)); + __uint(value_size, sizeof(int)); + __uint(max_entries, 64); +} xdp_tx_ports SEC(".maps");/* from include/net/ip.h */ static __always_inline int ip_decrease_ttl(struct iphdr *iph)
samples/bpf/xdp_redirect_cpu_kern.c +54 -54
133 lines not on this page · raw message
samples/bpf/xdp_redirect_kern.c +12 -12
@@ -19,22 +19,22 @@#include <linux/ipv6.h> #include "bpf_helpers.h" -struct bpf_map_def SEC("maps") tx_port = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(int), - .value_size = sizeof(int), - .max_entries = 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, int); + __type(value, int); + __uint(max_entries, 1); +} tx_port SEC(".maps");/* Count RX packets, as XDP bpf_prog doesn't get direct TX-success * feedback. Redirect TX errors can be caught via a tracepoint. */ -struct bpf_map_def SEC("maps") rxcnt = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(long), - .max_entries = 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, long); + __uint(max_entries, 1); +} rxcnt SEC(".maps");static void swap_src_dst_mac (void *data) {
samples/bpf/xdp_redirect_map_kern.c +12 -12
@@ -19,22 +19,22 @@#include <linux/ipv6.h> #include "bpf_helpers.h" -struct bpf_map_def SEC("maps") tx_port = { - .type = BPF_MAP_TYPE_DEVMAP, - .key_size = sizeof(int), - .value_size = sizeof(int), - .max_entries = 100, -}; +struct { + __uint(type, BPF_MAP_TYPE_DEVMAP); + __uint(key_size, sizeof(int)); + __uint(value_size, sizeof(int)); + __uint(max_entries, 100); +} tx_port SEC(".maps");/* Count RX packets, as XDP bpf_prog doesn't get direct TX-success * feedback. Redirect TX errors can be caught via a tracepoint. */ -struct bpf_map_def SEC("maps") rxcnt = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(long), - .max_entries = 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, long); + __uint(max_entries, 1); +} rxcnt SEC(".maps");static void swap_src_dst_mac (void *data) {
samples/bpf/xdp_router_ipv4_kern.c +32 -32
76 lines not on this page · raw message
samples/bpf/xdp_rxq_info_kern.c +19 -18
@@ -23,12 +23,13 @@ enum cfg_options_flags {READ_MEM =0x1U , SWAP_MAC = 0x2U, }; -struct bpf_map_def SEC("maps") config_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(int), - .value_size = sizeof(struct config), - .max_entries = 1, -}; + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, int); + __type(value, struct config); + __uint(max_entries, 1); +} config_map SEC(".maps");/* Common stats data record (shared with userspace) */ struct datarec {
@@ -36,22 +37,22 @@ struct datarec {__u64 issue; }; -struct bpf_map_def SEC("maps") stats_global_map = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(struct datarec), - .max_entries = 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, struct datarec); + __uint(max_entries, 1); +} stats_global_map SEC(".maps");#define MAX_RXQs 64/* Stats per rx_queue_index (per CPU) */ -struct bpf_map_def SEC("maps") rx_queue_index_map = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(u32), - .value_size = sizeof(struct datarec), - .max_entries = MAX_RXQs + 1, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, u32); + __type(value, struct datarec); + __uint(max_entries, MAX_RXQs + 1); +} rx_queue_index_map SEC(".maps");static __always_inline void swap_src_dst_mac(void *data)
samples/bpf/xdp_tx_iptunnel_kern.c +12 -12
@@ -19,19 +19,19 @@#include "bpf_helpers.h" #include "xdp_tx_iptunnel_common.h" -struct bpf_map_def SEC("maps") rxcnt = { - .type = BPF_MAP_TYPE_PERCPU_ARRAY, - .key_size = sizeof(__u32), - .value_size = sizeof(__u64), - .max_entries = 256, -}; +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __type(key, __u32); + __type(value, __u64); + __uint(max_entries, 256); +} rxcnt SEC(".maps"); -struct bpf_map_def SEC("maps") vip2tnl = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(struct vip), - .value_size = sizeof(struct iptnl_info), - .max_entries = MAX_IPTNL_ENTRIES, -}; +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, struct vip); + __type(value, struct iptnl_info); + __uint(max_entries, MAX_IPTNL_ENTRIES); +} vip2tnl SEC(".maps"); static __always_inline void count_tx(u32 protocol) {
Greg Kroah-Hartman
maintainerPATCH 10/102 samples/bpf: Fix broken xdp_rxq_info due to map order assumptions
In reply to Greg Kroah-HartmanFrom: Jesper Dangaard Brouer <[email protected]>
commit edbca120a8cdfa5a5793707e33497aa5185875ca upstream.
In the days of using bpf_load.c the order in which the 'maps' sections were defines in BPF side (*_kern.c) file, were used by userspace side to identify the map via using the map order as an index. In effect the order-index is created based on the order the maps sections are stored in the ELF-object file, by the LLVM compiler.
This have also carried over in libbpf via API bpf_map__next(NULL, obj) to extract maps in the order libbpf parsed the ELF-object file.
When BTF based maps were introduced a new section type ".maps" were created. I found that the LLVM compiler doesn't create the ".maps" sections in the order they are defined in the C-file. The order in the ELF file is based on the order the map pointer is referenced in the code.
This combination of changes lead to xdp_rxq_info mixing up the map file-descriptors in userspace, resulting in very broken behaviour, but without warning the user.
This patch fix issue by instead using bpf_object__find_map_by_name() to find maps via their names. (Note, this is the ELF name, which can be longer than the name the kernel retains).
--- samples/bpf/xdp_rxq_info_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
samples/bpf/xdp_rxq_info_user.c +3 -3
@@ -489,9 +489,9 @@ int main(int argc, char **argv)if (bpf_prog_load_xattr (&prog_load_attr, &obj, &prog_fd))return EXIT_FAIL ; - map =bpf_map__next (NULL , obj); - stats_global_map =bpf_map__next (map, obj); - rx_queue_index_map =bpf_map__next (stats_global_map, obj); + map =bpf_object__find_map_by_name (obj,"config_map" ); + stats_global_map =bpf_object__find_map_by_name (obj,"stats_global_map" ); + rx_queue_index_map =bpf_object__find_map_by_name (obj,"rx_queue_index_map" );if (!map || !stats_global_map || !rx_queue_index_map) {printf ("finding a map in obj file failed\n" );return EXIT_FAIL ;
Greg Kroah-Hartman
maintainerPATCH 11/102 ARM: dts: logicpd-torpedo-37xx-devkit-28: Reference new DRM panel
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
commit a177057a95f6a3f1e0e52a17eea2178c15073648 upstream.
With the removal of the panel-dpi from the omap drivers, the LCD no longer works. This patch points the device tree to a newly created panel named "logicpd,type28"
--- arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts | 20 +------------------ 1 file changed, 2 insertions(+), 18 deletions(-)
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts +2 -18
@@ -11,22 +11,6 @@ #include "logicpd-torpedo-37xx-devkit.dts" &lcd0 { - - label = "28"; - - panel-timing { - clock-frequency = <9000000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <3>; - hback-porch = <2>; - hsync-len = <42>; - vback-porch = <3>; - vfront-porch = <2>; - vsync-len = <11>; - hsync-active = <1>; - vsync-active = <1>; - de-active = <1>; - pixelclk-active = <0>; - }; + /* To make it work, set CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=4 */ + compatible = "logicpd,type28"; };
Greg Kroah-Hartman
maintainerPATCH 12/102 ARM: OMAP2+: Add missing put_device() call in omapdss_init_of()
In reply to Greg Kroah-HartmanFrom: Markus Elfring <[email protected]>
commit 0b491904f053e41685162af5c5411b85b18c97a7 upstream.
A coccicheck run provided information like the following.
arch/arm/mach-omap2/display.c:268:2-8: ERROR: missing put_device; call of_find_device_by_node on line 258, but without a corresponding object release within this function.
Generated by: scripts/coccinelle/free/put_device.cocci
Thus add the missed function call to fix the exception handling for this function implementation.
--- arch/arm/mach-omap2/display.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/display.c +1 -0
@@ -265,6 +265,7 @@ static int __init omapdss_init_of(void) r =of_platform_populate (node,NULL ,NULL , &pdev->dev);if (r) {pr_err ("Unable to populate DSS submodule devices\n" ); +put_device (&pdev->dev);return r; }
Greg Kroah-Hartman
maintainerPATCH 13/102 xfs: Sanity check flags of Q_XQUOTARM call
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 3dd4d40b420846dd35869ccc8f8627feef2cff32 upstream.
Flags passed to Q_XQUOTARM were not sanity checked for invalid values. Fix that.
--- fs/xfs/xfs_quotaops.c | 3 +++ 1 file changed, 3 insertions(+)
fs/xfs/xfs_quotaops.c +3 -0
@@ -201,6 +201,9 @@ xfs_fs_rm_xquota(if (XFS_IS_QUOTA_ON (mp))return -EINVAL ; +if (uflags & ~(FS_USER_QUOTA |FS_GROUP_QUOTA |FS_PROJ_QUOTA )) +return -EINVAL ; +if (uflags &FS_USER_QUOTA ) flags |=XFS_DQ_USER ;if (uflags &FS_GROUP_QUOTA )
Greg Kroah-Hartman
maintainerPATCH 14/102 i2c: stm32f7: rework slave_id allocation
In reply to Greg Kroah-HartmanFrom: Alain Volmat <[email protected]>
commit 52d3be711e065a97a57c2f2ffba3098748855bd6 upstream.
The IP can handle two slave addresses. One address can either be 7 bits or 10 bits while the other can only be 7 bits.
In order to ensure that a 10 bits address can always be allocated (assuming there is only one 7 bits address already allocated), pick up the 7-bits only address slot in priority when performing a 7-bits address allocation.
--- drivers/i2c/busses/i2c-stm32f7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-stm32f7.c +1 -1
@@ -1267,7 +1267,7 @@ static int stm32f7_i2c_get_free_slave_id* slave[0] supports 7-bit and 10-bit slave address * slave[1] supports 7-bit slave address only */ -for (i =0 ; i <STM32F7_I2C_MAX_SLAVE ; i++) { +for (i =STM32F7_I2C_MAX_SLAVE -1 ; i >=0 ; i--) {if (i ==1 && (slave->flags &I2C_CLIENT_PEC ))continue ;if (!i2c_dev->slave[i]) {
Greg Kroah-Hartman
maintainerPATCH 15/102 i2c: i2c-stm32f7: fix 10-bits check in slave free id search loop
In reply to Greg Kroah-HartmanFrom: Alain Volmat <[email protected]>
commit 7787657d7ee55a9ecf4aea4907b46b87a44eda67 upstream.
Fix a typo in the free slave id search loop. Instead of I2C_CLIENT_PEC, it should have been I2C_CLIENT_TEN. The slave id 1 can only handle 7-bit addresses and thus is not eligible in case of 10-bit addresses. As a matter of fact none of the slave id support I2C_CLIENT_PEC, overall check is performed at the beginning of the stm32f7_i2c_reg_slave function.
--- drivers/i2c/busses/i2c-stm32f7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-stm32f7.c +1 -1
@@ -1268,7 +1268,7 @@ static int stm32f7_i2c_get_free_slave_id* slave[1] supports 7-bit slave address only */ for (i =STM32F7_I2C_MAX_SLAVE -1 ; i >=0 ; i--) { -if (i ==1 && (slave->flags &I2C_CLIENT_PEC )) +if (i ==1 && (slave->flags &I2C_CLIENT_TEN ))continue ;if (!i2c_dev->slave[i]) { *id = i;
Greg Kroah-Hartman
maintainerPATCH 16/102 mfd: intel-lpss: Add default I2C device properties for Gemini Lake
In reply to Greg Kroah-HartmanFrom: Jarkko Nikula <[email protected]>
commit 3f31bc67e4dc6a555341dffefe328ddd58e8b431 upstream.
It turned out Intel Gemini Lake doesn't use the same I2C timing parameters as Broxton.
I got confirmation from the Windows team that Gemini Lake systems should use updated timing parameters that differ from those used in Broxton based systems.
--- drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/mfd/intel-lpss-pci.c +20 -8
@@ -122,6 +122,18 @@ static const struct intel_lpss_platform_ .properties = apl_i2c_properties, }; +static struct property_entry glk_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,313 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,290 ), + { }, +}; + +static const struct intel_lpss_platform_info glk_i2c_info = { + .clk_rate =133000000 , + .properties = glk_i2c_properties, +}; +static const struct intel_lpss_platform_info cnl_i2c_info = { .clk_rate =216000000 , .properties = spt_i2c_properties,
@@ -174,14 +186,14 @@ static const struct pci_device_id intel_ { PCI_VDEVICE(INTEL, 0x1ac6), (kernel_ulong_t)&bxt_info }, { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info },/* GLK */ - { PCI_VDEVICE(INTEL, 0x31ac), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31ae), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31b0), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31b2), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31b4), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31b6), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31b8), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x31ba), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31ac), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31ae), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31b0), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31b2), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31b4), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31b6), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31b8), (kernel_ulong_t)&glk_i2c_info }, + { PCI_VDEVICE(INTEL, 0x31ba), (kernel_ulong_t)&glk_i2c_info }, { PCI_VDEVICE(INTEL, 0x31bc), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x31be), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x31c0), (kernel_ulong_t)&bxt_uart_info },
Greg Kroah-Hartman
maintainerPATCH 17/102 SUNRPC: Fix svcauth_gss_proxy_init()
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 5866efa8cbfbadf3905072798e96652faf02dbe8 upstream.
gss_read_proxy_verf() assumes things about the XDR buffer containing the RPC Call that are not true for buffers generated by svc_rdma_recv().
RDMA's buffers look more like what the upper layer generates for
sending: head is a kmalloc'd buffer; it does not point to a page whose contents are contiguous with the first page in the buffers' page array. The result is that ACCEPT_SEC_CONTEXT via RPC/RDMA has stopped working on Linux NFS servers that use gssproxy.
This does not affect clients that use only TCP to send their ACCEPT_SEC_CONTEXT operation (that's all Linux clients). Other clients, like Solaris NFS clients, send ACCEPT_SEC_CONTEXT on the same transport as they send all other NFS operations. Such clients can send ACCEPT_SEC_CONTEXT via RPC/RDMA.
I thought I had found every direct reference in the server RPC code to the rqstp->rq_pages field.
Bug found at the 2019 Westford NFS bake-a-thon.
--- net/sunrpc/auth_gss/svcauth_gss.c | 84 ++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 21 deletions(-)
net/sunrpc/auth_gss/svcauth_gss.c +63 -21
@@ -1075,24 +1075,32 @@ gss_read_verf(struct rpc_gss_wire_cred *return 0 ; } -/* Ok this is really heavily depending on a set of semantics in -* how rqstp is set up by svc_recv and pages laid down by the -* server when reading a request. We are basically guaranteed that -* the token lays all down linearly across a set of pages, starting -* at iov_base in rq_arg.head[0] which happens to be the first of a -* set of pages stored in rq_pages[]. -* rq_arg.head[0].iov_base will provide us the page_base to pass -* to the upcall. -*/ -static inline int -gss_read_proxy_verf (struct svc_rqst *rqstp, -struct rpc_gss_wire_cred *gc,__be32 *authp, -struct xdr_netobj *in_handle, -struct gssp_in_token *in_token) +static void gss_free_in_token_pages (struct gssp_in_token *in_token) { -struct kvec *argv = &rqstp->rq_arg.head[0 ];u32 inlen; -int res; +int i; + + i =0 ; + inlen = in_token->page_len; +while (inlen) { +if (in_token->pages[i]) +put_page (in_token->pages[i]); + inlen -= inlen >PAGE_SIZE ?PAGE_SIZE : inlen; + } + +kfree (in_token->pages); + in_token->pages =NULL ; +} + +static int gss_read_proxy_verf (struct svc_rqst *rqstp, +struct rpc_gss_wire_cred *gc,__be32 *authp, +struct xdr_netobj *in_handle, +struct gssp_in_token *in_token) +{ +struct kvec *argv = &rqstp->rq_arg.head[0 ]; +unsigned int page_base, length; +int pages, i, res; +size_t inlen; res =gss_read_common_verf (gc, argv, authp, in_handle);if (res)
@@ -1102,10 +1110,36 @@ gss_read_proxy_verf(struct svc_rqst *rqsif (inlen > (argv->iov_len + rqstp->rq_arg.page_len))return SVC_DENIED ; - in_token->pages = rqstp->rq_pages; - in_token->page_base = (ulong )argv->iov_base & ~PAGE_MASK ; + pages =DIV_ROUND_UP (inlen,PAGE_SIZE ); + in_token->pages =kcalloc (pages,sizeof (struct page *),GFP_KERNEL ); +if (!in_token->pages) +return SVC_DENIED ; + in_token->page_base =0 ; in_token->page_len = inlen; +for (i =0 ; i < pages; i++) { + in_token->pages[i] =alloc_page (GFP_KERNEL ); +if (!in_token->pages[i]) { +gss_free_in_token_pages (in_token); +return SVC_DENIED ; + } + } + length = min_t(unsigned int, inlen, argv->iov_len); +memcpy (page_address (in_token->pages[0 ]), argv->iov_base, length); + inlen -= length; + + i =1 ; + page_base = rqstp->rq_arg.page_base; +while (inlen) { + length = min_t(unsigned int, inlen, PAGE_SIZE); +memcpy (page_address (in_token->pages[i]), +page_address (rqstp->rq_arg.pages[i]) + page_base, + length); + + inlen -= length; + page_base =0 ; + i++; + }return 0 ; }
@@ -1280,8 +1314,11 @@ static int svcauth_gss_proxy_init(structbreak ;case GSS_S_COMPLETE : status =gss_proxy_save_rsc (sn->rsc_cache, &ud, &handle); -if (status) +if (status) { +pr_info ("%s: gss_proxy_save_rsc failed (%d)\n" , + __func__, status); goto out; + } cli_handle.data = (u8 *)&handle; cli_handle.len =sizeof (handle);break ;
@@ -1292,15 +1329,20 @@ static int svcauth_gss_proxy_init(struct/* Got an answer to the upcall; use it: */ if (gss_write_init_verf (sn->rsc_cache, rqstp, - &cli_handle, &ud.major_status)) + &cli_handle, &ud.major_status)) { +pr_info ("%s: gss_write_init_verf failed\n" , __func__); goto out; + }if (gss_write_resv (resv,PAGE_SIZE , &cli_handle, &ud.out_token, - ud.major_status, ud.minor_status)) + ud.major_status, ud.minor_status)) { +pr_info ("%s: gss_write_resv failed\n" , __func__); goto out; + } ret =SVC_COMPLETE ; out: +gss_free_in_token_pages (&ud.in_token);gssp_free_upcall_data (&ud);return ret; }
Greg Kroah-Hartman
maintainerPATCH 18/102 SUNRPC: Fix backchannel latency metrics
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 8729aaba74626c4ebce3abf1b9e96bb62d2958ca upstream.
I noticed that for callback requests, the reported backlog latency is always zero, and the rtt value is crazy big. The problem was that rqst->rq_xtime is never set for backchannel requests.
--- net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 + net/sunrpc/xprtsock.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
net/sunrpc/xprtrdma/svc_rdma_backchannel.c +1 -0
@@ -195,6 +195,7 @@ rpcrdma_bc_send_request(struct svcxprt_rpr_info ("%s: %*ph\n" , __func__,64 , rqst->rq_buffer);#endif + rqst->rq_xtime =ktime_get (); rc =svc_rdma_bc_sendto (rdma, rqst, ctxt);if (rc) {svc_rdma_send_ctxt_put (rdma, ctxt);
net/sunrpc/xprtsock.c +2 -1
@@ -2659,6 +2659,8 @@ static int bc_sendto(struct rpc_rqst *re .iov_len = sizeof(marker), }; + req->rq_xtime =ktime_get (); + len =kernel_sendmsg (transport->sock, &msg, &iov,1 , iov.iov_len);if (len != iov.iov_len)return -EAGAIN ;
@@ -2684,7 +2686,6 @@ static int bc_send_request(struct rpc_rqstruct svc_xprt *xprt;int len; -dprintk ("sending request with xid: %08x\n" ,ntohl (req->rq_xid));/* * Get the server socket associated with this callback xprt */
Greg Kroah-Hartman
maintainerPATCH 19/102 powerpc/security: Fix debugfs data leak on 32-bit
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
commit 3b05a1e517e1a8cfda4866ec31d28b2bc4fee4c4 upstream.
"powerpc_security_features" is "unsigned long", i.e. 32-bit or 64-bit, depending on the platform (PPC_FSL_BOOK3E or PPC_BOOK3S_64). Hence casting its address to "u64 *", and calling debugfs_create_x64() is wrong, and leaks 32-bit of nearby data to userspace on 32-bit platforms.
While all currently defined SEC_FTR_* security feature flags fit in 32-bit, they all have "ULL" suffixes to make them 64-bit constants. Hence fix the leak by changing the type of "powerpc_security_features" (and the parameter types of its accessors) to "u64". This also allows to drop the cast.
--- arch/powerpc/include/asm/security_features.h | 8 ++++---- arch/powerpc/kernel/security.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/include/asm/security_features.h +4 -4
@@ -9,7 +9,7 @@#define _ASM_POWERPC_SECURITY_FEATURES_H -extern unsigned long powerpc_security_features; +extern u64 powerpc_security_features;extern bool rfi_flush;/* These are bit flags */
@@ -24,17 +24,17 @@ void setup_stf_barrier(void);void do_stf_barrier_fixups (enum stf_barrier_type types);void setup_count_cache_flush (void ); -static inline void security_ftr_set (unsigned long feature) +static inline void security_ftr_set (u64 feature) { powerpc_security_features |= feature; } -static inline void security_ftr_clear (unsigned long feature) +static inline void security_ftr_clear (u64 feature) { powerpc_security_features &= ~feature; } -static inline bool security_ftr_enabled (unsigned long feature) +static inline bool security_ftr_enabled (u64 feature) {return !!(powerpc_security_features & feature); }
arch/powerpc/kernel/security.c +2 -2
@@ -16,7 +16,7 @@#include <asm/setup.h> -unsigned long powerpc_security_features__read_mostly =SEC_FTR_DEFAULT ; +u64 powerpc_security_features__read_mostly =SEC_FTR_DEFAULT ;enum count_cache_flush_type {COUNT_CACHE_FLUSH_NONE =0x1 ,
@@ -109,7 +109,7 @@ device_initcall(barrier_nospec_debugfs_istatic __init int security_feature_debugfs_init (void ) {debugfs_create_x64 ("security_features" ,0400 , powerpc_debugfs_root, - (u64 *)&powerpc_security_features); + &powerpc_security_features);return 0 ; }device_initcall (security_feature_debugfs_init);
Greg Kroah-Hartman
maintainerPATCH 20/102 powerpc/pseries: Enable support for ibm,drc-info property
In reply to Greg Kroah-HartmanFrom: Tyrel Datwyler <[email protected]>
commit 0a87ccd3699983645f54cafd2258514a716b20b8 upstream.
Advertise client support for the PAPR architected ibm,drc-info device tree property during CAS handshake.
--- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/prom_init.c +1 -1
@@ -1053,7 +1053,7 @@ static const struct ibm_arch_vec ibm_arc .reserved2 = 0, .reserved3 = 0, .subprocessors = 1, - .byte22 = OV5_FEAT(OV5_DRMEM_V2), + .byte22 = OV5_FEAT(OV5_DRMEM_V2) | OV5_FEAT(OV5_DRC_INFO), .intarch = 0, .mmu = 0, .hash_ext = 0,
Greg Kroah-Hartman
maintainerPATCH 21/102 powerpc/kasan: Fix boot failure with RELOCATABLE && FSL_BOOKE
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
commit 71eb40fc53371bc247c8066ae76ad9e22ae1e18d upstream.
When enabling CONFIG_RELOCATABLE and CONFIG_KASAN on FSL_BOOKE, the kernel doesn't boot.
relocate_init() requires KASAN early shadow area to be set up because it needs access to the device tree through generic functions.
Call kasan_early_init() before calling relocate_init()
--- arch/powerpc/kernel/head_fsl_booke.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/head_fsl_booke.S +3 -3
@@ -238,6 +238,9 @@ set_ivor: bl early_init +#ifdef CONFIG_KASAN + bl kasan_early_init +#endif #ifdef CONFIG_RELOCATABLE mr r3,r30 mr r4,r31
@@ -264,9 +267,6 @@ set_ivor: /* * Decide what sort of machine this is and initialize the MMU. */ -#ifdef CONFIG_KASAN - bl kasan_early_init -#endif mr r3,r30 mr r4,r31 bl machine_init
Greg Kroah-Hartman
maintainerPATCH 22/102 powerpc/archrandom: fix arch_get_random_seed_int()
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit b6afd1234cf93aa0d71b4be4788c47534905f0be upstream.
Commit 01c9348c7620ec65
powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*
updated arch_get_random_[int|long]() to be NOPs, and moved the hardware RNG backing to arch_get_random_seed_[int|long]() instead. However, it failed to take into account that arch_get_random_int() was implemented in terms of arch_get_random_long(), and so we ended up with a version of the former that is essentially a NOP as well.
Fix this by calling arch_get_random_seed_long() from arch_get_random_seed_int() instead.
--- arch/powerpc/include/asm/archrandom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/archrandom.h +1 -1
@@ -28,7 +28,7 @@ static inline int arch_get_random_seed_iunsigned long val;int rc; - rc =arch_get_random_long (&val); + rc =arch_get_random_seed_long (&val);if (rc) *v = val;
Greg Kroah-Hartman
maintainerPATCH 23/102 tipc: reduce sensitive to retransmit failures
In reply to Greg Kroah-HartmanFrom: Hoang Le <[email protected]>
commit 426071f1f3995d7e9603246bffdcbf344cd31719 upstream.
With huge cluster (e.g >200nodes), the amount of that flow:
gap -> retransmit packet -> acked will take time in case of STATE_MSG dropped/delayed because a lot of traffic. This lead to 1.5 sec tolerance value criteria made link easy failure around 2nd, 3rd of failed retransmission attempts.
Instead of re-introduced criteria of 99 faled retransmissions to fix the issue, we increase failure detection timer to ten times tolerance value.
--- net/tipc/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/link.c +1 -1
@@ -1084,7 +1084,7 @@ static bool link_retransmit_failure(strureturn false;if (!time_after (jiffies,TIPC_SKB_CB (skb)->retr_stamp + -msecs_to_jiffies (r->tolerance))) +msecs_to_jiffies (r->tolerance *10 )))return false; hdr =buf_msg (skb);
Greg Kroah-Hartman
maintainerPATCH 24/102 tipc: update mons self addr when node addr generated
In reply to Greg Kroah-HartmanFrom: Hoang Le <[email protected]>
commit 46cb01eeeb86fca6afe24dda1167b0cb95424e29 upstream.
In commit 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values"), the 32-bit node address only generated after one second trial period expired. However the self's addr in struct tipc_monitor do not update according to node address generated. This lead to it is always zero as initial value. As result, sorting algorithm using this value does not work as expected, neither neighbor monitoring framework.
In this commit, we add a fix to update self's addr when 32-bit node address generated.
--- net/tipc/monitor.c | 15 +++++++++++++++ net/tipc/monitor.h | 1 + net/tipc/net.c | 2 ++ 3 files changed, 18 insertions(+)
net/tipc/monitor.c +15 -0
@@ -665,6 +665,21 @@ void tipc_mon_delete(struct net *net, inkfree (mon); } +void tipc_mon_reinit_self (struct net *net) +{ +struct tipc_monitor *mon; +int bearer_id; + +for (bearer_id =0 ; bearer_id <MAX_BEARERS ; bearer_id++) { + mon =tipc_monitor (net, bearer_id); +if (!mon) +continue ; +write_lock_bh (&mon->lock); + mon->self->addr =tipc_own_addr (net); +write_unlock_bh (&mon->lock); + } +} +int tipc_nl_monitor_set_threshold (struct net *net,u32 cluster_size) {struct tipc_net *tn =tipc_net (net);
net/tipc/monitor.h +1 -0
@@ -77,6 +77,7 @@ int __tipc_nl_add_monitor(struct net *ne u32 bearer_id);int tipc_nl_add_monitor_peer (struct net *net,struct tipc_nl_msg *msg,u32 bearer_id,u32 *prev_node); +void tipc_mon_reinit_self (struct net *net);extern const int tipc_max_domain_size;#endif
net/tipc/net.c +2 -0
@@ -42,6 +42,7 @@#include "node.h" #include "bcast.h" #include "netlink.h" +#include "monitor.h" /* * The TIPC locking policy is designed to ensure a very fine locking
@@ -136,6 +137,7 @@ static void tipc_net_finalize(struct nettipc_set_node_addr (net, addr);tipc_named_reinit (net);tipc_sk_reinit (net); +tipc_mon_reinit_self (net);tipc_nametbl_publish (net,TIPC_CFG_SRV , addr, addr,TIPC_CLUSTER_SCOPE ,0 , addr); }
Greg Kroah-Hartman
maintainerPATCH 25/102 tipc: fix potential memory leak in __tipc_sendmsg()
In reply to Greg Kroah-HartmanFrom: Tung Nguyen <[email protected]>
commit 2fe97a578d7bad3116a89dc8a6692a51e6fc1d9c upstream.
When initiating a connection message to a server side, the connection message is cloned and added to the socket write queue. However, if the cloning is failed, only the socket write queue is purged. It causes memory leak because the original connection message is not freed.
This commit fixes it by purging the list of connection message when it cannot be cloned.
--- net/tipc/socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/tipc/socket.c +3 -1
@@ -1396,8 +1396,10 @@ static int __tipc_sendmsg(struct socket rc =tipc_msg_build (hdr, m,0 , dlen, mtu, &pkts);if (unlikely (rc != dlen))return rc; -if (unlikely (syn && !tipc_msg_skb_clone (&pkts, &sk->sk_write_queue))) +if (unlikely (syn && !tipc_msg_skb_clone (&pkts, &sk->sk_write_queue))) { +__skb_queue_purge (&pkts);return -ENOMEM ; + }trace_tipc_sk_sendmsg (sk,skb_peek (&pkts),TIPC_DUMP_SK_SNDQ ," " ); rc =tipc_node_xmit (net, &pkts, dnode, tsk->portid);
Greg Kroah-Hartman
maintainerPATCH 26/102 tipc: fix wrong socket reference counter after tipc_sk_timeout() returns
In reply to Greg Kroah-HartmanFrom: Tung Nguyen <[email protected]>
commit 91a4a3eb433e4d786420c41f3c08d1d16c605962 upstream.
When tipc_sk_timeout() is executed but user space is grabbing ownership, this function rearms itself and returns. However, the socket reference counter is not reduced. This causes potential unexpected behavior.
This commit fixes it by calling sock_put() before tipc_sk_timeout() returns in the above-mentioned case.
--- net/tipc/socket.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/socket.c +1 -0
@@ -2687,6 +2687,7 @@ static void tipc_sk_timeout(struct timerif (sock_owned_by_user (sk)) {sk_reset_timer (sk, &sk->sk_timer, jiffies +HZ /20 );bh_unlock_sock (sk); +sock_put (sk);return ; }
Greg Kroah-Hartman
maintainerPATCH 27/102 tipc: fix wrong timeout input for tipc_wait_for_cond()
In reply to Greg Kroah-HartmanFrom: Tung Nguyen <[email protected]>
commit 12db3c8083fcab4270866a88191933f2d9f24f89 upstream.
In function __tipc_shutdown(), the timeout value passed to tipc_wait_for_cond() is not jiffies.
This commit fixes it by converting that value from milliseconds to jiffies.
--- net/tipc/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/tipc/socket.c +1 -1
@@ -504,7 +504,7 @@ static void __tipc_shutdown(struct sockestruct sock *sk = sock->sk;struct tipc_sock *tsk =tipc_sk (sk);struct net *net =sock_net (sk); -long timeout =CONN_TIMEOUT_DEFAULT ; +long timeout =msecs_to_jiffies (CONN_TIMEOUT_DEFAULT );u32 dnode =tsk_peer_node (tsk);struct sk_buff *skb;
Greg Kroah-Hartman
maintainerPATCH 28/102 net/mlx5e: Fix free peer_flow when refcount is 0
In reply to Greg Kroah-HartmanFrom: Roi Dayan <[email protected]>
commit eb252c3a24fc5856fa62140c2f8269ddce6ce4e5 upstream.
It could be neigh update flow took a refcount on peer flow so sometimes we cannot release peer flow even if parent flow is being freed now.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +5 -2
@@ -1615,8 +1615,11 @@ static void __mlx5e_tc_del_fdb_peer_flowflow_flag_clear (flow,DUP ); -mlx5e_tc_del_fdb_flow (flow->peer_flow->priv, flow->peer_flow); -kfree (flow->peer_flow); +if (refcount_dec_and_test (&flow->peer_flow->refcnt)) { +mlx5e_tc_del_fdb_flow (flow->peer_flow->priv, flow->peer_flow); +kfree (flow->peer_flow); + } + flow->peer_flow =NULL ; }
Greg Kroah-Hartman
maintainerPATCH 29/102 phy: lantiq: vrx200-pcie: fix error return code in ltq_vrx200_pcie_phy_power_on()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
commit 82b5d164415549e74cfa1f9156ffd4463d0a76e2 upstream.
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c +2 -1
@@ -323,7 +323,8 @@ static int ltq_vrx200_pcie_phy_power_on( goto err_disable_pdi_clk;/* Check if we are in "startup ready" status */ -if (ltq_vrx200_pcie_phy_wait_for_pll (phy) !=0 ) + ret =ltq_vrx200_pcie_phy_wait_for_pll (phy); +if (ret) goto err_disable_phy_clk;ltq_vrx200_pcie_phy_apply_workarounds (phy);
Greg Kroah-Hartman
maintainerPATCH 30/102 net: phy: broadcom: Fix RGMII delays configuration for BCM54210E
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
commit fea7fda7f50a6059220f83251e70709e45cc8040 upstream.
Commit 0fc9ae107669 ("net: phy: broadcom: add support for BCM54210E") added support for BCM54210E but also unconditionally cleared the RXC to RXD skew and the TXD to TXC skew, thus only making PHY_INTERFACE_MODE_RGMII a possible configuration. Use bcm54xx_config_clock_delay() which correctly sets the registers depending on the 4 possible PHY interface values that exist for RGMII.
--- drivers/net/phy/broadcom.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/net/phy/broadcom.c +3 -8
@@ -26,18 +26,13 @@ MODULE_DESCRIPTION("Broadcom PHY driver"MODULE_AUTHOR ("Maciej W. Rozycki" );MODULE_LICENSE ("GPL" ); +static int bcm54xx_config_clock_delay (struct phy_device *phydev); +static int bcm54210e_config_init (struct phy_device *phydev) {int val; - val =bcm54xx_auxctl_read (phydev,MII_BCM54XX_AUXCTL_SHDWSEL_MISC ); - val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN ; - val |=MII_BCM54XX_AUXCTL_MISC_WREN ; -bcm54xx_auxctl_write (phydev,MII_BCM54XX_AUXCTL_SHDWSEL_MISC , val); - - val =bcm_phy_read_shadow (phydev,BCM54810_SHD_CLK_CTL ); - val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN ; -bcm_phy_write_shadow (phydev,BCM54810_SHD_CLK_CTL , val); +bcm54xx_config_clock_delay (phydev);if (phydev->dev_flags &PHY_BRCM_EN_MASTER_MODE ) { val =phy_read (phydev,MII_CTRL1000 );
Greg Kroah-Hartman
maintainerPATCH 31/102 phy: ti: gmii-sel: fix mac tx internal delay for rgmii-rxid
In reply to Greg Kroah-HartmanFrom: Grygorii Strashko <[email protected]>
commit 316b429459066215abb50060873ec0832efc4044 upstream.
Now phy-gmii-sel will disable MAC TX internal delay for PHY interface mode "rgmii-rxid" which is incorrect.
Hence, fix it by enabling MAC TX internal delay in the case of "rgmii-rxid" mode.
--- drivers/phy/ti/phy-gmii-sel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ti/phy-gmii-sel.c +1 -1
@@ -69,11 +69,11 @@ static int phy_gmii_sel_mode(struct phybreak ;case PHY_INTERFACE_MODE_RGMII : +case PHY_INTERFACE_MODE_RGMII_RXID : gmii_sel_mode =AM33XX_GMII_SEL_MODE_RGMII ;break ;case PHY_INTERFACE_MODE_RGMII_ID : -case PHY_INTERFACE_MODE_RGMII_RXID :case PHY_INTERFACE_MODE_RGMII_TXID : gmii_sel_mode =AM33XX_GMII_SEL_MODE_RGMII ; rgmii_id =1 ;
Greg Kroah-Hartman
maintainerPATCH 32/102 mt76: mt76u: fix endpoint definition order
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
commit 23cb16d2ccb5f819d7acff602e5a153157bf2884 upstream.
Even if they are not currently used fix BK/BE endpoint definition order.
--- drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76.h +1 -1
@@ -367,8 +367,8 @@ enum mt76u_in_ep {enum mt76u_out_ep {MT_EP_OUT_INBAND_CMD , -MT_EP_OUT_AC_BK ,MT_EP_OUT_AC_BE , +MT_EP_OUT_AC_BK ,MT_EP_OUT_AC_VI ,MT_EP_OUT_AC_VO ,MT_EP_OUT_HCCA ,
Greg Kroah-Hartman
maintainerPATCH 33/102 mt7601u: fix bbp version check in mt7601u_wait_bbp_ready
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
commit 15e14f76f85f4f0eab3b8146e1cd3c58ce272823 upstream.
Fix bbp ready check in mt7601u_wait_bbp_ready. The issue is reported by coverity with the following error:
Logical vs. bitwise operator
The expression's value does not depend on the operands; inadvertent use of the wrong operator is a likely logic error.
Addresses-Coverity-ID: 1309441 ("Logical vs. bitwise operator")
--- drivers/net/wireless/mediatek/mt7601u/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt7601u/phy.c +1 -1
@@ -213,7 +213,7 @@ int mt7601u_wait_bbp_ready(struct mt7601do { val =mt7601u_bbp_rr (dev,MT_BBP_REG_VERSION ); -if (val && ~val) +if (val && val !=0xff )break ; }while (--i);
Greg Kroah-Hartman
maintainerPATCH 34/102 ice: fix stack leakage
In reply to Greg Kroah-HartmanFrom: Jesse Brandeburg <[email protected]>
commit 949375de945f7042df2b6488228a1a2b36e69f35 upstream.
In the case of an invalid virtchannel request the driver would return uninitialized data to the VF from the PF stack which is a bug. Fix by initializing the stack variable earlier in the function before any return paths can be taken.
--- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +1 -2
@@ -1873,8 +1873,8 @@ static int ice_vc_get_stats_msg(struct ienum virtchnl_status_code v_ret =VIRTCHNL_STATUS_SUCCESS ;struct virtchnl_queue_select *vqs = (struct virtchnl_queue_select *)msg; +struct ice_eth_stats stats = {0 };struct ice_pf *pf = vf->pf; -struct ice_eth_stats stats;struct ice_vsi *vsi;if (!test_bit (ICE_VF_STATE_ACTIVE , vf->vf_states)) {
@@ -1893,7 +1893,6 @@ static int ice_vc_get_stats_msg(struct i goto error_param; } -memset (&stats,0 ,sizeof (struct ice_eth_stats ));ice_update_eth_stats (vsi); stats = vsi->eth_stats;
Greg Kroah-Hartman
maintainerPATCH 35/102 s390/pkey: fix memory leak within _copy_apqns_from_user()
In reply to Greg Kroah-HartmanFrom: Heiko Carstens <[email protected]>
commit f9cac4fd8878929c6ebff0bd272317905d77c38a upstream.
--- drivers/s390/crypto/pkey_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/s390/crypto/pkey_api.c +3 -1
@@ -740,8 +740,10 @@ static void *_copy_apqns_from_user(void kapqns =kmalloc (nbytes,GFP_KERNEL );if (!kapqns)return ERR_PTR (-ENOMEM ); -if (copy_from_user (kapqns, uapqns, nbytes)) +if (copy_from_user (kapqns, uapqns, nbytes)) { +kfree (kapqns);return ERR_PTR (-EFAULT ); + } }return kapqns;
Greg Kroah-Hartman
maintainerPATCH 36/102 nfsd: depend on CRYPTO_MD5 for legacy client tracking
In reply to Greg Kroah-HartmanFrom: Patrick Steinhardt <[email protected]>
commit 38a2204f5298620e8a1c3b1dc7b831425106dbc0 upstream.
The legacy client tracking infrastructure of nfsd makes use of MD5 to derive a client's recovery directory name. As the nfsd module doesn't declare any dependency on CRYPTO_MD5, though, it may fail to allocate the hash if the kernel was compiled without it. As a result, generation of client recovery directories will fail with the following error:
NFSD: unable to generate recoverydir name
The explicit dependency on CRYPTO_MD5 was removed as redundant back in 6aaa67b5f3b9 (NFSD: Remove redundant "select" clauses in fs/Kconfig 2008-02-11) as it was already implicitly selected via RPCSEC_GSS_KRB5. This broke when RPCSEC_GSS_KRB5 was made optional for NFSv4 in commit df486a25900f (NFS: Fix the selection of security flavours in Kconfig) at a later point.
Fix the issue by adding back an explicit dependency on CRYPTO_MD5.
--- fs/nfsd/Kconfig | 1 + 1 file changed, 1 insertion(+)
fs/nfsd/Kconfig +1 -0
@@ -73,6 +73,7 @@ config NFSD_V4 select NFSD_V3 select FS_POSIX_ACL select SUNRPC_GSS + select CRYPTO_MD5 select CRYPTO_SHA256 select GRACE_PERIOD help
Greg Kroah-Hartman
maintainerPATCH 37/102 crypto: amcc - restore CRYPTO_AES dependency
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
commit 298b4c604008025b134bc6fccbc4018449945d60 upstream.
This patch restores the CRYPTO_AES dependency. This is necessary since some of the crypto4xx driver provided modes need functioning software fallbacks for AES-CTR/CCM and GCM.
--- drivers/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/Kconfig +1 -0
@@ -333,6 +333,7 @@ config CRYPTO_DEV_PPC4XX depends on PPC && 4xx select CRYPTO_HASH select CRYPTO_AEAD + select CRYPTO_AES select CRYPTO_LIB_AES select CRYPTO_CCM select CRYPTO_CTR
Greg Kroah-Hartman
maintainerPATCH 38/102 crypto: sun4i-ss - fix big endian issues
In reply to Greg Kroah-HartmanFrom: Corentin Labbe <[email protected]>
commit d1d787bcebfe122a5bd443ae565696661e2e9656 upstream.
When testing BigEndian kernel, the sun4i-ss was failling all crypto tests.
This patch fix endian issues with it.
--- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/crypto/sunxi-ss/sun4i-ss-hash.c +11 -10
@@ -175,7 +175,7 @@ static int sun4i_hash(struct ahash_reque*/ unsigned int i =0 , end, fill, min_fill, nwait, nbw =0 , j =0 , todo;unsigned int in_i =0 ; -u32 spaces, rx_cnt =SS_RX_DEFAULT , bf[32 ] = {0 }, wb =0 , v, ivmode =0 ; +u32 spaces, rx_cnt =SS_RX_DEFAULT , bf[32 ] = {0 }, v, ivmode =0 ;struct sun4i_req_ctx *op =ahash_request_ctx (areq);struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq);struct sun4i_tfm_ctx *tfmctx =crypto_ahash_ctx (tfm);
@@ -184,6 +184,7 @@ static int sun4i_hash(struct ahash_requestruct sg_mapping_iter mi;int in_r, err =0 ;size_t copied =0 ; +__le32 wb =0 ; dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x", __func__, crypto_tfm_alg_name(areq->base.tfm),
@@ -395,7 +396,7 @@ hash_final: nbw = op->len -4 * nwait;if (nbw) { - wb = *(u32 *)(op->buf + nwait *4 ); + wb =cpu_to_le32 (*(u32 *)(op->buf + nwait *4 )); wb &=GENMASK ((nbw *8 ) -1 ,0 ); op->byte_count += nbw;
@@ -404,7 +405,7 @@ hash_final:/* write the remaining bytes of the nbw buffer */ wb |= ((1 <<7 ) << (nbw *8 )); - bf[j++] = wb; + bf[j++] =le32_to_cpu (wb);/* * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)
@@ -423,13 +424,13 @@ hash_final:/* write the length of data */ if (op->mode ==SS_OP_SHA1 ) { -__be64 bits =cpu_to_be64 (op->byte_count <<3 ); - bf[j++] =lower_32_bits (bits); - bf[j++] =upper_32_bits (bits); +__be64 *bits = (__be64 *)&bf[j]; + *bits =cpu_to_be64 (op->byte_count <<3 ); + j +=2 ; }else { -__le64 bits = op->byte_count <<3 ; - bf[j++] =lower_32_bits (bits); - bf[j++] =upper_32_bits (bits); +__le64 *bits = (__le64 *)&bf[j]; + *bits =cpu_to_le64 (op->byte_count <<3 ); + j +=2 ; }writesl (ss->base +SS_RXFIFO , bf, j);
@@ -471,7 +472,7 @@ hash_final: } }else {for (i =0 ; i <4 ; i++) { - v =readl (ss->base +SS_MD0 + i *4 ); + v =cpu_to_le32 (readl (ss->base +SS_MD0 + i *4 ));memcpy (areq->result + i *4 , &v,4 ); } }
Greg Kroah-Hartman
maintainerPATCH 39/102 perf map: No need to adjust the long name of modules
In reply to Greg Kroah-HartmanFrom: Arnaldo Carvalho de Melo <[email protected]>
commit f068435d9bb2d825d59e3c101bc579f09315ee01 upstream.
At some point in the past we needed to make sure we would get the long name of modules and not just what we get from /proc/modules, but that need, as described in the cset that introduced the adjustment function:
Without using the buildid-cache:
# lsmod | grep trusted
# insmod trusted.ko
# lsmod | grep trusted
trusted 24576 0
# strace -e open,openat perf probe -m ./trusted.ko key_seal |& grep trusted
openat(AT_FDCWD, "/sys/module/trusted/notes/.note.gnu.build-id", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/module/trusted/notes/.note.gnu.build-id", O_RDONLY) = 7
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.debug/root/trusted.ko/dd3d355d567394d540f527e093e0f64b95879584/probes", O_RDWR|O_CREAT, 0644) = 3
openat(AT_FDCWD, "/usr/lib/debug/root/trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/debug/root/trusted.ko", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/.debug/trusted.ko", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3
openat(AT_FDCWD, "trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, ".debug/trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 4
openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3
probe:key_seal (on key_seal in trusted)
# perf probe -l
probe:key_seal (on key_seal in trusted)
#No attempt at opening '[trusted]'.
Now using the build-id cache:
# rmmod trusted # perf buildid-cache --add ./trusted.ko # insmod trusted.ko # strace -e open,openat perf probe -m ./trusted.ko key_seal |& grep trusted openat(AT_FDCWD, "/sys/module/trusted/notes/.note.gnu.build-id", O_RDONLY) = 4 openat(AT_FDCWD, "/sys/module/trusted/notes/.note.gnu.build-id", O_RDONLY) = 7 openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3 openat(AT_FDCWD, "/root/.debug/root/trusted.ko/dd3d355d567394d540f527e093e0f64b95879584/probes", O_RDWR|O_CREAT, 0644) = 3 openat(AT_FDCWD, "/usr/lib/debug/root/trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/debug/root/trusted.ko", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/root/.debug/trusted.ko", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3 openat(AT_FDCWD, "trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, ".debug/trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "trusted.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3 openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3 openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 4 openat(AT_FDCWD, "/root/trusted.ko", O_RDONLY) = 3 #
Again, no attempt at reading '[trusted]'.
Finally, adding a probe to that function and then using:
[root@quaco ~]# perf trace -e probe_perf:*/max-stack=16/ --max-events=2
0.000 perf/13456 probe_perf:dso__adjust_kmod_long_name(__probe_ip: 5492263)
dso__adjust_kmod_long_name (/home/acme/bin/perf)
machine__process_kernel_mmap_event (/home/acme/bin/perf)
machine__process_mmap_event (/home/acme/bin/perf)
perf_event__process_mmap (/home/acme/bin/perf)
machines__deliver_event (/home/acme/bin/perf)
perf_session__deliver_event (/home/acme/bin/perf)
perf_session__process_event (/home/acme/bin/perf)
process_simple (/home/acme/bin/perf)
reader__process_events (/home/acme/bin/perf)
__perf_session__process_events (/home/acme/bin/perf)
perf_session__process_events (/home/acme/bin/perf)
process_buildids (/home/acme/bin/perf)
record__finish_output (/home/acme/bin/perf)
__cmd_record (/home/acme/bin/perf)
cmd_record (/home/acme/bin/perf)
run_builtin (/home/acme/bin/perf)
0.055 perf/13456 probe_perf:dso__adjust_kmod_long_name(__probe_ip: 5492263)
dso__adjust_kmod_long_name (/home/acme/bin/perf)
machine__process_kernel_mmap_event (/home/acme/bin/perf)
machine__process_mmap_event (/home/acme/bin/perf)
perf_event__process_mmap (/home/acme/bin/perf)
machines__deliver_event (/home/acme/bin/perf)
perf_session__deliver_event (/home/acme/bin/perf)
perf_session__process_event (/home/acme/bin/perf)
process_simple (/home/acme/bin/perf)
reader__process_events (/home/acme/bin/perf)
__perf_session__process_events (/home/acme/bin/perf)
perf_session__process_events (/home/acme/bin/perf)
process_buildids (/home/acme/bin/perf)
record__finish_output (/home/acme/bin/perf)
__cmd_record (/home/acme/bin/perf)
cmd_record (/home/acme/bin/perf)
run_builtin (/home/acme/bin/perf)#
This was the only path I could find using the perf tools that reach at this function, then as of november/2019, if we put a probe in the line where the actuall setting of the dso->long_name is done:
# perf trace -e probe_perf:*
^C[root@quaco ~]
# perf stat -e probe_perf:* -I 2000
2.000404265 0 probe_perf:dso__adjust_kmod_long_name
4.001142200 0 probe_perf:dso__adjust_kmod_long_name
6.001704120 0 probe_perf:dso__adjust_kmod_long_name
8.002398316 0 probe_perf:dso__adjust_kmod_long_name
10.002984010 0 probe_perf:dso__adjust_kmod_long_name
12.003597851 0 probe_perf:dso__adjust_kmod_long_name
14.004113303 0 probe_perf:dso__adjust_kmod_long_name
16.004582773 0 probe_perf:dso__adjust_kmod_long_name
18.005176373 0 probe_perf:dso__adjust_kmod_long_name
20.005801605 0 probe_perf:dso__adjust_kmod_long_name
22.006467540 0 probe_perf:dso__adjust_kmod_long_name
^C 23.683261941 0 probe_perf:dso__adjust_kmod_long_name#
Its not being used at all.
To further test this I used kvm.ko as the offline module, i.e. removed if from the buildid-cache by nuking it completely (rm -rf ~/.debug) and moved it from the normal kernel distro path, removed the modules, stoped the kvm guest, and then installed it manually, etc.
# rmmod kvm-intel
# rmmod kvm
# lsmod | grep kvm
# modprobe kvm-intel
modprobe: ERROR: ctx=0x55d3b1722260 path=/lib/modules/5.3.8-200.fc30.x86_64/kernel/arch/x86/kvm/kvm.ko.xz error=No such file or directory
modprobe: ERROR: ctx=0x55d3b1722260 path=/lib/modules/5.3.8-200.fc30.x86_64/kernel/arch/x86/kvm/kvm.ko.xz error=No such file or directory
modprobe: ERROR: could not insert 'kvm_intel': Unknown symbol in module, or unknown parameter (see dmesg)
# insmod ./kvm.ko
# modprobe kvm-intel
modprobe: ERROR: ctx=0x562f34026260 path=/lib/modules/5.3.8-200.fc30.x86_64/kernel/arch/x86/kvm/kvm.ko.xz error=No such file or directory
modprobe: ERROR: ctx=0x562f34026260 path=/lib/modules/5.3.8-200.fc30.x86_64/kernel/arch/x86/kvm/kvm.ko.xz error=No such file or directory
# lsmod | grep kvm
kvm_intel 299008 0
kvm 765952 1 kvm_intel
irqbypass 16384 1 kvm
#
# perf probe -x ~/bin/perf machine__findnew_module_map:12 mname=m.name:string filename=filename:string 'dso_long_name=map->dso->long_name:string' 'dso_name=map->dso->name:string'
# perf probe -l
probe_perf:machine__findnew_module_map (on machine__findnew_module_map:12@util/machine.c in /home/acme/bin/perf with mname filename dso_long_name dso_name)
# perf record
^C[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 3.416 MB perf.data (33956 samples) ]
# perf trace -e probe_perf:machine*
<SNIP>
6.322 perf/23099 probe_perf:machine__findnew_module_map(__probe_ip: 5492493, mname: "[salsa20_generic]", filename: "/lib/modules/5.3.8-200.fc30.x86_64/kernel/crypto/salsa20_generic.ko.xz", dso_long_name: "/lib/modules/5.3.8-200.fc30.x86_64/kernel/crypto/salsa20_generic.ko.xz", dso_name: "[salsa20_generic]")
6.375 perf/23099 probe_perf:machine__findnew_module_map(__probe_ip: 5492493, mname: "[kvm]", filename: "[kvm]", dso_long_name: "[kvm]", dso_name: "[kvm]")
<SNIP>The filename doesn't come with the path, no point in trying to set the dso->long_name.
[root@quaco ~]# strace -e open,openat perf probe -m ./kvm.ko kvm_apic_local_deliver |& egrep 'open.*kvm' openat(AT_FDCWD, "/sys/module/kvm_intel/notes/.note.gnu.build-id", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/module/kvm/notes/.note.gnu.build-id", O_RDONLY) = 4
openat(AT_FDCWD, "/lib/modules/5.3.8-200.fc30.x86_64/kernel/arch/x86/kvm", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 7 openat(AT_FDCWD, "/sys/module/kvm_intel/notes/.note.gnu.build-id", O_RDONLY) = 8
openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.debug/root/kvm.ko/5955f426cb93f03f30f3e876814be2db80ab0b55/probes", O_RDWR|O_CREAT, 0644) = 3 openat(AT_FDCWD, "/usr/lib/debug/root/kvm.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/debug/root/kvm.ko", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/root/.debug/kvm.ko", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 3
openat(AT_FDCWD, "kvm.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, ".debug/kvm.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "kvm.ko.debug", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 3
openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 4
openat(AT_FDCWD, "/root/kvm.ko", O_RDONLY) = 3
[root@quaco ~]#
--- tools/perf/util/machine.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-)
tools/perf/util/machine.c +1 -26
@@ -767,24 +767,6 @@ int machine__process_ksymbol(struct machreturn machine__process_ksymbol_register (machine, event, sample); } -static void dso__adjust_kmod_long_name (struct dso *dso,const char *filename) -{ -const char *dup_filename; - -if (!filename || !dso || !dso->long_name) -return ; -if (dso->long_name[0 ] !='[' ) -return ; -if (!strchr (filename,'/' )) -return ; - - dup_filename =strdup (filename); -if (!dup_filename) -return ; - -dso__set_long_name (dso, dup_filename, true); -} -struct map *machine__findnew_module_map (struct machine *machine,u64 start,const char *filename) {
@@ -796,15 +778,8 @@ struct map *machine__findnew_module_map(return NULL ; map =map_groups__find_by_name (&machine->kmaps, m.name); -if (map) { -/* -* If the map's dso is an offline module, give dso__load() -* a chance to find the file path of that module by fixing -* long_name. -*/ -dso__adjust_kmod_long_name (map->dso, filename); +if (map) goto out; - } dso =machine__findnew_module_dso (machine, &m, filename);if (dso ==NULL )
Greg Kroah-Hartman
maintainerPATCH 40/102 leds: tlc591xx: update the maximum brightness
In reply to Greg Kroah-HartmanFrom: Jean-Jacques Hiblot <[email protected]>
commit a2cafdfd8cf5ad8adda6c0ce44a59f46431edf02 upstream.
The TLC chips actually offer 257 levels:
- 0: led OFF
- 1-255: Led dimmed is using a PWM. The duty cycle range from 0.4% to 99.6%
- 256: led fully ON
--- drivers/leds/leds-tlc591xx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/leds/leds-tlc591xx.c +4 -3
@@ -13,6 +13,7 @@#include <linux/slab.h> #define TLC591XX_MAX_LEDS 16 +#define TLC591XX_MAX_BRIGHTNESS 256#define TLC591XX_REG_MODE1 0x00#define MODE1_RESPON_ADDR_MASK 0xF0
@@ -112,11 +113,11 @@ tlc591xx_brightness_set(struct led_classstruct tlc591xx_priv *priv = led->priv;int err; -switch (brightness) { +switch ((int )brightness) {case 0 : err =tlc591xx_set_ledout (priv, led,LEDOUT_OFF );break ; -case LED_FULL : +case TLC591XX_MAX_BRIGHTNESS : err =tlc591xx_set_ledout (priv, led,LEDOUT_ON );break ;default :
@@ -157,7 +158,7 @@ tlc591xx_configure(struct device *dev, led->priv = priv; led->led_no = i; led->ldev.brightness_set_blocking = tlc591xx_brightness_set; - led->ldev.max_brightness =LED_FULL ; + led->ldev.max_brightness =TLC591XX_MAX_BRIGHTNESS ; err =led_classdev_register (dev, &led->ldev);if (err <0 ) { dev_err(dev, "couldn't register LED %s\n",
Greg Kroah-Hartman
maintainerPATCH 41/102 soc/tegra: pmc: Fix crashes for hierarchical interrupts
In reply to Greg Kroah-HartmanFrom: Thierry Reding <[email protected]>
commit c9e753767a9c75d2044fb7343950a6a992d34a16 upstream.
Interrupts that don't have an associated wake event or GPIO wake events end up with an associate IRQ chip that is NULL and which causes IRQ code to crash. This is because we don't implicitly set the parent IRQ chip by allocating the interrupt at the parent. However, there really isn't a corresponding interrupt at the parent, so we need to work around this by setting the special no_irq_chip as the IRQ chip for these interrupts.
--- drivers/soc/tegra/pmc.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/soc/tegra/pmc.c +27 -1
@@ -1899,6 +1899,20 @@ static int tegra_pmc_irq_alloc(struct ir event->id, &pmc->irq, pmc); +/* +* GPIOs don't have an equivalent interrupt in the +* parent controller (GIC). However some code, such +* as the one in irq_get_irqchip_state(), require a +* valid IRQ chip to be set. Make sure that's the +* case by passing NULL here, which will install a +* dummy IRQ chip for the interrupt in the parent +* domain. +*/ +if (domain->parent) +irq_domain_set_hwirq_and_chip (domain->parent, + virq,0 ,NULL , +NULL ); +break ; } }
@@ -1908,10 +1922,22 @@ static int tegra_pmc_irq_alloc(struct ir* dummy hardware IRQ number. This is used in the ->irq_set_type() * and ->irq_set_wake() callbacks to return early for these IRQs. */ -if (i == soc->num_wake_events) +if (i == soc->num_wake_events) { err =irq_domain_set_hwirq_and_chip (domain, virq,ULONG_MAX , &pmc->irq, pmc); +/* +* Interrupts without a wake event don't have a corresponding +* interrupt in the parent controller (GIC). Pass NULL for the +* chip here, which causes a dummy IRQ chip to be installed +* for the interrupt in the parent domain, to make this +* explicit. +*/ +if (domain->parent) +irq_domain_set_hwirq_and_chip (domain->parent, virq,0 , +NULL ,NULL ); + } +return err; }
Greg Kroah-Hartman
maintainerPATCH 42/102 soc: qcom: llcc: Name regmaps to avoid collisions
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
commit 2bfd3e7651addcaf48f12d4f11ea9d8fca6c3aa8 upstream.
We'll end up with debugfs collisions if we don't give names to the regmaps created by this driver. Change the name of the config before registering it so we don't collide in debugfs.
--- drivers/soc/qcom/llcc-slice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/qcom/llcc-slice.c +2 -1
@@ -48,7 +48,7 @@static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER ; -static const struct regmap_config llcc_regmap_config = { +static struct regmap_config llcc_regmap_config = { .reg_bits =32 , .reg_stride =4 , .val_bits =32 ,
@@ -323,6 +323,7 @@ static struct regmap *qcom_llcc_init_mmiif (IS_ERR (base))return ERR_CAST (base); + llcc_regmap_config.name = name;return devm_regmap_init_mmio (&pdev->dev, base, &llcc_regmap_config); }
Greg Kroah-Hartman
maintainerPATCH 43/102 soc: renesas: Add missing check for non-zero product register address
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
commit 4194b583c104922c6141d6610bfbce26847959df upstream.
If the DTB for a device with an RZ/A2 SoC lacks a device node for the BSID register, the ID validation code falls back to using a register at address 0x0, which leads to undefined behavior (e.g. reading back a random value).
This could be fixed by letting fam_rza2.reg point to the actual BSID register. However, the hardcoded fallbacks were meant for backwards compatibility with old DTBs only, not for new SoCs. Hence fix this by validating renesas_family.reg before using it.
--- drivers/soc/renesas/renesas-soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/renesas/renesas-soc.c +1 -1
@@ -326,7 +326,7 @@ static int __init renesas_soc_init(void)if (np) { chipid =of_iomap (np,0 );of_node_put (np); - }else if (soc->id) { + }else if (soc->id && family->reg) { chipid =ioremap (family->reg,4 ); }if (chipid) {
Greg Kroah-Hartman
maintainerPATCH 44/102 soc: aspeed: Fix snoop_file_poll()s return type
In reply to Greg Kroah-HartmanFrom: Luc Van Oostenryck <[email protected]>
commit a4e55ccd4392e70f296d12e81b93c6ca96ee21d5 upstream.
snoop_file_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.
Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t.
--- drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/aspeed/aspeed-lpc-snoop.c +2 -2
@@ -97,13 +97,13 @@ static ssize_t snoop_file_read(struct fireturn ret ? ret : copied; } -static unsigned int snoop_file_poll (struct file *file, +static __poll_t snoop_file_poll (struct file *file,struct poll_table_struct *pt) {struct aspeed_lpc_snoop_channel *chan =snoop_file_to_chan (file);poll_wait (file, &chan->wq, pt); -return !kfifo_is_empty (&chan->fifo) ?POLLIN :0 ; +return !kfifo_is_empty (&chan->fifo) ?EPOLLIN :0 ; }static const struct file_operations snoop_fops = {
Greg Kroah-Hartman
maintainerPATCH 45/102 watchdog: sprd: Fix the incorrect pointer getting from driver data
In reply to Greg Kroah-HartmanFrom: Shuiqing Li <[email protected]>
commit 39e68d9e7ab276880980ee5386301fb218202192 upstream.
The device driver data saved the 'struct sprd_wdt' object, it is incorrect to get 'struct watchdog_device' object from the driver data, thus fix it.
--- drivers/watchdog/sprd_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/watchdog/sprd_wdt.c +2 -4
@@ -327,10 +327,9 @@ static int sprd_wdt_probe(struct platforstatic int __maybe_unused sprd_wdt_pm_suspend (struct device *dev) { -struct watchdog_device *wdd =dev_get_drvdata (dev);struct sprd_wdt *wdt =dev_get_drvdata (dev); -if (watchdog_active (wdd)) +if (watchdog_active (&wdt->wdd))sprd_wdt_stop (&wdt->wdd);sprd_wdt_disable (wdt);
@@ -339,7 +338,6 @@ static int __maybe_unused sprd_wdt_pm_sustatic int __maybe_unused sprd_wdt_pm_resume (struct device *dev) { -struct watchdog_device *wdd =dev_get_drvdata (dev);struct sprd_wdt *wdt =dev_get_drvdata (dev);int ret;
@@ -347,7 +345,7 @@ static int __maybe_unused sprd_wdt_pm_reif (ret)return ret; -if (watchdog_active (wdd)) { +if (watchdog_active (&wdt->wdd)) { ret =sprd_wdt_start (&wdt->wdd);if (ret) {sprd_wdt_disable (wdt);
Greg Kroah-Hartman
maintainerPATCH 46/102 ipmi: Fix memory leak in __ipmi_bmc_register
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit 4aa7afb0ee20a97fbf0c5bab3df028d5fb85fdab upstream.
In the impelementation of __ipmi_bmc_register() the allocated memory for bmc should be released in case ida_simple_get() fails.
Message-Id: <[email protected]>
--- drivers/char/ipmi/ipmi_msghandler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/char/ipmi/ipmi_msghandler.c +4 -1
@@ -3039,8 +3039,11 @@ static int __ipmi_bmc_register(struct ip bmc->pdev.name ="ipmi_bmc" ; rv =ida_simple_get (&ipmi_bmc_ida,0 ,0 ,GFP_KERNEL ); -if (rv <0 ) +if (rv <0 ) { +kfree (bmc); goto out; + } + bmc->pdev.dev.driver = &ipmidriver.driver; bmc->pdev.id = rv; bmc->pdev.dev.release = release_bmc_device;
Greg Kroah-Hartman
maintainerPATCH 47/102 sched/core: Further clarify sched_class::set_next_task()
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
commit a0e813f26ebcb25c0b5e504498fbd796cca1a4ba upstream.
It turns out there really is something special to the first set_next_task() invocation. In specific the 'change' pattern really should not cause balance callbacks.
--- kernel/sched/deadline.c | 7 +++++-- kernel/sched/fair.c | 2 +- kernel/sched/idle.c | 4 ++-- kernel/sched/rt.c | 7 +++++-- kernel/sched/sched.h | 4 ++-- kernel/sched/stop_task.c | 4 ++-- 6 files changed, 17 insertions(+), 11 deletions(-)
kernel/sched/deadline.c +5 -2
@@ -1743,13 +1743,16 @@ static void start_hrtick_dl(struct rq *r }#endif -static void set_next_task_dl (struct rq *rq,struct task_struct *p) +static void set_next_task_dl (struct rq *rq,struct task_struct *p,bool first) { p->se.exec_start =rq_clock_task (rq);/* You can't push away the running task */ dequeue_pushable_dl_task (rq, p); +if (!first) +return ; +if (hrtick_enabled (rq))start_hrtick_dl (rq, p);
@@ -1785,7 +1788,7 @@ pick_next_task_dl(struct rq *rq, struct dl_se =pick_next_dl_entity (rq, dl_rq);BUG_ON (!dl_se); p =dl_task_of (dl_se); -set_next_task_dl (rq, p); +set_next_task_dl (rq, p, true);return p; }
kernel/sched/fair.c +1 -1
@@ -10151,7 +10151,7 @@ static void switched_to_fair(struct rq ** This routine is mostly called to set cfs_rq->curr field when a task * migrates between groups/classes. */ -static void set_next_task_fair (struct rq *rq,struct task_struct *p) +static void set_next_task_fair (struct rq *rq,struct task_struct *p,bool first) {struct sched_entity *se = &p->se;
kernel/sched/idle.c +2 -2
@@ -385,7 +385,7 @@ static void put_prev_task_idle(struct rq { } -static void set_next_task_idle (struct rq *rq,struct task_struct *next) +static void set_next_task_idle (struct rq *rq,struct task_struct *next,bool first) {update_idle_core (rq);schedstat_inc (rq->sched_goidle);
@@ -399,7 +399,7 @@ pick_next_task_idle(struct rq *rq, strucif (prev)put_prev_task (rq, prev); -set_next_task_idle (rq, next); +set_next_task_idle (rq, next, true);return next; }
kernel/sched/rt.c +5 -2
@@ -1515,13 +1515,16 @@ static void check_preempt_curr_rt(struct#endif } -static inline void set_next_task_rt (struct rq *rq,struct task_struct *p) +static inline void set_next_task_rt (struct rq *rq,struct task_struct *p,bool first) { p->se.exec_start =rq_clock_task (rq);/* The running task is never eligible for pushing */ dequeue_pushable_task (rq, p); +if (!first) +return ; +/* * If prev task was rt, put_prev_task() has already updated the * utilization. We only care of the case where we start to schedule a
@@ -1575,7 +1578,7 @@ pick_next_task_rt(struct rq *rq, structreturn NULL ; p =_pick_next_task_rt (rq); -set_next_task_rt (rq, p); +set_next_task_rt (rq, p, true);return p; }
kernel/sched/sched.h +2 -2
@@ -1728,7 +1728,7 @@ struct sched_class {struct task_struct *prev, struct rq_flags *rf);void (*put_prev_task)(struct rq *rq,struct task_struct *p); -void (*set_next_task)(struct rq *rq,struct task_struct *p); +void (*set_next_task)(struct rq *rq,struct task_struct *p,bool first);#ifdef CONFIG_SMP int (*balance)(struct rq *rq,struct task_struct *prev,struct rq_flags *rf);
@@ -1780,7 +1780,7 @@ static inline void put_prev_task(structstatic inline void set_next_task (struct rq *rq,struct task_struct *next) {WARN_ON_ONCE (rq->curr != next); - next->sched_class->set_next_task (rq, next); + next->sched_class->set_next_task (rq, next, false); }#ifdef CONFIG_SMP
kernel/sched/stop_task.c +2 -2
@@ -29,7 +29,7 @@ check_preempt_curr_stop(struct rq *rq, s/* we're never preempted */ } -static void set_next_task_stop (struct rq *rq,struct task_struct *stop) +static void set_next_task_stop (struct rq *rq,struct task_struct *stop,bool first) { stop->se.exec_start =rq_clock_task (rq); }
@@ -42,7 +42,7 @@ pick_next_task_stop(struct rq *rq, strucif (!sched_stop_runnable (rq))return NULL ; -set_next_task_stop (rq, rq->stop); +set_next_task_stop (rq, rq->stop, true);return rq->stop; }
Greg Kroah-Hartman
maintainerPATCH 48/102 gpiolib: No need to call gpiochip_remove_pin_ranges() twice
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit 2f4133bb5f14f49a99acf0cc55b84996dbfb4dff upstream.
of_gpiochip_add(), when fails, calls gpiochip_remove_pin_ranges().
ADD:
gpiochip_add_data_with_key() ->
of_gpiochip_add() -> (ERROR path)
gpiochip_remove_pin_ranges()At the same time of_gpiochip_remove() calls exactly the above mentioned function unconditionally and so does gpiochip_remove().
REMOVE:
gpiochip_remove() ->
gpiochip_remove_pin_ranges()
of_gpiochip_remove() ->
gpiochip_remove_pin_ranges()Since gpiochip_remove() calls gpiochip_remove_pin_ranges() unconditionally, we have duplicate call to the same function when it's not necessary.
Move gpiochip_remove_pin_ranges() from of_gpiochip_add() to gpiochip_add() to avoid duplicate calls and be consistent with the explicit call in gpiochip_remove().
Depends-on: f7299d441a4d ("gpio: of: Fix of_gpiochip_add() error path")
--- drivers/gpio/gpiolib-of.c | 5 +---- drivers/gpio/gpiolib.c | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/gpio/gpiolib-of.c +1 -4
@@ -909,16 +909,13 @@ int of_gpiochip_add(struct gpio_chip *chof_node_get (chip->of_node); ret =of_gpiochip_scan_gpios (chip); -if (ret) { +if (ret)of_node_put (chip->of_node); -gpiochip_remove_pin_ranges (chip); - }return ret; }void of_gpiochip_remove (struct gpio_chip *chip) { -gpiochip_remove_pin_ranges (chip);of_node_put (chip->of_node); }
drivers/gpio/gpiolib.c +2 -1
@@ -1452,6 +1452,7 @@ err_remove_of_chip:gpiochip_free_hogs (chip);of_gpiochip_remove (chip); err_free_gpiochip_mask: +gpiochip_remove_pin_ranges (chip);gpiochip_free_valid_mask (chip); err_remove_from_list:spin_lock_irqsave (&gpio_lock, flags);
@@ -1507,8 +1508,8 @@ void gpiochip_remove(struct gpio_chip *c gdev->chip =NULL ;gpiochip_irqchip_remove (chip);acpi_gpiochip_remove (chip); -gpiochip_remove_pin_ranges (chip);of_gpiochip_remove (chip); +gpiochip_remove_pin_ranges (chip);gpiochip_free_valid_mask (chip);/* * We accept no more calls into the driver from this point, so
Greg Kroah-Hartman
maintainerPATCH 49/102 rtw88: fix beaconing mode rsvd_page memory violation issue
In reply to Greg Kroah-HartmanFrom: Yan-Hsuan Chuang <[email protected]>
commit c3594559f49c601d410dee4b767c3536a5535bfd upstream.
When downloading the reserved page, the first page always contains a beacon for the firmware to reference. For non-beaconing modes such as station mode, also put a blank skb with length=1.
And for the beaconing modes, driver will get a real beacon with a length approximate to the page size. But as the beacon is always put at the first page, it does not need a tx_desc, because the TX path will generate one when TXing the reserved page to the hardware. So we could allocate a buffer with a size smaller than the reserved page, when using memcpy() to copy the content of reserved page to the buffer, the over-sized reserved page will violate the kernel memory.
To fix it, add the tx_desc before memcpy() the reserved packets to the buffer, then we can get SKBs with correct length when counting the pages in total. And for page 0, count the extra tx_desc_sz that the TX path will generate. This way, the first beacon that allocated without tx_desc can be counted with the extra tx_desc_sz to get actual pages it requires.
--- drivers/net/wireless/realtek/rtw88/fw.c | 52 ++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 9 deletions(-)
drivers/net/wireless/realtek/rtw88/fw.c +43 -9
@@ -498,9 +498,6 @@ static void rtw_rsvd_page_list_to_buf(st {struct sk_buff *skb = rsvd_pkt->skb; -if (rsvd_pkt->add_txdesc) -rtw_fill_rsvd_page_desc (rtwdev, skb); -if (page >=1 )memcpy (buf + page_margin + page_size * (page -1 ), skb->data, skb->len);
@@ -625,16 +622,37 @@ static u8 *rtw_build_rsvd_page(struct rtlist_for_each_entry (rsvd_pkt, &rtwdev->rsvd_page_list, list) { iter =rtw_get_rsvd_page_skb (hw, vif, rsvd_pkt->type);if (!iter) { -rtw_err (rtwdev,"fail to build rsvd packet\n" ); +rtw_err (rtwdev,"failed to build rsvd packet\n" ); goto release_skb; } + +/* Fill the tx_desc for the rsvd pkt that requires one. +* And iter->len will be added with size of tx_desc_sz. +*/ +if (rsvd_pkt->add_txdesc) +rtw_fill_rsvd_page_desc (rtwdev, iter); + rsvd_pkt->skb = iter; rsvd_pkt->page = total_page; -if (rsvd_pkt->add_txdesc) + +/* Reserved page is downloaded via TX path, and TX path will +* generate a tx_desc at the header to describe length of +* the buffer. If we are not counting page numbers with the +* size of tx_desc added at the first rsvd_pkt (usually a +* beacon, firmware default refer to the first page as the +* content of beacon), we could generate a buffer which size +* is smaller than the actual size of the whole rsvd_page +*/ +if (total_page ==0 ) { +if (rsvd_pkt->type !=RSVD_BEACON ) { +rtw_err (rtwdev,"first page should be a beacon\n" ); + goto release_skb; + } total_page +=rtw_len_to_page (iter->len + tx_desc_sz, page_size); -else + }else { total_page +=rtw_len_to_page (iter->len, page_size); + } }if (total_page > rtwdev->fifo.rsvd_drv_pg_num) {
@@ -647,13 +665,24 @@ static u8 *rtw_build_rsvd_page(struct rtif (!buf) goto release_skb; +/* Copy the content of each rsvd_pkt to the buf, and they should +* be aligned to the pages. +* +* Note that the first rsvd_pkt is a beacon no matter what vif->type. +* And that rsvd_pkt does not require tx_desc because when it goes +* through TX path, the TX path will generate one for it. +*/ list_for_each_entry (rsvd_pkt, &rtwdev->rsvd_page_list, list) {rtw_rsvd_page_list_to_buf (rtwdev, page_size, page_margin, page, buf, rsvd_pkt); - page +=rtw_len_to_page (rsvd_pkt->skb->len, page_size); - } -list_for_each_entry (rsvd_pkt, &rtwdev->rsvd_page_list, list) +if (page ==0 ) + page +=rtw_len_to_page (rsvd_pkt->skb->len + + tx_desc_sz, page_size); +else + page +=rtw_len_to_page (rsvd_pkt->skb->len, page_size); +kfree_skb (rsvd_pkt->skb); + }return buf;
@@ -706,6 +735,11 @@ int rtw_fw_download_rsvd_page(struct rtw goto free; } +/* The last thing is to download the *ONLY* beacon again, because +* the previous tx_desc is to describe the total rsvd page. Download +* the beacon again to replace the TX desc header, and we will get +* a correct tx_desc for the beacon in the rsvd page. +*/ ret =rtw_download_beacon (rtwdev, vif);if (ret) {rtw_err (rtwdev,"failed to download beacon\n" );
Greg Kroah-Hartman
maintainerPATCH 50/102 rtw88: fix error handling when setup efuse info
In reply to Greg Kroah-HartmanFrom: Ping-Ke Shih <[email protected]>
commit f4268729eb1eefe23f6746849c1b5626d9030532 upstream.
Disable efuse if the efuse is enabled when we failed to setup the efuse information, otherwise the hardware will not turn off.
--- drivers/net/wireless/realtek/rtw88/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtw88/main.c +6 -5
@@ -1048,19 +1048,19 @@ static int rtw_chip_efuse_info_setup(str/* power on mac to read efuse */ ret =rtw_chip_efuse_enable (rtwdev);if (ret) - goto out; + goto out_unlock; ret =rtw_parse_efuse_map (rtwdev);if (ret) - goto out; + goto out_disable; ret =rtw_dump_hw_feature (rtwdev);if (ret) - goto out; + goto out_disable; ret =rtw_check_supported_rfe (rtwdev);if (ret) - goto out; + goto out_disable;if (efuse->crystal_cap ==0xff ) efuse->crystal_cap =0 ;
@@ -1087,9 +1087,10 @@ static int rtw_chip_efuse_info_setup(str efuse->ext_pa_5g = efuse->pa_type_5g &BIT (0 ) ?1 :0 ; efuse->ext_lna_2g = efuse->lna_type_5g &BIT (3 ) ?1 :0 ; +out_disable:rtw_chip_efuse_disable (rtwdev); -out: +out_unlock:mutex_unlock (&rtwdev->mutex);return ret; }
Greg Kroah-Hartman
maintainerPATCH 51/102 drm/panfrost: Add missing check for pfdev->regulator
In reply to Greg Kroah-HartmanFrom: Steven Price <[email protected]>
[ Upstream commit 52282163dfa651849e905886845bcf6850dd83c2 ]
When modifying panfrost_devfreq_target() to support a device without a regulator defined I missed the check on the error path. Let's add it.
--- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/panfrost/panfrost_devfreq.c +4 -2
@@ -53,8 +53,10 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,if (err) {dev_err (dev,"Cannot set frequency %lu (%d)\n" , target_rate, err); -regulator_set_voltage (pfdev->regulator, pfdev->devfreq.cur_volt, - pfdev->devfreq.cur_volt); +if (pfdev->regulator) +regulator_set_voltage (pfdev->regulator, + pfdev->devfreq.cur_volt, + pfdev->devfreq.cur_volt);return err; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 52/102 drm: panel-lvds: Potential Oops in probe error handling
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit fb2ee9bf084bcaeff1e5be100decc0eacb4af2d5 ]
The "lvds->backlight" pointer could be NULL in situations where of_parse_phandle() returns NULL. This code is cleaner if we use the managed devm_of_find_backlight() so the clean up is automatic.
--- drivers/gpu/drm/panel/panel-lvds.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
drivers/gpu/drm/panel/panel-lvds.c +4 -17
@@ -197,7 +197,6 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)static int panel_lvds_probe (struct platform_device *pdev) {struct panel_lvds *lvds; -struct device_node *np;int ret; lvds =devm_kzalloc (&pdev->dev,sizeof (*lvds),GFP_KERNEL );
@@ -243,14 +242,9 @@ static int panel_lvds_probe(struct platform_device *pdev)return ret; } - np =of_parse_phandle (lvds->dev->of_node,"backlight" ,0 ); -if (np) { - lvds->backlight =of_find_backlight_by_node (np); -of_node_put (np); - -if (!lvds->backlight) -return -EPROBE_DEFER ; - } + lvds->backlight =devm_of_find_backlight (lvds->dev); +if (IS_ERR (lvds->backlight)) +return PTR_ERR (lvds->backlight);/* * TODO: Handle all power supplies specified in the DT node in a generic
@@ -266,14 +260,10 @@ static int panel_lvds_probe(struct platform_device *pdev) ret =drm_panel_add (&lvds->panel);if (ret <0 ) - goto error; +return ret;dev_set_drvdata (lvds->dev, lvds);return 0 ; - -error: -put_device (&lvds->backlight->dev); -return ret; }static int panel_lvds_remove (struct platform_device *pdev)
@@ -284,9 +274,6 @@ static int panel_lvds_remove(struct platform_device *pdev)panel_lvds_disable (&lvds->panel); -if (lvds->backlight) -put_device (&lvds->backlight->dev); -return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 53/102 drm/amdgpu: remove excess function parameter description
In reply to Greg Kroah-HartmanFrom: yu kuai <[email protected]>
[ Upstream commit d0580c09c65cff211f589a40e08eabc62da463fb ]
Fixes gcc warning:
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:431: warning: Excess function parameter 'sw' description in 'vcn_v2_5_disable_clock_gating' drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:550: warning: Excess function parameter 'sw' description in 'vcn_v2_5_enable_clock_gating'
--- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +0 -2
@@ -423,7 +423,6 @@ static void vcn_v2_5_mc_resume(struct amdgpu_device *adev)* vcn_v2_5_disable_clock_gating - disable VCN clock gating * * @adev: amdgpu_device pointer -* @sw: enable SW clock gating * * Disable clock gating for VCN block */
@@ -542,7 +541,6 @@ static void vcn_v2_5_disable_clock_gating(struct amdgpu_device *adev)* vcn_v2_5_enable_clock_gating - enable VCN clock gating * * @adev: amdgpu_device pointer -* @sw: enable SW clock gating * * Enable clock gating for VCN block */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 54/102 hwrng: omap3-rom - Fix missing clock by probing with device tree
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 0c0ef9ea6f3f0d5979dc7b094b0a184c1a94716b ]
Commit 0ed266d7ae5e ("clk: ti: omap3: cleanup unnecessary clock aliases") removed old omap3 clock framework aliases but caused omap3-rom-rng to stop working with clock not found error.
Based on discussions on the mailing list it was requested by Tero Kristo that it would be best to fix this issue by probing omap3-rom-rng using device tree to provide a proper clk property. The other option would be to add back the missing clock alias, but that does not help moving things forward with removing old legacy platform_data.
Let's also add a proper device tree binding and keep it together with the fix.
--- .../devicetree/bindings/rng/omap3_rom_rng.txt | 27 +++++++++++++++++++ arch/arm/boot/dts/omap3-n900.dts | 6 +++++ arch/arm/mach-omap2/pdata-quirks.c | 12 +-------- drivers/char/hw_random/omap3-rom-rng.c | 17 ++++++++++-- 4 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 Documentation/devicetree/bindings/rng/omap3_rom_rng.txt
Documentation/devicetree/bindings/rng/omap3_rom_rng.txt new file +27 -0
@@ -0,0 +1,27 @@ +OMAP ROM RNG driver binding + +Secure SoCs may provide RNG via secure ROM calls like Nokia N900 does. The +implementation can depend on the SoC secure ROM used. + +- compatible: + Usage: required + Value type: <string> + Definition: must be "nokia,n900-rom-rng" + +- clocks: + Usage: required + Value type: <prop-encoded-array> + Definition: reference to the the RNG interface clock + +- clock-names: + Usage: required + Value type: <stringlist> + Definition: must be "ick" + +Example: + + rom_rng: rng { + compatible = "nokia,n900-rom-rng"; + clocks = <&rng_ick>; + clock-names = "ick"; + };
arch/arm/boot/dts/omap3-n900.dts +6 -0
@@ -155,6 +155,12 @@ pwms = <&pwm9 0 26316 0>; /* 38000 Hz */ }; + rom_rng: rng { + compatible = "nokia,n900-rom-rng"; + clocks = <&rng_ick>; + clock-names = "ick"; + }; + /* controlled (enabled/disabled) directly by bcm2048 and wl1251 */ vctcxo: vctcxo { compatible = "fixed-clock";
arch/arm/mach-omap2/pdata-quirks.c +1 -11
@@ -268,14 +268,6 @@ static void __init am3517_evm_legacy_init(void)am35xx_emac_reset (); } -static struct platform_device omap3_rom_rng_device = { - .name ="omap3-rom-rng" , - .id =-1 , - .dev = { - .platform_data = rx51_secure_rng_call, - }, -}; -static void __init nokia_n900_legacy_init (void ) {hsmmc2_internal_input_clk ();
@@ -291,9 +283,6 @@ static void __init nokia_n900_legacy_init(void)pr_warn ("RX-51: Not enabling ARM errata 430973 workaround\n" );pr_warn ("Thumb binaries may crash randomly without this workaround\n" ); } - -pr_info ("RX-51: Registering OMAP3 HWRNG device\n" ); -platform_device_register (&omap3_rom_rng_device); } }
@@ -538,6 +527,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {OF_DEV_AUXDATA ("ti,davinci_mdio" ,0x5c030000 ,"davinci_mdio.0" ,NULL ),OF_DEV_AUXDATA ("ti,am3517-emac" ,0x5c000000 ,"davinci_emac.0" , &am35xx_emac_pdata), +OF_DEV_AUXDATA ("nokia,n900-rom-rng" ,0 ,NULL , rx51_secure_rng_call),/* McBSP modules with sidetone core */ #if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP) OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata),
drivers/char/hw_random/omap3-rom-rng.c +15 -2
@@ -20,6 +20,8 @@#include <linux/workqueue.h> #include <linux/clk.h> #include <linux/err.h> +#include <linux/of.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #define RNG_RESET 0x01
@@ -86,14 +88,18 @@ static int omap3_rom_rng_read(struct hwrng *rng, void *data, size_t max, bool w)static struct hwrng omap3_rom_rng_ops = { .name ="omap3-rom" , - .read = omap3_rom_rng_read, };static int omap3_rom_rng_probe (struct platform_device *pdev) {int ret =0 ; -pr_info ("initializing\n" ); + omap3_rom_rng_ops.read =of_device_get_match_data (&pdev->dev); +if (!omap3_rom_rng_ops.read) { +dev_err (&pdev->dev,"missing rom code handler\n" ); + +return -ENODEV ; + } omap3_rom_rng_call = pdev->dev.platform_data;if (!omap3_rom_rng_call) {
@@ -126,9 +132,16 @@ static int omap3_rom_rng_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id omap_rom_rng_match[] = { + { .compatible ="nokia,n900-rom-rng" , .data = omap3_rom_rng_read, }, + {/* sentinel */ }, +}; +MODULE_DEVICE_TABLE (of, omap_rom_rng_match); +static struct platform_driver omap3_rom_rng_driver = { .driver = { .name ="omap3-rom-rng" , + .of_match_table = omap_rom_rng_match, }, .probe = omap3_rom_rng_probe, .remove = omap3_rom_rng_remove,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 55/102 dpaa2-eth: Fix minor bug in ethtool stats reporting
In reply to Greg Kroah-HartmanFrom: Ioana Radulescu <[email protected]>
[ Upstream commit 4b177f065e7ec37399b18e18412a8c7b75f8f299 ]
Don't print error message for a successful return value.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c +1 -1
@@ -216,7 +216,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,if (err == -EINVAL )/* Older firmware versions don't support all pages */ memset (&dpni_stats,0 ,sizeof (dpni_stats)); -else +else if (err)netdev_warn (net_dev,"dpni_get_stats(%d) failed\n" , j); num_cnt = dpni_stats_page_size[j] /sizeof (u64);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 56/102 drm/rockchip: Round up _before_ giving to the clock framework
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 287422a95fe28e05c1952de0472e0dfdffa6caae ]
I'm embarassed to say that even though I've touched vop_crtc_mode_fixup() twice and I swear I tested it, there's still a stupid glaring bug in it. Specifically, on veyron_minnie (with all the latest display timings) we want to be setting our pixel clock to 66,666,666.67 Hz and we tell userspace that's what we set, but we're actually choosing 66,000,000 Hz. This is confirmed by looking at the clock tree.
The problem is that in drm_display_mode_from_videomode() we convert from Hz to kHz with:
dmode->clock = vm->pixelclock / 1000;
...and drm_display_mode_from_videomode() is called from panel-simple when we have an "override_mode" like we do on veyron_minnie. See commit 123643e5c40a ("ARM: dts: rockchip: Specify rk3288-veyron-minnie's display timings").
...so when the device tree specifies a clock of 66666667 for the panel then DRM translates that to 66666000. The clock framework will always pick a clock that is _lower_ than the one requested, so it will refuse to pick 66666667 and we'll end up at 66000000.
While we could try to fix drm_display_mode_from_videomode() to round to the nearest kHz and it would fix our problem, it wouldn't help if the clock we actually needed was 60,000,001 Hz. We could alternatively have DRM always round up, but maybe this would break someone else who already baked in the assumption that DRM rounds down. Specifically note that clock drivers are not consistent about whether they round up or round down when you call clk_set_rate(). We know how Rockchip's clock driver works, but (for instance) you can see that on most Qualcomm clocks the default is clk_rcg2_ops which rounds up.
Let's solve this by just adding 999 Hz before calling clk_round_rate(). This should be safe and work everywhere. As discussed in more detail in comments in the commit, Rockchip's PLLs are configured in a way that there shouldn't be another PLL setting that is only a few kHz off so we won't get mixed up.
NOTE: if this is picked to stable, it's probably easiest to first pick commit 527e4ca3b6d1 ("drm/rockchip: Base adjustments of the mode based on prev adjustments") which shouldn't hurt in stable.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 37 +++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +34 -3
@@ -1040,10 +1040,41 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) {struct vop *vop =to_vop (crtc); +unsigned long rate; - adjusted_mode->clock = -DIV_ROUND_UP (clk_round_rate (vop->dclk, - adjusted_mode->clock *1000 ),1000 ); +/* +* Clock craziness. +* +* Key points: +* +* - DRM works in in kHz. +* - Clock framework works in Hz. +* - Rockchip's clock driver picks the clock rate that is the +* same _OR LOWER_ than the one requested. +* +* Action plan: +* +* 1. When DRM gives us a mode, we should add 999 Hz to it. That way +* if the clock we need is 60000001 Hz (~60 MHz) and DRM tells us to +* make 60000 kHz then the clock framework will actually give us +* the right clock. +* +* NOTE: if the PLL (maybe through a divider) could actually make +* a clock rate 999 Hz higher instead of the one we want then this +* could be a problem. Unfortunately there's not much we can do +* since it's baked into DRM to use kHz. It shouldn't matter in +* practice since Rockchip PLLs are controlled by tables and +* even if there is a divider in the middle I wouldn't expect PLL +* rates in the table that are just a few kHz different. +* +* 2. Get the clock framework to round the rate for us to tell us +* what it will actually make. +* +* 3. Store the rounded up rate so that we don't need to worry about +* this in the actual clk_set_rate(). +*/ + rate =clk_round_rate (vop->dclk, adjusted_mode->clock *1000 +999 ); + adjusted_mode->clock =DIV_ROUND_UP (rate,1000 );return true; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 57/102 software node: Get reference to parent swnode in get_parent op
In reply to Greg Kroah-HartmanFrom: Sakari Ailus <[email protected]>
[ Upstream commit 51c100a651a471fcb8ead1ecc1224471eb0d61b9 ]
The software_node_get_parent() returned a pointer to the parent swnode, but did not take a reference to it, leading the caller to put a reference that was not taken. Take that reference now.
--- drivers/base/swnode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/base/swnode.c +4 -1
@@ -520,7 +520,10 @@ software_node_get_parent(const struct fwnode_handle *fwnode) {struct swnode *swnode =to_swnode (fwnode); -return swnode ? (swnode->parent ? &swnode->parent->fwnode :NULL ) :NULL ; +if (!swnode || !swnode->parent) +return NULL ; + +return fwnode_handle_get (&swnode->parent->fwnode); } static struct fwnode_handle *
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 58/102 PCI: mobiveil: Fix csr_read()/write() build issue
In reply to Greg Kroah-HartmanFrom: Kefeng Wang <[email protected]>
[ Upstream commit 4906c05b87d44c19b225935e24d62e4480ca556d ]
RISCV has csr_read()/write() macros in arch/riscv/include/asm/csr.h.
The same function naming is used in the PCI mobiveil driver thus causing build error.
Rename csr_[read,write][l,] to mobiveil_csr_read()/write() to fix it.
drivers/pci/controller/pcie-mobiveil.c:238:69: error: macro "csr_read" passed 3 arguments, but takes just 1
static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size)
drivers/pci/controller/pcie-mobiveil.c:253:80: error: macro "csr_write" passed 4 arguments, but takes just 2
static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size)
--- drivers/pci/controller/pcie-mobiveil.c | 119 +++++++++++++------------ 1 file changed, 62 insertions(+), 57 deletions(-)
drivers/pci/controller/pcie-mobiveil.c +62 -57
@@ -235,7 +235,7 @@ static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val)return PCIBIOS_SUCCESSFUL ; } -static u32 csr_read (struct mobiveil_pcie *pcie,u32 off,size_t size) +static u32 mobiveil_csr_read (struct mobiveil_pcie *pcie,u32 off,size_t size) {void *addr;u32 val;
@@ -250,7 +250,8 @@ static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size)return val; } -static void csr_write (struct mobiveil_pcie *pcie,u32 val,u32 off,size_t size) +static void mobiveil_csr_write (struct mobiveil_pcie *pcie,u32 val,u32 off, +size_t size) {void *addr;int ret;
@@ -262,19 +263,19 @@ static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size)dev_err (&pcie->pdev->dev,"write CSR address failed\n" ); } -static u32 csr_readl (struct mobiveil_pcie *pcie,u32 off) +static u32 mobiveil_csr_readl (struct mobiveil_pcie *pcie,u32 off) { -return csr_read (pcie, off,0x4 ); +return mobiveil_csr_read (pcie, off,0x4 ); } -static void csr_writel (struct mobiveil_pcie *pcie,u32 val,u32 off) +static void mobiveil_csr_writel (struct mobiveil_pcie *pcie,u32 val,u32 off) { -csr_write (pcie, val, off,0x4 ); +mobiveil_csr_write (pcie, val, off,0x4 ); }static bool mobiveil_pcie_link_up (struct mobiveil_pcie *pcie) { -return (csr_readl (pcie,LTSSM_STATUS ) & +return (mobiveil_csr_readl (pcie,LTSSM_STATUS ) <SSM_STATUS_L0_MASK ) ==LTSSM_STATUS_L0 ; }
@@ -323,7 +324,7 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus,PCI_SLOT (devfn) <<PAB_DEVICE_SHIFT |PCI_FUNC (devfn) <<PAB_FUNCTION_SHIFT ; -csr_writel (pcie, value,PAB_AXI_AMAP_PEX_WIN_L (WIN_NUM_0 )); +mobiveil_csr_writel (pcie, value,PAB_AXI_AMAP_PEX_WIN_L (WIN_NUM_0 ));return pcie->config_axi_slave_base + where; }
@@ -353,13 +354,14 @@ static void mobiveil_pcie_isr(struct irq_desc *desc)chained_irq_enter (chip, desc);/* read INTx status */ - val =csr_readl (pcie,PAB_INTP_AMBA_MISC_STAT ); - mask =csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); + val =mobiveil_csr_readl (pcie,PAB_INTP_AMBA_MISC_STAT ); + mask =mobiveil_csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); intr_status = val & mask;/* Handle INTx */ if (intr_status &PAB_INTP_INTX_MASK ) { - shifted_status =csr_readl (pcie,PAB_INTP_AMBA_MISC_STAT ); + shifted_status =mobiveil_csr_readl (pcie, +PAB_INTP_AMBA_MISC_STAT ); shifted_status &=PAB_INTP_INTX_MASK ; shifted_status >>=PAB_INTX_START ; do {
@@ -373,12 +375,13 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) bit);/* clear interrupt handled */ -csr_writel (pcie,1 << (PAB_INTX_START + bit), -PAB_INTP_AMBA_MISC_STAT ); +mobiveil_csr_writel (pcie, +1 << (PAB_INTX_START + bit), +PAB_INTP_AMBA_MISC_STAT ); } - shifted_status =csr_readl (pcie, -PAB_INTP_AMBA_MISC_STAT ); + shifted_status =mobiveil_csr_readl (pcie, +PAB_INTP_AMBA_MISC_STAT ); shifted_status &=PAB_INTP_INTX_MASK ; shifted_status >>=PAB_INTX_START ; }while (shifted_status !=0 );
@@ -413,7 +416,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) }/* Clear the interrupt status */ -csr_writel (pcie, intr_status,PAB_INTP_AMBA_MISC_STAT ); +mobiveil_csr_writel (pcie, intr_status,PAB_INTP_AMBA_MISC_STAT );chained_irq_exit (chip, desc); }
@@ -474,24 +477,24 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num,return ; } - value =csr_readl (pcie,PAB_PEX_AMAP_CTRL (win_num)); + value =mobiveil_csr_readl (pcie,PAB_PEX_AMAP_CTRL (win_num)); value &= ~(AMAP_CTRL_TYPE_MASK <<AMAP_CTRL_TYPE_SHIFT |WIN_SIZE_MASK ); value |= type <<AMAP_CTRL_TYPE_SHIFT |1 <<AMAP_CTRL_EN_SHIFT | (lower_32_bits (size64) &WIN_SIZE_MASK ); -csr_writel (pcie, value,PAB_PEX_AMAP_CTRL (win_num)); +mobiveil_csr_writel (pcie, value,PAB_PEX_AMAP_CTRL (win_num)); -csr_writel (pcie,upper_32_bits (size64), -PAB_EXT_PEX_AMAP_SIZEN (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (size64), +PAB_EXT_PEX_AMAP_SIZEN (win_num)); -csr_writel (pcie,lower_32_bits (cpu_addr), -PAB_PEX_AMAP_AXI_WIN (win_num)); -csr_writel (pcie,upper_32_bits (cpu_addr), -PAB_EXT_PEX_AMAP_AXI_WIN (win_num)); +mobiveil_csr_writel (pcie,lower_32_bits (cpu_addr), +PAB_PEX_AMAP_AXI_WIN (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (cpu_addr), +PAB_EXT_PEX_AMAP_AXI_WIN (win_num)); -csr_writel (pcie,lower_32_bits (pci_addr), -PAB_PEX_AMAP_PEX_WIN_L (win_num)); -csr_writel (pcie,upper_32_bits (pci_addr), -PAB_PEX_AMAP_PEX_WIN_H (win_num)); +mobiveil_csr_writel (pcie,lower_32_bits (pci_addr), +PAB_PEX_AMAP_PEX_WIN_L (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (pci_addr), +PAB_PEX_AMAP_PEX_WIN_H (win_num)); pcie->ib_wins_configured++; }
@@ -515,27 +518,29 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num,* program Enable Bit to 1, Type Bit to (00) base 2, AXI Window Size Bit * to 4 KB in PAB_AXI_AMAP_CTRL register */ - value =csr_readl (pcie,PAB_AXI_AMAP_CTRL (win_num)); + value =mobiveil_csr_readl (pcie,PAB_AXI_AMAP_CTRL (win_num)); value &= ~(WIN_TYPE_MASK <<WIN_TYPE_SHIFT |WIN_SIZE_MASK ); value |=1 <<WIN_ENABLE_SHIFT | type <<WIN_TYPE_SHIFT | (lower_32_bits (size64) &WIN_SIZE_MASK ); -csr_writel (pcie, value,PAB_AXI_AMAP_CTRL (win_num)); +mobiveil_csr_writel (pcie, value,PAB_AXI_AMAP_CTRL (win_num)); -csr_writel (pcie,upper_32_bits (size64),PAB_EXT_AXI_AMAP_SIZE (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (size64), +PAB_EXT_AXI_AMAP_SIZE (win_num));/* * program AXI window base with appropriate value in * PAB_AXI_AMAP_AXI_WIN0 register */ -csr_writel (pcie,lower_32_bits (cpu_addr) & (~AXI_WINDOW_ALIGN_MASK ), -PAB_AXI_AMAP_AXI_WIN (win_num)); -csr_writel (pcie,upper_32_bits (cpu_addr), -PAB_EXT_AXI_AMAP_AXI_WIN (win_num)); +mobiveil_csr_writel (pcie, +lower_32_bits (cpu_addr) & (~AXI_WINDOW_ALIGN_MASK ), +PAB_AXI_AMAP_AXI_WIN (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (cpu_addr), +PAB_EXT_AXI_AMAP_AXI_WIN (win_num)); -csr_writel (pcie,lower_32_bits (pci_addr), -PAB_AXI_AMAP_PEX_WIN_L (win_num)); -csr_writel (pcie,upper_32_bits (pci_addr), -PAB_AXI_AMAP_PEX_WIN_H (win_num)); +mobiveil_csr_writel (pcie,lower_32_bits (pci_addr), +PAB_AXI_AMAP_PEX_WIN_L (win_num)); +mobiveil_csr_writel (pcie,upper_32_bits (pci_addr), +PAB_AXI_AMAP_PEX_WIN_H (win_num)); pcie->ob_wins_configured++; }
@@ -579,42 +584,42 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie)struct resource_entry *win;/* setup bus numbers */ - value =csr_readl (pcie,PCI_PRIMARY_BUS ); + value =mobiveil_csr_readl (pcie,PCI_PRIMARY_BUS ); value &=0xff000000 ; value |=0x00ff0100 ; -csr_writel (pcie, value,PCI_PRIMARY_BUS ); +mobiveil_csr_writel (pcie, value,PCI_PRIMARY_BUS );/* * program Bus Master Enable Bit in Command Register in PAB Config * Space */ - value =csr_readl (pcie,PCI_COMMAND ); + value =mobiveil_csr_readl (pcie,PCI_COMMAND ); value |=PCI_COMMAND_IO |PCI_COMMAND_MEMORY |PCI_COMMAND_MASTER ; -csr_writel (pcie, value,PCI_COMMAND ); +mobiveil_csr_writel (pcie, value,PCI_COMMAND );/* * program PIO Enable Bit to 1 (and PEX PIO Enable to 1) in PAB_CTRL * register */ - pab_ctrl =csr_readl (pcie,PAB_CTRL ); + pab_ctrl =mobiveil_csr_readl (pcie,PAB_CTRL ); pab_ctrl |= (1 <<AMBA_PIO_ENABLE_SHIFT ) | (1 <<PEX_PIO_ENABLE_SHIFT ); -csr_writel (pcie, pab_ctrl,PAB_CTRL ); +mobiveil_csr_writel (pcie, pab_ctrl,PAB_CTRL ); -csr_writel (pcie, (PAB_INTP_INTX_MASK |PAB_INTP_MSI_MASK ), -PAB_INTP_AMBA_MISC_ENB ); +mobiveil_csr_writel (pcie, (PAB_INTP_INTX_MASK |PAB_INTP_MSI_MASK ), +PAB_INTP_AMBA_MISC_ENB );/* * program PIO Enable Bit to 1 and Config Window Enable Bit to 1 in * PAB_AXI_PIO_CTRL Register */ - value =csr_readl (pcie,PAB_AXI_PIO_CTRL ); + value =mobiveil_csr_readl (pcie,PAB_AXI_PIO_CTRL ); value |=APIO_EN_MASK ; -csr_writel (pcie, value,PAB_AXI_PIO_CTRL ); +mobiveil_csr_writel (pcie, value,PAB_AXI_PIO_CTRL );/* Enable PCIe PIO master */ - value =csr_readl (pcie,PAB_PEX_PIO_CTRL ); + value =mobiveil_csr_readl (pcie,PAB_PEX_PIO_CTRL ); value |=1 <<PIO_ENABLE_SHIFT ; -csr_writel (pcie, value,PAB_PEX_PIO_CTRL ); +mobiveil_csr_writel (pcie, value,PAB_PEX_PIO_CTRL );/* * we'll program one outbound window for config reads and
@@ -647,10 +652,10 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) }/* fixup for PCIe class register */ - value =csr_readl (pcie,PAB_INTP_AXI_PIO_CLASS ); + value =mobiveil_csr_readl (pcie,PAB_INTP_AXI_PIO_CLASS ); value &=0xff ; value |= (PCI_CLASS_BRIDGE_PCI <<16 ); -csr_writel (pcie, value,PAB_INTP_AXI_PIO_CLASS ); +mobiveil_csr_writel (pcie, value,PAB_INTP_AXI_PIO_CLASS );/* setup MSI hardware registers */ mobiveil_pcie_enable_msi (pcie);
@@ -668,9 +673,9 @@ static void mobiveil_mask_intx_irq(struct irq_data *data) pcie =irq_desc_get_chip_data (desc); mask =1 << ((data->hwirq +PAB_INTX_START ) -1 );raw_spin_lock_irqsave (&pcie->intx_mask_lock, flags); - shifted_val =csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); + shifted_val =mobiveil_csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); shifted_val &= ~mask; -csr_writel (pcie, shifted_val,PAB_INTP_AMBA_MISC_ENB ); +mobiveil_csr_writel (pcie, shifted_val,PAB_INTP_AMBA_MISC_ENB );raw_spin_unlock_irqrestore (&pcie->intx_mask_lock, flags); }
@@ -684,9 +689,9 @@ static void mobiveil_unmask_intx_irq(struct irq_data *data) pcie =irq_desc_get_chip_data (desc); mask =1 << ((data->hwirq +PAB_INTX_START ) -1 );raw_spin_lock_irqsave (&pcie->intx_mask_lock, flags); - shifted_val =csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); + shifted_val =mobiveil_csr_readl (pcie,PAB_INTP_AMBA_MISC_ENB ); shifted_val |= mask; -csr_writel (pcie, shifted_val,PAB_INTP_AMBA_MISC_ENB ); +mobiveil_csr_writel (pcie, shifted_val,PAB_INTP_AMBA_MISC_ENB );raw_spin_unlock_irqrestore (&pcie->intx_mask_lock, flags); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 59/102 drm: rcar_lvds: Fix color mismatches on R-Car H2 ES2.0 and later
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 3986457110a054466bf02f9c4a85aa2bba96177b ]
Commit 5cca30ebe089be23 ("drm/rcar-du: Add LVDS_LANES quirk") states that LVDS lanes 1 and 3 are inverted on R-Car H2 ES1 only, and that the problem has been fixed in newer revisions.
However, the code didn't take into account the actual hardware revision, thus applying the quirk also on newer hardware revisions, causing green color reversals.
Fix this by applying the quirk when running on R-Car H2 ES1.x only.
--- drivers/gpu/drm/rcar-du/rcar_lvds.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
drivers/gpu/drm/rcar-du/rcar_lvds.c +21 -7
@@ -16,6 +16,7 @@#include <linux/of_graph.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include <linux/sys_soc.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h>
@@ -842,8 +843,23 @@ static int rcar_lvds_get_clocks(struct rcar_lvds *lvds)return 0 ; } +static const struct rcar_lvds_device_info rcar_lvds_r8a7790es1_info = { + .gen =2 , + .quirks =RCAR_LVDS_QUIRK_LANES , + .pll_setup = rcar_lvds_pll_setup_gen2, +}; + +static const struct soc_device_attribute lvds_quirk_matches[] = { + { + .soc_id ="r8a7790" , .revision ="ES1.*" , + .data = &rcar_lvds_r8a7790es1_info, + }, + {/* sentinel */ } +}; +static int rcar_lvds_probe (struct platform_device *pdev) { +const struct soc_device_attribute *attr;struct rcar_lvds *lvds;struct resource *mem;int ret;
@@ -857,6 +873,10 @@ static int rcar_lvds_probe(struct platform_device *pdev) lvds->dev = &pdev->dev; lvds->info =of_device_get_match_data (&pdev->dev); + attr =soc_device_match (lvds_quirk_matches); +if (attr) + lvds->info = attr->data; + ret =rcar_lvds_parse_dt (lvds);if (ret <0 )return ret;
@@ -893,12 +913,6 @@ static const struct rcar_lvds_device_info rcar_lvds_gen2_info = { .pll_setup = rcar_lvds_pll_setup_gen2, }; -static const struct rcar_lvds_device_info rcar_lvds_r8a7790_info = { - .gen =2 , - .quirks =RCAR_LVDS_QUIRK_LANES , - .pll_setup = rcar_lvds_pll_setup_gen2, -}; -static const struct rcar_lvds_device_info rcar_lvds_gen3_info = { .gen =3 , .quirks =RCAR_LVDS_QUIRK_PWD ,
@@ -930,7 +944,7 @@ static const struct of_device_id rcar_lvds_of_table[] = { { .compatible = "renesas,r8a7744-lvds", .data = &rcar_lvds_gen2_info }, { .compatible = "renesas,r8a774a1-lvds", .data = &rcar_lvds_gen3_info }, { .compatible = "renesas,r8a774c0-lvds", .data = &rcar_lvds_r8a77990_info }, - { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_r8a7790_info }, + { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_gen2_info }, { .compatible = "renesas,r8a7791-lvds", .data = &rcar_lvds_gen2_info }, { .compatible = "renesas,r8a7793-lvds", .data = &rcar_lvds_gen2_info }, { .compatible = "renesas,r8a7795-lvds", .data = &rcar_lvds_gen3_info },
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 60/102 net: netsec: Correct dma sync for XDP_TX frames
In reply to Greg Kroah-HartmanFrom: Ilias Apalodimas <[email protected]>
[ Upstream commit d9496f3ecfe4823c1e12aecbcc29220147fa012c ]
bpf_xdp_adjust_head() can change the frame boundaries. Account for the potential shift properly by calculating the new offset before syncing the buffer to the device for XDP_TX
--- drivers/net/ethernet/socionext/netsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/socionext/netsec.c +2 -2
@@ -847,8 +847,8 @@ static u32 netsec_xdp_queue_one(struct netsec_priv *priv,enum dma_data_direction dma_dir =page_pool_get_dma_dir (rx_ring->page_pool); - dma_handle =page_pool_get_dma_addr (page) + -NETSEC_RXBUF_HEADROOM ; + dma_handle =page_pool_get_dma_addr (page) + xdpf->headroom + +sizeof (*xdpf);dma_sync_single_for_device (priv->dev, dma_handle, xdpf->len, dma_dir); tx_desc.buf_type =TYPE_NETSEC_XDP_TX ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 61/102 ACPI: platform: Unregister stale platform devices
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit cb0701acfa7e3fe9e919cf2aa2aa939b7fd603c2 ]
When commit 68bdb6773289 ("ACPI: add support for ACPI reconfiguration notifiers") introduced reconfiguration notifiers, it missed the point that the ACPI table, which might be loaded and then unloaded via ConfigFS, could contain devices that were not enumerated by their parents.
In such cases, the stale platform device is dangling in the system while the rest of the devices from the same table are already gone.
Introduce acpi_platform_device_remove_notify() notifier that, in similar way to I²C or SPI buses, unregisters the platform devices on table removal event.
Depends-on: 00500147cbd3 ("drivers: Introduce device lookup variants by ACPI_COMPANION device")
--- drivers/acpi/acpi_platform.c | 43 ++++++++++++++++++++++++++++++++++++ drivers/acpi/scan.c | 1 + 2 files changed, 44 insertions(+)
drivers/acpi/acpi_platform.c +43 -0
@@ -31,6 +31,44 @@ static const struct acpi_device_id forbidden_id_list[] = { {"", 0}, }; +static struct platform_device *acpi_platform_device_find_by_companion (struct acpi_device *adev) +{ +struct device *dev; + + dev =bus_find_device_by_acpi_dev (&platform_bus_type, adev); +return dev ?to_platform_device (dev) :NULL ; +} + +static int acpi_platform_device_remove_notify (struct notifier_block *nb, +unsigned long value,void *arg) +{ +struct acpi_device *adev = arg; +struct platform_device *pdev; + +switch (value) { +case ACPI_RECONFIG_DEVICE_ADD : +/* Nothing to do here */ +break ; +case ACPI_RECONFIG_DEVICE_REMOVE : +if (!acpi_device_enumerated (adev)) +break ; + + pdev =acpi_platform_device_find_by_companion (adev); +if (!pdev) +break ; + +platform_device_unregister (pdev); +put_device (&pdev->dev); +break ; + } + +return NOTIFY_OK ; +} + +static struct notifier_block acpi_platform_notifier = { + .notifier_call = acpi_platform_device_remove_notify, +}; +static void acpi_platform_fill_resource (struct acpi_device *adev,const struct resource *src,struct resource *dest) {
@@ -130,3 +168,8 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,return pdev; }EXPORT_SYMBOL_GPL (acpi_create_platform_device); + +void __init acpi_platform_init (void ) +{ +acpi_reconfig_notifier_register (&acpi_platform_notifier); +}
drivers/acpi/scan.c +1 -0
@@ -2174,6 +2174,7 @@ int __init acpi_scan_init(void)acpi_pci_root_init ();acpi_pci_link_init ();acpi_processor_init (); +acpi_platform_init ();acpi_lpss_init ();acpi_apd_init ();acpi_cmos_rtc_init ();
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 62/102 pwm: sun4i: Fix incorrect calculation of duty_cycle/period
In reply to Greg Kroah-HartmanFrom: Ondrej Jirman <[email protected]>
[ Upstream commit 50cc7e3e4f26e3bf5ed74a8d061195c4d2161b8b ]
Since 5.4-rc1, pwm_apply_state calls ->get_state after ->apply if available, and this revealed an issue with integer precision when calculating duty_cycle and period for the currently set state in ->get_state callback.
This issue manifested in broken backlight on several Allwinner based devices.
Previously this worked, because ->apply updated the passed state directly.
--- drivers/pwm/pwm-sun4i.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-sun4i.c +2 -2
@@ -137,10 +137,10 @@ static void sun4i_pwm_get_state(struct pwm_chip *chip, val =sun4i_pwm_readl (sun4i_pwm,PWM_CH_PRD (pwm->hwpwm)); - tmp = prescaler *NSEC_PER_SEC *PWM_REG_DTY (val); + tmp = (u64 )prescaler *NSEC_PER_SEC *PWM_REG_DTY (val); state->duty_cycle =DIV_ROUND_CLOSEST_ULL (tmp, clk_rate); - tmp = prescaler *NSEC_PER_SEC *PWM_REG_PRD (val); + tmp = (u64 )prescaler *NSEC_PER_SEC *PWM_REG_PRD (val); state->period =DIV_ROUND_CLOSEST_ULL (tmp, clk_rate); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 63/102 regulator: bd70528: Add MODULE_ALIAS to allow module auto loading
In reply to Greg Kroah-HartmanFrom: Matti Vaittinen <[email protected]>
[ Upstream commit 55d5f62c3fa005a6a8010363d7d1855909ceefbc ]
The bd70528 regulator driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for regulators is added.
--- drivers/regulator/bd70528-regulator.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/bd70528-regulator.c +1 -0
@@ -285,3 +285,4 @@ module_platform_driver(bd70528_regulator);MODULE_AUTHOR ("Matti Vaittinen <[email protected]>" );MODULE_DESCRIPTION ("BD70528 voltage regulator driver" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:bd70528-pmic" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 64/102 drm/amdgpu/vi: silence an uninitialized variable warning
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 4ff17a1df7d550257972a838220a8af4611c8f2c ]
Smatch complains that we need to initialized "*cap" otherwise it can lead to an uninitialized variable bug in the caller. This seems like a reasonable warning and it doesn't hurt to silence it at least.
drivers/gpu/drm/amd/amdgpu/vi.c:767 vi_asic_reset_method() error: uninitialized symbol 'baco_reset'.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -0
@@ -1421,6 +1421,7 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap) {struct pp_hwmgr *hwmgr = handle; + *cap = false;if (!hwmgr)return -EINVAL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 65/102 power: supply: bd70528: Add MODULE_ALIAS to allow module auto loading
In reply to Greg Kroah-HartmanFrom: Matti Vaittinen <[email protected]>
[ Upstream commit 9480029fe5c24d482efad38dc631bd555fc7afe2 ]
The bd70528 charger driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for charger is added.
--- drivers/power/supply/bd70528-charger.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/supply/bd70528-charger.c +1 -0
@@ -741,3 +741,4 @@ module_platform_driver(bd70528_power);MODULE_AUTHOR ("Matti Vaittinen <[email protected]>" );MODULE_DESCRIPTION ("BD70528 power-supply driver" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platform:bd70528-power" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 66/102 firmware: imx: Remove call to devm_of_platform_populate
In reply to Greg Kroah-HartmanFrom: Daniel Baluta <[email protected]>
[ Upstream commit 0e4e8cc30a2940c57448af1376e40d3c0996fb29 ]
IMX DSP device is created by SOF layer. The current call to devm_of_platform_populate is not needed and it doesn't produce any effects.
--- drivers/firmware/imx/imx-dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/imx/imx-dsp.c +1 -1
@@ -114,7 +114,7 @@ static int imx_dsp_probe(struct platform_device *pdev)dev_info (dev,"NXP i.MX DSP IPC initialized\n" ); -return devm_of_platform_populate (dev); +return 0 ; out:kfree (chan_name);for (j =0 ; j < i; j++) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 67/102 libbpf: Dont use kernel-side u32 type in xsk.c
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit a566e35f1e8b4b3be1e96a804d1cca38b578167c ]
u32 is a kernel-side typedef. User-space library is supposed to use __u32. This breaks Github's projection of libbpf. Do u32 -> __u32 fix.
--- tools/lib/bpf/xsk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/lib/bpf/xsk.c +4 -4
@@ -161,22 +161,22 @@ static void xsk_mmap_offsets_v1(struct xdp_mmap_offsets *off) off->rx.producer = off_v1.rx.producer; off->rx.consumer = off_v1.rx.consumer; off->rx.desc = off_v1.rx.desc; - off->rx.flags = off_v1.rx.consumer +sizeof (u32); + off->rx.flags = off_v1.rx.consumer +sizeof (__u32); off->tx.producer = off_v1.tx.producer; off->tx.consumer = off_v1.tx.consumer; off->tx.desc = off_v1.tx.desc; - off->tx.flags = off_v1.tx.consumer +sizeof (u32); + off->tx.flags = off_v1.tx.consumer +sizeof (__u32); off->fr.producer = off_v1.fr.producer; off->fr.consumer = off_v1.fr.consumer; off->fr.desc = off_v1.fr.desc; - off->fr.flags = off_v1.fr.consumer +sizeof (u32); + off->fr.flags = off_v1.fr.consumer +sizeof (__u32); off->cr.producer = off_v1.cr.producer; off->cr.consumer = off_v1.cr.consumer; off->cr.desc = off_v1.cr.desc; - off->cr.flags = off_v1.cr.consumer +sizeof (u32); + off->cr.flags = off_v1.cr.consumer +sizeof (__u32); }static int xsk_get_mmap_offsets (int fd,struct xdp_mmap_offsets *off)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 68/102 rcu: Fix uninitialized variable in nocb_gp_wait()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit b8889c9c89a2655a231dfed93cc9bdca0930ea67 ]
We never set this to false. This probably doesn't affect most people's runtime because GCC will automatically initialize it to false at certain common optimization levels. But that behavior is related to a bug in GCC and obviously should not be relied on.
--- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_plugin.h +1 -1
@@ -1946,7 +1946,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)int __maybe_unused cpu = my_rdp->cpu;unsigned long cur_gp_seq;unsigned long flags; -bool gotcbs; +bool gotcbs = false;unsigned long j = jiffies;bool needwait_gp = false;// This prevents actual uninitialized use. bool needwake;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 69/102 dpaa_eth: perform DMA unmapping before read
In reply to Greg Kroah-HartmanFrom: Madalin Bucur <[email protected]>
[ Upstream commit c70fd3182caef014e6c628b412f81aa57a3ef9e4 ]
DMA unmapping is required before accessing the HW provided timestamping information.
--- .../net/ethernet/freescale/dpaa/dpaa_eth.c | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +17 -15
@@ -1620,18 +1620,6 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, skbh = (struct sk_buff **)phys_to_virt (addr); skb = *skbh; -if (priv->tx_tstamp &&skb_shinfo (skb)->tx_flags &SKBTX_HW_TSTAMP ) { -memset (&shhwtstamps,0 ,sizeof (shhwtstamps)); - -if (!fman_port_get_tstamp (priv->mac_dev->port[TX ], (void *)skbh, - &ns)) { - shhwtstamps.hwtstamp =ns_to_ktime (ns); -skb_tstamp_tx (skb, &shhwtstamps); - }else { -dev_warn (dev,"fman_port_get_tstamp failed!\n" ); - } - } -if (unlikely (qm_fd_get_format (fd) == qm_fd_sg)) { nr_frags =skb_shinfo (skb)->nr_frags; dma_unmap_single(dev, addr,
@@ -1654,14 +1642,28 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,dma_unmap_page (dev,qm_sg_addr (&sgt[i]),qm_sg_entry_get_len (&sgt[i]), dma_dir); } - -/* Free the page frag that we allocated on Tx */ -skb_free_frag (phys_to_virt (addr)); }else {dma_unmap_single (dev, addr,skb_tail_pointer (skb) - (u8 *)skbh, dma_dir); } +/* DMA unmapping is required before accessing the HW provided info */ +if (priv->tx_tstamp &&skb_shinfo (skb)->tx_flags &SKBTX_HW_TSTAMP ) { +memset (&shhwtstamps,0 ,sizeof (shhwtstamps)); + +if (!fman_port_get_tstamp (priv->mac_dev->port[TX ], (void *)skbh, + &ns)) { + shhwtstamps.hwtstamp =ns_to_ktime (ns); +skb_tstamp_tx (skb, &shhwtstamps); + }else { +dev_warn (dev,"fman_port_get_tstamp failed!\n" ); + } + } + +if (qm_fd_get_format (fd) == qm_fd_sg) +/* Free the page frag that we allocated on Tx */ +skb_free_frag (phys_to_virt (addr)); +return skb; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 70/102 dpaa_eth: avoid timestamp read on error paths
In reply to Greg Kroah-HartmanFrom: Madalin Bucur <[email protected]>
[ Upstream commit 9a4f4f3a894ff4487f5597b7aabba9432b238292 ]
The dpaa_cleanup_tx_fd() function is called by the frame transmit confirmation callback but also on several error paths. This function is reading the transmit timestamp value. Avoid reading an invalid timestamp value on the error paths.
--- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +10 -7
@@ -1600,13 +1600,15 @@ static int dpaa_eth_refill_bpools(struct dpaa_priv *priv)* Skb freeing is not handled here. * * This function may be called on error paths in the Tx function, so guard -* against cases when not all fd relevant fields were filled in. +* against cases when not all fd relevant fields were filled in. To avoid +* reading the invalid transmission timestamp for the error paths set ts to +* false. * * Return the skb backpointer, since for S/G frames the buffer containing it * gets freed here. */ static struct sk_buff *dpaa_cleanup_tx_fd (const struct dpaa_priv *priv, -const struct qm_fd *fd) +const struct qm_fd *fd,bool ts) {const enum dma_data_direction dma_dir =DMA_TO_DEVICE ;struct device *dev = priv->net_dev->dev.parent;
@@ -1648,7 +1650,8 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, }/* DMA unmapping is required before accessing the HW provided info */ - if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { + if (ts && priv->tx_tstamp && + skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { memset(&shhwtstamps, 0, sizeof(shhwtstamps)); if (!fman_port_get_tstamp(priv->mac_dev->port[TX], (void *)skbh,
@@ -2116,7 +2119,7 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev)if (likely (dpaa_xmit (priv, percpu_stats, queue_mapping, &fd) ==0 ))return NETDEV_TX_OK ; -dpaa_cleanup_tx_fd (priv, &fd); +dpaa_cleanup_tx_fd (priv, &fd, false); skb_to_fd_failed: enomem: percpu_stats->tx_errors++;
@@ -2162,7 +2165,7 @@ static void dpaa_tx_error(struct net_device *net_dev, percpu_priv->stats.tx_errors++; - skb =dpaa_cleanup_tx_fd (priv, fd); + skb =dpaa_cleanup_tx_fd (priv, fd, false);dev_kfree_skb (skb); }
@@ -2202,7 +2205,7 @@ static void dpaa_tx_conf(struct net_device *net_dev, percpu_priv->tx_confirm++; - skb =dpaa_cleanup_tx_fd (priv, fd); + skb =dpaa_cleanup_tx_fd (priv, fd, true);consume_skb (skb); }
@@ -2432,7 +2435,7 @@ static void egress_ern(struct qman_portal *portal, percpu_priv->stats.tx_fifo_errors++;count_ern (percpu_priv, msg); - skb =dpaa_cleanup_tx_fd (priv, fd); + skb =dpaa_cleanup_tx_fd (priv, fd, false);dev_kfree_skb_any (skb); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 71/102 scsi: ufs: delete redundant function ufshcd_def_desc_sizes()
In reply to Greg Kroah-HartmanFrom: Bean Huo <[email protected]>
[ Upstream commit 059efd847a4097c67817782d8ff65397e369e69b ]
There is no need to call ufshcd_def_desc_sizes() in ufshcd_init(), since descriptor lengths will be checked and initialized later in ufshcd_init_desc_sizes().
--- drivers/scsi/ufs/ufshcd.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -14
@@ -6779,23 +6779,13 @@ static void ufshcd_init_desc_sizes(struct ufs_hba *hba) &hba->desc_size.geom_desc);if (err) hba->desc_size.geom_desc =QUERY_DESC_GEOMETRY_DEF_SIZE ; + err =ufshcd_read_desc_length (hba,QUERY_DESC_IDN_HEALTH ,0 , &hba->desc_size.hlth_desc);if (err) hba->desc_size.hlth_desc =QUERY_DESC_HEALTH_DEF_SIZE ; } -static void ufshcd_def_desc_sizes (struct ufs_hba *hba) -{ - hba->desc_size.dev_desc =QUERY_DESC_DEVICE_DEF_SIZE ; - hba->desc_size.pwr_desc =QUERY_DESC_POWER_DEF_SIZE ; - hba->desc_size.interc_desc =QUERY_DESC_INTERCONNECT_DEF_SIZE ; - hba->desc_size.conf_desc =QUERY_DESC_CONFIGURATION_DEF_SIZE ; - hba->desc_size.unit_desc =QUERY_DESC_UNIT_DEF_SIZE ; - hba->desc_size.geom_desc =QUERY_DESC_GEOMETRY_DEF_SIZE ; - hba->desc_size.hlth_desc =QUERY_DESC_HEALTH_DEF_SIZE ; -} -static struct ufs_ref_clk ufs_ref_clk_freqs[] = { {19200000 ,REF_CLK_FREQ_19_2_MHZ }, {26000000 ,REF_CLK_FREQ_26_MHZ },
@@ -8283,9 +8273,6 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) hba->mmio_base = mmio_base; hba->irq = irq; -/* Set descriptor lengths to specification defaults */ -ufshcd_def_desc_sizes (hba); - err =ufshcd_hba_init (hba);if (err) goto out_error;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 72/102 net: openvswitch: dont unlock mutex when changing the user_features fails
In reply to Greg Kroah-HartmanFrom: Tonghao Zhang <[email protected]>
[ Upstream commit 4c76bf696a608ea5cc555fe97ec59a9033236604 ]
Unlocking of a not locked mutex is not allowed. Other kernel thread may be in critical section while we unlock it because of setting user_feature fail.
--- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/datapath.c +1 -1
@@ -1667,6 +1667,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)ovs_dp_reset_user_features (skb, info); } +ovs_unlock (); goto err_destroy_meters; }
@@ -1683,7 +1684,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)return 0 ; err_destroy_meters: -ovs_unlock ();ovs_meters_exit (dp); err_destroy_ports_array:kfree (dp->ports);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 73/102 hv_netvsc: flag software created hash value
In reply to Greg Kroah-HartmanFrom: Stephen Hemminger <[email protected]>
[ Upstream commit df9f540ca74297a84bafacfa197e9347b20beea5 ]
When the driver needs to create a hash value because it was not done at higher level, then the hash should be marked as a software not hardware hash.
--- drivers/net/hyperv/netvsc_drv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/hyperv/netvsc_drv.c +3 -4
@@ -285,9 +285,9 @@ static inline u32 netvsc_get_hash(else if (flow.basic.n_proto ==htons (ETH_P_IPV6 )) hash =jhash2 ((u32 *)&flow.addrs.v6addrs,8 , hashrnd);else - hash =0 ; +return 0 ; -skb_set_hash (skb, hash,PKT_HASH_TYPE_L3 ); +__skb_set_sw_hash (skb, hash, false); }return hash;
@@ -795,8 +795,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net, skb->protocol == htons(ETH_P_IP))netvsc_comp_ipcsum (skb); -/* Do L4 checksum offload if enabled and present. -*/ +/* Do L4 checksum offload if enabled and present. */ if (csum_info && (net->features &NETIF_F_RXCSUM )) {if (csum_info->receive.tcp_checksum_succeeded || csum_info->receive.udp_checksum_succeeded)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 74/102 rt2800: remove errornous duplicate condition
In reply to Greg Kroah-HartmanFrom: Daniel Golle <[email protected]>
[ Upstream commit a1f7c2cabf701a17b1a05d6526bbdadc3d05e05c ]
Quoted 13 lines · wbob
Hello Roman,
while reading around
drivers/net/wireless/ralink/rt2x00/rt2800lib.cI stumbled on what I think is an edit of yours made in error in march 2017:https://github.com/torvalds/linux/commit/41977e86#diff-dae5dc10da180f3b055809a48118e18aR5281
RT6352 in line 5281 should not have been introduced as the "else if" below line 5291 can then not take effect for a RT6352 device. Another possibility is for line 5291 to be not for RT6352, but this seems very unlikely. Are you able to clarify still after this substantial time?
Quoted 8 lines
5277: static int
rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
...
5279: } else if (rt2x00_rt(rt2x00dev, RT5390)||
5280:rt2x00_rt(rt2x00dev, RT5392)||
5281:rt2x00_rt(rt2x00dev, RT6352)) {
...
5291: } else if (rt2x00_rt(rt2x00dev, RT6352)) {
...
Hence remove errornous line 5281 to make the driver actually execute the correct initialization routine for MT7620 chips.
As it was requested by Stanislaw Gruszka remove setting values of MIMO_PS_CFG and TX_PIN_CFG. MIMO_PS_CFG is responsible for MIMO power-safe mode (which is disabled), hence we can drop setting it. TX_PIN_CFG is set correctly in other functions, and as setting this value breaks some devices, rather don't set it here during init, but only modify it later on.
--- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +1 -4
@@ -5839,8 +5839,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2800_register_write (rt2x00dev,TX_TXBF_CFG_0 ,0x8000fc21 );rt2800_register_write (rt2x00dev,TX_TXBF_CFG_3 ,0x00009c40 ); }else if (rt2x00_rt (rt2x00dev,RT5390 ) || -rt2x00_rt (rt2x00dev,RT5392 ) || -rt2x00_rt (rt2x00dev,RT6352 )) { +rt2x00_rt (rt2x00dev,RT5392 )) {rt2800_register_write (rt2x00dev,TX_SW_CFG0 ,0x00000404 );rt2800_register_write (rt2x00dev,TX_SW_CFG1 ,0x00080606 );rt2800_register_write (rt2x00dev,TX_SW_CFG2 ,0x00000000 );
@@ -5854,8 +5853,6 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)rt2800_register_write (rt2x00dev,TX_SW_CFG0 ,0x00000401 );rt2800_register_write (rt2x00dev,TX_SW_CFG1 ,0x000C0000 );rt2800_register_write (rt2x00dev,TX_SW_CFG2 ,0x00000000 ); -rt2800_register_write (rt2x00dev,MIMO_PS_CFG ,0x00000002 ); -rt2800_register_write (rt2x00dev,TX_PIN_CFG ,0x00150F0F );rt2800_register_write (rt2x00dev,TX_ALC_VGA3 ,0x00000000 );rt2800_register_write (rt2x00dev,TX0_BB_GAIN_ATTEN ,0x0 );rt2800_register_write (rt2x00dev,TX1_BB_GAIN_ATTEN ,0x0 );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 75/102 net: neigh: use long type to store jiffies delta
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 9d027e3a83f39b819e908e4e09084277a2e45e95 ]
A difference of two unsigned long needs long storage.
--- net/core/neighbour.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/neighbour.c +2 -2
@@ -2049,8 +2049,8 @@ static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl, goto nla_put_failure; {unsigned long now = jiffies; -unsigned int flush_delta = now - tbl->last_flush; -unsigned int rand_delta = now - tbl->last_rand; +long flush_delta = now - tbl->last_flush; +long rand_delta = now - tbl->last_rand;struct neigh_hash_table *nht;struct ndt_config ndc = { .ndtc_key_len = tbl->key_len,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 76/102 net: axienet: Fix error return code in axienet_probe()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
[ Upstream commit eb34e98baf4ce269423948dacefea6747e963b48 ]
In the DMA memory resource get failed case, the error is not set and 0 will be returned. Fix it by removing redundant check since devm_ioremap_resource() will handle it.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -4
@@ -1790,10 +1790,6 @@ static int axienet_probe(struct platform_device *pdev)/* Check for these resources directly on the Ethernet node. */ struct resource *res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); -if (!res) { -dev_err (&pdev->dev,"unable to get DMA memory resource\n" ); - goto free_netdev; - } lp->dma_regs =devm_ioremap_resource (&pdev->dev, res); lp->rx_irq =platform_get_irq (pdev,1 ); lp->tx_irq =platform_get_irq (pdev,0 );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 77/102 selftests: gen_kselftest_tar.sh: Do not clobber kselftest/
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit ea1bf0bb18c0bd627d7b551196453ff2fff44225 ]
The default installation location for gen_kselftest_tar.sh was still "kselftest/" which collides with the existing directory. Instead, this moves the installation target into "kselftest_install/kselftest/" and adjusts the tar creation accordingly. This also adjusts indentation and logic to be consistent.
--- tools/testing/selftests/gen_kselftest_tar.sh | 21 ++++++++++------- tools/testing/selftests/kselftest_install.sh | 24 ++++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-)
tools/testing/selftests/gen_kselftest_tar.sh +13 -8
@@ -38,16 +38,21 @@ main() esac fi - install_dir=./kselftest + # Create working directory. + dest=`pwd` + install_work="$dest"/kselftest_install + install_name=kselftest + install_dir="$install_work"/"$install_name" + mkdir -p "$install_dir" -# Run install using INSTALL_KSFT_PATH override to generate install -# directory -./kselftest_install.sh -tar $copts kselftest${ext} $install_dir -echo "Kselftest archive kselftest${ext} created!" + # Run install using INSTALL_KSFT_PATH override to generate install + # directory + ./kselftest_install.sh "$install_dir" + (cd "$install_work"; tar $copts "$dest"/kselftest${ext} $install_name) + echo "Kselftest archive kselftest${ext} created!" -# clean up install directory -rm -rf kselftest + # clean up top-level install work directory + rm -rf "$install_work" } main "$@"
tools/testing/selftests/kselftest_install.sh +12 -12
@@ -6,30 +6,30 @@ # Author: Shuah Khan <[email protected]> # Copyright (C) 2015 Samsung Electronics Co., Ltd. -install_loc=`pwd` - main() { - if [ $(basename $install_loc) != "selftests" ]; then + base_dir=`pwd` + install_dir="$base_dir"/kselftest_install + + # Make sure we're in the selftests top-level directory. + if [ $(basename "$base_dir") != "selftests" ]; then echo "$0: Please run it in selftests directory ..." exit 1; fi + + # Only allow installation into an existing location. if [ "$#" -eq 0 ]; then - echo "$0: Installing in default location - $install_loc ..." + echo "$0: Installing in default location - $install_dir ..." elif [ ! -d "$1" ]; then echo "$0: $1 doesn't exist!!" exit 1; else - install_loc=$1 - echo "$0: Installing in specified location - $install_loc ..." + install_dir="$1" + echo "$0: Installing in specified location - $install_dir ..." fi - install_dir=$install_loc/kselftest_install - -# Create install directory - mkdir -p $install_dir -# Build tests - KSFT_INSTALL_PATH=$install_dir make install + # Build tests + KSFT_INSTALL_PATH="$install_dir" make install } main "$@"
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 78/102 rtc: bd70528: fix module alias to autoload module
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit afe19a7ae8b6b6032d04d3895ebd5bbac7fe9f30 ]
The module alias platform tag contains a spelling mistake. Fix it.
--- drivers/rtc/rtc-bd70528.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-bd70528.c +1 -1
@@ -491,4 +491,4 @@ module_platform_driver(bd70528_rtc);MODULE_AUTHOR ("Matti Vaittinen <[email protected]>" );MODULE_DESCRIPTION ("BD70528 RTC driver" );MODULE_LICENSE ("GPL" ); -MODULE_ALIAS ("platofrm:bd70528-rtc" ); +MODULE_ALIAS ("platform:bd70528-rtc" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 79/102 packet: fix data-race in fanout_flow_is_huge()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit b756ad928d98e5ef0b74af7546a6a31a8dadde00 ]
KCSAN reported the following data-race [1]
Adding a couple of READ_ONCE()/WRITE_ONCE() should silence it.
Since the report hinted about multiple cpus using the history concurrently, I added a test avoiding writing on it if the victim slot already contains the desired value.
[1]
BUG: KCSAN: data-race in fanout_demux_rollover / fanout_demux_rollover
read to 0xffff8880b01786cc of 4 bytes by task 18921 on cpu 1:
fanout_flow_is_huge net/packet/af_packet.c:1303 [inline] fanout_demux_rollover+0x33e/0x3f0 net/packet/af_packet.c:1353 packet_rcv_fanout+0x34e/0x490 net/packet/af_packet.c:1453 deliver_skb net/core/dev.c:1888 [inline] dev_queue_xmit_nit+0x15b/0x540 net/core/dev.c:1958 xmit_one net/core/dev.c:3195 [inline] dev_hard_start_xmit+0x3f5/0x430 net/core/dev.c:3215 __dev_queue_xmit+0x14ab/0x1b40 net/core/dev.c:3792 dev_queue_xmit+0x21/0x30 net/core/dev.c:3825 neigh_direct_output+0x1f/0x30 net/core/neighbour.c:1530 neigh_output include/net/neighbour.h:511 [inline] ip6_finish_output2+0x7a2/0xec0 net/ipv6/ip6_output.c:116 __ip6_finish_output net/ipv6/ip6_output.c:142 [inline] __ip6_finish_output+0x2d7/0x330 net/ipv6/ip6_output.c:127 ip6_finish_output+0x41/0x160 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0xf2/0x280 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] ip6_local_out+0x74/0x90 net/ipv6/output_core.c:179 ip6_send_skb+0x53/0x110 net/ipv6/ip6_output.c:1795 udp_v6_send_skb.isra.0+0x3ec/0xa70 net/ipv6/udp.c:1173 udpv6_sendmsg+0x1906/0x1c20 net/ipv6/udp.c:1471 inet6_sendmsg+0x6d/0x90 net/ipv6/af_inet6.c:576 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0x9f/0xc0 net/socket.c:657 ___sys_sendmsg+0x2b7/0x5d0 net/socket.c:2311 __sys_sendmmsg+0x123/0x350 net/socket.c:2413 __do_sys_sendmmsg net/socket.c:2442 [inline] __se_sys_sendmmsg net/socket.c:2439 [inline] __x64_sys_sendmmsg+0x64/0x80 net/socket.c:2439 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9
write to 0xffff8880b01786cc of 4 bytes by task 18922 on cpu 0:
fanout_flow_is_huge net/packet/af_packet.c:1306 [inline] fanout_demux_rollover+0x3a4/0x3f0 net/packet/af_packet.c:1353 packet_rcv_fanout+0x34e/0x490 net/packet/af_packet.c:1453 deliver_skb net/core/dev.c:1888 [inline] dev_queue_xmit_nit+0x15b/0x540 net/core/dev.c:1958 xmit_one net/core/dev.c:3195 [inline] dev_hard_start_xmit+0x3f5/0x430 net/core/dev.c:3215 __dev_queue_xmit+0x14ab/0x1b40 net/core/dev.c:3792 dev_queue_xmit+0x21/0x30 net/core/dev.c:3825 neigh_direct_output+0x1f/0x30 net/core/neighbour.c:1530 neigh_output include/net/neighbour.h:511 [inline] ip6_finish_output2+0x7a2/0xec0 net/ipv6/ip6_output.c:116 __ip6_finish_output net/ipv6/ip6_output.c:142 [inline] __ip6_finish_output+0x2d7/0x330 net/ipv6/ip6_output.c:127 ip6_finish_output+0x41/0x160 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0xf2/0x280 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] ip6_local_out+0x74/0x90 net/ipv6/output_core.c:179 ip6_send_skb+0x53/0x110 net/ipv6/ip6_output.c:1795 udp_v6_send_skb.isra.0+0x3ec/0xa70 net/ipv6/udp.c:1173 udpv6_sendmsg+0x1906/0x1c20 net/ipv6/udp.c:1471 inet6_sendmsg+0x6d/0x90 net/ipv6/af_inet6.c:576 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0x9f/0xc0 net/socket.c:657 ___sys_sendmsg+0x2b7/0x5d0 net/socket.c:2311 __sys_sendmmsg+0x123/0x350 net/socket.c:2413 __do_sys_sendmmsg net/socket.c:2442 [inline] __se_sys_sendmmsg net/socket.c:2439 [inline] __x64_sys_sendmmsg+0x64/0x80 net/socket.c:2439 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 18922 Comm: syz-executor.3 Not tainted 5.4.0-rc6+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
--- net/packet/af_packet.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
net/packet/af_packet.c +9 -3
@@ -1296,15 +1296,21 @@ static void packet_sock_destruct(struct sock *sk)static bool fanout_flow_is_huge (struct packet_sock *po,struct sk_buff *skb) { -u32 rxhash; +u32 *history = po->rollover->history; +u32 victim, rxhash;int i, count =0 ; rxhash =skb_get_hash (skb);for (i =0 ; i <ROLLOVER_HLEN ; i++) -if (po->rollover->history[i] == rxhash) +if (READ_ONCE (history[i]) == rxhash) count++; - po->rollover->history[prandom_u32 () %ROLLOVER_HLEN ] = rxhash; + victim =prandom_u32 () %ROLLOVER_HLEN ; + +/* Avoid dirtying the cache line if possible */ +if (READ_ONCE (history[victim]) != rxhash) +WRITE_ONCE (history[victim], rxhash); +return count > (ROLLOVER_HLEN >>1 ); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 80/102 i2c: stm32f7: report dma error during probe
In reply to Greg Kroah-HartmanFrom: Alain Volmat <[email protected]>
[ Upstream commit d77eceb2de99f5d7e0c645bad15511fe1af59e09 ]
Distinguish between the case where dma information is not provided within the DT and the case of an error during the dma init. Exit the probe with error in case of an error during dma init.
--- drivers/i2c/busses/i2c-stm32.c | 16 ++++++++-------- drivers/i2c/busses/i2c-stm32f7.c | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-stm32.c +8 -8
@@ -20,13 +20,13 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, dma =devm_kzalloc (dev,sizeof (*dma),GFP_KERNEL );if (!dma) -return NULL ; +return ERR_PTR (-ENOMEM );/* Request and configure I2C TX dma channel */ - dma->chan_tx =dma_request_slave_channel (dev,"tx" ); -if (!dma->chan_tx) { + dma->chan_tx =dma_request_chan (dev,"tx" ); +if (IS_ERR (dma->chan_tx)) {dev_dbg (dev,"can't request DMA tx channel\n" ); - ret = -EINVAL ; + ret =PTR_ERR (dma->chan_tx); goto fail_al; }
@@ -42,10 +42,10 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, }/* Request and configure I2C RX dma channel */ - dma->chan_rx =dma_request_slave_channel (dev,"rx" ); -if (!dma->chan_rx) { + dma->chan_rx =dma_request_chan (dev,"rx" ); +if (IS_ERR (dma->chan_rx)) {dev_err (dev,"can't request DMA rx channel\n" ); - ret = -EINVAL ; + ret =PTR_ERR (dma->chan_rx); goto fail_tx; }
@@ -75,7 +75,7 @@ fail_al:devm_kfree (dev, dma);dev_info (dev,"can't use DMA\n" ); -return NULL ; +return ERR_PTR (ret); }void stm32_i2c_dma_free (struct stm32_i2c_dma *dma)
drivers/i2c/busses/i2c-stm32f7.c +9 -0
@@ -1955,6 +1955,15 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) i2c_dev->dma =stm32_i2c_dma_request (i2c_dev->dev, phy_addr,STM32F7_I2C_TXDR ,STM32F7_I2C_RXDR ); +if (PTR_ERR (i2c_dev->dma) == -ENODEV ) + i2c_dev->dma =NULL ; +else if (IS_ERR (i2c_dev->dma)) { + ret =PTR_ERR (i2c_dev->dma); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev, +"Failed to request dma error %i\n" , ret); + goto clk_free; + }platform_set_drvdata (pdev, i2c_dev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 81/102 kselftests: cgroup: Avoid the reuse of fd after it is deallocated
In reply to Greg Kroah-HartmanFrom: Hewenliang <[email protected]>
[ Upstream commit d671fa6393d6788fc65555d4643b71cb3a361f36 ]
It is necessary to set fd to -1 when inotify_add_watch() fails in cg_prepare_for_wait. Otherwise the fd which has been closed in cg_prepare_for_wait may be misused in other functions such as cg_enter_and_wait_for_frozen and cg_freeze_wait.
--- tools/testing/selftests/cgroup/test_freezer.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/cgroup/test_freezer.c +1 -0
@@ -72,6 +72,7 @@ static int cg_prepare_for_wait(const char *cgroup)if (ret ==-1 ) {debug ("Error: inotify_add_watch() failed\n" );close (fd); + fd =-1 ; }return fd;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 82/102 firmware: arm_scmi: Fix doorbell ring logic for !CONFIG_64BIT
In reply to Greg Kroah-HartmanFrom: Sudeep Holla <[email protected]>
[ Upstream commit 7bd39bc6bfdf96f5df0f92199bbc1a3ee2f2adb8 ]
The logic to ring the scmi performance fastchannel ignores the value read from the doorbell register in case of !CONFIG_64BIT. This bug also shows up as warning with '-Wunused-but-set-variable' gcc flag:
drivers/firmware/arm_scmi/perf.c: In function scmi_perf_fc_ring_db:drivers/firmware/arm_scmi/perf.c:323:7: warning: variable val set but
not used [-Wunused-but-set-variable]
Fix the same by aligning the logic with CONFIG_64BIT as used in the macro SCMI_PERF_FC_RING_DB().
--- drivers/firmware/arm_scmi/perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_scmi/perf.c +1 -1
@@ -323,7 +323,7 @@ static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db)if (db->mask) val =ioread64_hi_lo (db->addr) & db->mask; - iowrite64_hi_lo(db->set, db->addr); + iowrite64_hi_lo(db->set | val, db->addr); }#endif }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 83/102 mmc: sdio: fix wl1251 vendor id
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit e5db673e7fe2f971ec82039a28dc0811c2100e87 ]
v4.11-rc1 did introduce a patch series that rearranged the sdio quirks into a header file. Unfortunately this did forget to handle SDIO_VENDOR_ID_TI differently between wl1251 and wl1271 with the result that although the wl1251 was found on the sdio bus, the firmware did not load any more and there was no interface registration.
This patch defines separate constants to be used by sdio quirks and drivers.
--- include/linux/mmc/sdio_ids.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/mmc/sdio_ids.h +2 -0
@@ -71,6 +71,8 @@#define SDIO_VENDOR_ID_TI 0x0097#define SDIO_DEVICE_ID_TI_WL1271 0x4076 +#define SDIO_VENDOR_ID_TI_WL1251 0x104c +#define SDIO_DEVICE_ID_TI_WL1251 0x9066#define SDIO_VENDOR_ID_STE 0x0020#define SDIO_DEVICE_ID_STE_CW1200 0x2280
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 84/102 mmc: core: fix wl1251 sdio quirks
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit 16568b4a4f0c34bd35cfadac63303c7af7812764 ]
wl1251 and wl1271 have different vendor id and device id. So we need to handle both with sdio quirks.
--- drivers/mmc/core/quirks.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/core/quirks.h +7 -0
@@ -119,7 +119,14 @@ static const struct mmc_fixup mmc_ext_csd_fixups[] = {END_FIXUP }; +static const struct mmc_fixup sdio_fixup_methods[] = { +SDIO_FIXUP (SDIO_VENDOR_ID_TI_WL1251 ,SDIO_DEVICE_ID_TI_WL1251 , + add_quirk,MMC_QUIRK_NONSTD_FUNC_IF ), + +SDIO_FIXUP (SDIO_VENDOR_ID_TI_WL1251 ,SDIO_DEVICE_ID_TI_WL1251 , + add_quirk,MMC_QUIRK_DISABLE_CD ), +SDIO_FIXUP (SDIO_VENDOR_ID_TI ,SDIO_DEVICE_ID_TI_WL1271 , add_quirk,MMC_QUIRK_NONSTD_FUNC_IF ),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 85/102 tee: optee: Fix dynamic shm pool allocations
In reply to Greg Kroah-HartmanFrom: Sumit Garg <[email protected]>
[ Upstream commit a249dd200d03791cab23e47571f3e13d9c72af6c ]
In case of dynamic shared memory pool, kernel memory allocated using dmabuf_mgr pool needs to be registered with OP-TEE prior to its usage during optee_open_session() or optee_invoke_func().
So fix dmabuf_mgr pool allocations via an additional call to optee_shm_register().
Also, allow kernel pages to be registered as shared memory with OP-TEE.
--- drivers/tee/optee/call.c | 7 +++++++ drivers/tee/optee/shm_pool.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)
drivers/tee/optee/call.c +7 -0
@@ -554,6 +554,13 @@ static int check_mem_type(unsigned long start, size_t num_pages)struct mm_struct *mm = current->mm;int rc; +/* +* Allow kernel address to register with OP-TEE as kernel +* pages are configured as normal memory only. +*/ +if (virt_addr_valid (start)) +return 0 ; +down_read (&mm->mmap_sem); rc =__check_mem_type (find_vma (mm, start), start + num_pages *PAGE_SIZE );
drivers/tee/optee/shm_pool.c +11 -1
@@ -17,6 +17,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, {unsigned int order =get_order (size);struct page *page; +int rc =0 ; page =alloc_pages (GFP_KERNEL | __GFP_ZERO, order);if (!page)
@@ -26,12 +27,21 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, shm->paddr =page_to_phys (page); shm->size =PAGE_SIZE << order; -return 0 ; +if (shm->flags &TEE_SHM_DMA_BUF ) { + shm->flags |=TEE_SHM_REGISTER ; + rc =optee_shm_register (shm->ctx, shm, &page,1 << order, + (unsigned long )shm->kaddr); + } + +return rc; }static void pool_op_free (struct tee_shm_pool_mgr *poolm,struct tee_shm *shm) { +if (shm->flags &TEE_SHM_DMA_BUF ) +optee_shm_unregister (shm->ctx, shm); +free_pages ((unsigned long )shm->kaddr,get_order (shm->size)); shm->kaddr =NULL ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 86/102 tee: optee: fix device enumeration error handling
In reply to Greg Kroah-HartmanFrom: Jens Wiklander <[email protected]>
[ Upstream commit 03212e347f9443e524d6383c6806ac08295c1fb0 ]
Prior to this patch in optee_probe() when optee_enumerate_devices() was called the struct optee was fully initialized. If optee_enumerate_devices() returns an error optee_probe() is supposed to clean up and free the struct optee completely, but will at this late stage need to call optee_remove() instead. This isn't done and thus freeing the struct optee prematurely.
With this patch the call to optee_enumerate_devices() is done after optee_probe() has returned successfully and in case optee_enumerate_devices() fails everything is cleaned up with a call to optee_remove().
--- drivers/tee/optee/core.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/tee/optee/core.c +12 -8
@@ -643,11 +643,6 @@ static struct optee *optee_probe(struct device_node *np)if (optee->sec_caps &OPTEE_SMC_SEC_CAP_DYNAMIC_SHM )pr_info ("dynamic shared memory is enabled\n" ); - rc =optee_enumerate_devices (); -if (rc) - goto err; - -pr_info ("initialized driver\n" );return optee; err:if (optee) {
@@ -702,9 +697,10 @@ static struct optee *optee_svc;static int __init optee_driver_init (void ) { -struct device_node *fw_np; -struct device_node *np; -struct optee *optee; +struct device_node *fw_np =NULL ; +struct device_node *np =NULL ; +struct optee *optee =NULL ; +int rc =0 ;/* Node is supposed to be below /firmware */ fw_np =of_find_node_by_name (NULL ,"firmware" );
@@ -723,6 +719,14 @@ static int __init optee_driver_init(void)if (IS_ERR (optee))return PTR_ERR (optee); + rc =optee_enumerate_devices (); +if (rc) { +optee_remove (optee); +return rc; + } + +pr_info ("initialized driver\n" ); + optee_svc = optee;return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 87/102 workqueue: Add RCU annotation for pwq list walk
In reply to Greg Kroah-HartmanFrom: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit 49e9d1a9faf2f71fdfd80a30697ee9a15070626d ]
An additional check has been recently added to ensure that a RCU related lock is held while the RCU list is iterated.
The `pwqs' are sometimes iterated without a RCU lock but with the &wq->mutex acquired leading to a warning.
Teach list_for_each_entry_rcu() that the RCU usage is okay if &wq->mutex is acquired during the list traversal.
--- kernel/workqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/workqueue.c +2 -1
@@ -425,7 +425,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq);* ignored. */ #define for_each_pwq (pwq, wq) \ - list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node) \ + list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, \ + lockdep_is_held(&wq->mutex)) \ if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ else
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 88/102 SUNRPC: Fix another issue with MIC buffer space
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit e8d70b321ecc9b23d09b8df63e38a2f73160c209 ]
xdr_shrink_pagelen() BUG's when @len is larger than buf->page_len. This can happen when xdr_buf_read_mic() is given an xdr_buf with a small page array (like, only a few bytes).
Instead, just cap the number of bytes that xdr_shrink_pagelen() will move.
--- net/sunrpc/xdr.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
net/sunrpc/xdr.c +5 -6
@@ -436,13 +436,12 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) }/** -* xdr_shrink_pagelen +* xdr_shrink_pagelen - shrinks buf->pages by up to @len bytes * @buf: xdr_buf * @len: bytes to remove from buf->pages * -* Shrinks XDR buffer's page array buf->pages by -* 'len' bytes. The extra data is not lost, but is instead -* moved into the tail. +* The extra data is not lost, but is instead moved into buf->tail. +* Returns the actual number of bytes moved. */ static unsigned int xdr_shrink_pagelen (struct xdr_buf *buf,size_t len)
@@ -455,8 +454,8 @@ xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) result =0 ; tail = buf->tail; -BUG_ON (len > pglen); - +if (len > buf->page_len) + len = buf-> page_len; tailbuf_len = buf->buflen - buf->head->iov_len - buf->page_len;/* Shift the tail first */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 89/102 sched/cpufreq: Move the cfs_rq_util_change() call to cpufreq_update_util()
In reply to Greg Kroah-HartmanFrom: Vincent Guittot <[email protected]>
[ Upstream commit bef69dd87828ef5d8ecdab8d857cd3a33cf98675 ]
update_cfs_rq_load_avg() calls cfs_rq_util_change() every time PELT decays, which might be inefficient when the cpufreq driver has rate limitation.
When a task is attached on a CPU, we have this call path:
update_load_avg()
update_cfs_rq_load_avg()
cfs_rq_util_change -- > trig frequency update
attach_entity_load_avg()
cfs_rq_util_change -- > trig frequency update
The 1st frequency update will not take into account the utilization of the newly attached task and the 2nd one might be discarded because of rate limitation of the cpufreq driver.
update_cfs_rq_load_avg() is only called by update_blocked_averages() and update_load_avg() so we can move the call to cfs_rq_util_change/cpufreq_update_util() into these two functions.
It's also interesting to note that update_load_avg() already calls cfs_rq_util_change() directly for the !SMP case.
This change will also ensure that cpufreq_update_util() is called even when there is no more CFS rq in the leaf_cfs_rq_list to update, but only IRQ, RT or DL PELT signals.
[ mingo: Minor updates. ]
--- kernel/sched/fair.c | 111 +++++++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 49 deletions(-)
kernel/sched/fair.c +62 -49
@@ -3504,9 +3504,6 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) cfs_rq->load_last_update_time_copy = sa->last_update_time;#endif -if (decayed) -cfs_rq_util_change (cfs_rq,0 ); -return decayed; }
@@ -3616,8 +3613,12 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *sattach_entity_load_avg (cfs_rq, se,SCHED_CPUFREQ_MIGRATION );update_tg_load_avg (cfs_rq,0 ); - }else if (decayed && (flags &UPDATE_TG )) -update_tg_load_avg (cfs_rq,0 ); + }else if (decayed) { +cfs_rq_util_change (cfs_rq,0 ); + +if (flags &UPDATE_TG ) +update_tg_load_avg (cfs_rq,0 ); + } }#ifndef CONFIG_64BIT
@@ -7517,6 +7518,28 @@ static inline bool others_have_blocked(struct rq *rq) { return false; }static inline void update_blocked_load_status (struct rq *rq,bool has_blocked) {}#endif +static bool __update_blocked_others (struct rq *rq,bool *done) +{ +const struct sched_class *curr_class; +u64 now =rq_clock_pelt (rq); +bool decayed; + +/* +* update_load_avg() can call cpufreq_update_util(). Make sure that RT, +* DL and IRQ signals have been updated before updating CFS. +*/ + curr_class = rq->curr->sched_class; + + decayed =update_rt_rq_load_avg (now, rq, curr_class == &rt_sched_class) | +update_dl_rq_load_avg (now, rq, curr_class == &dl_sched_class) | +update_irq_load_avg (rq,0 ); + +if (others_have_blocked (rq)) + *done = false; + +return decayed; +} +#ifdef CONFIG_FAIR_GROUP_SCHED static inline bool cfs_rq_is_decayed (struct cfs_rq *cfs_rq)
@@ -7536,29 +7559,11 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)return true; } -static void update_blocked_averages (int cpu) +static bool __update_blocked_fair (struct rq *rq,bool *done) { -struct rq *rq =cpu_rq (cpu);struct cfs_rq *cfs_rq, *pos; -const struct sched_class *curr_class; -struct rq_flags rf; -bool done = true; - -rq_lock_irqsave (rq, &rf); -update_rq_clock (rq); - -/* -* update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure -* that RT, DL and IRQ signals have been updated before updating CFS. -*/ - curr_class = rq->curr->sched_class; -update_rt_rq_load_avg (rq_clock_pelt (rq), rq, curr_class == &rt_sched_class); -update_dl_rq_load_avg (rq_clock_pelt (rq), rq, curr_class == &dl_sched_class); -update_irq_load_avg (rq,0 ); - -/* Don't need periodic decay once load/util_avg are null */ -if (others_have_blocked (rq)) - done = false; +bool decayed = false; +int cpu =cpu_of (rq);/* * Iterates the task_group tree in a bottom up fashion, see
@@ -7567,9 +7572,13 @@ static void update_blocked_averages(int cpu)for_each_leaf_cfs_rq_safe (rq, cfs_rq, pos) {struct sched_entity *se; -if (update_cfs_rq_load_avg (cfs_rq_clock_pelt (cfs_rq), cfs_rq)) +if (update_cfs_rq_load_avg (cfs_rq_clock_pelt (cfs_rq), cfs_rq)) {update_tg_load_avg (cfs_rq,0 ); +if (cfs_rq == &rq->cfs) + decayed = true; + } +/* Propagate pending load changes to the parent, if any: */ se = cfs_rq->tg->se[cpu];if (se && !skip_blocked_update (se))
@@ -7584,11 +7593,10 @@ static void update_blocked_averages(int cpu)/* Don't need periodic decay once load/util_avg are null */ if (cfs_rq_has_blocked (cfs_rq)) - done = false; + *done = false; } -update_blocked_load_status (rq, !done); -rq_unlock_irqrestore (rq, &rf); +return decayed; }/*
@@ -7638,29 +7646,16 @@ static unsigned long task_h_load(struct task_struct *p) cfs_rq_load_avg(cfs_rq) + 1); }#else -static inline void update_blocked_averages (int cpu) +static bool __update_blocked_fair (struct rq *rq,bool *done) { -struct rq *rq =cpu_rq (cpu);struct cfs_rq *cfs_rq = &rq->cfs; -const struct sched_class *curr_class; -struct rq_flags rf; - -rq_lock_irqsave (rq, &rf); -update_rq_clock (rq); - -/* -* update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure -* that RT, DL and IRQ signals have been updated before updating CFS. -*/ - curr_class = rq->curr->sched_class; -update_rt_rq_load_avg (rq_clock_pelt (rq), rq, curr_class == &rt_sched_class); -update_dl_rq_load_avg (rq_clock_pelt (rq), rq, curr_class == &dl_sched_class); -update_irq_load_avg (rq,0 ); +bool decayed; -update_cfs_rq_load_avg (cfs_rq_clock_pelt (cfs_rq), cfs_rq); + decayed =update_cfs_rq_load_avg (cfs_rq_clock_pelt (cfs_rq), cfs_rq); +if (cfs_rq_has_blocked (cfs_rq)) + *done = false; -update_blocked_load_status (rq,cfs_rq_has_blocked (cfs_rq) ||others_have_blocked (rq)); -rq_unlock_irqrestore (rq, &rf); +return decayed; }static unsigned long task_h_load (struct task_struct *p)
@@ -7669,6 +7664,24 @@ static unsigned long task_h_load(struct task_struct *p) }#endif +static void update_blocked_averages (int cpu) +{ +bool decayed = false, done = true; +struct rq *rq =cpu_rq (cpu); +struct rq_flags rf; + +rq_lock_irqsave (rq, &rf); +update_rq_clock (rq); + + decayed |=__update_blocked_others (rq, &done); + decayed |=__update_blocked_fair (rq, &done); + +update_blocked_load_status (rq, !done); +if (decayed) +cpufreq_update_util (rq,0 ); +rq_unlock_irqrestore (rq, &rf); +} +/********** Helpers for find_busiest_group ************************/ /*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 90/102 mt76: mt76u: rely on usb_interface instead of usb_dev
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
[ Upstream commit 80df01f4dc79abbed724bbe0851cab3fe8ad9d99 ]
usb drivers are supposed to communicate using usb_interface instead mt76x{0,2}u is now registering through usb_device. Fix it by passing usb_intf device to mt76_alloc_device routine.
--- drivers/net/wireless/mediatek/mt76/mt76.h | 3 ++- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 12 +++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76.h +2 -1
@@ -799,7 +799,8 @@ static inline int mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, int timeout) { - struct usb_device *udev = to_usb_device(dev->dev); + struct usb_interface *uintf = to_usb_interface(dev->dev); +struct usb_device *udev =interface_to_usbdev (uintf);struct mt76_usb *usb = &dev->usb;unsigned int pipe;
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c +1 -1
@@ -226,7 +226,7 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,u32 mac_rev;int ret; - mdev =mt76_alloc_device (&usb_dev->dev,sizeof (*dev), &mt76x0u_ops, + mdev =mt76_alloc_device (&usb_intf->dev,sizeof (*dev), &mt76x0u_ops, &drv_ops);if (!mdev)return -ENOMEM ;
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +1 -1
@@ -39,7 +39,7 @@ static int mt76x2u_probe(struct usb_interface *intf,struct mt76_dev *mdev;int err; - mdev =mt76_alloc_device (&udev->dev,sizeof (*dev), &mt76x2u_ops, + mdev =mt76_alloc_device (&intf->dev,sizeof (*dev), &mt76x2u_ops, &drv_ops);if (!mdev)return -ENOMEM ;
drivers/net/wireless/mediatek/mt76/usb.c +9 -3
@@ -20,7 +20,8 @@ static int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type, u16 val, u16 offset, void *buf, size_t len) { - struct usb_device *udev = to_usb_device(dev->dev); + struct usb_interface *uintf = to_usb_interface(dev->dev); +struct usb_device *udev =interface_to_usbdev (uintf);unsigned int pipe;int i, ret;
@@ -235,7 +236,8 @@ mt76u_rd_rp(struct mt76_dev *dev, u32 base,static bool mt76u_check_sg (struct mt76_dev *dev) { -struct usb_device *udev =to_usb_device (dev->dev); +struct usb_interface *uintf =to_usb_interface (dev->dev); +struct usb_device *udev =interface_to_usbdev (uintf); return (!disable_usb_sg && udev->bus->sg_tablesize > 0 && (udev->bus->no_sg_constraint ||
@@ -370,7 +372,8 @@ mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index, struct urb *urb, usb_complete_t complete_fn, void *context) { - struct usb_device *udev = to_usb_device(dev->dev); + struct usb_interface *uintf = to_usb_interface(dev->dev); +struct usb_device *udev =interface_to_usbdev (uintf);unsigned int pipe;if (dir ==USB_DIR_IN )
@@ -952,6 +955,7 @@ int mt76u_init(struct mt76_dev *dev, .rd_rp = mt76u_rd_rp, .type = MT76_BUS_USB, }; +struct usb_device *udev =interface_to_usbdev (intf);struct mt76_usb *usb = &dev->usb;tasklet_init (&usb->rx_tasklet, mt76u_rx_tasklet, (unsigned long )dev);
@@ -965,6 +969,8 @@ int mt76u_init(struct mt76_dev *dev, dev->bus = &mt76u_ops; dev->queue_ops = &usb_queue_ops; +dev_set_drvdata (&udev->dev, dev); + usb->sg_en =mt76u_check_sg (dev);return mt76u_set_endpoints (intf, usb);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 91/102 dma-direct: dont check swiotlb=force in dma_direct_map_resource
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 4268ac6ae5870af10a7417b22990d615f72f77e2 ]
When mapping resources we can't just use swiotlb ram for bounce buffering. Switch to a direct dma_capable check instead.
--- kernel/dma/direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/direct.c +1 -1
@@ -375,7 +375,7 @@ dma_addr_t dma_direct_map_resource(struct device *dev, phys_addr_t paddr, {dma_addr_t dma_addr = paddr; -if (unlikely (!dma_direct_possible (dev, dma_addr, size))) { +if (unlikely (!dma_capable (dev, dma_addr, size))) {report_addr (dev, dma_addr, size);return DMA_MAPPING_ERROR ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 92/102 afs: Remove set but not used variables before, after
In reply to Greg Kroah-HartmanFrom: zhengbin <[email protected]>
[ Upstream commit 51590df4f3306cb1f43dca54e3ccdd121ab89594 ]
Fixes gcc '-Wunused-but-set-variable' warning:
fs/afs/dir_edit.c: In function afs_set_contig_bits:fs/afs/dir_edit.c:75:20: warning: variable after set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_set_contig_bits:fs/afs/dir_edit.c:75:12: warning: variable before set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_clear_contig_bits:fs/afs/dir_edit.c:100:20: warning: variable after set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_clear_contig_bits:fs/afs/dir_edit.c:100:12: warning: variable before set but not used [-Wunused-but-set-variable]
They are never used since commit 63a4681ff39c.
--- fs/afs/dir_edit.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
fs/afs/dir_edit.c +2 -10
@@ -68,13 +68,11 @@ static int afs_find_contig_bits(union afs_xdr_dir_block *block, unsigned int nr_static void afs_set_contig_bits (union afs_xdr_dir_block *block,int bit,unsigned int nr_slots) { -u64 mask, before, after; +u64 mask; mask = (1 << nr_slots) -1 ; mask <<= bit; - before = *(u64 *)block->hdr.bitmap; - block->hdr.bitmap[0 ] |= (u8)(mask >>0 *8 ); block->hdr.bitmap[1 ] |= (u8)(mask >>1 *8 ); block->hdr.bitmap[2 ] |= (u8)(mask >>2 *8 );
@@ -83,8 +81,6 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block, block->hdr.bitmap[5 ] |= (u8)(mask >>5 *8 ); block->hdr.bitmap[6 ] |= (u8)(mask >>6 *8 ); block->hdr.bitmap[7 ] |= (u8)(mask >>7 *8 ); - - after = *(u64 *)block->hdr.bitmap; }/*
@@ -93,13 +89,11 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block,static void afs_clear_contig_bits (union afs_xdr_dir_block *block,int bit,unsigned int nr_slots) { -u64 mask, before, after; +u64 mask; mask = (1 << nr_slots) -1 ; mask <<= bit; - before = *(u64 *)block->hdr.bitmap; - block->hdr.bitmap[0 ] &= ~(u8)(mask >>0 *8 ); block->hdr.bitmap[1 ] &= ~(u8)(mask >>1 *8 ); block->hdr.bitmap[2 ] &= ~(u8)(mask >>2 *8 );
@@ -108,8 +102,6 @@ static void afs_clear_contig_bits(union afs_xdr_dir_block *block, block->hdr.bitmap[5 ] &= ~(u8)(mask >>5 *8 ); block->hdr.bitmap[6 ] &= ~(u8)(mask >>6 *8 ); block->hdr.bitmap[7 ] &= ~(u8)(mask >>7 *8 ); - - after = *(u64 *)block->hdr.bitmap; }/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 93/102 dmaengine: ti: edma: fix missed failure handling
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
[ Upstream commit 340049d453682a9fe8d91fe794dd091730f4bb25 ]
When devm_kcalloc fails, it forgets to call edma_free_slot. Replace direct return with failure handler to fix it.
--- drivers/dma/ti/edma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/dma/ti/edma.c +4 -2
@@ -2403,8 +2403,10 @@ static int edma_probe(struct platform_device *pdev) ecc->tc_list =devm_kcalloc (dev, ecc->num_tc,sizeof (*ecc->tc_list),GFP_KERNEL ); -if (!ecc->tc_list) -return -ENOMEM ; +if (!ecc->tc_list) { + ret = -ENOMEM ; + goto err_reg1; + }for (i =0 ;; i++) { ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 94/102 drm/radeon: fix bad DMA from INTERRUPT_CNTL2
In reply to Greg Kroah-HartmanFrom: Sam Bobroff <[email protected]>
[ Upstream commit 62d91dd2851e8ae2ca552f1b090a3575a4edf759 ]
The INTERRUPT_CNTL2 register expects a valid DMA address, but is currently set with a GPU MC address. This can cause problems on systems that detect the resulting DMA read from an invalid address (found on a Power8 guest).
Instead, use the DMA address of the dummy page because it will always be safe.
--- drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/r600.c | 4 ++-- drivers/gpu/drm/radeon/si.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/cik.c +2 -2
@@ -6969,8 +6969,8 @@ static int cik_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* XXX this should actually be a bus address, not an MC address. same on older asics */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
drivers/gpu/drm/radeon/r600.c +2 -2
@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* set dummy read address to ring address */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
drivers/gpu/drm/radeon/si.c +2 -2
@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* set dummy read address to ring address */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 95/102 xdp: Fix cleanup on map free for devmap_hash map type
In reply to Greg Kroah-HartmanFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 071cdecec57fb5d5df78e6a12114ad7bccea5b0e ]
Tetsuo pointed out that it was not only the device unregister hook that was broken for devmap_hash types, it was also cleanup on map free. So better fix this as well.
While we're at it, there's no reason to allocate the netdev_map array for DEVMAP_HASH, so skip that and adjust the cost accordingly.
--- kernel/bpf/devmap.c | 74 ++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 28 deletions(-)
kernel/bpf/devmap.c +46 -28
@@ -74,7 +74,7 @@ struct bpf_dtab_netdev {struct bpf_dtab {struct bpf_map map; -struct bpf_dtab_netdev **netdev_map; +struct bpf_dtab_netdev **netdev_map;/* DEVMAP type only */ struct list_head __percpu *flush_list;struct list_head list;
@@ -101,6 +101,12 @@ static struct hlist_head *dev_map_create_hash(unsigned int entries)return hash; } +static inline struct hlist_head *dev_map_index_hash (struct bpf_dtab *dtab, +int idx) +{ +return &dtab->dev_index_head[idx & (dtab->n_buckets -1 )]; +} +static int dev_map_init_map (struct bpf_dtab *dtab,union bpf_attr *attr) {int err, cpu;
@@ -120,8 +126,7 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr)bpf_map_init_from_attr (&dtab->map, attr);/* make sure page count doesn't overflow */ - cost = (u64 ) dtab->map.max_entries *sizeof (struct bpf_dtab_netdev *); - cost +=sizeof (struct list_head ) *num_possible_cpus (); + cost = (u64 )sizeof (struct list_head ) *num_possible_cpus ();if (attr->map_type ==BPF_MAP_TYPE_DEVMAP_HASH ) { dtab->n_buckets =roundup_pow_of_two (dtab->map.max_entries);
@@ -129,6 +134,8 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr)if (!dtab->n_buckets)/* Overflow check */ return -EINVAL ; cost += (u64 )sizeof (struct hlist_head ) * dtab->n_buckets; + }else { + cost += (u64 ) dtab->map.max_entries *sizeof (struct bpf_dtab_netdev *); }/* if map size is larger than memlock limit, reject it */
@@ -143,24 +150,22 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr)for_each_possible_cpu (cpu)INIT_LIST_HEAD (per_cpu_ptr (dtab->flush_list, cpu)); - dtab->netdev_map =bpf_map_area_alloc (dtab->map.max_entries * -sizeof (struct bpf_dtab_netdev *), - dtab->map.numa_node); -if (!dtab->netdev_map) - goto free_percpu; -if (attr->map_type ==BPF_MAP_TYPE_DEVMAP_HASH ) { dtab->dev_index_head =dev_map_create_hash (dtab->n_buckets);if (!dtab->dev_index_head) - goto free_map_area; + goto free_percpu;spin_lock_init (&dtab->index_lock); + }else { + dtab->netdev_map =bpf_map_area_alloc (dtab->map.max_entries * +sizeof (struct bpf_dtab_netdev *), + dtab->map.numa_node); +if (!dtab->netdev_map) + goto free_percpu; }return 0 ; -free_map_area: -bpf_map_area_free (dtab->netdev_map); free_percpu:free_percpu (dtab->flush_list); free_charge:
@@ -228,21 +233,40 @@ static void dev_map_free(struct bpf_map *map)cond_resched (); } -for (i =0 ; i < dtab->map.max_entries; i++) { -struct bpf_dtab_netdev *dev; +if (dtab->map.map_type ==BPF_MAP_TYPE_DEVMAP_HASH ) { +for (i =0 ; i < dtab->n_buckets; i++) { +struct bpf_dtab_netdev *dev; +struct hlist_head *head; +struct hlist_node *next; - dev = dtab->netdev_map[i]; -if (!dev) -continue ; + head =dev_map_index_hash (dtab, i); -free_percpu (dev->bulkq); -dev_put (dev->dev); -kfree (dev); +hlist_for_each_entry_safe (dev, next, head, index_hlist) { +hlist_del_rcu (&dev->index_hlist); +free_percpu (dev->bulkq); +dev_put (dev->dev); +kfree (dev); + } + } + +kfree (dtab->dev_index_head); + }else { +for (i =0 ; i < dtab->map.max_entries; i++) { +struct bpf_dtab_netdev *dev; + + dev = dtab->netdev_map[i]; +if (!dev) +continue ; + +free_percpu (dev->bulkq); +dev_put (dev->dev); +kfree (dev); + } + +bpf_map_area_free (dtab->netdev_map); }free_percpu (dtab->flush_list); -bpf_map_area_free (dtab->netdev_map); -kfree (dtab->dev_index_head);kfree (dtab); }
@@ -263,12 +287,6 @@ static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key)return 0 ; } -static inline struct hlist_head *dev_map_index_hash (struct bpf_dtab *dtab, -int idx) -{ -return &dtab->dev_index_head[idx & (dtab->n_buckets -1 )]; -} -struct bpf_dtab_netdev *__dev_map_hash_lookup_elem (struct bpf_map *map,u32 key) { struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 96/102 platform/chrome: wilco_ec: fix use after free issue
In reply to Greg Kroah-HartmanFrom: Wen Yang <[email protected]>
[ Upstream commit 856a0a6e2d09d31fd8f00cc1fc6645196a509d56 ]
This is caused by dereferencing 'dev_data' after put_device() in the telem_device_remove() function.
This patch just moves the put_device() down a bit to avoid this issue.
--- drivers/platform/chrome/wilco_ec/telemetry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/telemetry.c +1 -1
@@ -406,8 +406,8 @@ static int telem_device_remove(struct platform_device *pdev)struct telem_device_data *dev_data =platform_get_drvdata (pdev);cdev_device_del (&dev_data->cdev, &dev_data->dev); -put_device (&dev_data->dev);ida_simple_remove (&telem_ida,MINOR (dev_data->dev.devt)); +put_device (&dev_data->dev);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 97/102 block: fix memleak of bio integrity data
In reply to Greg Kroah-HartmanFrom: Justin Tee <[email protected]>
[ Upstream commit ece841abbed2da71fa10710c687c9ce9efb6bf69 ]
7c20f11680a4 ("bio-integrity: stop abusing bi_end_io") moves bio_integrity_free from bio_uninit() to bio_integrity_verify_fn() and bio_endio(). This way looks wrong because bio may be freed without calling bio_endio(), for example, blk_rq_unprep_clone() is called from dm_mq_queue_rq() when the underlying queue of dm-mpath is busy.
So memory leak of bio integrity data is caused by commit 7c20f11680a4.
Fixes this issue by re-adding bio_integrity_free() to bio_uninit().
Signed-off-by Justin Tee <[email protected]>
Add commit log, and simplify/fix the original patch wroten by Justin.
--- block/bio-integrity.c | 2 +- block/bio.c | 3 +++ block/blk.h | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-)
block/bio-integrity.c +1 -1
@@ -87,7 +87,7 @@ EXPORT_SYMBOL(bio_integrity_alloc);* Description: Used to free the integrity portion of a bio. Usually * called from bio_free(). */ -static void bio_integrity_free (struct bio *bio) +void bio_integrity_free (struct bio *bio) {struct bio_integrity_payload *bip =bio_integrity (bio);struct bio_set *bs = bio->bi_pool;
block/bio.c +3 -0
@@ -233,6 +233,9 @@ fallback:void bio_uninit (struct bio *bio) {bio_disassociate_blkg (bio); + +if (bio_integrity (bio)) +bio_integrity_free (bio); }EXPORT_SYMBOL (bio_uninit);
block/blk.h +4 -0
@@ -122,6 +122,7 @@ static inline void blk_rq_bio_prep(struct request *rq, struct bio *bio,#ifdef CONFIG_BLK_DEV_INTEGRITY void blk_flush_integrity (void );bool __bio_integrity_endio (struct bio *); +void bio_integrity_free (struct bio *bio);static inline bool bio_integrity_endio (struct bio *bio) {if (bio_integrity (bio))
@@ -167,6 +168,9 @@ static inline bool bio_integrity_endio(struct bio *bio) {return true; } +static inline void bio_integrity_free (struct bio *bio) +{ +}#endif /* CONFIG_BLK_DEV_INTEGRITY */ unsigned long blk_rq_timeout (unsigned long timeout);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 98/102 s390/qeth: fix dangling IO buffers after halt/clear
In reply to Greg Kroah-HartmanFrom: Julian Wiedmann <[email protected]>
[ Upstream commit f9e50b02a99c3ebbaa30690e8d5be28a5c2624eb ]
The cio layer's intparm logic does not align itself well with how qeth manages cmd IOs. When an active IO gets terminated via halt/clear, the corresponding IRQ's intparm does not reflect the cmd buffer but rather the intparm that was passed to ccw_device_halt() / ccw_device_clear(). This behaviour was recently clarified in
commit b91d9e67e50b ("s390/cio: fix intparm documentation").
As a result, qeth_irq() currently doesn't cancel a cmd that was terminated via halt/clear. This primarily causes us to leak card->read_cmd after the qeth device is removed, since our IO path still holds a refcount for this cmd.
For qeth this means that we need to keep track of which IO is pending on a device ('active_cmd'), and use this as the intparm when calling halt/clear. Otherwise qeth_irq() can't match the subsequent IRQ to its cmd buffer.
Since we now keep track of the _expected_ intparm, we can also detect any mismatch; this would constitute a bug somewhere in the lower layers. In this case cancel the active cmd - we effectively "lost" the IRQ and should not expect any further notification for this IO.
--- drivers/s390/net/qeth_core.h | 3 ++ drivers/s390/net/qeth_core_main.c | 71 ++++++++++++++++++++++--------- drivers/s390/net/qeth_core_mpc.h | 14 ------ drivers/s390/net/qeth_l2_main.c | 12 +++--- drivers/s390/net/qeth_l3_main.c | 13 +++--- 5 files changed, 67 insertions(+), 46 deletions(-)
drivers/s390/net/qeth_core.h +3 -0
@@ -620,6 +620,7 @@ struct qeth_ipato {struct qeth_channel {struct ccw_device *ccwdev; +struct qeth_cmd_buffer *active_cmd;enum qeth_channel_states state;atomic_t irq_pending; };
@@ -1024,6 +1025,8 @@ int qeth_do_run_thread(struct qeth_card *, unsigned long);void qeth_clear_thread_start_bit (struct qeth_card *,unsigned long );void qeth_clear_thread_running_bit (struct qeth_card *,unsigned long );int qeth_core_hardsetup_card (struct qeth_card *card,bool *carrier_ok); +int qeth_stop_channel (struct qeth_channel *channel); +void qeth_print_status_message (struct qeth_card *);int qeth_init_qdio_queues (struct qeth_card *); int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
drivers/s390/net/qeth_core_main.c +51 -20
135 lines not on this page · raw message
drivers/s390/net/qeth_core_mpc.h +0 -14
@@ -28,20 +28,6 @@ extern unsigned char IPA_PDU_HEADER[];#define QETH_TIMEOUT (10 * HZ)#define QETH_IPA_TIMEOUT (45 * HZ) -#define QETH_CLEAR_CHANNEL_PARM -10 -#define QETH_HALT_CHANNEL_PARM -11 - -static inline bool qeth_intparm_is_iob (unsigned long intparm) -{ -switch (intparm) { -case QETH_CLEAR_CHANNEL_PARM : -case QETH_HALT_CHANNEL_PARM : -case 0 : -return false; - } -return true; -} -/*****************************************************************************/ /* IP Assist related definitions */ /*****************************************************************************/
drivers/s390/net/qeth_l2_main.c +6 -6
@@ -877,9 +877,9 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) out_remove:qeth_l2_stop_card (card); -ccw_device_set_offline (CARD_DDEV (card)); -ccw_device_set_offline (CARD_WDEV (card)); -ccw_device_set_offline (CARD_RDEV (card)); +qeth_stop_channel (&card->data); +qeth_stop_channel (&card->write); +qeth_stop_channel (&card->read);qdio_free (CARD_DDEV (card));mutex_unlock (&card->conf_mutex);
@@ -910,9 +910,9 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,rtnl_unlock ();qeth_l2_stop_card (card); - rc =ccw_device_set_offline (CARD_DDEV (card)); - rc2 =ccw_device_set_offline (CARD_WDEV (card)); - rc3 =ccw_device_set_offline (CARD_RDEV (card)); + rc =qeth_stop_channel (&card->data); + rc2 =qeth_stop_channel (&card->write); + rc3 =qeth_stop_channel (&card->read);if (!rc) rc = (rc2) ? rc2 : rc3;if (rc)
drivers/s390/net/qeth_l3_main.c +7 -6
@@ -2383,9 +2383,9 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)return 0 ; out_remove:qeth_l3_stop_card (card); -ccw_device_set_offline (CARD_DDEV (card)); -ccw_device_set_offline (CARD_WDEV (card)); -ccw_device_set_offline (CARD_RDEV (card)); +qeth_stop_channel (&card->data); +qeth_stop_channel (&card->write); +qeth_stop_channel (&card->read);qdio_free (CARD_DDEV (card));mutex_unlock (&card->conf_mutex);
@@ -2421,9 +2421,10 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev,call_netdevice_notifiers (NETDEV_REBOOT , card->dev);rtnl_unlock (); } - rc =ccw_device_set_offline (CARD_DDEV (card)); - rc2 =ccw_device_set_offline (CARD_WDEV (card)); - rc3 =ccw_device_set_offline (CARD_RDEV (card)); + + rc =qeth_stop_channel (&card->data); + rc2 =qeth_stop_channel (&card->write); + rc3 =qeth_stop_channel (&card->read);if (!rc) rc = (rc2) ? rc2 : rc3;if (rc)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 99/102 net-sysfs: Call dev_hold always in netdev_queue_add_kobject
In reply to Greg Kroah-HartmanFrom: Jouni Hogander <[email protected]>
[ Upstream commit e0b60903b434a7ee21ba8d8659f207ed84101e89 ]
Dev_hold has to be called always in netdev_queue_add_kobject. Otherwise usage count drops below 0 in case of failure in kobject_init_and_add.
--- net/core/net-sysfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/core/net-sysfs.c +5 -2
@@ -1462,14 +1462,17 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index)struct kobject *kobj = &queue->kobj;int error =0 ; +/* Kobject_put later will trigger netdev_queue_release call +* which decreases dev refcount: Take that reference here +*/ +dev_hold (queue->dev); + kobj->kset = dev->queues_kset; error =kobject_init_and_add (kobj, &netdev_queue_ktype,NULL ,"tx-%u" , index);if (error) goto err; -dev_hold (queue->dev); -#ifdef CONFIG_BQL error =sysfs_create_group (kobj, &dql_group);if (error)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 100/102 gpio: aspeed: avoid return type warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 11e299de3aced4ea23a9fb1fef6c983c8d516302 ]
gcc has a hard time tracking whether BUG_ON(1) ends execution or not:
drivers/gpio/gpio-aspeed-sgpio.c: In function 'bank_reg':drivers/gpio/gpio-aspeed-sgpio.c:112:1: error: control reaches end of non-void function [-Werror=return-type]
Use the simpler BUG() that gcc knows cannot continue.
--- drivers/gpio/sgpio-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/sgpio-aspeed.c +1 -1
@@ -107,7 +107,7 @@ static void __iomem *bank_reg(struct aspeed_sgpio *gpio,return gpio->base + bank->irq_regs +GPIO_IRQ_STATUS ;default :/* acturally if code runs to here, it's an error case */ -BUG_ON (1 ); +BUG (); } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 101/102 phy/rockchip: inno-hdmi: round clock rate down to closest 1000 Hz
In reply to Greg Kroah-HartmanFrom: Jonas Karlman <[email protected]>
[ Upstream commit 4f510aa10468954b1da4e94689c38ac6ea8d3627 ]
Commit 287422a95fe2 ("drm/rockchip: Round up _before_ giving to the clock framework") changed what rate clk_round_rate() is called with, an additional 999 Hz added to the requsted mode clock. This has caused a regression on RK3328 and presumably also on RK3228 because the inno-hdmi-phy clock requires an exact match of the requested rate in the pre pll config table.
When an exact match is not found the parent clock rate (24MHz) is returned to the clk_round_rate() caller. This cause wrong pixel clock to be used and result in no-signal when configuring a mode on RK3328.
Fix this by rounding the rate down to closest 1000 Hz in round_rate func, this allows an exact match to be found in pre pll config table.
--- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +4 -0
@@ -603,6 +603,8 @@ static long inno_hdmi_phy_rk3228_clk_round_rate(struct clk_hw *hw, {const struct pre_pll_config *cfg = pre_pll_cfg_table; + rate = (rate /1000 ) *1000 ; +for (; cfg->pixclock !=0 ; cfg++)if (cfg->pixclock == rate && !cfg->fracdiv)break ;
@@ -755,6 +757,8 @@ static long inno_hdmi_phy_rk3328_clk_round_rate(struct clk_hw *hw, {const struct pre_pll_config *cfg = pre_pll_cfg_table; + rate = (rate /1000 ) *1000 ; +for (; cfg->pixclock !=0 ; cfg++)if (cfg->pixclock == rate)break ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 102/102 optee: Fix multi page dynamic shm pool alloc
In reply to Greg Kroah-HartmanFrom: Sumit Garg <[email protected]>
[ Upstream commit 5a769f6ff439cedc547395a6dc78faa26108f741 ]
optee_shm_register() expected pages to be passed as an array of page pointers rather than as an array of contiguous pages. So fix that via correctly passing pages as per expectation.
--- drivers/tee/optee/shm_pool.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/tee/optee/shm_pool.c +14 -1
@@ -28,9 +28,22 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, shm->size =PAGE_SIZE << order;if (shm->flags &TEE_SHM_DMA_BUF ) { +unsigned int nr_pages =1 << order, i; +struct page **pages; + + pages =kcalloc (nr_pages,sizeof (pages),GFP_KERNEL ); +if (!pages) +return -ENOMEM ; + +for (i =0 ; i < nr_pages; i++) { + pages[i] = page; + page++; + } + shm->flags |=TEE_SHM_REGISTER ; - rc =optee_shm_register (shm->ctx, shm, &page,1 << order, + rc =optee_shm_register (shm->ctx, shm, pages, nr_pages, (unsigned long )shm->kaddr); +kfree (pages); }return rc;
Signature · 1 line
2.20.1
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +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.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
Quoted 6 lines
thanks,
greg k-h
Andrii Nakryiko <[email protected]>
libbpf: Fix call relocation offset calculation bug
Perf build failed on stable-rc 5.4 branch for arm, arm64, x86_64 and i386.
libbpf.c: In function 'bpf_program__collect_reloc':
libbpf.c:1795:5: error: implicit declaration of function 'pr_warn'; did you mean 'pr_warning'? [-Werror=implicit-function-declaration]
pr_warn("bad call relo offset: %lu\n", sym.st_value);
^~~~~~~
pr_warninglibbpf.c:1795:5: error: nested extern declaration of 'pr_warn' [-Werror=nested-externs]
Makefile:653: arch/arm64/Makefile: No such file or directory
cc1: all warnings being treated as errors
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Jon Hunter
maintainerQuoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
All tests are passing for Tegra ...
Test results for stable-v5.4:
13 builds: 13 pass, 0 fail
22 boots: 22 pass, 0 fail
40 tests: 40 pass, 0 failLinux version: 5.4.15-rc1-g28d0c8c0a7ca
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Cheers
Jon
Signature · 1 line
nvpublic
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Greg Kroah-Hartman
maintainerQuoted 15 lines · shuah
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +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.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing all of these and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +0000. Anything received after that time might be too late.
For v5.4.14-102-g5b29268443c0:
Build results:
total: 158 pass: 158 fail: 0 Qemu test results: total: 389 pass: 389 fail: 0
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +0000. Anything received after that time might be too late.
Quoted 6 lines
For v5.4.14-102-g5b29268443c0:
Build results:
total: 158 pass: 158 fail: 0 Qemu test results: total: 389 pass: 389 fail: 0
Great, thanks for testing all of these and letting me know.
greg k-h
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
rc2 test results report.
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 5.4.15-rc2
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.4.y
git commit: 5b29268443c010e77bd281f8439188f03c4cdf7c
git describe: v5.4.14-102-g5b29268443c0
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/build/v5.4.14-102-g5b29268443c0
No regressions (compared to build v5.4.14)
No fixes (compared to build v5.4.14)
Ran 25632 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libgpiod
* libhugetlbfs
* linux-log-parser
* ltp-containers-tests
* ltp-cve-tests
* ltp-fs-tests
* ltp-hugetlb-tests
* ltp-mm-tests
* spectre-meltdown-checker-test
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-cpuhotplug-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* network-basic-tests
* perf
* v4l2-compliance
* ltp-open-posix-tests
* kvm-unit-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
* ssuite
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 17 lines · Naresh Kamboju
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.15 release. There are 102 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 Sun, 26 Jan 2020 09:26:29 +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.15-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.
Quoted 8 lines
Quoted 3 lines
thanks,
greg k-h
rc2 test results report.
Results from Linaro’s test farm.
No regressions on arm64, arm,x86_64, and i386.
Thanks for testing all of these and letting me know.
greg k-h