Commit graph

889,307 commits

Author SHA1 Message Date
qctecmdr
402d0f255e Merge "defconfig: Shima: enable recommended memory configs" 2020-08-06 03:32:49 -07:00
qctecmdr
f7021dc9b9 Merge "serial: msm_geni_serial: Do not place msm_geni_console_setup under __init" 2020-08-06 03:32:48 -07:00
Odelu Kukatla
49f651e328 arm64: defconfig: Enable interconnect driver for Holi
Enable the interconnect driver so that consumers are
able to obtain their path handles properly.

Change-Id: Ic9b11ac283beb5d1c00ba98564377d214d323a82
Signed-off-by: Odelu Kukatla <[email protected]>
2020-08-06 13:37:52 +05:30
qctecmdr
64d377e6a2 Merge "soc-compress: Update error handling to cleanup backend" 2020-08-06 00:53:21 -07:00
qctecmdr
60fd474f45 Merge "msm: msi: add support for Synopsys MSI" 2020-08-06 00:53:21 -07:00
qctecmdr
95e9552b1a Merge "sched/walt: Improve the scheduler" 2020-08-06 00:53:20 -07:00
qctecmdr
734fd627ac Merge "power: supply: qti_battery_charger: update USB power supply type runtime" 2020-08-06 00:53:20 -07:00
qctecmdr
e3dad1cb95 Merge "cnss2: Check device power state for Suspend / Resume operations" 2020-08-06 00:53:19 -07:00
qctecmdr
98161b4faa Merge "ABI: Disable USB_ROLE_SWITCH and TYPEC in GKI" 2020-08-06 00:53:19 -07:00
himta ram
b32df69673 RTC6226: disable the RDS during scan operation
RDS enable is set during scanning and it causing the
incorrect register update for rtc6226 chip and this
leads to no audio issue.
Set the RDS enable bit to 0 before scanning and
set to 1 after scanning finishes.

CRs-Fixed: 2744378
Change-Id: I2c2fae1e01fb1fadccbc9133f472fca996bc2496
Signed-off-by: himta ram <[email protected]>
2020-08-05 22:32:03 -07:00
qctecmdr
60c110ac9c Merge "msm: adsprpc: check for fastrpc session ctx initialization" 2020-08-05 19:48:50 -07:00
qctecmdr
581a648da0 Merge "usb: phy: snps: Enable auto-resume during host mode bus suspend" 2020-08-05 19:48:49 -07:00
qctecmdr
562c20cd32 Merge "sched/fair: Add policy for restricting prefer_spread to newly idle balance" 2020-08-05 19:48:49 -07:00
qctecmdr
28b12c5b97 Merge "spi: spi-msm-geni: Add lock/unlock tre support in SPI GSI mode" 2020-08-05 19:48:49 -07:00
qctecmdr
64b7fed46b Merge "soc: qcom: Skip setting wakeup for ipcc irqchip" 2020-08-05 19:48:48 -07:00
qctecmdr
cbabda2667 Merge "defconfig: Support for SSG HLOS drivers" 2020-08-05 19:48:48 -07:00
Mahesh Kumar Sharma
83d4e2a32b Bluetooth: Update TCS content table based on PA config
When BT is turned ON on a platform using external power
amplifier(xPA), default voting ON of S3E buck results in
PMIC crash.
Solution is to disable S3E by default in AOP and enable it
dynamically based on the power amplifier confifuration
read from NVM. Handle IOCTL call for setting power
amplifier configuration from BT power driver.

Change-Id: Ibe7ef17481e33456c4692d0820ff44d9f43995de
Signed-off-by: Mahesh Kumar Sharma <[email protected]>
2020-08-05 19:16:02 -07:00
Manikandan Mohan
017791027b cnss2: Add support for PCIE gen switch
Add support for PCIE gen switch request from wlan driver using
QMI message to FW.

Change-Id: I6ea4ee234a38162cb9093d36d580c872b4d62644
Signed-off-by: Manikandan Mohan <[email protected]>
2020-08-05 18:34:36 -07:00
Himateja Reddy
78b3a77c76 msm: adsprpc: do not check for domains support in kernel
Do not check for domains support in kernel as the capability is
queried in userspace itself.

