This patch contains changes for returning power sources status
to BT HAL and also setting value of SW CTRL for CHE chip.
Change-Id: I8a0349171a5bbd516b098cc5a070804a454c2b7d
Signed-off-by: priyankar <prigup@codeaurora.org>
* refs/heads/tmp-fcb0d3e:
Linux 5.4.56
perf bench: Share some global variables to fix build with gcc 10
perf env: Do not return pointers to local variables
perf tests bp_account: Make global variable static
x86/i8259: Use printk_deferred() to prevent deadlock
KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
KVM: arm64: Don't inherit exec permission across page-table levels
drivers/net/wan: lapb: Corrected the usage of skb_cow
RISC-V: Set maximum number of mapped pages correctly
xen-netfront: fix potential deadlock in xennet_remove()
cxgb4: add missing release on skb in uld_send()
x86/stacktrace: Fix reliable check for empty user task stacks
x86/unwind/orc: Fix ORC for newly forked tasks
Revert "i2c: cadence: Fix the hold bit setting"
net: ethernet: ravb: exit if re-initialization fails in tx timeout
parisc: add support for cmpxchg on u8 pointers
scsi: core: Run queue in case of I/O resource contention failure
nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame
selftests: net: ip_defrag: modprobe missing nf_defrag_ipv6 support
qed: Disable "MFW indication via attention" SPAM every 5 minutes
selftests: fib_nexthop_multiprefix: fix cleanup() netns deletion
usb: hso: Fix debug compile warning on sparc32
vxlan: fix memleak of fdb
perf tools: Fix record failure when mixed with ARM SPE event
net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq
net: gemini: Fix missing clk_disable_unprepare() in error path of gemini_ethernet_port_probe()
net: nixge: fix potential memory leak in nixge_probe()
Bluetooth: fix kernel oops in store_pending_adv_report
arm64: csum: Fix handling of bad packets
arm64/alternatives: move length validation inside the subsection
mac80211: mesh: Free pending skb when destroying a mpath
mac80211: mesh: Free ie data when leaving mesh
bpf: Fix map leak in HASH_OF_MAPS map
ibmvnic: Fix IRQ mapping disposal in error path
mlxsw: core: Free EMAD transactions using kfree_rcu()
mlxsw: core: Increase scope of RCU read-side critical section
mlx4: disable device on shutdown
rhashtable: Fix unprotected RCU dereference in __rht_ptr
net: lan78xx: fix transfer-buffer memory leak
net: lan78xx: add missing endpoint sanity check
net/mlx5e: Fix kernel crash when setting vf VLANID on a VF dev
net/mlx5e: Modify uplink state on interface up/down
net/mlx5: Verify Hardware supports requested ptp function on a given pin
net/mlx5e: Fix error path of device attach
net/mlx5: E-switch, Destroy TSAR when fail to enable the mode
net: hns3: fix aRFS FD rules leftover after add a user FD rule
net: hns3: fix a TX timeout issue
sh: Fix validation of system call number
sh/tlb: Fix PGTABLE_LEVELS > 2
selftests/net: so_txtime: fix clang issues for target arch PowerPC
selftests/net: psock_fanout: fix clang issues for target arch PowerPC
selftests/net: rxtimestamp: fix clang issues for target arch PowerPC
nvme-tcp: fix possible hang waiting for icresp response
ARM: dts: armada-38x: fix NETA lockup when repeatedly switching speeds
xfrm: Fix crash when the hold queue is used.
ARM: dts sunxi: Relax a bit the CMA pool allocation range
xfrm: policy: match with both mark and mask on user interfaces
net/x25: Fix null-ptr-deref in x25_disconnect
net/x25: Fix x25_neigh refcnt leak when x25 disconnect
libtraceevent: Fix build with binutils 2.35
rds: Prevent kernel-infoleak in rds_notify_queue_get()
drm: hold gem reference until object is no longer accessed
drm/dbi: Fix SPI Type 1 (9-bit) transfer
drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
drm/amd/display: Clear dm_state for fast updates
Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
virtio_balloon: fix up endian-ness for free cmd id
ARM: dts: imx6qdl-icore: Fix OTG_ID pin and sdcard detect
ARM: dts: imx6sx-sdb: Fix the phy-mode on fec2
ARM: dts: imx6sx-sabreauto: Fix the phy-mode on fec2
ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints
wireless: Use offsetof instead of custom macro.
9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
vhost/scsi: fix up req type endian-ness
IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE
ALSA: hda/hdmi: Fix keep_power assignment for non-component devices
ALSA: hda/realtek - Fixed HP right speaker no sound
ALSA: hda/realtek: Fix add a "ultra_low_power" function for intel reference board (alc256)
ALSA: hda/realtek: typo_fix: enable headset mic of ASUS ROG Zephyrus G14(GA401) series with ALC289
ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G15(GA502) series with ALC289
ALSA: usb-audio: Add implicit feedback quirk for SSL2
mm/filemap.c: don't bother dropping mmap_sem for zero size readahead
PCI/ASPM: Disable ASPM on ASMedia ASM1083/1085 PCIe-to-PCI bridge
ath10k: enable transmit data ack RSSI for QCA9884
sunrpc: check that domain table is empty at module unload.
media: rc: prevent memory leak in cx23888_ir_probe
crypto: ccp - Release all allocated memory if sha type is invalid
ANDROID: ABI: Update allowed list for QCOM
Revert "ANDROID: GKI: update abi symbol lists now that CONFIG_DWC3 is enabled."
ANDROID: kallsyms: increase KSYM_NAME_LEN
ANDROID: GKI: update KMI after RCU CONFIGs added
ANDROID: GKI: enable RCU configs
ANDROID: KABI updates for db845c (USB_DWC3 whiplash fixups)
ANDROID: Revert "ANDROID: db845c_gki.fragment: Remove DWC3 modules built into GKI"
ANDROID: Open-code OWNERS emails for now
ANDROID: Initial OWNERS for abi metafiles
ANDROID: ABI: update symbols of charger-manager.ko to unisoc
ANDROID: GKI: fix symbol_get/put() build error on arm64 defconfig
ANDROID: GKI: Fix up "do not export symbol_get/put()" commit
Conflicts:
android/abi_gki_aarch64_qcom
mm/filemap.c
Change-Id: I24f59bf5cf2a9ab41ae0864beb8756eed0998345
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
* refs/heads/tmp-53b501f:
Revert "qrtr: orphan socket in qrtr_release()"
ANDROID: GKI: fix up abi definition files
Revert "ANDROID: GKI: Enable CONFIG_USB_DWC3"
ANDROID: GKI: remove symbols from sunxi for uas driver
Linux 5.4.55
Revert "dpaa_eth: fix usage as DSA master, try 3"
PM: wakeup: Show statistics for deleted wakeup sources again
regmap: debugfs: check count when read regmap file
udp: Improve load balancing for SO_REUSEPORT.
udp: Copy has_conns in reuseport_grow().
sctp: shrink stream outq when fails to do addstream reconf
sctp: shrink stream outq only when new outcnt < old outcnt
AX.25: Prevent integer overflows in connect and sendmsg
tcp: allow at most one TLP probe per flight
rxrpc: Fix sendmsg() returning EPIPE due to recvmsg() returning ENODATA
rtnetlink: Fix memory(net_device) leak when ->newlink fails
qrtr: orphan socket in qrtr_release()
net: udp: Fix wrong clean up for IS_UDPLITE macro
net-sysfs: add a newline when printing 'tx_timeout' by sysfs
ip6_gre: fix null-ptr-deref in ip6gre_init_net()
drivers/net/wan/x25_asy: Fix to make it work
dev: Defer free of skbs in flush_backlog
AX.25: Prevent out-of-bounds read in ax25_sendmsg()
AX.25: Fix out-of-bounds read in ax25_connect()
Revert "Revert "ANDROID: ALSA: jack: Update supported jack switch types""
Revert "Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check""
ANDROID: GKI: enable CONFIG_VIDEO_V4L2_SUBDEV_API
FROMLIST: power: add "Wireless" to power_supply_type and power_supply_type_text
Revert "ANDROID: ASoC: compress: fix unsigned integer overflow check"
Revert "ANDROID: ALSA: jack: Update supported jack switch types"
BACKPORT: FROMLIST: cpuidle: change enter_s2idle() prototype
Change-Id: I0dfd8e6b5e2a26997f144e542498f18f5f89408a
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
Adding changes for the new target and reading the FW name
from dtsi.
Change-Id: I224ebe001126c33c55fc039e74f42555a4dce1f8
Signed-off-by: suchawla <suchawla@codeaurora.org>
Enable the interconnect driver so that consumers are
able to obtain their path handles properly.
Change-Id: Ic9b11ac283beb5d1c00ba98564377d214d323a82
Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
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 <smahesh@codeaurora.org>
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 <manikand@codeaurora.org>
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 <subbaram@codeaurora.org>
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 <subbaram@codeaurora.org>
Switch the clang version to r383902 (clang-11). Update the
ABI snapshot accordingly.
Change-Id: I12e60c1bb3bd1e64f26bdc0b85b08e5e08b72ae9
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
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 <rkollals@codeaurora.org>
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 <akashast@codeaurora.org>
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 <snimmala@codeaurora.org>
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 <satyap@codeaurora.org>
Add a new sys node to support runtime dynamic report rate.
Change-Id: Ifa7f4290b648f79cfeec80ae421af4c7c7a36aaf
Signed-off-by: Fei Mao <feim1@codeaurora.org>
-----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 <gregkh@google.com>
Change-Id: I06b0147860242cfcac3dd8a7acefdb211020cab1
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 <vkaur@codeaurora.org>
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 <tglx@linutronix.de>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200303155811.GD13702@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>