OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
4 years agoSilences WLAN, PCIe, and CPU suspend state kernel messages
Nick Desaulniers [Tue, 23 Feb 2016 22:12:49 +0000 (14:12 -0800)]
Silences WLAN, PCIe, and CPU suspend state kernel messages

Bug: 27134656
Change-Id: I681ec2171472514489365ca4bfc4ef16d9b344fe

4 years agoPM / devfreq: bw_hwmon: Add missing mutex unlock
Michael Bestas [Mon, 4 Mar 2019 17:47:39 +0000 (19:47 +0200)]
PM / devfreq: bw_hwmon: Add missing mutex unlock

Fixes 28aab0311cfcd9b279f41f2f4da0085a660d5ed5
"PM/devfreq: bw_hwmon: add mutex lock in polling interval case"

Change-Id: I84ccefedbc9d9c0d25806799451346b6a46bae90

4 years agoPM / devfreq: memlat: Don't ignore extremely latency sensitive workloads
Saravana Kannan [Fri, 8 Sep 2017 05:22:49 +0000 (22:22 -0700)]
PM / devfreq: memlat: Don't ignore extremely latency sensitive workloads

The ratio value that's compared against ratio_ceil tunable can be 0 for
workloads that are extremely latency sensitive. So, we can't ignore cores
that have a ratio of 0 (which was done to ignore idle cores). So, stop
ignoring cores with a ratio of 0 and instead check for instruction or
frequency being 0 to identify idle cores.

Change-Id: I8c6c14f374f016e6612c3b834589d065bad8f488
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
4 years agoPM / devfreq: bw_hwmon: use unsigned parameter for bytes_to_mbps
Maria Yu [Fri, 2 Mar 2018 08:23:32 +0000 (16:23 +0800)]
PM / devfreq: bw_hwmon: use unsigned parameter for bytes_to_mbps

In bytes_to_mbps function, the parameter is all unsigned,
so change the decleration of the function to include unsigned long
long to avoid compilation errors in 32 bit environment.
Also changed the return value as unsigned long to avoid
any data loss possible in 64 bit environment.

Change-Id: Ib3906bb4bc16086ae343764c5a718f6f005428c5
Signed-off-by: Maria Yu <aiquny@codeaurora.org>
4 years agodrivers: cpuidle: lpm-levels: Reset suspend wake time
Maulik Shah [Fri, 8 Dec 2017 07:04:25 +0000 (12:34 +0530)]
drivers: cpuidle: lpm-levels: Reset suspend wake time

During suspend alarm timer sends next wakeup time to
be programmed. Currently next wakeup time is not reset
upon wakeup. This causes unintended wakeups if there is
no alarm set during next suspend.

Reset suspend wake time during exit from suspend.

Change-Id: Ia0e5d08a4e5cdc71f6c2d884363b830de5ef88d5
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
4 years agocpuidle: lpm-levels: Do not predict LPM for isolated cpus
Maulik Shah [Thu, 30 Nov 2017 11:39:29 +0000 (17:09 +0530)]
cpuidle: lpm-levels: Do not predict LPM for isolated cpus

Prediction can select shallower low power mode for isolated
cpu based on historical data.

Do not predict LPMs for isolated cpus.

Change-Id: I998008ef3c578c1dccfacae8513a15dfbe397e16
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
4 years agolpm_levels: Return true for CPU WFI mode allow check
Srinivas Rao L [Fri, 13 Oct 2017 18:11:58 +0000 (23:41 +0530)]
lpm_levels: Return true for CPU WFI mode allow check

As it's a general understanding across all architectures to have
a WFI (or equalivalent) mode always present and never disabled
for cpuidle, return true for CPU WFI mode allow check.

Change-Id: Ic55571488f845e4aaf997faaac3b2e0f22368d4e
Signed-off-by: Srinivas Rao L <lsrao@codeaurora.org>
4 years agobinder: Disable debug mask
Alex Naidis [Wed, 5 Jul 2017 14:50:59 +0000 (16:50 +0200)]
binder: Disable debug mask

According to Google we should set this to 0
as there is excessive logging in specific usecases
which has a negative impact on latency.

Change-Id: If03401694c2b746b5e2111cb5daafa8eab169e29
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
4 years agoANDROID: binder: Switch binder_deferred_lock to a spinlock.
Corey Tabaka [Mon, 25 Sep 2017 21:25:48 +0000 (14:25 -0700)]
ANDROID: binder: Switch binder_deferred_lock to a spinlock.

Avoid delays in binder transactions due to preemption of
binder_deferred_func() with binder_deferred_lock held.

Bug: 66914906
Test: boots; binder tests pass; trace analysis in bug
Change-Id: I1a89ba15b27e43552890292f135a5e2d969231e2
Signed-off-by: Corey Tabaka <eieio@google.com>
4 years agocpu: Silence log spam when a CPU is brought up
Sultanxda [Wed, 3 Jan 2018 03:19:14 +0000 (19:19 -0800)]
cpu: Silence log spam when a CPU is brought up

Change-Id: Ib9bc76270fedb8d620714faf45de58d5ecdcd64e
Signed-off-by: Sultanxda <sultanxda@gmail.com>
4 years agocfq: Give a chance to arm slice idle timer in case of group_idle
Ritesh Harjani [Tue, 8 Aug 2017 04:50:56 +0000 (10:20 +0530)]
cfq: Give a chance to arm slice idle timer in case of group_idle

In below scenario blkio cgroup does not work as per their assigned
weights :-
1. When the underlying device is nonrotational with a single HW queue
with depth of > 5
2. When the use case is forming two blkio cgroups cg1(weight 1000) &
cg2(wight 100) and two processes(file1 and file2) doing sync IO in
their respective blkio cgroups.

For above usecase result of fio (without this patch):-
file1: (groupid=0, jobs=1): err= 0: pid=685: Thu Jan  1 19:41:49 1970
  write: IOPS=1315, BW=41.1MiB/s (43.1MB/s)(1024MiB/24906msec)
<...>
file2: (groupid=0, jobs=1): err= 0: pid=686: Thu Jan  1 19:41:49 1970
  write: IOPS=1295, BW=40.5MiB/s (42.5MB/s)(1024MiB/25293msec)
<...>
// both the process BW is equal even though they belong to different
cgroups with weight of 1000(cg1) and 100(cg2)

In above case as soon as the request from cg1 is completed and even
though it is provided with higher slice_idle=10, because of CFQ
algorithm when the driver tries to fetch the request, CFQ expires
this group without providing any idle time nor weight priority
and schedules another cfq group (in this case cg2).
And thus both cfq groups(cg1 & cg2) keep alternating to get the
disk time and hence loses the cgroup weight based scheduling.

Below patch gives a chance to cfq algorithm (cfq_arm_slice_timer)
to arm the slice timer in case group_idle is enabled.

With this patch result of fio(for above usecase) :-
file1: (groupid=0, jobs=1): err= 0: pid=690: Thu Jan  1 00:06:08 1970
  write: IOPS=1706, BW=53.3MiB/s (55.9MB/s)(1024MiB/19197msec)
<..>
file2: (groupid=0, jobs=1): err= 0: pid=691: Thu Jan  1 00:06:08 1970
  write: IOPS=1043, BW=32.6MiB/s (34.2MB/s)(1024MiB/31401msec)
<..>
// In this processes BW is as per their respective cgroups weight.

