Commit Graph

447092 Commits

Author SHA1 Message Date
Shaibal Dutta 7e036937b3 net: rfkill: move poll work to power efficient workqueue
This patch moves the rfkill poll_work to the power efficient workqueue.
This work does not have to be bound to the CPU that scheduled it, hence
the selection of CPU that executes it would be left to the scheduler.
Net result is that CPU idle times would be extended, resulting in power
savings.

This behaviour is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com>
[zoran.markovic@linaro.org: Rebased to latest kernel, added commit message.
Fixed workqueue selection after suspend/resume cycle.]
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-27 22:11:06 +02:00
Shaibal Dutta b194a07f03 net: wireless: move regulatory timeout work to power efficient workqueue
For better use of CPU idle time, allow the scheduler to select the CPU
on which the timeout work of regulatory settings would be executed.
This extends CPU idle residency time and saves power.

This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com>
[zoran.markovic@linaro.org: Rebased to latest kernel. Added commit message.]
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-27 22:11:06 +02:00
Matias Bjørling d554c91a58 block: remove WQ_POWER_EFFICIENT from kblockd
blk-mq issues async requests through kblockd. To issue a work request on
a specific CPU, kblockd_schedule_delayed_work_on is used. However, the
specific CPU choice may not be honored, if the power_efficient option
for workqueues is set. blk-mq requires that we have strict per-cpu
scheduling, so it wont work properly if kblockd is marked
POWER_EFFICIENT and power_efficient is set.

Remove the kblockd WQ_POWER_EFFICIENT flag to prevent this behavior.
This essentially reverts part of commit 695588f9454b, which added
the WQ_POWER_EFFICIENT marker to kblockd.

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
2019-07-27 22:11:05 +02:00
viresh kumar d656ae1fd1 net/neighbour: queue work on power efficient wq
Workqueue used in neighbour layer have no real dependency of scheduling these on
the cpu which scheduled them.

On a idle system, it is observed that an idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.

This patch replaces normal workqueues with power efficient versions. This
doesn't change existing behavior of code unless CONFIG_WQ_POWER_EFFICIENT is
enabled.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-27 22:11:05 +02:00
viresh kumar 8105e8acac net/ipv4: queue work on power efficient wq
Workqueue used in ipv4 layer have no real dependency of scheduling these on the
cpu which scheduled them.

On a idle system, it is observed that an idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.