Change-Id: I6b014648ff19d9bfba6f94db078ff748e7de8ce6
Acked-by: Thyagarajan Venkatanarayanan <[email protected]>
Signed-off-by: Himateja Reddy <[email protected]>
2020-08-05 18:29:28 -07:00
George Shen
1b3ae4aa6d msm: cvp: power off cvp core before fw boot
Add it to CVP cold boot path.

Change-Id: I41dd08ee52186fb1779d995d5af6570efed8f943
Signed-off-by: George Shen <[email protected]>
2020-08-05 16:26:50 -07:00
Manikandan Mohan
85799b3a85 cnss2: Check device power state for Suspend / Resume operations
If WLAN driver probe fails, its intenal state may not be
proper. Thus check for device powered on state before calling
WLAN driver operations for suspend / resume.

Change-Id: I81da8969e9b0e0525256db8da2c0db25a996b241
Signed-off-by: Manikandan Mohan <[email protected]>
2020-08-05 15:06:46 -07:00
qctecmdr
c0410e7e36 Merge "Merge android11-5.4.54 (261a54f) into msm-5.4" 2020-08-05 15:01:28 -07:00
Subbaraman Narayanamurthy
466c5d5e26 power: supply: qti_battery_charger: update USB power supply type runtime
Currently, USB power supply type is set to POWER_SUPPLY_TYPE_USB
in power supply descriptor. power_supply_show_property() would
show POWER_SUPPLY_PROP_TYPE based on psy->desc->type. Userspace
process like healthd would read POWER_SUPPLY_PROP_TYPE to print
the adapter type in logs (e.g. "chg=u" for SDP, "chg=a" for DCP).
Hence update usb_psy_desc type runtime to show the USB power
supply type accordingly. This is useful for testing.

Change-Id: Icd88098f97beba053105d826614b4182f3716144
Signed-off-by: Subbaraman Narayanamurthy <[email protected]>
2020-08-05 14:48:30 -07:00
Subbaraman Narayanamurthy
9c3f7e472c power: supply: qti_battery_charger: add some more properties
To support userspace application and testing, add some more
properties under USB power supply and qcom-battery class.

To show USB connector temperature, following property is added.

- /sys/class/power_supply/usb/temp

To support restricted charging similar to legacy targets,
following parameters are added.

- /sys/class/qcom-battery/restrict_cur
- /sys/class/qcom-battery/restrict_chg

To show whether the Type-C sink/source connected is compliant,
following parameter is added.

- /sys/class/qcom-battery/usb_typec_compliant

To show the custom USB_TYPE for Quick charge adapters like HVDCP,
HVDCP3 etc., following parameter is added.

- /sys/class/qcom-battery/usb_real_type.

Change-Id: Ia8dfba41c6ed3056dda588a1955a60ef19568112
Signed-off-by: Subbaraman Narayanamurthy <[email protected]>
2020-08-05 14:48:22 -07:00
Raghavendra Rao Ananta
aa30ee3b61 build.config.common: Move to clang-11
Switch the clang version to r383902 (clang-11). Update the
ABI snapshot accordingly.

Change-Id: I12e60c1bb3bd1e64f26bdc0b85b08e5e08b72ae9
Signed-off-by: Raghavendra Rao Ananta <[email protected]>
2020-08-05 14:34:03 -07:00
Himateja Reddy
4d7fb4cc7f msm: adsprpc: Clean buffers on remote invocation failure
Current code doesn't clean up buffers and dma handles when failure
is seen in the remote invocation to DSP. This will end up leaking
buffers and also dma handles pointing to wrong memory in the fastrpc
kernel. Clean buffers and dma handles even when remote invocation to
DSP returns failure.

Change-Id: I23998a1825f14a4c97380e284626df18f5045ed8
Signed-off-by: Himateja Reddy <[email protected]>
2020-08-05 10:15:11 -07:00
Jordan Crouse
fc44c0ba38 msm_rtb: Don't lose the __user tag on relaxed reads/writes
The RTB logging was accidently losing the __user tag from I/O operation
addresses which caused the static analysis tools to be upset. Force a
void * address for the logger but leave the original address untouched for
the actual operation.

