net: ipv6: allow choosing optimistic addresses with use_optimistic

The use_optimistic sysctl makes optimistic IPv6 addresses
equivalent to preferred addresses for source address selection
(e.g., when calling connect()), but it does not allow an
application to bind to optimistic addresses. This behaviour is
inconsistent - for example, it doesn't make sense for bind() to
an optimistic address fail with EADDRNOTAVAIL, but connect() to
choose that address outgoing address on the same socket.

Bug: 17769720
Bug: 18609055
Change-Id: I9de0d6c92ac45e29d28e318ac626c71806666f13
Signed-off-by: Erik Kline <ek@google.com>
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
MMC: Restore MMC_BLOCK_DEFERRED_RESUME changes. for future use.

This restore:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0ec4df36a63aee16f2d37cdc8ef0400d7433ba36
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/38f752bed0ea0be8573a765e7ea84ba4c6424e3a
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/ae8695e2fd8021f64c4748f1b0ebc872ebc1778b
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/6241623da43deeaaef849ac451ed6b2b6d499898
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0049ab570ada4b84909e43f5f89db47c01951e94

+ change not delete:
ifndef CONFIG_MMC_BLOCK_DEFERRED_RESUME
        if (host->bus_ops->detect && !host->bus_dead)
                host->bus_ops->detect(host);
endif
alucard_hotplug: use cpu_is_offline instead of !cpu_online function.
alucard, darkness, nightmare governors: check if policy->cpu is assigned on the right cpu. Code style.
Revert "WIFI: do not use powersuspend for WIFI, it's has it's own PM triggers."

This reverts commit 2cbc2c8bfbcd43a9e0e894e289918498d2346ce6.

People reporting that WIFI drain mre power when suspended, right after this change.
and WIFI wakelock is a lot higher than before.

So revert this change.
Revert "Turn OFF HTC ASYNC_FSYNC code for all models."

This reverts commit 5b71591529853eccb150cd7a1ba4210e22c41a0e.

RESTORE HTC ASYNC, seems that it's was saving some power, and was
not the problem maker, it's was all in MMC code.
RESTORE MMC WAKE/SUSPEND Functions: MMC bug was in other commit.

This restores:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/001fdb4ca1cd06ba4176567d3eec67f28f900dd1
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/1a6c77ca40177f4ff8f6af60ab8197cd16a858c6
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/545d315391b0613932adfd373b934767184f5e21
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/f436acc570d16bf330b875fcd94b077e55051a58
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/e439062ac344a9bd88b5560f58b6ef654e35c60a

Need to deep test this changes.

Any way power usage was higher than with all this added. so restore it.
ASoC: wcd9xxx: Handle fake mechanical interrupt

Handle fake mechanical interrupt during slow insertion of
headset usecase when the plug type is detected as lineout.

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Disable current source in error scenarios

Sometimes during removal, fake electrical removal interrupt
can also get generated. In that case, current source needs
to be disabled after a round of DCE measurements. Otherwise,
next time when the plug is re-inserted, measurements can go
wrong and hence plug type can be wrongly detected.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Revert "ASoC: wcd9xxx: Check headset insertion for consistency"

* Superseded by the next patch, which also eliminates the long delay
  when certain types of headsets are inserted.

This reverts commit 214c08b71f93d48abcf273e3f211f17c876605d5.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: wcd9xxx: Continue polling for Unsupported plug types

Sometimes slow insertion of headphone could lead to
detection of unsupported plug types. In these cases,
continue polling so that headphone can be detected
once it is fully inserted.

Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
sched: Fix inaccurate accounting for real-time task

It is possible that rq->clock_task was not updated in put_prev_task()
in which case we can potentially overcharge a real-time task for time
it did not run. This is because clock_task could be stale and not
represent the exact time real-time task started running.

Fix this by forcing update of rq->clock_task when real-time task
starts running.

Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Add INITITAL L01F config modded for my kernel! from stock source.

Need to test and do changes if needed.
Kernel 9.3
RESTORE FS/KERNEL/BLOCK/SECURITY Updates: now that SOD bug found! I can restore!

SOD bug was with MMC change, now that it's fixed, i can restore all good
updates/fixes that i lost during SOD bug hunt.