Change-Id: I2eb20e48d6fd8ee48e01f00c514a1ee1476fd19c
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
4 years agoion: ion_system_heap: update supported page-orders for ion pool
Prakash Gupta [Tue, 10 Apr 2018 09:43:21 +0000 (15:13 +0530)]
ion: ion_system_heap: update supported page-orders for ion pool

The supported mappings for ARMv8 are 1GB, 2MB, 64KB and 4KB. So 1MB
allocations from ion pool is not used for ARMv8 section map. Such
allocations end up being mapped as multiple 64K sections map, while still
using 1MB contiguous memory. In case of ARMv7s, page-order 9 allocations
are not used as section map.

Drop page-order 8 ion pool for builds using ARMv8 pagetables and page-order
9 ion pool for builds using ARMv7s.

Change-Id: Ifff2d8f1cf61ce443311d16c11b8edc191b27a22
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
4 years agomsm: kgsl: Increase priority of RT thread
Alex Naidis [Sat, 31 Dec 2016 15:08:30 +0000 (16:08 +0100)]
msm: kgsl: Increase priority of RT thread

We need kgsl_worker_thread to preempt
all userspace surfaceflinger threads to
avoid a possible deadlock.

This will prevent the SF
threads from "stealing" cputime from
kgsl_worker_thread.
This is important, since kgsl_worker_thread
executes work which blocks SF from proceeding.

Change-Id: Ic4c9ca1f44ad8952ae2154a84ded7013244ca20d
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
4 years agomsm: kgsl: Stop slab shrinker when no more pages can be reclaimed
Suren Baghdasaryan [Tue, 5 Dec 2017 21:34:17 +0000 (13:34 -0800)]
msm: kgsl: Stop slab shrinker when no more pages can be reclaimed

do_shrink_slab() scans each shrinker in batches of at most
batch_size (128) pages at a time until total_scan pages are
scanned or until shrinker returns SHRINK_STOP. Under heavy
memory pressure total_scan can be large (in thousands) and
kgsl_pool_shrink_scan_objects() ends up returning 0 after
all pages that were reclaimable are reclaimed. This results in
multiple calls to kgsl_pool_shrink_scan_objects() that do not
reclaim any memory. To prevent this kgsl_pool_shrink_scan_objects()
is modified to return SHRINK_STOP as soon as no more memory can
be reclaimed.

Bug: 69931996
Test: tested using alloc-stress with additional traces

Change-Id: Ia48fc2c0d888c54ec9642c0b0962a70ca3cb4c5e
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
4 years agoRevert "msm: kgsl: Do not memset pages to zero while adding to pool"
Deepak Kumar [Tue, 12 Sep 2017 05:05:49 +0000 (10:35 +0530)]
Revert "msm: kgsl: Do not memset pages to zero while adding to pool"

This reverts commit 90d6246fca5f288606551c5d02af920bfeb05b9b.

To address the launch latency issue seen because of increase in
memory allocation time.

Change-Id: I147ca8607337541b7a29056b4bd1b46aa374c6e3
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
4 years agoRevert "msm: kgsl: Disallow L2PC during wake up from SLUMBER"
Kyle Piefer [Thu, 12 Oct 2017 23:20:36 +0000 (16:20 -0700)]
Revert "msm: kgsl: Disallow L2PC during wake up from SLUMBER"

This reverts commit 5344e5c78f5820dfa34cfcea4572d8e347a018ce.
The change negatively impacted performance.

CRs-Fixed: 2120475
Change-Id: Ib6ff329a3501e77d990c2e9502ed35e041f730c8
Signed-off-by: Kyle Piefer <kpiefer@codeaurora.org>
4 years agomfd: wcd9xxx: disable slimbus register access for debugfs
David Lin [Thu, 12 Oct 2017 23:08:18 +0000 (16:08 -0700)]
mfd: wcd9xxx: disable slimbus register access for debugfs

This patch disables default slimbus access exposed through debugfs.

Bug: 67430947
Change-Id: Iaf1b7cdf638dbc6e6de3681b8418f1840b94ccad
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm: mdss: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 04:41:59 +0000 (21:41 -0700)]
msm: mdss: fix inconsistent mutex_lock

drivers/video/fbdev/msm/mdss_mdp_splash_logo.c:480
mdss_mdp_splash_kickoff() warn: inconsistent returns
'mutex:&mdp5_data->ov_lock'

Change-Id: I3e97f80ff562bb0b260adeff733e78af1a8f1e67
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm: mdss: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 04:33:46 +0000 (21:33 -0700)]
msm: mdss: fix inconsistent mutex_lock

drivers/video/fbdev/msm/mdss_mdp_pp.c:4093 mdss_mdp_igc_lut_config()
warn: inconsistent returns 'mutex:&mdss_pp_mutex'

Change-Id: I956017162cde27fbaa3da5aeb28b76ec7308530e
Signed-off-by: David Lin <dtwlin@google.com>
4 years agoslimbus: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 04:00:09 +0000 (21:00 -0700)]
slimbus: fix inconsistent mutex_lock

drivers/slimbus/slimbus.c:1331 slim_config_mgrports() warn: inconsistent
returns 'mutex:&ctrl->sched.m_reconf'

Change-Id: I023f69cc3496e9b98d9881c447fc1bf9053de97f
Signed-off-by: David Lin <dtwlin@google.com>
4 years agoqdsp6v2: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 03:57:09 +0000 (20:57 -0700)]
qdsp6v2: fix inconsistent mutex_lock

sound/soc/msm/qdsp6v2/q6voice.c:5984 voc_set_device_config() warn:
inconsistent returns 'mutex:&v->lock'

Change-Id: Ie58dbea8881acdd6a5253828e15d29075092b818
Signed-off-by: David Lin <dtwlin@google.com>
4 years agowcd9335: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 03:47:18 +0000 (20:47 -0700)]
wcd9335: fix inconsistent mutex_lock

sound/soc/codecs/wcd9335.c:2608 slim_tx_mixer_put() warn: inconsistent
returns 'mutex:&tasha_p->codec_mutex'

Change-Id: I73d5331aa29155c85cce6940fe2b918cc7a445f6
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm: mdss: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 03:42:31 +0000 (20:42 -0700)]
msm: mdss: fix inconsistent mutex_lock

drivers/video/fbdev/msm/mdss_mdp_overlay.c:5280
__handle_overlay_prepare() warn: inconsistent returns
'mutex:&mdp5_data->ov_lock'

Change-Id: Iac6acb5fb84331949637258a55733b8be94690eb
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm: qdsp6v2: fix inconsistent spin_lock
David Lin [Fri, 2 Jun 2017 03:36:22 +0000 (20:36 -0700)]
msm: qdsp6v2: fix inconsistent spin_lock

sound/soc/msm/qdsp6v2/msm-lsm-client.c:334 lsm_event_handler() warn:
inconsistent returns 'spin_lock:&prtd->event_lock'

sound/soc/msm/qdsp6v2/msm-lsm-client.c:1635 msm_lsm_ioctl_compat() warn:
inconsistent returns 'mutex:&prtd->lsm_api_lock'

sound/soc/msm/qdsp6v2/msm-lsm-client.c:1914 msm_lsm_ioctl() warn:
inconsistent returns 'mutex:&prtd->lsm_api_lock'