Change-Id: Ic0dedbad38a49d6bfd9e102f91bbf9ae21c4c14c
Signed-off-by: Jordan Crouse <[email protected]>
2020-08-05 11:07:01 -06:00
Neeraj Upadhyay
80a75f12de drivers: edac: Add panic notifier for kryo EDAC device
Add panic notifier, which captures any cache errors
which were not handled, due to interrupts not getting
handled.

Change-Id: I9315a32dcbf6fdfa509c4ab934b75d076fedfa39
Signed-off-by: Neeraj Upadhyay <[email protected]>
Signed-off-by: Mukesh Ojha <[email protected]>
2020-08-05 22:18:35 +05:30
Faiyaz Mohammed
3ff95e2841 defconfig: Shima: enable recommended memory configs
Enable recommended memory configs.

Change-Id: I0fd0fefb27178cc18e66e56f6c30465cdd270991
Signed-off-by: Faiyaz Mohammed <[email protected]>
2020-08-05 07:29:24 -07:00
Rohith Kollalsi
a215b92aa2 usb: u_ether: Add null pointer check for sk_buff in eth_start_xmit
There is a possibility of null pointer dereference for sk_buff in
the function eth_start_xmit. Fix this by removing sk_buff from if
check at the start of the function eth_start_xmit so that if sk_buff
is null dev_kfree_skb_any will return without proceeding further.

Change-Id: I105e42c59aaa83c8d74cc5a9e894ae4fc87c3c9f
Signed-off-by: Rohith Kollalsi <[email protected]>
2020-08-05 06:48:13 -07:00
Akash Asthana
d6433f75e5 serial: msm_geni_serial: Do not place msm_geni_console_setup under __init
msm_geni_console_setup() can be potentially called from the driver's
probe via uart_add_one_port(). Since it's placed under __init, the
function would be discarded as soon as the module_init portion of the
driver completes, and when called during probe, it causes an instruction
abort. As a result, move the msm_geni_console_setup() out of __init.

Change-Id: I27ebdcd0832bb49d66e85b250b652cc38f4aa333
Signed-off-by: Akash Asthana <[email protected]>
2020-08-05 06:14:34 -07:00
Naman Padhiar
f75af2ca53 icnss2: Do not clear SHUTDOWN_DONE flag until reinit is done
In case of SSR/PDR, when FW comes up, platform driver receives
FW_READY indication. As part of FW_READY, platform driver calls
shutdown and reinit ops of host driver.
Clear SHUTDOWN_DONE flag at right place so that if reinit is not
called SSR/PDR because of FW again went down between calling driver
shutdown and reinit then next time directly call reinit and avoid
calling shutdown.

Change-Id: Icdd259d52db1b84203a9efb2e5948207f3213ce6
Signed-off-by: Naman Padhiar <[email protected]>
2020-08-05 05:32:03 -07:00
Naman Padhiar
1ffeb96f43 icnss2: Add support for Runtime PM
Add Runtime Suspend/Resume Callbaks, to enable Runtime PM
on Moselle platform.

Change-Id: Ie906652cca4dd69f9f3e8dbe811eeaf1322b2a1c
Signed-off-by: Naman Padhiar <[email protected]>
2020-08-05 17:44:22 +05:30
Sai Harshini Nimmala
94ee947a37 soc: qcom: hyp_core_ctl: Minor cleanup
Change member sid in driver data structure to cap_id.
Fix condition check in hh_vcpu_done_populate_affinity_info for better
readability.

Change-Id: Idc7f8a4fd6b6a7ac8e004eb96c2020a9f1f4444b
Signed-off-by: Sai Harshini Nimmala <[email protected]>
2020-08-05 05:09:05 -07:00
Satya Durga Srinivasu Prabhala
c1b84fedb0 soc: qcom: hyp_core_ctl: fix issue with CPU Freq policy dependency
commit 9acfa80c3d
("BACKPORT: driver core: fw_devlink: Add support for batching fwnode parsing")
changed the way drivers gets probed and by the time hyp core ctl driver tries
to get CPU freq policy, cpufreq driver is not probed which leads to hyp core
ctl driver probe failure. Fix the dependency on CPU Freq policy by moving
freq qos initialization from probe to first write of the min freq node.

