sync: add Documentation/sync.txt

Change-Id: Ic7f3a6d4622083be607b82ddd8d676609225bb8f
Signed-off-by: Erik Gilling <konkers@android.com>
net: wireless: bcmdhd: Avoid suspend on watchdog

Change-Id: Ic41a8f369a2ee8b2a0084e6a1cbf6b454ff53353
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ARM: fiq_debugger: lock between tty and console writes

debug_console_write calls debug_uart_flush, which will usually wait
until the serial port fifo empties.  If another thread is continuously
calling fiq_tty_write, the fifo will constantly be refilled and
debug_uart_flush might never return.

Add a spinlock that is locked in debug_console_write and fiq_tty_write
to ensure they can't run at the same time.  This has an extra advantage
of preventing lines from the console and tty from being mixed together.

Also reduce the size returned by fiq_tty_write_room to keep the time
spent with the spinlock held to a reasonable value.

In addition, make sure fiq context can't loop forever by never calling
debug_uart_flush when the console is enabled.

Change-Id: I5712b01f740ca0c84f680d2032c9fa16b7656939
Signed-off-by: Colin Cross <ccross@android.com>
ARM: fiq_debugger: fix uninitialised spin_lock.

Backtrace:
[<c0045ea0>] (dump_backtrace+0x0/0x10c) from [<c0575c60>] (dump_stack+0x1)
 r6:c07a489c r5:c0c9b9dc r4:00000002 r3:271aed3b
[<c0575c48>] (dump_stack+0x0/0x1c) from [<c00b1b00>] (__lock_acquire+0x93)
[<c00b11c8>] (__lock_acquire+0x0/0xad4) from [<c00b219c>] (lock_acquire+0)
[<c00b210c>] (lock_acquire+0x0/0xa4) from [<c057e544>] (_raw_spin_lock_ir)
[<c057e4f8>] (_raw_spin_lock_irq+0x0/0x5c) from [<c005297c>] (fiq_tty_wri)
 r5:e30f0000 r4:e36f0c00
[<c005293c>] (fiq_tty_write+0x0/0x80) from [<c023168c>] (n_tty_write+0x18)
 r8:e370fc40 r7:e378a000 r6:e3572d1c r5:e36f0c00 r4:00000002
r3:c005293c
[<c0231500>] (n_tty_write+0x0/0x440) from [<c022d4a4>] (tty_write+0x100/0)
[<c022d3a4>] (tty_write+0x0/0x2a8) from [<c0100b80>] (vfs_write+0xa4/0x14)
[<c0100adc>] (vfs_write+0x0/0x148) from [<c0100cdc>] (sys_write+0x40/0x78)
 r8:00000002 r7:4076d2c4 r6:e370fc40 r5:00000000 r4:00000000
[<c0100c9c>] (sys_write+0x0/0x78) from [<c0041740>] (ret_fast_syscall+0x0)
 r8:c0041908 r7:00000004 r6:00000002 r5:00000000 r4:4007cbe0

[ccross: moved spin_lock_init into existing #ifdef]
Change-Id: If400d084eb20433c126ea1dd027a6be7f2ebb1f6
Signed-off-by: Mars <caoziqiang@meizu.com>
Signed-off-by: Colin Cross <ccross@android.com>
net: wireless: bcmdhd: Update wireless stack pm mode

Change-Id: Iadf400f113884001894dca7cf098f971190765d1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ARM: exynos: add irq_set_affinity function for the combiner

Add an API to allow setting CPU affinity to combined IRQs.
This enables performance measurements via the perf utility.

Bug: 6904183
Change-Id: I7476dc85d54734f6f17fcbed6ef04cc6be87876a
Signed-off-by: Alexander Levitskiy <sanek@google.com>
cpufreq: interactive: pin timers to associated CPU

Helps avoid waking up other CPUs to react to activity on the local CPU.

Change-Id: Ife272aaa7916894a437705d44521b1a1693fbe8e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: use deferrable timer by default

Avoid wakeups only to handle the governor timer when the system is otherwise
idle.

For platforms where the power cost of remaining in idle at higher CPU
speed may outweigh the cost of a governor wakeup from idle to lower the speed,
set parameter cpufreq_interactive.governidle=1.

Change-Id: Id6c43eb35caecf9b0574fcdd5b769711bc7e6de6
Signed-off-by: LianWei WANG <a22439@motorola.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: kick timer on idle exit past expiry

The deferrable timer list isn't checked on all idle exits, such as when
hi-res timers expire or ISRs schedule workers.  If the idle loop is
exited and it's past time to run the governor load polling timer,
run it immediately.  This ensures we handle load spikes caused by actvity
that does not run the normal timer list.

Rename the field that timestamps the "time_in_idle" value to be more
accurate.

Change-Id: Ied590ecbefc83c9a9ec5eb9e31903557f6fa1614
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Merge branch 'android-3.4' into android-exynos-3.4
mali-t6xx: fix null pointer deref whn dumping MMU page tables

At the moment when if we perform an instrumented dump of the MMU page tables,
the munmap call back will try to free physical pages that are supposed to be
in the memory region allocated for the dump but that are not there,
thus resulting in a NULL pointer exception followed by kernel panic.

In order to solve this, in "kbase_free_phy_pages()" (that is called by the
munmap callback) we need to check the memory region flags to see if
KBASE_REG_IS_MMU_DUMP flag is set.  If it is set then we have to skip the
 call to free the physical pages.

Bug:  7432454
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@arm.com>
Change-Id: I37d5c9f634ae08a1e8340671b15287354c75fd64
mali-t6xx: debug patch to trace "dep_item[0]" list abuse

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@arm.com>
Change-Id: I563a4c3c8696fa85505cc97379fb375df034c9bf
mmc: dw_mmc: add h/w reset for mmc card

This patch adds h/w reset to support mmc core sequence
for mmc card. This patch provides more stability on mmc driver.

Bug: 7118793

Change-Id: I2b8a7553f48ce9622aaad843e4679b09e5d49760
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: add DW_MMC_QUIRK_HW_RESET_PW quirk

This patch adds DW_MMC_QUIRK_HW_RESET_PW quirk for supporting
hardware reset using power off/on of card instead of reset pin
that is explicit in ext_csd regs.

Bug: 7390764

Change-Id: Ieb151ccae0bbc6d2d9c2120472afbbc82ccd5908
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: remove wait_prvdata_complete bit setting

This patch removes wait_prvdata_complete bit setting of CMD reg in
abnormal status. This bit is used for waiting for previous data transfer
completion before sending command. In abnormal status, it is not needed.

Bug: 7390764

Change-Id: I8c55f19184d6716a99d8e4da0ffe770789961fac
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
mmc: dw_mmc: fix to check data busy on request func by CMD13

CMD13 is used to check the card state whether card is busy or not
after block write. If busy time is long, CMD13 should be issued many times.
Instead of that case, old patch was added to reduce cpu load.
But it was not considered for some erase operations which takes long
times over a few seconds. If it was taking time over a few seconds,
though it returned error, it was not error.
This patch fixes CMD13 is able to issue every 1 seconds.

Bug: 7336393, 7118793

Change-Id: I82ae59e0ebb0a07b9660e509ed848dfe73333255
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>