Change-Id: Id1f754702a56ef21952c7f7bc8cf3ebd0a0ebefa
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm_cci: fix inconsistent mutex_lock
David Lin [Fri, 2 Jun 2017 04:25:38 +0000 (21:25 -0700)]
msm_cci: fix inconsistent mutex_lock

drivers/media/platform/msm/camera_v2/sensor/cci/msm_cci.c:939
msm_cci_i2c_read() warn: inconsistent returns
'mutex:&cci_dev->cci_master_info[master].mutex_q[queue]'

Change-Id: Ied241d3ff2fd00d4ce892e250a6236fccf16fac9
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm: memshare: relaese mutex if req client id is not found
David Lin [Sun, 30 Apr 2017 23:50:31 +0000 (16:50 -0700)]
msm: memshare: relaese mutex if req client id is not found

This fixes the smatch warning below:

drivers/soc/qcom/memshare/msm_memshare.c:570 handle_alloc_generic_req()
warn: inconsistent returns 'mutex:&memsh_drv->mem_share'.

Bug: 35898203
Change-Id: I86f3d77c9bb471b1bc26360e11e378fa3d1a3f66
Signed-off-by: David Lin <dtwlin@google.com>
4 years agothermal: qpnp-adc-tm: release lock upon disable_chan_meas failure
David Lin [Sun, 30 Apr 2017 23:43:24 +0000 (16:43 -0700)]
thermal: qpnp-adc-tm: release lock upon disable_chan_meas failure

This fixes the smath warning below:

drivers/thermal/qpnp-adc-tm.c:2943 qpnp_adc_tm_disable_chan_meas() warn:
inconsistent returns 'mutex:&chip->adc->adc_lock'.

Bug: 35898203
Change-Id: I149ed4868cd4754246b3b8845a0af7f1f08c0931
Signed-off-by: David Lin <dtwlin@google.com>
4 years agoqcom: qmi: release mutex upon qmi_svc_event_notifier_register error
David Lin [Sun, 30 Apr 2017 23:37:27 +0000 (16:37 -0700)]
qcom: qmi: release mutex upon qmi_svc_event_notifier_register error

This fixes the following smatch warning:

drivers/soc/qcom/qmi_interface.c:2019 qmi_svc_event_notifier_register()
warn: inconsistent returns 'mutex:&temp->svc_addr_list_lock'.

Change-Id: I2ada7d79a0ac6b6a14abad0cb463af491dd1c319
Signed-off-by: David Lin <dtwlin@google.com>
4 years agoi2c-msm-v2: allow i2c_adapter to retry on arbitration lost
David Lin [Mon, 20 Mar 2017 17:40:20 +0000 (10:40 -0700)]
i2c-msm-v2: allow i2c_adapter to retry on arbitration lost

In case of error on lost arbitration, the host should at least attempt
to retry in case if the bus error is transient (i.e., from signal
interference or misbehaved devices). Use the default 2s timeout setting.

Bug: 35439882

Change-Id: Id9bd5a5ea764405401588220a2d2bf0fd85111f7
Signed-off-by: David Lin <dtwlin@google.com>
4 years agomsm_rng: fix issue with unbalanced clk_put
David Lin [Thu, 2 Mar 2017 04:15:37 +0000 (20:15 -0800)]
msm_rng: fix issue with unbalanced clk_put

This patch fixes the following coccicheck errors:

msm_rng.c:335:2-8: ERROR: missing clk_put;
clk_get on line 282 and execution via conditional on line 333
msm_rng.c:335:2-8: ERROR: missing clk_put;
clk_get on line 285 and execution via conditional on line 333

Bug: 35898203
Change-Id: Id6e0854ec11f95fe2bf7f887876535e2d8e74d22
Signed-off-by: David Lin <dtwlin@google.com>
4 years agopower: reset: allow device to preserve memory on restart
Ethan Chen [Sat, 28 Feb 2015 02:31:48 +0000 (18:31 -0800)]
power: reset: allow device to preserve memory on restart

* Always perform a soft reset as this preserves memory contents,
  including pstore and other persistent memory.

Change-Id: Ideca44c9f38d2ebcd437ff289f8e036922eafcd2

4 years agoRevert "qcacld-3.0: Fix OOB in wma_stats_event_handler"
LuK1337 [Thu, 6 Jun 2019 16:11:45 +0000 (18:11 +0200)]
Revert "qcacld-3.0: Fix OOB in wma_stats_event_handler"

* This change makes WiFi report invalid signal strength.

This reverts commit be468730d315e973e9936da275b06600d0ce276c.

Change-Id: I01094049520ea706c27e00f316539f9d9d53bbc7

4 years agostaging: qcacld-3.0: make debug functions configurable
Luca Stefani [Wed, 11 Jul 2018 18:01:44 +0000 (20:01 +0200)]
staging: qcacld-3.0: make debug functions configurable

Change-Id: If0643fc66aac1846fc5e1466d047ff31a5b175c3

4 years agostaging: qcacld-3.0: Enable WLAN_WARN_ON_ASSERT for debug builds
Dustin Brown [Thu, 22 Mar 2018 20:00:44 +0000 (13:00 -0700)]
staging: qcacld-3.0: Enable WLAN_WARN_ON_ASSERT for debug builds

QDF_ASSERT is being featurized in
I39e3ab6499210569b6ce09d77ee72f0081741989. Enable the QDF_ASSERT feature
in debug builds by default.

Change-Id: I96484e6dbebcecf17ae7877dc30906ed8fa90bd7
CRs-Fixed: 2211987

4 years agostaging: qca-wifi-host-cmn: Featurize QDF_ASSERT
Dustin Brown [Thu, 22 Mar 2018 19:40:00 +0000 (12:40 -0700)]
staging: qca-wifi-host-cmn: Featurize QDF_ASSERT

QDF_ASSERT is not properly featurized with its own build time config
flag. This leads to unnecessary logs and increased driver size for
platforms which do not want the feature enabled. Use the newly
introduced WLAN_WARN_ON_ASSERT build time flag to decide if QDF_ASSERT
should be a no-op.

Change-Id: I39e3ab6499210569b6ce09d77ee72f0081741989
CRs-Fixed: 2211983

4 years agostaging: qca-wifi-host-cmn: fix build after disabling debug
Akhil Narang [Sat, 15 Sep 2018 10:55:46 +0000 (16:25 +0530)]
staging: qca-wifi-host-cmn: fix build after disabling debug

../drivers/staging/qcacld-3.0/../qca-wifi-host-cmn/qdf/linux/src/qdf_event.c:363:54: error: expected expression
                        "Failed to add event in the list in %s", __func__),
                                                                          ^
1 error generated.

Change-Id: I0412209ffdbbeabb87a289b96e47f9785f18d23c
Signed-off-by: Akhil Narang <akhilnarang.1999@gmail.com>
4 years agostaging: qcacld-3.0: fix build after disabling debug
Akhil Narang [Sat, 15 Sep 2018 10:54:03 +0000 (16:24 +0530)]
staging: qcacld-3.0: fix build after disabling debug

../drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_tx_rx.c:1569:45: error: expected expression
                hdd_debug("LRO and GRO both are disabled");
                                                          ^
1 error generated.

Convert to a normal if-else statement