Change-Id: I75c628e768ee37a78d1ee54df3e55b6d2389f9a2
Signed-off-by: Satya Durga Srinivasu Prabhala <[email protected]>
2020-08-05 05:08:59 -07:00
Fei Mao
327cd14766 input: touchscreen: focaltech_touch: support dynamic report rate
Add a new sys node to support runtime dynamic report rate.

Change-Id: Ifa7f4290b648f79cfeec80ae421af4c7c7a36aaf
Signed-off-by: Fei Mao <[email protected]>
2020-08-05 18:51:11 +08:00
Greg Kroah-Hartman
fcb0d3ef9b This is the 5.4.56 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl8qZwoACgkQONu9yGCS
 aT4gVA//ZuAjdnvfTBp3wvPu4D507HBz2hPqsJXVzJrt+Icw5qOqG5kn9icDfgVF
 VUNAFD3evDkESFe2OV/gZR3Qu9JNyJk0GVQGkzFPnxCX7FP+XaIHHNBDALBem1SA
 8e3coFTMaqf1W8ualF/gpogYVz8SkbzqU+GOOA/+y8dQwyXtRrbIv8XuxQfmbMfD
 +ttaqeytm6deBYNL/Ok2Lxl3H01ShchdmKLFn5L3M6GiKzucp7NYWOz0luEF1Uak
 jsShFl+DfKT3Lq666CmecoyvLug5VWGPLvNm/UeJHwHZBr2KFWmTbMTIo/6gB9Ud
 YNv5xwZXKflUZlV3i0jeAVYQ4vNrtsCpOTqnkw8JpW78sJPfb9Ozlvk/XgnXEtpl
 ojv2eX5R+5yxPp8yJoxwBmuaoYYEsngTXsgTzQ2T+bvSWtUK8qyoTCa+6FEG6ylv
 DkMIMSvdb9AC80KbfN5cCNEloryoaEPp4aXgqX0E6ZKAWvuAfnS+7ohPCw1x12D6
 VqwAinq0gnie8TD9E3Bcn3m2COFwF/Ow38uO4F/gQ9zcOXS6+QiqrpQwCzSVdumU
 NQHJbvMFwfMR35yN2lo87Xk8MvHLhloKIIBhmxAMaGR2NRwg9w2vDkxfjuZUiElz
 YKOhNw51jFwCkMUtLJmn6pon/DGnDH23+/2LC0oqGNLASG7sUjQ=
 =A5pn
 -----END PGP SIGNATURE-----

Merge 5.4.56 into android11-5.4

