Add /dev/frandom
msm: cpufreq: Prevent going above max freq when adding new device

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Tune deadline, readahead, ondemand, interactive.

Conflicts:
	include/linux/mm.h
kcal_ctrl: Remove the lower limits from the RGB values

Allow the full range of kcal to be applied.
Makefile: use ccache.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mmc: sdhci: fix incorrect command used in tuning

For SD hosts using retuning mode 1, when retuning timer expired, it will
need to do retuning in sdhci_request before processing the actual
request. But the retuning command is fixed: cmd19 for SD card and cmd21
for eMMC card, so we can't use the original request's command to do the
tuning.

And since the tuning command depends on the card type attached to the
host, we will need to know the card type to use the correct tuning
command.

Change-Id: Ibde71d8a8b4e0ff75456923c7c3d8579c04109b4
Signed-off-by: Aaron Lu <aaron.lu@amd.com>
Reviewed-by: Philip Rakity <prakity@marvell.com>
Cc: stable <stable@vger.kernel.org> [3.3+]
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: fix NULL dereference in sdhci_request() tuning

Commit 473b095a72a9 ("mmc: sdhci: fix incorrect command used in tuning")
introduced a NULL dereference at resume-time if an SD 3.0 host controller
raises the SDHCI_NEEDS_TUNING flag while no card is inserted.  Seen on an
OLPC XO-4 with sdhci-pxav3, but presumably affects other controllers too.

Change-Id: I14a9e2a4566ed9f6d4186d6f63ed2e192485973d
Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: stable <stable@vger.kernel.org> [3.3+]
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: retune on cmd or data CRC error

Initiate a DLL (delay locked loop) retune for the next command,
if the current command fails with a CRC error.
This may help to choose a different phase (delay) if the same
has changed over the elapsed period of time.

CRs-Fixed: 587985
Change-Id: I21f6a5dadb096dd38d41fcf2251fa50b03c8bbb4
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: do not use maximum timeout for all cards
Remove maximum timeout for all cards, since this causes
a long resume time for SD cards. Now only Hynix cards would
have this maximum timeout and this would be decided at the core
layer.

Change-Id: I758f9e5ecf407aba371928a86c313cf69e3cda63
CRs-fixed: 587284
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: finish the request if sdhc is in bad state

In the current code, if sdhci_check_state returns true a tasklet is
scheduled which doesn't complete the request if host->mrq is NULL,
which is the case, if sdhci is in bad state. This would make the
mmcqd thread wait for completion infinitely.
Hence, complete the request if sdhci_check_state returns true instead
of scheduling the tasklet.

CRs-Fixed: 615537
Change-Id: I8e2950c3999ac3806f9d631c52d86f0dc13b992f
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: add asynchronous interrupt support for sdio card

Some controllers can gate the clock to save power
even for SDIO cards. In such cases, an asynchronous
interrupt mechanism is used to receive interrupts
even when clocks are off.

This patch wakes up the sdio thread if interrupts
were received when clocks were off.

CRs-Fixed: 585481
Change-Id: Ifcfafad251dedc992637596b6bb9349cfbca5d8b
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: add sdio wakeup event

This patch adds wakeup event capability for sdio cards.
When a wakeup event is received during suspend, a reference
to the card devices' wakeup source is taken for 300 ms.

It is expected that the function driver would act on the
wakeup event within this time-period.

CRs-Fixed: 585481
Change-Id: I80fe0c450e8d9b3df51aa181d667d94517c961dc
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci-msm: ignore data-end-bit error in 1 bit mode

Some SDHC controllers are unable to handle data end-bit
errors in one bit mode.
This patch adds a quirk to ignore data-end-bit error in
1-bit mode in Qualcomm SDHC controllers.

CRs-Fixed: 585481
Change-Id: Ica0f10573d654021449c32197b126e12bb1a3c10
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci: Use right API to read/write host control2 register

The SDHCI host control2 register offset is 0x3E which is not
word aligned and is only 16 bits wide. But we use readl/writel
to read/write to it. Use readw/writew to avoid any alignment
issues.

CRs-Fixed: 585481
Change-Id: Ibaa87ce46f2a2dd97f9e1c7979adb38e426acd5b
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
mmc: sdhci-msm: fix issue with tuning command

As of now we ignore CRC/INDEX command failures to tuning command
and still wait for data from card but in case the card did not
receive the command, it won't send the data. This is causing
software request timeout for tuning commands. Hence, software
must not ignore such cmd errors for tuning commands but end the
request immediately after resetting the controller for both CMD
and DATA. Also, wait for 146 MCLK cycles for card to send out the
data and thus to move to transfer state. Its corresponding phase must
also be considered as bad phase.

