tuna: update defconfig
Power: add an API to log wakeup reasons

Add API log_wakeup_reason() and expose it to userspace via sysfs path
/sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: I81addaf420f1338255c5d0638b0d244a99d777d1
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
POWER: fix compile warnings in log_wakeup_reason

Change I81addaf420f1338255c5d0638b0d244a99d777d1 introduced compile
warnings, fix these.

Change-Id: I05482a5335599ab96c0a088a7d175c8d4cf1cf69
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Power: Changes the permission to read only for sysfs file
/sys/kernel/wakeup_reasons/last_resume_reason

Change-Id: If25e8e416ee9726996518b58b6551a61dc1591e3
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Power: Add an API call to log wakeup reasons
prctl: adds PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread.

Second argument is similar to PR_SET_TIMERSLACK, if non-zero then the
slack is set to that value otherwise sets it to the default for the thread.

Takes PID of the thread as the third argument.

This allows power/performance management software to set timer slack for
other threads according to its policy for the thread (such as when the
thread is designated foreground vs. background activity)

Change-Id: I744d451ff4e60dae69f38f53948ff36c51c14a3f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>

Conflicts:
	include/linux/prctl.h
	kernel/sys.c
prctl: adds the capable(CAP_SYS_NICE) check to PR_SET_TIMERSLACK_PID.

Adds a capable() check to make sure that arbitary apps do not change the
timer slack for other apps.

Bug: 15000427
Change-Id: I558a2551a0e3579c7f7e7aae54b28aa9d982b209
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
[MMC] Improve error handling of Samsung e-MMC wear leveling quirk

Prior to this change, errors when reading from the e-MMC during
the handling of the quirk would not be detected.

In addition, if an error did occur, the actual error code would
be overwritten by the code that exits the special OEM mode.

Change-Id: Ic470cf8ef4edb27119f0fdf1fa1b0cf44a2bf31e
Signed-off-by: Scott Anderson <saa@android.com>
[MMC] Provide access to Samsung's e-MMC Smart Report via sysfs

Added CONFIG_MMC_SAMSUNG_SMART which enables code that will
expose Samsung's proprietary e-MMC health information to sysfs.

Example output:
$ cat /sys/devices/platform/*/*/mmc_host/mmc*/mmc*/samsung_smart
version                       : 0
error mode                    : Normal
super block size              : 4194304
super page size               : 32768
optimal write size            : 32768
read reclaim count            : 0
optimal trim size             : 262144
number of banks               : 2
initial bad blocks per bank   : 10,4,0,0
runtime bad blocks per bank   : 0,0,0,0
reserved blocks left per bank : 131,137,0,0
all erase counts (min,avg,max): 0,760,65535
SLC erase counts (min,avg,max): 0,5,74
MLC erase counts (min,avg,max): 0,790,65535

Change-Id: Ib476ea5d35264aa94b378f49121d31b20b751f04
Signed-off-by: Scott Anderson <saa@android.com>
tuna: enable CONFIG_MMC_SAMSUNG_SMART
[REVIEW ME] tuna: temporary fix for gcc 4.8 build breakage