Changes in 5.4.56
	crypto: ccp - Release all allocated memory if sha type is invalid
	media: rc: prevent memory leak in cx23888_ir_probe
	sunrpc: check that domain table is empty at module unload.
	ath10k: enable transmit data ack RSSI for QCA9884
	PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge
	mm/filemap.c: don't bother dropping mmap_sem for zero size readahead
	ALSA: usb-audio: Add implicit feedback quirk for SSL2
	ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289
	ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289
	ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256)
	ALSA: hda/realtek - Fixed HP right speaker no sound
	ALSA: hda/hdmi: Fix keep_power assignment for non-component devices
	IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE
	vhost/scsi: fix up req type endian-ness
	9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
	wireless: Use offsetof instead of custom macro.
	ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints
	ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2
	ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2
	ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect
	virtio_balloon: fix up endian-ness for free cmd id
	Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
	drm/amd/display: Clear dm_state for fast updates
	drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
	drm/dbi: Fix SPI Type 1 (9-bit) transfer
	drm: hold gem reference until object is no longer accessed
	rds: Prevent kernel-infoleak in rds_notify_queue_get()
	libtraceevent: Fix build with binutils 2.35
	net/x25: Fix x25_neigh refcnt leak when x25 disconnect
	net/x25: Fix null-ptr-deref in x25_disconnect
	xfrm: policy: match with both mark and mask on user interfaces
	ARM: dts sunxi: Relax a bit the CMA pool allocation range
	xfrm: Fix crash when the hold queue is used.
	ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds
	nvme-tcp: fix possible hang waiting for icresp response
	selftests/net: rxtimestamp: fix clang issues for target arch PowerPC
	selftests/net: psock_fanout: fix clang issues for target arch PowerPC
	selftests/net: so_txtime: fix clang issues for target arch PowerPC
	sh/tlb: Fix PGTABLE_LEVELS > 2
	sh: Fix validation of system call number
	net: hns3: fix a TX timeout issue
	net: hns3: fix aRFS FD rules leftover after add a user FD rule
	net/mlx5: E-switch, Destroy TSAR when fail to enable the mode
	net/mlx5e: Fix error path of device attach
	net/mlx5: Verify Hardware supports requested ptp function on a given pin
	net/mlx5e: Modify uplink state on interface up/down
	net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev
	net: lan78xx: add missing endpoint sanity check
	net: lan78xx: fix transfer-buffer memory leak
	rhashtable: Fix unprotected RCU dereference in __rht_ptr
	mlx4: disable device on shutdown
	mlxsw: core: Increase scope of RCU read-side critical section
	mlxsw: core: Free EMAD transactions using kfree_rcu()
	ibmvnic: Fix IRQ mapping disposal in error path
	bpf: Fix map leak in HASH_OF_MAPS map
	mac80211: mesh: Free ie data when leaving mesh
	mac80211: mesh: Free pending skb when destroying a mpath
	arm64/alternatives: move length validation inside the subsection
	arm64: csum: Fix handling of bad packets
	Bluetooth: fix kernel oops in store_pending_adv_report
	net: nixge: fix potential memory leak in nixge_probe()
	net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()
	net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq
	perf tools: Fix record failure when mixed with ARM SPE event
	vxlan: fix memleak of fdb
	usb: hso: Fix debug compile warning on sparc32
	selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion
	qed: Disable "MFW indication via attention" SPAM every 5 minutes
	selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
	nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame
	scsi: core: Run queue in case of I/O resource contention failure
	parisc: add support for cmpxchg on u8 pointers
	net: ethernet: ravb: exit if re-initialization fails in tx timeout
	Revert "i2c: cadence: Fix the hold bit setting"
	x86/unwind/orc: Fix ORC for newly forked tasks
	x86/stacktrace: Fix reliable check for empty user task stacks
	cxgb4: add missing release on skb in uld_send()
	xen-netfront: fix potential deadlock in xennet_remove()
	RISC-V: Set maximum number of mapped pages correctly
	drivers/net/wan: lapb: Corrected the usage of skb_cow
	KVM: arm64: Don't inherit exec permission across page-table levels
	KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
	x86/i8259: Use printk_deferred() to prevent deadlock
	perf tests bp_account: Make global variable static
	perf env: Do not return pointers to local variables
	perf bench: Share some global variables to fix build with gcc 10
	Linux 5.4.56

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I06b0147860242cfcac3dd8a7acefdb211020cab1
2020-08-05 11:19:16 +02:00
Vipin Deep Kaur
67640229d7 spi: spi-msm-geni: Add lock/unlock tre support in SPI GSI mode
Add lock/unlock TRE support in SPI GSI mode for following cases.
Shared_ se is a multi-ee usecase where two Excecution Environments
simultaneously access an SE, the locking support here is enabled per
message i.e. gpii lock is taken in prepare_message api and gpii unlock
is done in unprepare_message api.
LE_VM usecase is the TUI usecase over spi where an SE is accessed between
LA and LE, here locking mechanism is provided per session i.e. gpii
lock is taken in pm_runtime_get_sync call and gpii unlock is done in
pm_runtime_put_sync call called by the client in LE.

Change-Id: I3f735aa5f7f98b13fccd49ebe8d83dcce5ca9b71
Signed-off-by: Vipin Deep Kaur <[email protected]>
2020-08-05 01:42:18 -07:00
Greg Kroah-Hartman
1b940bbc5c Linux 5.4.56
Tested-by: Shuah Khan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Arnaldo Carvalho de Melo
df35e878d0 perf bench: Share some global variables to fix build with gcc 10
commit e4d9b04b973b2dbce7b42af95ea70d07da1c936d upstream.