Change-Id: Ia210044d6d6103a1120f0e5fdb74b88ff28d8fc8
Signed-off-by: Akhil Narang <akhilnarang.1999@gmail.com>
4 years agostaging: qcacld-3.0: disable debug build
lance [Sun, 5 Nov 2017 03:06:57 +0000 (11:06 +0800)]
staging: qcacld-3.0: disable debug build

Change-Id: I13bc8b229f6bc3b5e2264188765c5af1cfe43ab9

4 years agostaging: qcacld-3.0: fix non-debug build
lance [Sun, 5 Nov 2017 05:11:44 +0000 (13:11 +0800)]
staging: qcacld-3.0: fix non-debug build

Change-Id: Ifa75acbdd3f5a316fcb593635585b74150833179

4 years agostaging: qcacld-3.0: load driver at device_initcall
Sultanxda [Sat, 17 Mar 2018 21:03:05 +0000 (14:03 -0700)]
staging: qcacld-3.0: load driver at device_initcall

The earlier, the better.

Change-Id: Iae43260050117d7b464dd3c7f47bf8093941a274
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
4 years agostaging: qcacld-3.0: load driver on late initcall when not built as a module
Sultanxda [Wed, 3 Jan 2018 20:40:12 +0000 (12:40 -0800)]
staging: qcacld-3.0: load driver on late initcall when not built as a module

Requiring userspace to write to /sys/kernel/boot_wlan/boot_wlan to boot
up the wlan device is unnecessary and blocks userspace for the large
amount of time it takes for wlan boot to finish.

Instead, load the driver asynchronously on late_initcall.

Change-Id: I4d696b9d46de032158fd223c60d9a7dbde26cc3f
Signed-off-by: Sultanxda <sultanxda@gmail.com>
[nc: Fix unused variable function warning]
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
4 years agostaging: qcacld-3.0: add sme_power_save_api.h include
Ethan Chen [Fri, 30 Nov 2018 07:43:23 +0000 (23:43 -0800)]
staging: qcacld-3.0: add sme_power_save_api.h include

Change-Id: Ic5c408a59ea0f859393fbc6e3f6ba6f0c391df43

4 years agostaging: qcacld-3.0: fix an inconsistency between userspace and kernel options
Park Ju Hyung [Sun, 19 Nov 2017 16:24:10 +0000 (01:24 +0900)]
staging: qcacld-3.0: fix an inconsistency between userspace and kernel options

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Change-Id: Ic8f571b9a948e81a0d1d282830007632a2b2c6c2

4 years agostaging: qcacld-3.0: Fix Kconfig
Ethan Chen [Mon, 4 Dec 2017 01:59:33 +0000 (17:59 -0800)]
staging: qcacld-3.0: Fix Kconfig

* Correct badly named options
* Add missing options

Change-Id: I4a5cc2216fe36a07520827cdb9577a75ec09450a

4 years agostaging: qcacld-3.0: Cleanup unused file
Scott Mertz [Mon, 21 Mar 2016 01:59:23 +0000 (20:59 -0500)]
staging: qcacld-3.0: Cleanup unused file

Change-Id: I23d65bc818a13496ffcebefa8e27a167521857f2

4 years agodrivers: staging: add qcacld-3.0
Dan Pasanen [Fri, 27 Oct 2017 15:22:24 +0000 (10:22 -0500)]
drivers: staging: add qcacld-3.0

Change-Id: Iefa79c859b7cc8bb72dfe00fd585e5afc25cf46b

4 years agoAdd 'drivers/staging/qcacld-3.0/' from commit 'a7b9da5b8cf5abc658a58597a35d30f3eac92a47'
Arian [Tue, 19 Nov 2019 14:31:35 +0000 (15:31 +0100)]
Add 'drivers/staging/qcacld-3.0/' from commit 'a7b9da5b8cf5abc658a58597a35d30f3eac92a47'

git-subtree-dir: drivers/staging/qcacld-3.0
git-subtree-mainline: 16770825fbd1094018ecd82e0bd821f83404a08c
git-subtree-split: a7b9da5b8cf5abc658a58597a35d30f3eac92a47

4 years agoAdd 'drivers/staging/qca-wifi-host-cmn/' from commit '9dc6a89757f8c58c93c64e606263140...
Arian [Tue, 19 Nov 2019 14:31:24 +0000 (15:31 +0100)]
Add 'drivers/staging/qca-wifi-host-cmn/' from commit '9dc6a89757f8c58c93c64e606263140d38ce0d48'

git-subtree-dir: drivers/staging/qca-wifi-host-cmn
git-subtree-mainline: 8c052e3b250ccb4efd0625464f93a3f279d3400b
git-subtree-split: 9dc6a89757f8c58c93c64e606263140d38ce0d48

4 years agoAdd 'drivers/staging/fw-api/' from commit '1e98a790cedaf267bb70cd6d3ffba620e46ee8d7'
Arian [Tue, 19 Nov 2019 14:31:20 +0000 (15:31 +0100)]
Add 'drivers/staging/fw-api/' from commit '1e98a790cedaf267bb70cd6d3ffba620e46ee8d7'

git-subtree-dir: drivers/staging/fw-api
git-subtree-mainline: 6ed4c5de4bb191a209c629463678e34f076fb417
git-subtree-split: 1e98a790cedaf267bb70cd6d3ffba620e46ee8d7

4 years agoMerge d625fb696695fa3587c4985f3974e8a9ea40d920 on remote branch
Linux Build Service Account [Fri, 4 Oct 2019 17:29:29 +0000 (10:29 -0700)]
Merge d625fb696695fa3587c4985f3974e8a9ea40d920 on remote branch

Change-Id: I61823f35b5ee495478e935f0fb464ed0187e8fb9

4 years agoMerge a97a917c1a361a11d8b40490aaf0d885e1dd1632 on remote branch
Linux Build Service Account [Fri, 4 Oct 2019 17:26:30 +0000 (10:26 -0700)]
Merge a97a917c1a361a11d8b40490aaf0d885e1dd1632 on remote branch

Change-Id: Ifd2ce9f1a56f0f57ec50e514edfa216b7aa86795

4 years agoMerge 00736f13fba23c1879bd4ced9b71e7af1f3fc9ad on remote branch
Linux Build Service Account [Fri, 4 Oct 2019 17:25:20 +0000 (10:25 -0700)]
Merge 00736f13fba23c1879bd4ced9b71e7af1f3fc9ad on remote branch

Change-Id: I1b3fadd75d94bc7cc7b9d0b575c476531e910310

4 years agoMerge a8e92fae3a9de72877cfbd2f8b84a0d539413eb1 on remote branch
Linux Build Service Account [Fri, 4 Oct 2019 04:46:53 +0000 (21:46 -0700)]
Merge a8e92fae3a9de72877cfbd2f8b84a0d539413eb1 on remote branch

Change-Id: I96a4fbd1df63e22c3b6b2234039b0005f3712d4c

4 years agoMerge "msm: pcie: Add proper check before accessing variables"
Linux Build Service Account [Mon, 30 Sep 2019 21:29:18 +0000 (14:29 -0700)]
Merge "msm: pcie: Add proper check before accessing variables"

4 years agoMerge "qseecom: correct range check in __qseecom_update_cmd_buf_64"
Linux Build Service Account [Mon, 30 Sep 2019 12:49:13 +0000 (05:49 -0700)]
Merge "qseecom: correct range check in __qseecom_update_cmd_buf_64"

