msm: thermal: make sure we actually want to go through with the policy adjust since this can be triggered by any policy update with the cPUFREQ_ADJUST flag.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: cpu-boost: Export cpu boost status

* This will help hotplug drivers to know boost status
  of CPU and act accordingly.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: hotplug: Do not butcher boosted CPU

* In existing scenario, we don't check whether CPU is
  booster or not before taking it down.
* Break the loop and wait for next cycle if CPU is
  currently being boosted.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
perf/debug: disable some debug

Following my changes on Bacon, let's disable this here as well

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
bluactive: don't scale beyond min if the load is low

by franciscofranco
defconfig: use smp idle threads
mm: fix prctl_set_vma_anon_name

prctl_set_vma_anon_name could attempt to set the name across
two vmas at the same time due to a typo, which might corrupt
the vma list.  Fix it to use tmp instead of end to limit
the name setting to a single vma at a time.

Change-Id: Ie32d8ddb0fd547efbeedd6528acdab5ca5b308b4
Reported-by: Jed Davis <jld@mozilla.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm8974: oc to 2534.4Mhz & uc to 96Mhz

Change-Id: I5a8f104b5eab45a3f44e076d0076493d56f57192
Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
ARM: dts: msm: i2c: change  clock rate to 19.2 MHz

For standard  requirement, I2C source
speed of 50MHz causes high power usage, hence
this patch change the clock rate to 19.2 MHz
to save power.

CRs-Fixed: 552956
Change-Id: Ifb17fb79062a390a19881d247a2ac0ca5cc55d80
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
ARM: dts: msm: SPI Modify SPI BAM physical memory size

SPI  driver does not map all spi bam memory space.
When  spi driver attempts to read from a register
by adding offset to  base address, that
address exceeds  memory area thus  data
abort happen.

This patch add the correct  size for SPI BAM
memory in DT file to map all the registers thus
avoid data abort.

CRs-Fixed: 562031
Change-Id: Ibd69176c5b8c90a15141b621beb27f2655770797
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
net/l2tp: don't fall back on UDP [get|set]sockopt

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel->sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Change-Id: Ia6c09487e92d1ee4e8d1d22a6273034b22272a2f
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: James Chapman <jchapman@katalix.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: Phil Turnbull <phil.turnbull@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
spi_qsd: Fix SPI L2 Crash

Message queue  is scheduled to process
SPI messages during system suspend
state which leads to crash.

This patch make sure all the messages
in queue are processed before system
suspends.

CRs-Fixed: 593658
Change-Id: I722f24fcee4a1d2bbfee4341c8bc6c36ff9e1ec8
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
ARM: dts: msm: SPI Modify SPI BAM physical memory size

SPI  driver does not map all spi bam memory space.
When  spi driver attempts to read from a register
by adding offset to  base address, that
address exceeds  memory area thus  data
abort happen.

This patch add the correct  size for SPI BAM
memory in DT file to map all the registers thus
avoid data abort.

CRs-Fixed: 562031
Change-Id: Ibd69176c5b8c90a15141b621beb27f2655770797
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
spi_qsd: Remove check for unaligned  length during input_irq

QUP_IRQ complete is triggered before dmov_rx callback.
Which will initiate SPI to start next transfer, due to
this earlier DMOV_CMD is blocked and results in kernel panic.

Current Implementation  make sure that transfer complete waits
For DMOV callback only in case of aligned lengths ,This patch
ensures transfer trigger only after DMOV RX call back for
unaligned length also.

CRs-Fixed: 583126
Change-Id: I306a705d0eaf0eac33b2dbf335992254351cce20
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
spi_qsd: Initialize wait queue

Due to missing initialization of wait queue
issues reported on customer builds. This patch
adds the missing wait queue initialization code.

Change-Id: I2150d94bfec74b26842aac4fbd0e2e44af3b9943
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
msm8974: oc to 2534.4Mhz & uc to 96Mhz

Change-Id: I5a8f104b5eab45a3f44e076d0076493d56f57192
Signed-off-by: Dennis Rassmann <showp1984@gmail.com> (reverted from commit 6f0b8741cde806070e6c4c2643c739f83dfcdf1d)
msm8974: oc to 2534.4Mhz & uc to 96Mhz

Change-Id: I82aa47718f71853a65a25fbb5720f74c162318e3
Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
bluesleep: Update to latest google version

Use bluesleep driver from android-msm-dory-3.10-kitkat-wear.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: video: Separate LCD notifier define

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	drivers/video/msm/mdss/Kconfig
defconfig: enable lcd_notify
msm: cpufreq: Add frequency limiter driver

* This driver limits max frequency on suspend/resume.
* This driver can be used by other boards as well
  since it doesn't contain any function specific to
  msm board.
* We will convert pr_info to pr_debug once tested
  and reviewed.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/Makefile
msm: limiter: Update path