Noticed with gcc 10 (fedora rawhide) that those variables were not being
declared as static, so end up with:

  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-wait.o:/git/perf/tools/perf/bench/epoll-wait.c:93: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `end'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `start'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  ld: /tmp/build/perf/bench/epoll-ctl.o:/git/perf/tools/perf/bench/epoll-ctl.c:38: multiple definition of `runtime'; /tmp/build/perf/bench/futex-hash.o:/git/perf/tools/perf/bench/futex-hash.c:40: first defined here
  make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/bench/perf-in.o] Error 1

Prefix those with bench__ and add them to bench/bench.h, so that we can
share those on the tools needing to access those variables from signal
handlers.

Acked-by: Thomas Gleixner <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Arnaldo Carvalho de Melo
702d1b287f perf env: Do not return pointers to local variables
commit ebcb9464a2ae3a547e97de476575c82ece0e93e2 upstream.

It is possible to return a pointer to a local variable when looking up
the architecture name for the running system and no normalization is
done on that value, i.e. we may end up returning the uts.machine local
variable.

While this doesn't happen on most arches, as normalization takes place,
lets fix this by making that a static variable and optimize it a bit by
not always running uname(), only the first time.

Noticed in fedora rawhide running with:

  [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version
  gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8)

Reported-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Namhyung Kim <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Arnaldo Carvalho de Melo
73d2d6b421 perf tests bp_account: Make global variable static
commit cff20b3151ccab690715cb6cf0f5da5cccb32adf upstream.

