wlan: add check for size of cache aligned skb->data

In receive path we check if the memory DMA'd is more
than the allocated memory. alloc_skb() can allocate
more memory than specified if the specified memory
size is not cache aligned, so check for the size
of cache aligned memory for deciding if the data
DMA's was more that allocated memory.

Change-Id: Iaf5b75b73d1f84d6d64ed0975414218a7bb6f591
CRs-Fixed: 717798
wlan: fix VOSS packet leak

The VOSS API to return packets to the system
had a bug which causes packet leak, the problem
occurs when low resource condition is hit and
the API is called to return a chain of VOSS packets
to the system. When the condition is hit the VOSS
packets are not added to the free or replenish
list and they are lost forever from the system.

Change-Id: I62d9238ba4ccb62365443650c8ad765c5042826f
CRs-Fixed: 653612
wlan: flush cached frames on assoc failure

Prima driver caches RX frames till the peer
is registered in TL. If assocication failure
occurs then free the cached frames so that
the RX resources are returned back to the
system.

Change-Id: I37d6c08075dc77026ad85863e4838eb5e3742fc3
CRs-Fixed: 643670
wlan: avoid race condition while accessing wpalPacketAvailableCB

wpalPacketAvailableCB can be called from the MC_Thread as well
as the RX_Thread, the race condition can occur when the callback
is called from the MC_Thread and immediately set to NULL after
the function returns and in between that the RX_Thread running
on another core has detected a low resource condition and set
wpalPacketAvailableCB before the MC_Thread sets it to NULL.
To avoid the race conditions always set/reset the values to
wpalPacketAvailableCB in RX_thread only.

Change-Id: Idb1700287186df4b3ede45324cfa2062b1b81d9e
CRs-Fixed: 599184
wlan: Fix the race condition in RX Low resource recovery mechanism

Set the wpalPacketAvailableCB before we try to get a VOS
packet from the 'free list' and reset it if vos_pkt_get_packet()
returns a valid packet. This order is required to avoid the
following race condition:
1. The call to vos_pkt_get_packet() from wpalPacketAlloc() in
   RX_Thread determines that no more packets are available in
   the 'free list' and sets the low resource callbacks.
2. In parallel vos_pkt_return_packet() is called in MC_Thread for a
   Management frame before wpalPacketAlloc() gets a chance to set
   wpalPacketAvailableCB and since the 'low resource callbacks'
   are set the, callback function - wpalPacketRXLowResourceCB is
   executed.But as wpalPacketAvailableCB is still NULL the low
   resource recovery fails.

Change-Id: Ie1cea3c9411e314a4309efdc207f4f69953f844f
CRs-Fixed: 591906
Revert "msm: kgsl: Fix Z180 memory leak"

This reverts commit 580f930b267f58a10e4781d84fb03b90bf5590a2.

Change-Id: I41e57853419436e72edaec5919b6f04a9c4b0e7f
net/ipv6/addrconf: fix wdog_bark caused by infinite spinning on a deadlock

A synchronization issue may occur while addrconf_ifdown(),
when it updates inet6_addr_lst[] with already destroyed *ifp
by ipv6_add/del_addr(), using the same addrconf_hash_lock.

[core 0]                                        [core 1]
   |                                               |
   |->ipv6_add_addr                                |->addrconf_ifdown
       |                                               |
       |                                               |-> spin_lock(&addrconf_hash_lock);
       |                                               |-> remove ifa->addr_lst from inet6_addr_lst
       |                                               |-> spin_unlock(&addrconf_hash_lock);
       |-> spin_lock(&addrconf_hash_lock);             |
       |-> add ifa->addr_lst to inet6_addr_lst[hash]   |
       |-> spin_unlock(&addrconf_hash_lock);           |
       |-> write_lock(&idev-lock);                     |
       |-> add ifa->if_list to idev->addr_list         |
       |-> write_unlock(&idev->lock);                  |
       |                                               |-> write_lock(&idev->lock);
       |                                               |-> remove ifa->if_list from idev->addr_list
       |                                               |-> write_unlock(&idev->lock);

