sec_jack: Use power effecient workqueue

The SEC jack detection power up work does not seem to be 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: Luis Cruz <ljc2491@gmail.com>
hwrng: add randomness to system from rng sources

When bringing a new RNG source online, it seems like it would make sense
to use some of its bytes to make the system entropy pool more random,
as done with all sorts of other devices that contain per-device or
per-boot differences.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
d2:defconfig: enable ARCH_RANDOM

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Merge branch 'axdev/next-random'
sched/deadline: Deny unprivileged users to set/change SCHED_DEADLINE policy

Deny the use of SCHED_DEADLINE policy to unprivileged users.
Even if root users can set the policy for normal users, we
don't want the latter to be able to change their parameters
(safest behavior).

Signed-off-by: Juri Lelli <juri.lelli@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1393844961-18097-1-git-send-email-juri.lelli@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Merge branch 'axdev/sched-dl'
msm: bam_dmux: UL inactivity timeout is too high

Reduce UL_TIMEOUT from 1000 ms to 200 ms to improve current drain
for idle use case.

Change-Id: I83eba12e28506735ff15f52533dda653872fc9f2
Signed-off-by: Alexander Filonenko <vtp684@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/538334
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Connie Zhao <czhao1@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Reviewed-by: Christopher Fries <c.fries@motorola.com>
SLT-Approved: Christopher Fries <c.fries@motorola.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Delay UL powerdown if BAM is in polling mode

Change-Id: I982c669863390d5ea828d8dd3158e76dab3163e9
Reviewed-on: http://gerrit.pcs.mot.com/548359
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Alexander Filonenko <alexf@motorola.com>
SLT-Approved: Christopher Fries <c.fries@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
msm: bam_dmux: optimize UL inactivity timeout

Increase UL_TIMEOUT_DELAY to 300 ms to avoid most of powerdown attempts while
in polling mode.

Change-Id: Ibbcf641caac492357f78c1d6fd378609ea546c67
Signed-off-by: Alexander Filonenko <vtp684@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/548732
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
SLT-Approved: Christopher Fries <c.fries@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
msm: bam_dmux: fix compilation issue

Change-Id: Ie4dd92ce622a1e59bd415b0d8ba25c1896b20fab
Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
[ljc: also call BUG instead of panic]
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
msm: bam_dmux: Use power efficient workqueues for delayed timeouts

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: Luis Cruz <ljc2491@gmail.com>
msm_fb: display: Add new panel_mutex

Add a panel_mutex to synchronize between the display driver
suspend, resume and update call.

Change-Id: If7069f92081e27ed53fc0baf87e84815a18bd2dd
Signed-off-by: Bang Nguyen <bnguyen1@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/493572
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: James Wylder <James.Wylder@motorola.com>
(cherry picked from commit c9b271eb1f75d0ad5984dc9e7369ec7d04c3a81c)

Conflicts:

	drivers/video/msm/msm_fb.c

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
 (CR) msm_fb: display: reduce turn-on display time.

    When turning on panel, increase its priority and restore it
    after panel has been turned on to reduce Turn-on display
    time when press power key.

    cherry pick commit:c43ca6a4 from main-jb-qc branch.

Change-Id: Ie0e8e55fc7498a6b2d43ad9e1995fa96c609c81e
Reviewed-on: http://gerrit.pcs.mot.com/500101
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Bang Nguyen <BNGUYEN1@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>

Conflicts:

	drivers/video/msm/mipi_dsi.c

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
msm:display: Don't hold mutex and deadwait for resume.

We need to unlock the panel_mutex to let resume finish its job.
Otherwise we will see deadlock by panel_mutex.

Change-Id: I54046eb181b76bf25174040db4c0d33d9ab7294a
Signed-off-by: Yuan Jiangli <jlyuan@motorola.com>
Change-Id: I7955c7c152b5fef78c526fb76c0f86b52b8369e1
Reviewed-on: http://gerrit.pcs.mot.com/560772
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Bang Nguyen <bnguyen1@motorola.com>
Reviewed-by: Zhi-Ming Yuan <a14194@motorola.com>
Reviewed-by: Patrick Auchter <auchter@motorola.com>
Reviewed-by: Jun-Xiao Chang <w20081@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Stephen Rossbach <ccpm12@motorola.com>
SLTApproved: Stephen Rossbach <ccpm12@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
msm: rng: pass correct size to kzalloc

The size passed to kzalloc should be structure size
instead of pointer size.

Change-Id: I55dc635672dca779a36620cac7b854af3b004ef9
Signed-off-by: Yuanyuan Zhong <zyy@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/548864
SLT-Approved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Check Patch <CHEKPACH@motorola.com>
Reviewed-by: Klocwork kwcheck <klocwork-kwcheck@sourceforge.mot.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>
Merge branch 'moto/bam_dmux'
Merge branch 'axdev/pe-wq'
msm: bam_dmux: Use power efficient workqueues in moto/bam_dmux import

The delay in 84a56e55ddca90f7a08e5585311d921a2787a52a has no need for a normal per-CPU workqueue

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
net: wireless: bcmdhd: Use fromdos on dhd.h

Lame formatting is wrong and lame.

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
net: wireless: bcmdhd: reduced the wakelock time of RX packet

	Reduce time : 1secs -> 500ms
	Problem : [Issue 11512235] 34% battery eaten overnight
		  [Issue 11374623] OS + Wifi used 41% of battery,
		  wlan_rx_wake
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Luis Cruz <ljc2491@gmail.com>