To fix the build with newer gccs, that without this patch exit with:

    LD       /tmp/build/perf/tests/perf-in.o
  ld: /tmp/build/perf/tests/bp_account.o:/git/perf/tools/perf/tests/bp_account.c:22: multiple definition of `the_var'; /tmp/build/perf/tests/bp_signal.o:/git/perf/tools/perf/tests/bp_signal.c:38: first defined here
  make[4]: *** [/git/perf/tools/build/Makefile.build:145: /tmp/build/perf/tests/perf-in.o] Error 1

First noticed in fedora:rawhide/32 with:

  [perfbuilder@a5ff49d6e6e4 ~]$ gcc --version
  gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8)

Reported-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Namhyung Kim <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ben Hutchings <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Thomas Gleixner
3956854670 x86/i8259: Use printk_deferred() to prevent deadlock
commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 upstream.

0day reported a possible circular locking dependency:

Chain exists of:
  &irq_desc_lock_class --> console_owner --> &port_lock_key

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&port_lock_key);
                               lock(console_owner);
                               lock(&port_lock_key);
  lock(&irq_desc_lock_class);

The reason for this is a printk() in the i8259 interrupt chip driver
which is invoked with the irq descriptor lock held, which reverses the
lock operations vs. printk() from arbitrary contexts.

Switch the printk() to printk_deferred() to avoid that.

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Wanpeng Li
01ac46c6ba KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
commit d2286ba7d574ba3103a421a2f9ec17cb5b0d87a1 upstream.

Prevent setting the tscdeadline timer if the lapic is hw disabled.

Fixes: bce87cce88 (KVM: x86: consolidate different ways to test for in-kernel LAPIC)
Cc: <[email protected]>
Signed-off-by: Wanpeng Li <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:52 +02:00
Will Deacon
fd412846a6 KVM: arm64: Don't inherit exec permission across page-table levels
commit b757b47a2fcba584d4a32fd7ee68faca510ab96f upstream.

If a stage-2 page-table contains an executable, read-only mapping at the
pte level (e.g. due to dirty logging being enabled), a subsequent write
fault to the same page which tries to install a larger block mapping
(e.g. due to dirty logging having been disabled) will erroneously inherit
the exec permission and consequently skip I-cache invalidation for the
rest of the block.

Ensure that exec permission is only inherited by write faults when the
new mapping is of the same size as the existing one. A subsequent
instruction abort will result in I-cache invalidation for the entire
block mapping.

Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Tested-by: Quentin Perret <[email protected]>
Reviewed-by: Quentin Perret <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-05 09:59:51 +02:00
Xie He
1aff51292e drivers/net/wan: lapb: Corrected the usage of skb_cow
[ Upstream commit 8754e1379e7089516a449821f88e1fe1ebbae5e1 ]

This patch fixed 2 issues with the usage of skb_cow in LAPB drivers
"lapbether" and "hdlc_x25":

1) After skb_cow fails, kfree_skb should be called to drop a reference
to the skb. But in both drivers, kfree_skb is not called.

2) skb_cow should be called before skb_push so that is can ensure the
safety of skb_push. But in "lapbether", it is incorrectly called after
skb_push.

More details about these 2 issues:

1) The behavior of calling kfree_skb on failure is also the behavior of
netif_rx, which is called by this function with "return netif_rx(skb);".
So this function should follow this behavior, too.

2) In "lapbether", skb_cow is called after skb_push. This results in 2
logical issues:
   a) skb_push is not protected by skb_cow;
   b) An extra headroom of 1 byte is ensured after skb_push. This extra
      headroom has no use in this function. It also has no use in the
      upper-layer function that this function passes the skb to
      (x25_lapb_receive_frame in net/x25/x25_dev.c).
So logically skb_cow should instead be called before skb_push.

Cc: Eric Dumazet <[email protected]>
Cc: Martin Schiller <[email protected]>
Signed-off-by: Xie He <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-08-05 09:59:51 +02:00
Atish Patra
f88c909dc2 RISC-V: Set maximum number of mapped pages correctly
[ Upstream commit d0d8aae64566b753c4330fbd5944b88af035f299 ]

Currently, maximum number of mapper pages are set to the pfn calculated
from the memblock size of the memblock containing kernel. This will work
until that memblock spans the entire memory. However, it will be set to
a wrong value if there are multiple memblocks defined in kernel
(e.g. with efi runtime services).

Set the the maximum value to the pfn calculated from dram size.

Signed-off-by: Atish Patra <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-08-05 09:59:51 +02:00
Andrea Righi
e3043abb5b xen-netfront: fix potential deadlock in xennet_remove()
[ Upstream commit c2c633106453611be07821f53dff9e93a9d1c3f0 ]

There's a potential race in xennet_remove(); this is what the driver is
doing upon unregistering a network device:

  1. state = read bus state
  2. if state is not "Closed":
  3.    request to set state to "Closing"
  4.    wait for state to be set to "Closing"
  5.    request to set state to "Closed"
  6.    wait for state to be set to "Closed"

If the state changes to "Closed" immediately after step 1 we are stuck
forever in step 4, because the state will never go back from "Closed" to
"Closing".

Make sure to check also for state == "Closed" in step 4 to prevent the
deadlock.

Also add a 5 sec timeout any time we wait for the bus state to change,
to avoid getting stuck forever in wait_event().

Signed-off-by: Andrea Righi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-08-05 09:59:51 +02:00
Navid Emamdoost
a7b488d65d cxgb4: add missing release on skb in uld_send()
[ Upstream commit e6827d1abdc9b061a57d7b7d3019c4e99fabea2f ]

In the implementation of uld_send(), the skb is consumed on all
execution paths except one. Release skb when returning NET_XMIT_DROP.

Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-08-05 09:59:51 +02:00
Josh Poimboeuf
5f4e6b874b x86/stacktrace: Fix reliable check for empty user task stacks
[ Upstream commit 039a7a30ec102ec866d382a66f87f6f7654f8140 ]

If a user task's stack is empty, or if it only has user regs, ORC
reports it as a reliable empty stack.  But arch_stack_walk_reliable()
incorrectly treats it as unreliable.

That happens because the only success path for user tasks is inside the
loop, which only iterates on non-empty stacks.  Generally, a user task
must end in a user regs frame, but an empty stack is an exception to
that rule.

Thanks to commit 71c95825289f ("x86/unwind/orc: Fix error handling in
__unwind_start()"), unwind_start() now sets state->error appropriately.
So now for both ORC and FP unwinders, unwind_done() and !unwind_error()
always means the end of the stack was successfully reached.  So the
success path for kthreads is no longer needed -- it can also be used for
empty user tasks.

Reported-by: Wang ShaoBo <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Wang ShaoBo <[email protected]>
Link: https://lkml.kernel.org/r/f136a4e5f019219cbc4f4da33b30c2f44fa65b84.1594994374.git.jpoimboe@redhat.com
Signed-off-by: Sasha Levin <[email protected]>
2020-08-05 09:59:51 +02:00