This patch replaces normal workqueues with power efficient versions. This
doesn't change existing behavior of code unless CONFIG_WQ_POWER_EFFICIENT is
enabled.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-27 22:11:05 +02:00
Shawn Bohrer 524e3d8583 sched/rt: Remove redundant nr_cpus_allowed test
In 76854c7e8f ("sched: Use
rt.nr_cpus_allowed to recover select_task_rq() cycles") an
optimization was added to select_task_rq_rt() that immediately
returns when p->nr_cpus_allowed == 1 at the beginning of the
function.

This makes the latter p->nr_cpus_allowed > 1 check redundant,
which can now be removed.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Mike Galbraith <mgalbraith@suse.de>
Cc: tomk@rgmadvisors.com
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1380914693-24634-1-git-send-email-shawn.bohrer@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-07-27 22:11:04 +02:00
Mark Brown cd6f5b0e8d ASoC: compress: Use power efficient workqueue
There is no need for the power down work to be done on a per CPU workqueue
especially considering the fairly long delay before powerdown.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
2019-07-27 22:11:04 +02:00
Mark Brown e85240ca74 ASoC: pcm: Use the power efficient workqueue for delayed powerdown
There is no need to use a normal per-CPU workqueue for delayed power downs
as they're not timing or performance critical and waking up a core for them
would defeat some of the point.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-07-27 22:11:03 +02:00
Mark Brown 53f4614f5d ASoC: jack: Use power efficient workqueue
The accessory detect debounce work is not performance sensitive so let
the scheduler run it wherever is most efficient rather than in a per CPU
workqueue by using the system power efficient workqueue.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-07-27 22:11:03 +02:00
Mark Brown aac80fa724 regulator: core: Use the power efficient workqueue for delayed powerdown
There is no need to use a normal per-CPU workqueue for delayed power downs
as they're not timing or performance critical and waking up a core for them
would defeat some of the point.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Liam Girdwood <liam.r.girdwood@intel.com>
2019-07-27 22:11:03 +02:00
Viresh Kumar 367b5deb13 fbcon: queue work on power efficient wq
fbcon uses workqueues and it has no real dependency of scheduling these on the
cpu which scheduled them.

On a idle system, it is observed that and idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.

This patch replaces system_wq with system_power_efficient_wq.

Cc: Dave Airlie <airlied@redhat.com>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-07-27 22:11:02 +02:00
Viresh Kumar d0dcfbd319 block: queue work on power efficient wq
Block layer uses workqueues for multiple purposes. There is no real dependency
of scheduling these on the cpu which scheduled them.

On a idle system, it is observed that and idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.

This patch replaces normal workqueues with power efficient versions.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-07-27 22:11:02 +02:00
Viresh Kumar fd6e9ff26f PHYLIB: queue work on system_power_efficient_wq
Phylib uses workqueues for multiple purposes. There is no real dependency of
scheduling these on the cpu which scheduled them.

On a idle system, it is observed that and idle cpu wakes up many times just to
service this work. It would be better if we can schedule it on a cpu which the
scheduler believes to be the most appropriate one.

This patch replaces system_wq with system_power_efficient_wq for PHYLIB.

Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-07-27 22:11:02 +02:00
Viresh Kumar 407b158b99 workqueue: Add system wide power_efficient workqueues
This patch adds system wide workqueues aligned towards power saving. This is
done by allocating them with WQ_UNBOUND flag if 'wq_power_efficient' is set to
'true'.

tj: updated comments a bit.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-07-27 22:11:01 +02:00
Viresh Kumar df8a9d39e7 workqueues: Introduce new flag WQ_POWER_EFFICIENT for power oriented workqueues
Workqueues can be performance or power-oriented. Currently, most workqueues are
bound to the CPU they were created on. This gives good performance (due to cache
effects) at the cost of potentially waking up otherwise idle cores (Idle from
scheduler's perspective. Which may or may not be physically idle) just to
process some work. To save power, we can allow the work to be rescheduled on a
core that is already awake.

Workqueues created with the WQ_UNBOUND flag will allow some power savings.
However, we don't change the default behaviour of the system.  To enable
power-saving behaviour, a new config option CONFIG_WQ_POWER_EFFICIENT needs to
be turned on. This option can also be overridden by the
workqueue.power_efficient boot parameter.

tj: Updated config description and comments.  Renamed
    CONFIG_WQ_POWER_EFFICIENT to CONFIG_WQ_POWER_EFFICIENT_DEFAULT.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
2019-07-27 22:11:01 +02:00
MSe 1251eb1446 drivers/muic: Fix '"WRITE" redefined' error after CVE-2019-2001 fix
Compile error:
In file included from kernel/samsung/gts2/drivers/muic/universal/muic_task.c:49:0:
 kernel/samsung/gts2/drivers/muic/universal/muic_debug.h:6:0: error: "WRITE" redefined [-Werror]
 #define WRITE 1
 ^
In file included from kernel/samsung/gts2/include/linux/seq_file.h:10:0,
                 from kernel/samsung/gts2/include/linux/pinctrl/pinctrl.h:19,
                 from kernel/samsung/gts2/include/asm-generic/gpio.h:8,
                 from kernel/samsung/gts2/arch/arm/include/asm/gpio.h:15,
                 from kernel/samsung/gts2/include/linux/gpio.h:45,
                 from kernel/samsung/gts2/drivers/muic/universal/muic_task.c:23:
 kernel/samsung/gts2/include/linux/fs.h:192:0: note: this is the location of the previous definition
 #define WRITE   RW_MASK

Fix is to change the define statements in drivers/muic/universal/muic_debug.h, used in
drivers/muic/universal/muic_i2c.c as follows WRITE >> DBG_WRITE, READ >> DBG_READ
to avoid the duplicate definition contradiction.

Change-Id: Ie2416adb3987fe16011fe1d14e24934218273a8a
2019-07-27 22:11:01 +02:00
syphyr 278c64a80a Revert "muic: Fix WRITE redefined compile error"
This reverts commit 3f40eaf1b9a3281929c141acc3fe495bb42863fc.
2019-07-27 22:11:00 +02:00
Wu Gao 436baac58f qcacld-2.0: Fix potential OOB read when indicate mgmt frame
In function __hdd_indicate_mgmt_frame, it doesn't check mgmt frame
length and access pointer to frame, which cause OOB read potentially.
So, check frame length before access pointer to frame.

Change-Id: Id2bd4276838f1eae49e8a24e8ab3361a69321a69
CRs-Fixed: 2429210
2019-07-27 22:11:00 +02:00
Brahmaji K 2d37893dce qseecom: Fix accessing userspace memory in kernel space
Use put_user API to write the data from kernel space to
userspace to avoid accessing userspace memory directly
in kernel space.

Bug: 65468973
Change-Id: I649fe2597e80ccad50cf16b355e220734810e94c
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
2019-07-27 22:11:00 +02:00
Vijay kumar Tumati 1287f1a46f msm: camera : Lock Implementation for avoid race condition
Lock Implementation for avoid race condition leading
to out-of-bound write in "msm_vb2_queue_setup

CRs-Fixed: 2362627
Change-Id: I7f7420c7437b9ac2f215929a8614b0846e890c98
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
2019-07-27 22:10:59 +02:00
Soumya Managoli 7f45834835 ASoC: msm: Modify buf size check to prevent OOB error
Expected buffer size to read is 2 bytes.
Corrected the size check to return error
when count is not 2.

Change-Id: I43b572d191f6f98a8a790b5ae77b43fabcd7329a
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
2019-07-27 22:10:59 +02:00
Xiaojun Sang e02c7a7eed dsp: asm: validate payload size before access
Payload size is not checked before payload access. Check size
to avoid out-of-boundary memory access.

Change-Id: Iaa39ee4ea5489bb5579e7b7d5dfada12d88c5809
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-07-27 22:10:59 +02:00
Karthikeyan Mani 8dc3bb6ce4 dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-07-27 22:10:58 +02:00
Vatsal Bucha a72aa003e4 dsp: asm: Add check for num_channels before calling q6asm_map_channels
Channel_mapping array size varies for different commands.
Add check for num_channels before calling q6asm_map_channels.

Change-Id: Iccbcfe82f716fc0ffe0a26b1779dcaa1c3cb805b
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:58 +02:00
Xiaojun Sang 9be69e398a dsp: validate token before usage as array index
Token from DSP might be invalid for array index. Validate
the token before being used as array index.

Change-Id: I9f47e1328d75d9f9acf7e85ddb452019b6eced0a
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-07-27 22:10:57 +02:00
Ajit Pandey 74e190f54e drivers: soc: qcom: Added check to avoid opening multiple instance
Opening of multiple instance of voice_svc user space from app will
lead to pointer deference of private data within apr callback. As
multi-instance not supported added check to deny open() from user
space if previous instance hasn't been closed.

Change-Id: Ia5ef16c69a517760fc9d45530a8a41a333fa2a21
Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
2019-07-27 22:10:57 +02:00
Rajesh Kemisetti b156e3861d msm: kgsl: Fix race condition while making page as dirty
set_page_dirty() is racy if the caller has no
reference against page->mapping->host, and if
the page is unlocked. This is because another
CPU could truncate the page off the mapping and
then free the mapping.

Use set_page_dirty_lock() to avoid this race condition.

Change-Id: I517fb9aee66560618c7676b311368f7a7498011f
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2019-07-27 22:10:57 +02:00
Manoj Prabhu B 07c5388313 diag: dci: Validate dci response length before parsing
Prevent possible out of bound access due to missing length check
while extracting dci packet response by adding proper checks.

CRs-Fixed: 2434571
Change-Id: I7b6972bf6559bdca99333a75d989cd6d3431b801
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-07-27 22:10:56 +02:00
Jianmin Zhu d4886fefc4 cfg80211: Fix use after free when process wdev events
"bssid" is only initialized out of the while loop, in case of two
events with same type: EVENT_CONNECT_RESULT, but one has zero
ether addr, the other is non-zero, the bssid pointer will be
referenced twice, which lead to use-after-free issue

Change-Id: Ie8a24275f7ec5c2f936ef0a802a42e5f63be9c71
CRs-Fixed: 2254305
Signed-off-by: Zhu Jianmin <jianminz@codeaurora.org>
2019-07-27 22:10:56 +02:00
Vignesh Kulothungan dbb4420cbd msm: asm: validate ADSP data before access
Validate buffer index obtained from ADSP token before using it.

CRs-Fixed: 2372302
Change-Id: I5c3b1634bd08b516844638dd67f726a882edfc17
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-07-27 22:10:56 +02:00
Manoj Prabhu B aea54399b0 diag: dci: Validate dci client entries prior read
Validate the dci entries and its task structure before
accessing structure members to prevent copying dci data to
invalid entries.

Change-Id: I07c59ef0705bc52a8268b0dc984ebfa9d26d178e
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2019-07-27 22:10:55 +02:00
kunleiz 358da63eb1 lsm: check payload size validity before using it as array index
Payload size validity is not checked before using it in array index.
Check payload size to avoid out-of-boundary memory.

Change-Id: Ic0b06bb331fc1753ff7543bb218ab12d6a4a3ca8
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
2019-07-27 22:10:55 +02:00
Zhen Kong 1aaa82aefa qseecom: Add a new smc cmd to check RPMB key provision status
A new smc cmd is added to check RPMB key provision status

Change-Id: I50411bf9ae7f31589be34d7b5aaf48f2c12f0018
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2019-07-27 22:10:55 +02:00
Vignesh Kulothungan 41ec0b6adb msm: adm: validate ADSP payload size before access
Check the size of ADSP payload before accessing it.

CRs-Fixed: 2380694
Change-Id: I52e74e5a86499ea61f8426f767948ce940d4d59c
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-07-27 22:10:54 +02:00
Vatsal Bucha acb7b45709 qdsp6v2: q6usm: Check size of payload before access
Check size of payload array before access in q6usm_callback.

Change-Id: Id0c85209a053f9dfdb53133aeb6b2510ecf18eb8
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:54 +02:00
Vatsal Bucha 3befe291bf qdsp6v2: q6usm: Check size of payload before access
Check size of payload before access in q6usm_mmapcallback.

Change-Id: Iff0672532c2ea40e7129237a92d8365d6b554cf2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:54 +02:00
Vatsal Bucha c2a162f30b dsp: q6voice: Check size of shared memory buffer before access
Check buffer size in qdsp_cvs_callback before access in
ul_pkt.

Change-Id: Ic19994b46086709231656ec747d2df988b7a512f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-27 22:10:53 +02:00
Alexandre Belloni e411eea119 rtc: ensure rtc_set_alarm fails when alarms are not supported
[ Upstream commit abfdff44bc38e9e2ef7929f633fb8462632299d4 ]

When using RTC_ALM_SET or RTC_WKALM_SET with rtc_wkalrm.enabled not set,
rtc_timer_enqueue() is not called and rtc_set_alarm() may succeed but the
subsequent RTC_AIE_ON ioctl will fail. RTC_ALM_READ would also fail in that
case.

Ensure rtc_set_alarm() fails when alarms are not supported to avoid letting
programs think the alarms are working for a particular RTC when they are
not.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 22:10:53 +02:00
Vaibhav Jain 3068d94fba rtc: interface: Validate alarm-time before handling rollover
[ Upstream commit da96aea0ed177105cb13ee83b328f6c61e061d3f ]

In function __rtc_read_alarm() its possible for an alarm time-stamp to
be invalid even after replacing missing components with current
time-stamp. The condition 'alarm->time.tm_year < 70' will trigger this
case and will cause the call to 'rtc_tm_to_time64(&alarm->time)'
return a negative value for variable t_alm.

While handling alarm rollover this negative t_alm (assumed to seconds
offset from '1970-01-01 00:00:00') is converted back to rtc_time via
rtc_time64_to_tm() which results in this error log with seemingly
garbage values:

"rtc rtc0: invalid alarm value: -2-1--1041528741
2005511117:71582844:32"

This error was generated when the rtc driver (rtc-opal in this case)
returned an alarm time-stamp of '00-00-00 00:00:00' to indicate that
the alarm is disabled. Though I have submitted a separate fix for the
rtc-opal driver, this issue may potentially impact other
existing/future rtc drivers.

To fix this issue the patch validates the alarm time-stamp just after
filling up the missing datetime components and if rtc_valid_tm() still
reports it to be invalid then bails out of the function without
handling the rollover.

Reported-by: Steve Best <sbest@redhat.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 22:10:52 +02:00
Hyogi Gim 91dae411e5 drivers/rtc/interface.c: check the error after __rtc_read_time()
In __rtc_set_alarm(), the error after __rtc_read_time() is not checked.
If rtc device fail to read time, we cannot guarantee the following
process.

Add the verification code for returned __rtc_read_time() error.

Signed-off-by: Hyogi Gim <hyogi.gim@lge.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-27 22:10:52 +02:00
Alessandro Zummo a8d8007d37 rtc: verify a critical argument to rtc_update_irq() before using it
This small addition to the core simplifies code in the drivers and makes
them more robust when handling shared IRQs.

Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-27 22:10:52 +02:00
Ales Novak 076926d16a drivers/rtc/interface.c: fix infinite loop in initializing the alarm
In __rtc_read_alarm(), if the alarm time retrieved by
rtc_read_alarm_internal() from the device contains invalid values (e.g.
month=2,mday=31) and the year not set (=-1), the initialization will
loop infinitely because the year-fixing loop expects the time being
invalid due to leap year.

Fix reduces the loop to the leap years and adds final validity check.

Signed-off-by: Ales Novak <alnovak@suse.cz>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Reported-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-27 22:10:51 +02:00
Chris Brand d40712d6de drivers/rtc/interface.c: return -EBUSY, not -EACCES when device is busy
If rtc->irq_task is non-NULL and task is NULL, they always
rtc_irq_set_freq(), whenever err is set to -EBUSY it will then immediately
be set to -EACCES, misleading the caller as to the underlying problem.

Signed-off-by: Chris Brand <chris.brand@broadcom.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-27 22:10:51 +02:00
Sachin Kamat 4a28334129 drivers/rtc/interface.c: fix checkpatch errors
Fixes the following types of errors:
  ERROR: "foo* bar" should be "foo *bar"
  ERROR: else should follow close brace '}'
  WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-27 22:10:50 +02:00
Zoran Markovic e06855f862 rtc: Keep system awake until all expired RTC timers are handled
Current implementation of RTC interface allows for system suspend to
occur in the following cases:
(a) if a timer is set in the past and rtc_timer_do_work() is scheduled
to handle it, and
(b) if rtc_timer_do_work() is called to handle expired timers whose
handlers implement a preemption point.

A pending suspend request may be honoured in the above cases causing
timer handling to be delayed until after the next resume. This is
undesirable since timer handlers may have time-critical code to execute.

This patch makes sure that the system stays awake until all expired
timers are handled.

Note that all calls to pm_stay_awake() are eventually paired with
the single pm_relax() call in rtc_timer_do_work(), which is launched
using schedule_work().

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Arve Hjonnevag <arve@android.com>
Cc: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-07-27 22:10:50 +02:00
Liangwei Dong 75aacddda2 Revert "qcacld-2.0: Fix sme active list timeout casued by delete sta request"
This reverts commit I3228badf66eeef627d7d3ff632bac1e0c90df1e5.

The orignal commit wants to fix below issue.
In some corner cases, delete sta request processing wma handler didn't sent
The response, the commands in active list will not be removed and timeout.

In current code when plugging out TF USB card in wow mode, driver
will crash due to double free the memory tpDelStaSelfParams.

The first time memory free happens as below.
When handling WDA_DEL_STA_SELF_REQ in wma_vdev_detach,
tpDelStaSelfParams is saved to iface->del_staself_req
since the vdev is still in started state. At the same
time an event <WDA_DEL_STA_SELF_RSP> with parameter
tpDelStaSelfParams is delivered, in which the
tpDelStaSelfParams is freed.
The second time memory free is in the wma_wmi_service_close
since the iface->del_staself_req is not NULL.

In normal case the iface->del_staself_req will be processed
later in wma_vdev_stop_ind, then the <WDA_DEL_STA_SELF_RSP>
event will be delivered in wma_vdev_detach_callback.
The WDA_DEL_STA_SELF_RSP event delivery in wma_vdev_detach
is unnecessary and duplicated.
If revert this change, no crash happens when plugging out TF USB card
in wow mode.

Change-Id: Ib844dd88f3a8b4496f9878b8a1fcddd72acc6a57
CRs-Fixed: 1023548
2019-07-27 22:10:49 +02:00
Selvaraj, Sridhar dcb2493c0b qcacld-2.0: Fix layer violations in SME layer
Some of the SME APIs are using LIM APIs, remove those
violations

Change-Id: I069bb328ee38078bdc0497cd4663e1ee287aa3ee
CRs-Fixed: 997473
2019-07-27 22:10:49 +02:00
Komal Seelam 3455cd9129 qcacld-2.0: Configure SSDP address to FW as WoW pattern or MC list
Incoming Data packets are filtered by FW during WoW based on the pattern
configuration done by host.

The incoming packet is filtered out to Multicast list if configured,
else it looks for other patterns that are configured.

SSDP pattern is not configured along with Multicast List, instead it
is configured as a normal WoW pattern during system/runtime suspend.
So, all the ssdp packets are dropped by FW during WoW.

To address this, host should configure the SSDP pattern as a Multicast
filter if Multicast filter is enabled in ini, else configure it as a
normal WoW Pattern. Hence the fix.

Change-Id: I64aa30832999a779591bdfce02e13545a6cbf4f2
CRs-Fixed: 1010542
2019-07-27 22:10:48 +02:00
Selvaraj, Sridhar 2017373446 qcacld-2.0: Check if vdev is created before LL stats query
Link Layer(LL) stats query is received in host in a corner/race condition
between the events "change iface" and "start ap" in HDD where vdev is not
created yet ie.as part of "change iface" in HDD, host does close session
(VDEV DELETE) and as part of start ap, host invokes open session(VDEV
CREATE). It leads to an exception issue in firmware since FW receives
REQUEST_LINK_STATS WMI for a deleted VDEV.

This fix adds a boolean variable vdev_active to vdev structure(wma_txrx_node),
which is set to true once vdev is created. vdev_active is checked for TRUE
before sending LL stats query to FW with WMI command.

Change-Id: Ifcc986c3352e4e66da35b8d6c489d98dbe61401d
CRs-Fixed: 987734
2019-07-27 22:10:48 +02:00
Krishna Kumaar Natarajan 528d045c0a qcacld-2.0: Fix layering violation in sirApi.h
Fix layering violation in sirApi.h by renaming
enumeration prefixed with LIM.

Change-Id: I8b33fbb6d315c54c8cd483bd89685719e460051a
CRs-Fixed: 995039
2019-07-27 22:10:47 +02:00