4 years agomsm_vidc: Add checks to avoid OOB access(refined)
Sanjay Singh [Wed, 25 Sep 2019 17:13:31 +0000 (22:43 +0530)]
msm_vidc: Add checks to avoid OOB access(refined)

validate structures and payload sizes in the
packet against packet size to avoid OOB access.

Change-Id: I8a203a81506f603c2e37c1b2a780d3088e6933be
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
4 years agoMerge "Merge android-4.4.194 (a749771) into msm-4.4"
Linux Build Service Account [Thu, 26 Sep 2019 14:32:38 +0000 (07:32 -0700)]
Merge "Merge android-4.4.194 (a749771) into msm-4.4"

4 years agomsm: pcie: Add proper check before accessing variables
Rama Krishna Phani A [Thu, 26 Sep 2019 10:22:45 +0000 (15:52 +0530)]
msm: pcie: Add proper check before accessing variables

Base_sel variable is being accessed with out any check.
Add proper check before accessing base_sel variable.

Change-Id: I31232cc0285bc8cc01d8fa4ee7954bf2f766cbce
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
4 years agomsm_vidc: Add checks to avoid OOB access(refined)
Sanjay Singh [Wed, 25 Sep 2019 17:13:31 +0000 (22:43 +0530)]
msm_vidc: Add checks to avoid OOB access(refined)

validate structures and payload sizes in the
packet against packet size to avoid OOB access.

Change-Id: I8a203a81506f603c2e37c1b2a780d3088e6933be
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
4 years agoMerge "msm: kgsl: Disable deprecated ioctls"
Linux Build Service Account [Wed, 25 Sep 2019 16:17:04 +0000 (09:17 -0700)]
Merge "msm: kgsl: Disable deprecated ioctls"

4 years agoMerge "ARM: dts: msm: Remove GPU min and low svs clocks for MSM8996ProAU"
Linux Build Service Account [Tue, 24 Sep 2019 18:00:44 +0000 (11:00 -0700)]
Merge "ARM: dts: msm: Remove GPU min and low svs clocks for MSM8996ProAU"

4 years agoqseecom: correct range check in __qseecom_update_cmd_buf_64
jitendrathakare [Fri, 23 Aug 2019 08:00:27 +0000 (13:30 +0530)]
qseecom: correct range check in __qseecom_update_cmd_buf_64

Make change to validate if there exists enough space to write a
unit64 instead of a unit32 value, in __qseecom_update_cmd_buf_64.

Change-Id: Iabf61dea240f16108e1765585aae3a12d2d651c9
Signed-off-by: jitendra thakare <jitendrathakare@codeaurora.org>
4 years agoMerge changes into msm-4.4
Gerrit - the friendly Code Review server [Tue, 24 Sep 2019 13:19:07 +0000 (06:19 -0700)]
Merge changes  into msm-4.4

4 years agoMerge "Merge android-4.4.193 (3edc5af) into msm-4.4"
Linux Build Service Account [Tue, 24 Sep 2019 06:40:24 +0000 (23:40 -0700)]
Merge "Merge android-4.4.193 (3edc5af) into msm-4.4"

4 years agoMerge android-4.4.194 (a749771) into msm-4.4
Srinivasarao P [Tue, 24 Sep 2019 05:28:02 +0000 (10:58 +0530)]
Merge android-4.4.194 (a749771) into msm-4.4

* refs/heads/tmp-a749771
  Linux 4.4.194
  net_sched: let qdisc_put() accept NULL pointer
  ARC: export "abort" for modules
  media: technisat-usb2: break out of loop at end of buffer
  floppy: fix usercopy direction
  keys: Fix missing null pointer check in request_key_auth_describe()
  dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()
  net: seeq: Fix the function used to release some memory in an error handling path
  tools/power turbostat: fix buffer overrun
  sky2: Disable MSI on yet another ASUS boards (P6Xxxx)
  cifs: Use kzfree() to zero out the password
  cifs: set domainName when a domain-key is used in multiuser
  NFSv2: Fix write regression
  NFSv2: Fix eof handling
  netfilter: nf_conntrack_ftp: Fix debug output
  x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines
  r8152: Set memory to all 0xFFs on failed reg reads
  ARM: 8874/1: mm: only adjust sections of valid mm structures
  Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105
  NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup
  NFSv4: Fix return values for nfs4_file_open()
  s390/bpf: use 32-bit index for tail calls
  ARM: OMAP2+: Fix omap4 errata warning on other SoCs
  s390/bpf: fix lcgr instruction encoding
  mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings
  tty/serial: atmel: reschedule TX after RX was started
  serial: sprd: correct the wrong sequence of arguments
  KVM: coalesced_mmio: add bounds checking
  xen-netfront: do not assume sk_buff_head list is empty in error handling
  x86/boot: Add missing bootparam that breaks boot on some platforms
  media: tm6000: double free if usb disconnect while streaming
  USB: usbcore: Fix slab-out-of-bounds bug during device reset
  ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs
  MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send()
  x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
  crypto: talitos - check data blocksize in ablkcipher.
  crypto: talitos - check AES key size
  driver core: Fix use-after-free and double free on glue directory
  clk: rockchip: Don't yell about bad mmc phases when getting
  MIPS: VDSO: Use same -m%-float cflag as the kernel proper
  MIPS: VDSO: Prevent use of smp_processor_id()
  KVM: nVMX: handle page fault in vmread
  KVM: x86: work around leak of uninitialized stack contents
  KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
  genirq: Prevent NULL pointer dereference in resend_irqs()
  Btrfs: fix assertion failure during fsync and use of stale transaction
  Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur"
  tun: fix use-after-free when register netdev failed
  tipc: add NULL pointer check before calling kfree_rcu
  tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
  sctp: use transport pf_retrans in sctp_do_8_2_transport_strike
  sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
  sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
  net: Fix null de-reference of device refcount
  isdn/capi: check message length in capi_write()
  ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
  cdc_ether: fix rndis support for Mediatek based smartphones
  bridge/mdb: remove wrong use of NLM_F_MULTI

Change-Id: I950778c771159febb721a4ebc2656c57ef40ad83
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
4 years agoMerge "usb: dwc3-msm: Try core reset and reinit if PHY PLL lock fails"
Linux Build Service Account [Mon, 23 Sep 2019 22:28:27 +0000 (15:28 -0700)]
Merge "usb: dwc3-msm: Try core reset and reinit if PHY PLL lock fails"

4 years agoMerge "msm: ipa: add additional checks to prevent use-after free errors"
Linux Build Service Account [Mon, 23 Sep 2019 22:28:26 +0000 (15:28 -0700)]
Merge "msm: ipa: add additional checks to prevent use-after free errors"

4 years agoMerge "PM / devfreq: gpubw_mon: Add null check for governor private data"
Linux Build Service Account [Mon, 23 Sep 2019 22:28:25 +0000 (15:28 -0700)]
Merge "PM / devfreq: gpubw_mon: Add null check for governor private data"

4 years agoMerge "dwc3-msm: Replace autosuspend delay functionality with stop host mode"
Linux Build Service Account [Mon, 23 Sep 2019 15:39:05 +0000 (08:39 -0700)]
Merge "dwc3-msm: Replace autosuspend delay functionality with stop host mode"

4 years agomsm: adsprpc: Fix integer overflow in refcount of map
c_mtharu [Tue, 17 Sep 2019 07:22:12 +0000 (12:52 +0530)]
msm: adsprpc: Fix integer overflow in refcount of map

