net/l2tp: don't fall back on UDP [get|set]sockopt

The l2tp [get|set]sockopt() code has fallen back to the UDP functions
for socket option levels != SOL_PPPOL2TP since day one, but that has
never actually worked, since the l2tp socket isn't an inet socket.

As David Miller points out:

  "If we wanted this to work, it'd have to look up the tunnel and then
   use tunnel->sk, but I wonder how useful that would be"

Since this can never have worked so nobody could possibly have depended
on that functionality, just remove the broken code and return -EINVAL.

Change-Id: I7d00fb0c595cdd65f9724d710f93ca5362019e43
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: James Chapman <jchapman@katalix.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: Phil Turnbull <phil.turnbull@oracle.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Divya Sharma <c_shard@codeaurora.org>
mdss: msm_fb: Allocate fb memory during mmap

Current design of display driver (overlay) is no more
using the physically contiguous memory for normal display
functionality.

However, we still need to be backward compatible for any client
using the legacy implementation (eg. pan display) functionality.
As soon as there is a mmap call, the allocation happens from
system heap and gets removed once the references to frame buffer
driver becomes NULL.

With this change one can remove the physically contiguous memory
which gets allocated at the boot time and the usage of physically
contiguous memory is optimized.

Change-Id: I1b6040187bda8095007faa4d9df7dc046aa30c6e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdss: fb: Add backward compatibility to fb memory

In the current implementation, contiguous memory allocation
during bootup is removed and related changes were made in
frame buffer driver which is not backward compatible. With this
change, add backward compatibility to map to physically contiguous
memory when available which is allocated at bootup.

Change-Id: Ib1a595f2426dda8d3e1c5e50c71c35d3f45854b6
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdss: mdp: update fix screen variable in mmap call

Update shared memory start address with iommu virtual
address for proper display on panel

Change-Id: I49495969f9085b76547d1f919bec5b7353a028dc
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdss: fb: ensure that shared memory is available during probe

Populate shared memory length during probe for availability
to userspace through FSCREENINFO ioctl. Also, ensure that fb
length is always available.

Change-Id: I94d3f83098fbfd81a7aa20f6fc1f19e756aebc4e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdss: fb: update smem_len when user updates parameters

There is an ioctl for userspace to update the variable
parameters. Frame buffer driver has to update the shared
memory length according to the new variable information.

Change-Id: Ic24ee3e4b1101b4e1ef4e9db2182602aa5175812
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm: mdss: use appropriate api to get length of scatterlist

Moving away from using sg_dma_len() api to be inline with
ion driver, use sg->length for scatterlist length.

Change-Id: I3a33340dc1bda5b24a406c29601aff4d5b2c5748
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
msm: mdss: align frame buffer size to PAGE_SIZE

When updating userspace with the shared memory length,
the size of each buffer needs to be 4k aligned for
performance. This is also required to avoid mmap failures
in the case of recovery and other usecases where the
requested size is 4k aligned.

Change-Id: I6e97f9c76ea1aff07572c500f30f888b6e12f9b4
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
netfilter: nf_conntrack: decrement global counter after object release

nf_conntrack_free() decrements our counter (net->ct.count)
before releasing the conntrack object. That counter is used in the
nf_conntrack_cleanup_net_list path to check if it's time to
kmem_cache_destroy our cache of conntrack objects. I think we have
a race there that should be easier to trigger (although still hard)
with CONFIG_DEBUG_OBJECTS_FREE as object releases become slowier
according to the following splat:

[ 1136.321305] WARNING: CPU: 2 PID: 2483 at lib/debugobjects.c:260
debug_print_object+0x83/0xa0()
[ 1136.321311] ODEBUG: free active (active state 0) object type:
timer_list hint: delayed_work_timer_fn+0x0/0x20
...
[ 1136.321390] Call Trace:
[ 1136.321398]  [<ffffffff8160d4a2>] dump_stack+0x45/0x56
[ 1136.321405]  [<ffffffff810514e8>] warn_slowpath_common+0x78/0xa0
[ 1136.321410]  [<ffffffff81051557>] warn_slowpath_fmt+0x47/0x50
[ 1136.321414]  [<ffffffff812f8883>] debug_print_object+0x83/0xa0
[ 1136.321420]  [<ffffffff8106aa90>] ? execute_in_process_context+0x90/0x90
[ 1136.321424]  [<ffffffff812f99fb>] debug_check_no_obj_freed+0x20b/0x250
[ 1136.321429]  [<ffffffff8112e7f2>] ? kmem_cache_destroy+0x92/0x100
[ 1136.321433]  [<ffffffff8115d945>] kmem_cache_free+0x125/0x210
[ 1136.321436]  [<ffffffff8112e7f2>] kmem_cache_destroy+0x92/0x100
[ 1136.321443]  [<ffffffffa046b806>] nf_conntrack_cleanup_net_list+0x126/0x160 [nf_conntrack]
[ 1136.321449]  [<ffffffffa046c43d>] nf_conntrack_pernet_exit+0x6d/0x80 [nf_conntrack]
[ 1136.321453]  [<ffffffff81511cc3>] ops_exit_list.isra.3+0x53/0x60
[ 1136.321457]  [<ffffffff815124f0>] cleanup_net+0x100/0x1b0
[ 1136.321460]  [<ffffffff8106b31e>] process_one_work+0x18e/0x430
[ 1136.321463]  [<ffffffff8106bf49>] worker_thread+0x119/0x390
[ 1136.321467]  [<ffffffff8106be30>] ? manage_workers.isra.23+0x2a0/0x2a0
[ 1136.321470]  [<ffffffff8107210b>] kthread+0xbb/0xc0
[ 1136.321472]  [<ffffffff81072050>] ? kthread_create_on_node+0x110/0x110
[ 1136.321477]  [<ffffffff8161b8fc>] ret_from_fork+0x7c/0xb0
[ 1136.321479]  [<ffffffff81072050>] ? kthread_create_on_node+0x110/0x110
[ 1136.321481] ---[ end trace 25f53c192da70825 ]---

CRs-fixed: 717356
Change-Id: I5e4aff3390cadadbac9ffe8fcdb651c79e42c685
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 0c3c6c00c69649f4749642b3e5d82125fde1600c
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
nl80211: add scan width to bss and scan request structs

To allow scanning and working with 5 MHz and 10 MHz BSS, extend the
inform bss commands and add wrappers to take 5 and 10 MHz bss into
account.

CRs-Fixed: 659678
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Git-commit: dcd6eac1f3b5fa1df11dfa99da0cf75b76cfef97
Git-repo : http://git.kernel.org/cgit/linux/kernel/git/linville/wireless-next.git
[clanctot@codeaurora.org: Only picked up the add of NL80211_BSS_CHAN_WIDTH]
Signed-off-by: Chet Lanctot <clanctot@codeaurora.org>
Change-Id: I06312c396919e9203cc7eaa1e14873191070e6a2
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
cfg80211: clarify BSS probe response vs. beacon data

There are a few possible cases of where BSS data came from:
 1) only a beacon has been received
 2) only a probe response has been received
 3) the driver didn't report what it received (this happens when
    using cfg80211_inform_bss[_width]())
 4) both probe response and beacon data has been received

Unfortunately, in the userspace API, a few things weren't there:
 a) there was no way to differentiate cases 1) and 4) above
    without comparing the data of the IEs
 b) the TSF was always from the last frame, instead of being
    exposed for beacon/probe response separately like IEs

Fix this by
   i) exporting a new flag attribute that indicates whether or
      not probe response data has been received - this addresses (a)
  ii) exporting a BEACON_TSF attribute that holds the beacon's TSF
      if a beacon has been received
 iii) not exporting the beacon attributes in case (3) above as that
      would just lead userspace into thinking the data actually came
      from a beacon when that isn't clear