CRs-fixed: 625855
Change-Id: Ic8462dd9c67e4f18a3ce73d972591772be8c6d10
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
WLAN subsystem: Sysctl support for key TCP/IP parameters

It has been observed that default values for some of key tcp/ip
parameters are affecting the tput/performance of the system. Hence
extending configuration capabilities to TCP/Ip stack through
sysctl interface

Change-Id: Ia92fc229c0a4a8c3f7e4e02cf7e3c8849719ddff
CRs-Fixed: 507581

Signed-off-by: Kiran Kumar Lokere <klokere@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>
Perf: keep events across hotplug

Keep event list alive across a CPU hotplug so that perf
can resume when the CPU comes back online. Bring a CPU
online when exiting a perf session so it can be cleaned
up properly.

Change-Id: Ie0e4a43f751beb77afdc84e9d52b21780f279d80
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	arch/arm/mach-msm/perf_debug.c
Perf: Support sw events across hotplug

When CPUs are hotplugged off and on, let the various
sw events continue after the hotplug.

Change-Id: Id1aaf30c459c9cf7c9c38967f9ccad56d4062fd3
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	arch/arm/mach-msm/perf_debug.c
msm: perf: clean up duplicate constraint events

Events with a duplicate constraint are set to state=OFF when detected,
so that their duplicate counts are not read. However, they were not being
cleaned up because the core code only cleaned up ACTIVE events.
This resulted in counters not being freed and eventually running out
of resources.

Clean up the events with state==OFF that were marked that way because of
constraint duplication.
Ensure counts are not updated for OFF events.

Change-Id: If532801c79e6ad6809869eb0a3063774f00c92c3
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	arch/arm/mach-msm/perf_debug.c
linux 3.4.91

Signed-off-by: houst0nn <houstonn@gmail.com>

Conflicts:
	arch/arm/Kconfig
	arch/arm/Makefile
	arch/arm/include/asm/mutex.h
	arch/arm/kernel/perf_event.c
	arch/arm/kernel/traps.c
	arch/arm/mm/dma-mapping.c
	arch/arm/mm/mmu.c
	arch/arm/mm/proc-v7.S
	arch/arm/mm/tlb-v7.S
	arch/arm/vfp/entry.S
	arch/arm/vfp/vfpmodule.c
	drivers/base/power/main.c
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
	drivers/gpio/gpio-msm-v2.c
	drivers/md/dm-crypt.c
	drivers/media/dvb/dvb-core/dmxdev.c
	drivers/mmc/card/block.c
	drivers/mmc/core/cd-gpio.c
	drivers/mmc/host/sdhci.c
	drivers/mtd/mtdchar.c
	drivers/net/ethernet/smsc/smc91x.h
	drivers/net/tun.c
	drivers/scsi/sd.c
	drivers/staging/zsmalloc/zsmalloc-main.c
	drivers/uio/uio.c
	drivers/usb/core/driver.c
	drivers/usb/core/hub.c
	drivers/usb/core/message.c
	drivers/usb/dwc3/ep0.c
	drivers/usb/dwc3/gadget.c
	drivers/usb/gadget/f_mass_storage.c
	drivers/usb/host/xhci-hub.c
	drivers/usb/host/xhci-plat.c
	drivers/usb/host/xhci.c
	drivers/usb/host/xhci.h
	drivers/usb/serial/qcserial.c
	drivers/usb/storage/scsiglue.c
	drivers/video/au1100fb.c
	drivers/video/au1200fb.c
	drivers/virtio/virtio_ring.c
	fs/ext4/xattr.c
	fs/ubifs/dir.c
	include/linux/kref.h
	include/linux/sched.h
	include/linux/virtio.h
	include/net/bluetooth/hci_core.h
	include/net/bluetooth/mgmt.h
	include/scsi/scsi_device.h
	include/sound/core.h
	kernel/cgroup.c
	kernel/events/core.c
	kernel/hrtimer.c
	kernel/power/suspend.c
	kernel/sched/core.c
	kernel/signal.c
	kernel/sys.c
	kernel/workqueue.c
	mm/internal.h
	mm/memory_hotplug.c
	mm/vmscan.c
	net/bluetooth/hci_conn.c
	net/bluetooth/hci_core.c
	net/bluetooth/hci_event.c
	net/bluetooth/l2cap_core.c
	net/bluetooth/mgmt.c
	net/bluetooth/rfcomm/sock.c
	net/bluetooth/smp.c
	net/ipv4/ping.c
	net/wireless/nl80211.c
	net/wireless/reg.c

Conflicts:
	arch/arm/boot/compressed/Makefile
	fs/ext4/xattr.c
	include/net/tcp.h