[28055.378524] ------------[ cut here ]------------
[28055.378591] WARNING: at net/ipv6/addrconf.c:546 inet6_ifa_finish_destroy+0x98/0xc8()
[28055.378691] [<c010de1c>] (unwind_backtrace+0x0/0x144) from [<c09fd08c>] (dump_stack+0x20/0x24)
[28055.378747] [<c09fd08c>] (dump_stack+0x20/0x24) from [<c0192adc>] (warn_slowpath_common+0x58/0x70)
[28055.378840] [<c0192adc>] (warn_slowpath_common+0x58/0x70) from [<c0192bec>] (warn_slowpath_null+0x2c/0x34)
[28055.378931] [<c0192bec>] (warn_slowpath_null+0x2c/0x34) from [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8)
[28055.379026] [<c0911a90>] (inet6_ifa_finish_destroy+0x98/0xc8) from [<c091498c>] (addrconf_ifdown+0x2e4/0x430)
[28055.379120] [<c091498c>] (addrconf_ifdown+0x2e4/0x430) from [<c0915b70>] (addrconf_notify+0xe4/0x3ac)
[28055.379209] [<c0915b70>] (addrconf_notify+0xe4/0x3ac) from [<c01b9df0>] (notifier_call_chain+0x54/0x94)
[28055.379321] [<c01b9df0>] (notifier_call_chain+0x54/0x94) from [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c)
[28055.379379] [<c01ba3ac>] (__raw_notifier_call_chain+0x24/0x2c) from [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30)
[28055.379475] [<c01ba3dc>] (raw_notifier_call_chain+0x28/0x30) from [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60)
[28055.379568] [<c0840ea4>] (call_netdevice_notifiers+0x38/0x60) from [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c)
[28055.379657] [<c0844d5c>] (__dev_notify_flags+0x3c/0x6c) from [<c0844dcc>] (dev_change_flags+0x40/0x58)
[28055.379747] [<c0844dcc>] (dev_change_flags+0x40/0x58) from [<c08d2834>] (devinet_ioctl+0x79c/0x8bc)
[28055.379837] [<c08d2834>] (devinet_ioctl+0x79c/0x8bc) from [<c08d3488>] (inet_ioctl+0x1c0/0x1d0)
[28055.379928] [<c08d3488>] (inet_ioctl+0x1c0/0x1d0) from [<c082d7f0>] (sock_ioctl+0x80/0x248)
[28055.379982] [<c082d7f0>] (sock_ioctl+0x80/0x248) from [<c0275364>] (do_vfs_ioctl+0x94/0x5bc)
[28055.380071] [<c0275364>] (do_vfs_ioctl+0x94/0x5bc) from [<c0275908>] (sys_ioctl+0x7c/0x8c)
[28055.380164] [<c0275908>] (sys_ioctl+0x7c/0x8c) from [<c0107300>] (ret_fast_syscall+0x0/0x30)
[28055.380252] ---[ end trace 920b8b321354f066 ]---
[28061.735021] Watchdog bark! Now = 28061.735014
[28061.735106] Watchdog last pet at 28050.179294
[28061.735245] cpu alive mask from last pet 0-3
[28061.735321] Causing a watchdog bite!

The addrconf_hash_lock should cover both modification of inet6_addr_list and idev->addr_list
to resolve any possible synchronization issue between addrconf_ifdown() and ipv6_add/del_addr().

Bug: 11293746
Change-Id: If263fc375b411bf21eacade0d094bff95939f7fe
Signed-off-by: David C. Park <davidc.park@lge.com>
msm: set the gdhs to power-collapse to get rid of the IRQ affinity fails.

Change-Id: Ic871a2c5d2cf5171d5c078ae327397e27b3dcbbc
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: cpu-boost: Don't register for cpufreq notifiers too early

The cpufreq notifiers should be registered only after all the data
structures used in the notifier callbacks have been initialized. So, move
the cpufreq notifier registration to a later point in the init function.

Change-Id: I043ab5bc0ebb98164c40549fe151a8d801c8c186
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>