Integer overflow in refcount of map is leading to use after free. Error
out if refcount reaches INT_MAX.

Change-Id: I21e88361a8e70ef8c5c9593f1fc0ddd2b351a55a
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
4 years agoMerge "cnss2: support wakeup using gpio"
Linux Build Service Account [Mon, 23 Sep 2019 07:43:38 +0000 (00:43 -0700)]
Merge "cnss2: support wakeup using gpio"

4 years agoPM / devfreq: gpubw_mon: Add null check for governor private data
Archana Sriram [Wed, 21 Nov 2018 12:53:48 +0000 (18:23 +0530)]
PM / devfreq: gpubw_mon: Add null check for governor private data

During SUSPEND event, check the pointer for governor
private data is not NULL before updating bus parameters
to zero.

Change-Id: I1a37173e8ae7ad4bcd5f8497c5956302e647c862
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
4 years agoMerge 4.4.194 into android-4.4
Greg Kroah-Hartman [Sat, 21 Sep 2019 06:03:02 +0000 (08:03 +0200)]
Merge 4.4.194 into android-4.4

Changes in 4.4.194
bridge/mdb: remove wrong use of NLM_F_MULTI
cdc_ether: fix rndis support for Mediatek based smartphones
ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
isdn/capi: check message length in capi_write()
net: Fix null de-reference of device refcount
sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
sctp: use transport pf_retrans in sctp_do_8_2_transport_strike
tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
tipc: add NULL pointer check before calling kfree_rcu
tun: fix use-after-free when register netdev failed
Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur"
Btrfs: fix assertion failure during fsync and use of stale transaction
genirq: Prevent NULL pointer dereference in resend_irqs()
KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
KVM: x86: work around leak of uninitialized stack contents
KVM: nVMX: handle page fault in vmread
MIPS: VDSO: Prevent use of smp_processor_id()
MIPS: VDSO: Use same -m%-float cflag as the kernel proper
clk: rockchip: Don't yell about bad mmc phases when getting
driver core: Fix use-after-free and double free on glue directory
crypto: talitos - check AES key size
crypto: talitos - check data blocksize in ablkcipher.
x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send()
ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs
USB: usbcore: Fix slab-out-of-bounds bug during device reset
media: tm6000: double free if usb disconnect while streaming
x86/boot: Add missing bootparam that breaks boot on some platforms
xen-netfront: do not assume sk_buff_head list is empty in error handling
KVM: coalesced_mmio: add bounds checking
serial: sprd: correct the wrong sequence of arguments
tty/serial: atmel: reschedule TX after RX was started
mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings
s390/bpf: fix lcgr instruction encoding
ARM: OMAP2+: Fix omap4 errata warning on other SoCs
s390/bpf: use 32-bit index for tail calls
NFSv4: Fix return values for nfs4_file_open()
NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup
Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105
ARM: 8874/1: mm: only adjust sections of valid mm structures
r8152: Set memory to all 0xFFs on failed reg reads
x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines
netfilter: nf_conntrack_ftp: Fix debug output
NFSv2: Fix eof handling
NFSv2: Fix write regression
cifs: set domainName when a domain-key is used in multiuser
cifs: Use kzfree() to zero out the password
sky2: Disable MSI on yet another ASUS boards (P6Xxxx)
tools/power turbostat: fix buffer overrun
net: seeq: Fix the function used to release some memory in an error handling path
dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()
keys: Fix missing null pointer check in request_key_auth_describe()
floppy: fix usercopy direction
media: technisat-usb2: break out of loop at end of buffer
ARC: export "abort" for modules
net_sched: let qdisc_put() accept NULL pointer
Linux 4.4.194

Change-Id: Ia27dd36133c3294c756d2376357572325afcd6fb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
4 years agoLinux 4.4.194
Greg Kroah-Hartman [Sat, 21 Sep 2019 05:12:54 +0000 (07:12 +0200)]
Linux 4.4.194

4 years agonet_sched: let qdisc_put() accept NULL pointer
Cong Wang [Thu, 12 Sep 2019 17:22:30 +0000 (10:22 -0700)]
net_sched: let qdisc_put() accept NULL pointer

[ Upstream commit 6efb971ba8edfbd80b666f29de12882852f095ae ]

When tcf_block_get() fails in sfb_init(), q->qdisc is still a NULL
pointer which leads to a crash in sfb_destroy(). Similar for
sch_dsmark.

Instead of fixing each separately, Linus suggested to just accept
NULL pointer in qdisc_put(), which would make callers easier.

(For sch_dsmark, the bug probably exists long before commit
6529eaba33f0.)

Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure")
Reported-by: syzbot+d5870a903591faaca4ae@syzkaller.appspotmail.com
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoARC: export "abort" for modules
Vineet Gupta [Thu, 19 Sep 2019 20:58:47 +0000 (13:58 -0700)]
ARC: export "abort" for modules

This is a custom patch (no mainline equivalent) for stable backport only
to address 0-Day kernel test infra ARC 4.x.y builds errors.

The reason for this custom patch as that it is a single patch, touches
only ARC, vs. atleast two 7c2c11b208be09c1dc8635b78cd8669 which touch
atleast 3 other arches (one long removed) and could potentially have a
fallout.

Reported-by: kbuild test robot <lkp@intel.com>
CC: stable@vger.kernel.org # 4.4, 4.9
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agomedia: technisat-usb2: break out of loop at end of buffer
Sean Young [Wed, 3 Jul 2019 14:52:39 +0000 (10:52 -0400)]
media: technisat-usb2: break out of loop at end of buffer

commit 0c4df39e504bf925ab666132ac3c98d6cbbe380b upstream.

Ensure we do not access the buffer beyond the end if no 0xff byte
is encountered.

Reported-by: syzbot+eaaaf38a95427be88f4b@syzkaller.appspotmail.com
Signed-off-by: Sean Young <sean@mess.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agofloppy: fix usercopy direction
Jann Horn [Tue, 26 Mar 2019 22:03:48 +0000 (23:03 +0100)]
floppy: fix usercopy direction

commit 52f6f9d74f31078964ca1574f7bb612da7877ac8 upstream.

As sparse points out, these two copy_from_user() should actually be
copy_to_user().

Fixes: 229b53c9bf4e ("take floppy compat ioctls to sodding floppy.c")
Cc: stable@vger.kernel.org
Acked-by: Alexander Popov <alex.popov@linux.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agokeys: Fix missing null pointer check in request_key_auth_describe()
Hillf Danton [Mon, 2 Sep 2019 12:37:29 +0000 (13:37 +0100)]
keys: Fix missing null pointer check in request_key_auth_describe()

[ Upstream commit d41a3effbb53b1bcea41e328d16a4d046a508381 ]

If a request_key authentication token key gets revoked, there's a window in
which request_key_auth_describe() can see it with a NULL payload - but it
makes no check for this and something like the following oops may occur:

BUG: Kernel NULL pointer dereference at 0x00000038
Faulting instruction address: 0xc0000000004ddf30
Oops: Kernel access of bad area, sig: 11 [#1]
...
NIP [...] request_key_auth_describe+0x90/0xd0
LR [...] request_key_auth_describe+0x54/0xd0
Call Trace:
[...] request_key_auth_describe+0x54/0xd0 (unreliable)
[...] proc_keys_show+0x308/0x4c0
[...] seq_read+0x3d0/0x540
[...] proc_reg_read+0x90/0x110
[...] __vfs_read+0x3c/0x70
[...] vfs_read+0xb4/0x1b0
[...] ksys_read+0x7c/0x130
[...] system_call+0x5c/0x70

Fix this by checking for a NULL pointer when describing such a key.

Also make the read routine check for a NULL pointer to be on the safe side.

[DH: Modified to not take already-held rcu lock and modified to also check
 in the read routine]

Fixes: 04c567d9313e ("[PATCH] Keys: Fix race between two instantiators of a key")
Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agodmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()
Wenwen Wang [Fri, 16 Aug 2019 06:56:08 +0000 (01:56 -0500)]
dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()

[ Upstream commit 962411b05a6d3342aa649e39cda1704c1fc042c6 ]

If devm_request_irq() fails to disable all interrupts, no cleanup is
performed before retuning the error. To fix this issue, invoke
omap_dma_free() to do the cleanup.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/1565938570-7528-1-git-send-email-wenwen@cs.uga.edu
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonet: seeq: Fix the function used to release some memory in an error handling path
Christophe JAILLET [Sat, 31 Aug 2019 07:17:51 +0000 (09:17 +0200)]
net: seeq: Fix the function used to release some memory in an error handling path

[ Upstream commit e1e54ec7fb55501c33b117c111cb0a045b8eded2 ]

In commit 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv"),
a call to 'get_zeroed_page()' has been turned into a call to
'dma_alloc_coherent()'. Only the remove function has been updated to turn
the corresponding 'free_page()' into 'dma_free_attrs()'.
The error hndling path of the probe function has not been updated.

Fix it now.

Rename the corresponding label to something more in line.

Fixes: 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agotools/power turbostat: fix buffer overrun
Naoya Horiguchi [Wed, 3 Apr 2019 07:02:14 +0000 (16:02 +0900)]
tools/power turbostat: fix buffer overrun

[ Upstream commit eeb71c950bc6eee460f2070643ce137e067b234c ]

turbostat could be terminated by general protection fault on some latest
hardwares which (for example) support 9 levels of C-states and show 18
"tADDED" lines. That bloats the total output and finally causes buffer
overrun.  So let's extend the buffer to avoid this.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agosky2: Disable MSI on yet another ASUS boards (P6Xxxx)
Takashi Iwai [Wed, 28 Aug 2019 06:31:19 +0000 (08:31 +0200)]
sky2: Disable MSI on yet another ASUS boards (P6Xxxx)

[ Upstream commit 189308d5823a089b56e2299cd96589507dac7319 ]

A similar workaround for the suspend/resume problem is needed for yet
another ASUS machines, P6X models.  Like the previous fix, the BIOS
doesn't provide the standard DMI_SYS_* entry, so again DMI_BOARD_*
entries are used instead.

Reported-and-tested-by: SteveM <swm@swm1.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agocifs: Use kzfree() to zero out the password
Dan Carpenter [Tue, 27 Aug 2019 10:59:17 +0000 (13:59 +0300)]
cifs: Use kzfree() to zero out the password

[ Upstream commit 478228e57f81f6cb60798d54fc02a74ea7dd267e ]

It's safer to zero out the password so that it can never be disclosed.

Fixes: 0c219f5799c7 ("cifs: set domainName when a domain-key is used in multiuser")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agocifs: set domainName when a domain-key is used in multiuser
Ronnie Sahlberg [Wed, 21 Aug 2019 22:09:50 +0000 (08:09 +1000)]
cifs: set domainName when a domain-key is used in multiuser

[ Upstream commit f2aee329a68f5a907bcff11a109dfe17c0b41aeb ]

RHBZ: 1710429

When we use a domain-key to authenticate using multiuser we must also set
the domainnmame for the new volume as it will be used and passed to the server
in the NTLMSSP Domain-name.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoNFSv2: Fix write regression
Trond Myklebust [Tue, 27 Aug 2019 11:03:28 +0000 (07:03 -0400)]
NFSv2: Fix write regression

[ Upstream commit d33d4beb522987d1c305c12500796f9be3687dee ]

Ensure we update the write result count on success, since the
RPC call itself does not do so.

Reported-by: Jan Stancek <jstancek@redhat.com>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoNFSv2: Fix eof handling
Trond Myklebust [Tue, 27 Aug 2019 00:41:16 +0000 (20:41 -0400)]
NFSv2: Fix eof handling

[ Upstream commit 71affe9be45a5c60b9772e1b2701710712637274 ]

If we received a reply from the server with a zero length read and
no error, then that implies we are at eof.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonetfilter: nf_conntrack_ftp: Fix debug output
Thomas Jarosch [Wed, 21 Aug 2019 14:14:28 +0000 (16:14 +0200)]
netfilter: nf_conntrack_ftp: Fix debug output

[ Upstream commit 3a069024d371125227de3ac8fa74223fcf473520 ]

The find_pattern() debug output was printing the 'skip' character.
This can be a NULL-byte and messes up further pr_debug() output.

Output without the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to `<7>nf_conntrack_ftp: find_pattern `PORT': dlen = 8
kernel: nf_conntrack_ftp: find_pattern `EPRT': dlen = 8

Output with the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to 0x0 delimiter!
kernel: nf_conntrack_ftp: Match succeeded!
kernel: nf_conntrack_ftp: conntrack_ftp: match `172,17,0,100,200,207' (20 bytes at 4150681645)
kernel: nf_conntrack_ftp: find_pattern `PORT': dlen = 8

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agox86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines
Thomas Gleixner [Wed, 21 Aug 2019 13:16:31 +0000 (15:16 +0200)]
x86/apic: Fix arch_dynirq_lower_bound() bug for DT enabled machines

[ Upstream commit 3e5bedc2c258341702ddffbd7688c5e6eb01eafa ]

Rahul Tanwar reported the following bug on DT systems:

> 'ioapic_dynirq_base' contains the virtual IRQ base number. Presently, it is
> updated to the end of hardware IRQ numbers but this is done only when IOAPIC
> configuration type is IOAPIC_DOMAIN_LEGACY or IOAPIC_DOMAIN_STRICT. There is
> a third type IOAPIC_DOMAIN_DYNAMIC which applies when IOAPIC configuration
> comes from devicetree.
>
> See dtb_add_ioapic() in arch/x86/kernel/devicetree.c
>
> In case of IOAPIC_DOMAIN_DYNAMIC (DT/OF based system), 'ioapic_dynirq_base'
> remains to zero initialized value. This means that for OF based systems,
> virtual IRQ base will get set to zero.

Such systems will very likely not even boot.

For DT enabled machines ioapic_dynirq_base is irrelevant and not
updated, so simply map the IRQ base 1:1 instead.

Reported-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
Tested-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: alan@linux.intel.com
Cc: bp@alien8.de
Cc: cheol.yong.kim@intel.com
Cc: qi-ming.wu@intel.com
Cc: rahul.tanwar@intel.com
Cc: rppt@linux.ibm.com
Cc: tony.luck@intel.com
Link: http://lkml.kernel.org/r/20190821081330.1187-1-rahul.tanwar@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agor8152: Set memory to all 0xFFs on failed reg reads
Prashant Malani [Sat, 24 Aug 2019 08:36:19 +0000 (01:36 -0700)]
r8152: Set memory to all 0xFFs on failed reg reads

[ Upstream commit f53a7ad189594a112167efaf17ea8d0242b5ac00 ]

get_registers() blindly copies the memory written to by the
usb_control_msg() call even if the underlying urb failed.

This could lead to junk register values being read by the driver, since
some indirect callers of get_registers() ignore the return values. One
example is:
  ocp_read_dword() ignores the return value of generic_ocp_read(), which
  calls get_registers().

So, emulate PCI "Master Abort" behavior by setting the buffer to all
0xFFs when usb_control_msg() fails.

This patch is copied from the r8152 driver (v2.12.0) published by
Realtek (www.realtek.com).

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoARM: 8874/1: mm: only adjust sections of valid mm structures
Doug Berger [Mon, 1 Jul 2019 17:50:11 +0000 (18:50 +0100)]
ARM: 8874/1: mm: only adjust sections of valid mm structures

[ Upstream commit c51bc12d06b3a5494fbfcbd788a8e307932a06e9 ]

A timing hazard exists when an early fork/exec thread begins
exiting and sets its mm pointer to NULL while a separate core
tries to update the section information.

This commit ensures that the mm pointer is not NULL before
setting its section parameters. The arguments provided by
commit 11ce4b33aedc ("ARM: 8672/1: mm: remove tasklist locking
from update_sections_early()") are equally valid for not
requiring grabbing the task_lock around this check.

Fixes: 08925c2f124f ("ARM: 8464/1: Update all mm structures with section adjustments")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoKconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICST...
Christophe JAILLET [Mon, 19 Aug 2019 05:04:25 +0000 (07:04 +0200)]
Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105

[ Upstream commit cd9d4ff9b78fcd0fc4708900ba3e52e71e1a7690 ]

This should be IDT77105, not IDT77015.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoNFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup
Trond Myklebust [Wed, 14 Aug 2019 18:19:09 +0000 (14:19 -0400)]
NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup

[ Upstream commit 17d8c5d145000070c581f2a8aa01edc7998582ab ]

Initialise the result count to 0 rather than initialising it to the
argument count. The reason is that we want to ensure we record the
I/O stats correctly in the case where an error is returned (for
instance in the layoutstats).

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoNFSv4: Fix return values for nfs4_file_open()
Trond Myklebust [Fri, 9 Aug 2019 19:03:11 +0000 (15:03 -0400)]
NFSv4: Fix return values for nfs4_file_open()

[ Upstream commit 90cf500e338ab3f3c0f126ba37e36fb6a9058441 ]

Currently, we are translating RPC level errors such as timeouts,
as well as interrupts etc into EOPENSTALE, which forces a single
replay of the open attempt. What we actually want to do is
force the replay only in the cases where the returned error
indicates that the file may have changed on the server.

So the fix is to spell out the exact set of errors where we want
to return EOPENSTALE.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agos390/bpf: use 32-bit index for tail calls
Ilya Leoshkevich [Mon, 12 Aug 2019 16:18:07 +0000 (18:18 +0200)]
s390/bpf: use 32-bit index for tail calls

[ Upstream commit 91b4db5313a2c793aabc2143efb8ed0cf0fdd097 ]

"p runtime/jit: pass > 32bit index to tail_call" fails when
bpf_jit_enable=1, because the tail call is not executed.

This in turn is because the generated code assumes index is 64-bit,
while it must be 32-bit, and as a result prog array bounds check fails,
while it should pass. Even if bounds check would have passed, the code
that follows uses 64-bit index to compute prog array offset.

Fix by using clrj instead of clgrj for comparing index with array size,
and also by using llgfr for truncating index to 32 bits before using it
to compute prog array offset.

Fixes: 6651ee070b31 ("s390/bpf: implement bpf_tail_call() helper")
Reported-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoARM: OMAP2+: Fix omap4 errata warning on other SoCs
Tony Lindgren [Tue, 23 Jul 2019 11:37:45 +0000 (04:37 -0700)]
ARM: OMAP2+: Fix omap4 errata warning on other SoCs

[ Upstream commit 45da5e09dd32fa98c32eaafe2513db6bd75e2f4f ]

We have errata i688 workaround produce warnings on SoCs other than
omap4 and omap5:

omap4_sram_init:Unable to allocate sram needed to handle errata I688
omap4_sram_init:Unable to get sram pool needed to handle errata I688

This is happening because there is no ti,omap4-mpu node, or no SRAM
to configure for the other SoCs, so let's remove the warning based
on the SoC revision checks.

As nobody has complained it seems that the other SoC variants do not
need this workaround.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agos390/bpf: fix lcgr instruction encoding
Ilya Leoshkevich [Mon, 12 Aug 2019 15:03:32 +0000 (17:03 +0200)]
s390/bpf: fix lcgr instruction encoding

[ Upstream commit bb2d267c448f4bc3a3389d97c56391cb779178ae ]

"masking, test in bounds 3" fails on s390, because
BPF_ALU64_IMM(BPF_NEG, BPF_REG_2, 0) ignores the top 32 bits of
BPF_REG_2. The reason is that JIT emits lcgfr instead of lcgr.
The associated comment indicates that the code was intended to
emit lcgr in the first place, it's just that the wrong opcode
was used.

Fix by using the correct opcode.

Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agomwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings
Wen Huang [Wed, 28 Aug 2019 02:07:51 +0000 (10:07 +0800)]
mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings

commit 7caac62ed598a196d6ddf8d9c121e12e082cac3a upstream.

mwifiex_update_vs_ie(),mwifiex_set_uap_rates() and
mwifiex_set_wmm_params() call memcpy() without checking
the destination size.Since the source is given from
user-space, this may trigger a heap buffer overflow.

Fix them by putting the length check before performing memcpy().

This fix addresses CVE-2019-14814,CVE-2019-14815,CVE-2019-14816.

Signed-off-by: Wen Huang <huangwenabc@gmail.com>
Acked-by: Ganapathi Bhat <gbhat@marvell.comg>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agotty/serial: atmel: reschedule TX after RX was started
Razvan Stefanescu [Tue, 13 Aug 2019 07:40:25 +0000 (10:40 +0300)]
tty/serial: atmel: reschedule TX after RX was started

commit d2ace81bf902a9f11d52e59e5d232d2255a0e353 upstream.

When half-duplex RS485 communication is used, after RX is started, TX
tasklet still needs to be  scheduled tasklet. This avoids console freezing
when more data is to be transmitted, if the serial communication is not
closed.

Fixes: 69646d7a3689 ("tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped")
Signed-off-by: Razvan Stefanescu <razvan.stefanescu@microchip.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190813074025.16218-1-razvan.stefanescu@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoserial: sprd: correct the wrong sequence of arguments
Chunyan Zhang [Thu, 5 Sep 2019 07:41:51 +0000 (15:41 +0800)]
serial: sprd: correct the wrong sequence of arguments

commit 9c801e313195addaf11c16e155f50789d6ebfd19 upstream.

The sequence of arguments which was passed to handle_lsr_errors() didn't
match the parameters defined in that function, &lsr was passed to flag
and &flag was passed to lsr, this patch fixed that.

Fixes: b7396a38fb28 ("tty/serial: Add Spreadtrum sc9836-uart driver support")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190905074151.5268-1-zhang.lyra@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>