This restores:
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/f04861f746e6bb82164df0b39557ffab16a4690d
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/3eede98cc0a0c4d37e9734f0c5bca5562c4ea121
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/05532661fd79ec5032e7abdb69d758f22519d41b
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/8836aeb3cf15a83bbe79ac6eec1fb37b2d898421
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/3ca22b93be122058e5e28a55b7ac26d62a802841
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0a654d3db4728010bbd3f5b100053d16c1f15d54
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/56bcfabb91eddd65fa04e0cc4bb37e7ba9cdf53f
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/6992b1b63a7168c70d90a91ff9e492853d0e544f
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/b437d9cd9abca9b7c55d86882cdc7cb5e7488391
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/0ec0213157ed46af2ea388c94096a5b893962dc1
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/e518e101af7deafda670cd73054934467cd2d5ca
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/40cc511dcb7883a087627cccf208671b5a1f5884
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/41bb1eef832c1f0782f171035c59d5848a02eabc

+small corrections for new FS code.
USB GADGET: trying to fix ADB for VS980
MMC: Fixed BUG that was added by LG, and not relevant any more.

<4>------------[ cut here ]------------
<4>WARNING: at mm/page_alloc.c:1584 get_page_from_freelist+0x654/0x664()
<4>Modules linked in:
<4>[<c010d314>] (unwind_backtrace) from [<c0194f6c>] (warn_slowpath_common+0x60/0x80)
<4>[<c0194f6c>] (warn_slowpath_common) from [<c0195040>] (warn_slowpath_null+0x1c/0x24)
<4>[<c0195040>] (warn_slowpath_null) from [<c021bb34>] (get_page_from_freelist+0x654/0x664)
<4>[<c021bb34>] (get_page_from_freelist) from [<c021c810>] (__alloc_pages_nodemask+0x168/0x904)
<4>[<c021c810>] (__alloc_pages_nodemask) from [<c021d020>] (__get_free_pages+0x14/0x3c)
<4>[<c021d020>] (__get_free_pages) from [<c072ff20>] (mmc_alloc_sg+0x20/0x54)
<4>[<c072ff20>] (mmc_alloc_sg) from [<c07302c8>] (mmc_init_queue+0x278/0x3dc)
<4>[<c07302c8>] (mmc_init_queue) from [<c072bf6c>] (mmc_blk_alloc_req+0x144/0x3e4)
<4>[<c072bf6c>] (mmc_blk_alloc_req) from [<c072d81c>] (mmc_blk_probe+0x90/0x318)
<4>[<c072d81c>] (mmc_blk_probe) from [<c04a6c14>] (driver_probe_device+0xa8/0x258)
<4>[<c04a6c14>] (driver_probe_device) from [<c04a4ec8>] (bus_for_each_drv+0x68/0xa8)
<4>[<c04a4ec8>] (bus_for_each_drv) from [<c04a6b3c>] (device_attach+0xa4/0xb8)
<4>[<c04a6b3c>] (device_attach) from [<c04a5fb4>] (bus_probe_device+0x98/0xcc)
<4>[<c04a5fb4>] (bus_probe_device) from [<c04a4538>] (device_add+0x520/0x5dc)
<4>[<c04a4538>] (device_add) from [<c071dd98>] (mmc_add_card+0x160/0x3bc)
<4>[<c071dd98>] (mmc_add_card) from [<c072176c>] (mmc_attach_mmc+0xd0/0x1f0)
<4>[<c072176c>] (mmc_attach_mmc) from [<c071d64c>] (mmc_rescan+0x354/0x3e0)
<4>[<c071d64c>] (mmc_rescan) from [<c01ac4d0>] (process_one_work+0x164/0x3cc)
<4>[<c01ac4d0>] (process_one_work) from [<c01ad364>] (worker_thread+0x148/0x410)
<4>[<c01ad364>] (worker_thread) from [<c01b207c>] (kthread+0xd8/0xf0)
<4>[<c01b207c>] (kthread) from [<c0107468>] (kernel_thread_exit+0x0/0x8)
<4>---[ end trace 093e5269c285b746 ]---

now all CLEAN. any way added FAIL SAFE, in case that something will go wrong.

LG comment was:
/* LGE_CHANGE, 2013-07-09, G2-FS@lge.com
 * In case of alloc-fail, we add '__GFP_NOFAIL'.
 */
Config Update + Cleanup READ MORE!

*Enabled bootloader bootstats for me to know how things works. once at boot.
*Set all ENCRYPT config to STOCK to fix DATA encryption by ROM, was broken.
*Disabled KERNEL DEBUG that had no active config under it any way.

Kernel size reduced by 100k.
Revert "USB GADGET: trying to fix ADB for VS980"

This reverts commit 7144159fce4295e37ee026c59ef8a345adfd52cb.

it's didnt help, something else broken.
Merge remote-tracking branch 'do/LG-STOCK-KK' into LG-STOCK-KK

Conflicts:
	arch/arm/configs/dorimanx_d801_defconfig
	arch/arm/configs/dorimanx_d802_defconfig
	arch/arm/configs/dorimanx_f320_defconfig