To implement this, track inside the IEs struct whether or not it
(definitely) came from a beacon.

CRs-Fixed: 659678
Reported-by: William Seto
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Git-commit: 95aaa02c6234c462684c9e56e6800a40cef33af8
Git-repo : https://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211-next.git
Signed-off-by: Chet Lanctot <clanctot@codeaurora.org>
[amarnath@codeaurora.org: Only picked up the change in nl80211.h for the user
 space code to remain same. Other changes are not applicable for this version
 of the kernel]
Change-Id: I774acd8849028d772c7530db66aa8949d1a9e5d4
Signed-off-by: Amarnath Hullur Subramanyam <amarnath@codeaurora.org>
NFC: Read core reset notification

After chip has cold booted wait maximum of 50ms to
receive core reset notification.
Implement kernel ioctl to read whether core reset
notification has recieved before timeout.
Cold boot implementation of NFCC had a bug,
GPIO disable needs to be held high for atleast
100ms before switching it to low for a clean cold
boot.

CRs-Fixed: 729456
Change-Id: I11a213d68ff1b44f433706e104bbaeac406bd5d6
Signed-off-by: Nakul Kadannavar <nakulk@codeaurora.org>
msm: mdss: fix for black stripe flicker in browse scroll

Fix a typo that was comparing the width instead of the height
parameter that lead to black stripe flickering when scrolling on
browser.

Change-Id: I10e57f876458f46d445b3404d09a5e7606aeb666
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm-camera: fix issue of isp unlock method

When we invoke isp unlock, it means isp hardware update is just
finished, we should update the "last update frame index" with
current frame id, so that the second hardware update can be avoided
in this frame.

Change-Id: Ib1f9458cba5c93f8d81b8f483f061747450ec3fd
Signed-off-by: Megha Tak <mtak@codeaurora.org>
msm: mdss: fix wb memory registration optimization

In order to avoid multiple mappings of same buffer handle, we check for
any existing handles that are already mapped within writeback. However
current checks are based on file descriptors, and these may be reused
for a new buffer handle, and in turn we end up having wrong assumptions
of the actual queued buffer while performing the writeback commit.

Fix this by getting the actual ion handle mapped to the file descriptor
and look for this handle instead.

Change-Id: Ib800dc4000ce8353ed16c7e779cda21644696ec8
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Fix check for highest of overlap and prefill bw calc

This check is supposed to be used to get the max between overlap and
prefill bandwidth value. This value is used when calculating the ib
bandwidth value to request when bus bandwidth is updated. Having a value
that is too low results in mdp underrun.

Change-Id: Iddf151eed53c8ae73418741b2775ee1dd0ef450c
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
msm: usbaudio: remove usbaudiosdev switch

- Remove usbaudiosdev switch to avoid reporting
  analog dock headset for USB headset

Change-Id: Ib5f505385742b708a98f13ab6fd98808b6d1803e
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ALSA: Avoid endless sleep after disconnect

    When disconnect callback is called, each component should wake up
    sleepers and check card->shutdown flag for avoiding the endless sleep
    blocking the proper resource release.

    Selectively taken from 0914f7961babbf28aaa2f19b453951fb4841c03f
    from kernel/msm-3.10

Change-Id: Id5f19eef3b3db030854b7d40a188d5b23ed8da45
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
ASoC: msm: update min buffer count and size

Update minimum buffer size and count to provide more
options to the client.

Change-Id: Ia303978f4e4b230e021a2ae35146328b1c594460
Signed-off-by: Divya Narayanan Poojary <dnaray@codeaurora.org>
wcnss: configure iris into cxo mode

configure iris into cxo mode when iris card not present
to avoid crash at boot time.

Change-Id: I5efd0fb704e2e534a3b608bc1e80f5d6a53a02aa
CRs-fixed: 691946
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>