Merge AU_LINUX_ANDROID_KK_3.5_RB1.04.04.02.006.084 on remote branch

Change-Id: If622ebf8ad5654614d8082469e530d79dee6148d
Merge AU_LINUX_ANDROID_KK_3.5_RB2.04.04.00.010.004 on remote branch

Change-Id: I75199531fba99da8c06f6f24a20b2df5aef6092f
Merge AU_LINUX_ANDROID_KK_3.5_RB2.04.04.00.010.008 on remote branch

Change-Id: I577c8202cbb7bd6aca0fc0e49b8b11cee457eecf
wlan:Retry ReassocReq only in FT_REASSOC_RSP_STATE

Currently upon the ReassocTimer expiry the
limAssocFailureTimerHandler checks and retries
the Reassoc request. But the ReassocRetryReq is
populated only in eLIM_MLM_WT_FT_REASSOC_RSP_STATE,
which is leading to crash due to lack of availablity
of retry context in another state
(eLIM_MLM_WT_REASSOC_RSP_STATE). Hence added the
approriate check in limAssocFailureTimerHandler
to retry reassoc when only in limstate
eLIM_MLM_WT_FT_REASSOC_RSP_STATE.

Change-Id: I62449d7e3f99781105d74c2f2042081a9673d4dc
CRs-Fixed: 608890
wlan: Adding panic in WDI timeout if SSR is in progress.

This fix will add a panic in WDI timeout if SSR is in progress
(re init sequence is ongoing) immediately after sending FIQ,
SSR does not get triggered again and subsystem does not get
restarted and we can debug the reason for WDI timeout
during re init.

Change-Id: I60ad67718e87e976a83490da0db1a370ce9f0a80
CRs-Fixed:  610527
wlan: Fix for register access in rx low resource timeout

This shall fix the reset when rx low resource timeout
occurs and rx thread access the register during
driver reload.

Change-Id: I6fab24b813195df9b490a26094ca6a1573647036
CRs-Fixed: 607780
Merge AU_LINUX_ANDROID_KK_3.5_RB2.04.04.00.010.010 on remote branch

Change-Id: I044d2c804fbcb3ebccdbef604c741358ba03271c
wlan: Reason code for scan abort.

Add a reason code for scan abort. Currently, this is required to
know if the abort is because of a band change. It can be enhanced
further to cater the requirements.

Change-Id: I641f36245d881b4f2cba70223f0abf90edd55b28
CRs-Fixed: 592516
wlan: Added OBSS scan param IE and TDLS frame in Dot11f

- Added support for Supported Operating Class IEs in TDLS frames
- Added Support for OBSS scan Parameters.
- Add new GID management Action

Change-Id: Iac28100baeddd72375c80cb792b0ad4d5314ccdc
CRs-Fixed: 608188
wlan: ba invalid lock crash fix

TL BA has mutex to protect BA resource from multi-thread access.
But current mutex implementation just protect from
timer context and RX thread context.
But DEL_BA session response came from FW through SMD thread it's
not protected properly.
During RX frame processing with RX thread, if DEL BA response
preempt RX thread, BA resources could not be protected properly.
Mutex should be initialized and destroy when STA creation and
deletion. And ADD BA, DEL BA also should be protected by mutex.

Change-Id: I858dd46eaafe14e2052ea011c05fb6674fbe6f1c
CRs-fixed: 605197
Merge AU_LINUX_ANDROID_KK_3.5_RB2.04.04.00.010.011 on remote branch

Change-Id: If63a5f459fc2040354abb4fbdd1e84228adcd2ac
Merge "wlan: Reason code for scan abort."
Merge "wlan: Added OBSS scan param IE and TDLS frame in Dot11f"
Merge "wlan: ba invalid lock crash fix"
Merge "wlan: Adding panic in WDI timeout if SSR is in progress."
Merge "wlan: Fix for register access in rx low resource timeout"
Merge "wlan:Retry ReassocReq only in FT_REASSOC_RSP_STATE"
Merge AU_LINUX_ANDROID_KK_3.5_RB2.04.04.00.010.016 on remote branch

Change-Id: I0fc27b891fb451342047ee50b1d872752f40d092
proc: pid/status: show all supplementary groups

commit 8d238027b87e654be552eabdf492042a34c5c300 upstream.

We display a list of supplementary group for each process in
/proc/<pid>/status.  However, we show only the first 32 groups, not all of
them.

Although this is rare, but sometimes processes do have more than 32
supplementary groups, and this kernel limitation breaks user-space apps
that rely on the group list in /proc/<pid>/status.

Number 32 comes from the internal NGROUPS_SMALL macro which defines the
length for the internal kernel "small" groups buffer.  There is no
apparent reason to limit to this value.

This patch removes the 32 groups printing limit.

The Linux kernel limits the amount of supplementary groups by NGROUPS_MAX,
which is currently set to 65536.  And this is the maximum count of groups
we may possibly print.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
idr: fix top layer handling

commit 326cf0f0f308933c10236280a322031f0097205d upstream.

Most functions in idr fail to deal with the high bits when the idr
tree grows to the maximum height.

* idr_get_empty_slot() stops growing idr tree once the depth reaches
  MAX_IDR_LEVEL - 1, which is one depth shallower than necessary to
  cover the whole range.  The function doesn't even notice that it
  didn't grow the tree enough and ends up allocating the wrong ID
  given sufficiently high @starting_id.

  For example, on 64 bit, if the starting id is 0x7fffff01,
  idr_get_empty_slot() will grow the tree 5 layer deep, which only
  covers the 30 bits and then proceed to allocate as if the bit 30
  wasn't specified.  It ends up allocating 0x3fffff01 without the bit
  30 but still returns 0x7fffff01.

* __idr_remove_all() will not remove anything if the tree is fully
  grown.

* idr_find() can't find anything if the tree is fully grown.

* idr_for_each() and idr_get_next() can't iterate anything if the tree
  is fully grown.

Fix it by introducing idr_max() which returns the maximum possible ID
given the depth of tree and replacing the id limit checks in all
affected places.

As the idr_layer pointer array pa[] needs to be 1 larger than the
maximum depth, enlarge pa[] arrays by one.

While this plugs the discovered issues, the whole code base is
horrible and in desparate need of rewrite.  It's fragile like hell,

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2:
 - Adjust context
 - s/MAX_IDR_LEVEL/MAX_LEVEL/; s/MAX_IDR_SHIFT/MAX_ID_SHIFT/
 - Drop change to idr_alloc()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>