* Attributes are created at /sys/kernel/msm_limiter/*

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Improve logic and formatting

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Cleanup debug prints

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Increase constraints prior changing limits

* In very rare instance, resume function causes wdog to reset
  on MSM board and hence a reboot.
* So let resume function execute and restore limits only if
  required.
* Increase suspend defer time to 10 seconds.
  (which is same as that of MSM Hotplug)

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Add enable switch and use workqueues

* In case user wish to use external app to set
  min-max frequencies, we should not override.
* Use high priority workqueues for limit work.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Fix updation waiting for next cycle

Change-Id: Ie72b89fc2ff584e76fc75ea64f50ce62216d95c3
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: enable msm_limiter
Revert Commits

bluesleep: Update to latest google version

Use bluesleep driver from android-msm-dory-3.10-kitkat-wear.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
drivers: video: Separate LCD notifier define

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	drivers/video/msm/mdss/Kconfig
defconfig: enable lcd_notify
msm: cpufreq: Add frequency limiter driver

* This driver limits max frequency on suspend/resume.
* This driver can be used by other boards as well
  since it doesn't contain any function specific to
  msm board.
* We will convert pr_info to pr_debug once tested
  and reviewed.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/Makefile
msm: limiter: Update path

* Attributes are created at /sys/kernel/msm_limiter/*

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Improve logic and formatting

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Cleanup debug prints

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Increase constraints prior changing limits

* In very rare instance, resume function causes wdog to reset
  on MSM board and hence a reboot.
* So let resume function execute and restore limits only if
  required.
* Increase suspend defer time to 10 seconds.
  (which is same as that of MSM Hotplug)

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Add enable switch and use workqueues

* In case user wish to use external app to set
  min-max frequencies, we should not override.
* Use high priority workqueues for limit work.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: limiter: Fix updation waiting for next cycle

Change-Id: Ie72b89fc2ff584e76fc75ea64f50ce62216d95c3
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
defconfig: enable msm_limiter (reverted from commit 2d9d20b22a329e7e8d7b3d9e66fb4ceaa057b547)
Merge branch 'code_blue-beta' into code_blue

Conflicts:
	arch/arm/configs/code_blue_hammerhead_defconfig

Change-Id: I8feda8399485e13c564bfe2fd984d3c90f560bac
Various Commits

msm8974: oc to 2534.4Mhz & uc to 96Mhz

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
ARM: dts: msm: i2c: change  clock rate to 19.2 MHz

For standard  requirement, I2C source
speed of 50MHz causes high power usage, hence
this patch change the clock rate to 19.2 MHz
to save power.

CRs-Fixed: 552956
Change-Id: Ifb17fb79062a390a19881d247a2ac0ca5cc55d80
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
spi_qsd: Fix SPI L2 Crash

Message queue  is scheduled to process
SPI messages during system suspend
state which leads to crash.

This patch make sure all the messages
in queue are processed before system
suspends.

CRs-Fixed: 593658
Change-Id: I722f24fcee4a1d2bbfee4341c8bc6c36ff9e1ec8
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
qup_i2c: Initialize I2C resource before registering.

Due to mismatch in sequence of initializing the
I2C resources  and registering device,  issues seen
while probing clients. This patch corrects the sequence.

CRs-Fixed: 581007
Change-Id: I98f0e73ce1ed1213409d5700f7a78e722e451ec0
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>

qup_i2c: Correct free memory call

Correct freeing of memory, which is allocated using
the devm prefixed API, to free it using devm_kfree rather
then kfree.

CRs-Fixed: 582597
Change-Id: If1aa9bcd86bb3a7d35adc5630ff19ad08bbdf762
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: dump gpio config on error

Dump the configuration of relevant GPIOs
on timeout error.

Change-Id: Iab5aa57befc146c232d12759990b0b8a23a68fe1
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: export qup_i2c_init_driver

Drivers like onsemi-ncp6335d and fan53555 are clients of i2c-qup driver.
In some targets, these clients have to initialize and probe early before
the i2c-qup driver is ready. Hence export qup_i2c_init_driver to make sure
i2c-qup driver is ready when its clients need to probe.

Change-Id: I0f866d1c4239f9c72f6753674c2283e97f3a3691
Signed-off-by: Ke Liu <keliu@codeaurora.org>

qup_i2c: improve PM functionality

Move system-PM functionality to noirq stage. Remove
the incorrect active-only clock path-voting setting.
Resolve synchronization of concurent transition of
system and runtime PM.

Change-Id: I2753557482da7a48a596e4b660165b4e2af0f854
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>

qup_i2c: support for configuarable noise rejection

allow to configure noise rejection value from device tree
which helps filter spikes in the i2c lines.

CRs-Fixed: 626250
Change-Id: If66132c8cc444294e4e6e275ece8b85108cf7abb
Signed-off-by: Ankit Gupta <ankgupta@codeaurora.org>

qup_i2c: Improve recovery from core and slave bad state

Unexpected noise, and/or unexpected behavior from a slave
may put the whole I2C bus in unworkable state. Clear I2C
bus state using HW command instead of bit-banging to avoid
assumption about GPIO recovery config.

Change-Id: I8d1d0002392f9ec9bc0db146aa0ce3e138334644
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>

Conflicts:
	Documentation/devicetree/bindings/i2c/i2c-qup.txt
	arch/arm/mach-msm/include/mach/board.h
	drivers/i2c/busses/i2c-qup.c
msm: Skip building perf debug

* Reduces non-important cruft.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
cpufreq: Add Nightmare

Signed-off-by: Chester Kener <Cl3Kener@gmail.com>
msm8974: Drop GPU Min to 100 MHz

Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
Merge remote-tracking branch 'github/code_blue-beta' into code_blue-beta